class OrganizationsCustomConstraints extends Resource (View source)

The "customConstraints" collection of methods.

Typical usage is:

 $orgpolicyService = new Google\Service\OrgPolicyAPI(...);
 $customConstraints = $orgpolicyService->organizations_customConstraints;

Methods

create(string $parent, GoogleCloudOrgpolicyV2CustomConstraint $postBody, array $optParams = [])

Creates a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the organization does not exist. Returns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the constraint already exists on the given organization. (customConstraints.create)

delete(string $name, array $optParams = [])

Deletes a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist.

get(string $name, array $optParams = [])

Gets a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the custom constraint does not exist.

listOrganizationsCustomConstraints(string $parent, array $optParams = [])

Retrieves all of the custom constraints that exist on a particular organization resource. (customConstraints.listOrganizationsCustomConstraints)

patch(string $name, GoogleCloudOrgpolicyV2CustomConstraint $postBody, array $optParams = [])

Updates a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist. Note: the supplied policy will perform a full overwrite of all fields.

Details

GoogleCloudOrgpolicyV2CustomConstraint create(string $parent, GoogleCloudOrgpolicyV2CustomConstraint $postBody, array $optParams = [])

Creates a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the organization does not exist. Returns a google.rpc.Status with google.rpc.Code.ALREADY_EXISTS if the constraint already exists on the given organization. (customConstraints.create)

Parameters

string $parent

Required. Must be in the following form: * organizations/{organization_id}

GoogleCloudOrgpolicyV2CustomConstraint $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudOrgpolicyV2CustomConstraint

Exceptions

Exception

GoogleProtobufEmpty delete(string $name, array $optParams = [])

Deletes a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist.

(customConstraints.delete)

Parameters

string $name

Required. Name of the custom constraint to delete. See the custom constraint entry for naming rules.

array $optParams

Optional parameters.

Return Value

GoogleProtobufEmpty

Exceptions

Exception

GoogleCloudOrgpolicyV2CustomConstraint get(string $name, array $optParams = [])

Gets a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the custom constraint does not exist.

(customConstraints.get)

Parameters

string $name

Required. Resource name of the custom constraint. See the custom constraint entry for naming requirements.

array $optParams

Optional parameters.

Return Value

GoogleCloudOrgpolicyV2CustomConstraint

Exceptions

Exception

GoogleCloudOrgpolicyV2ListCustomConstraintsResponse listOrganizationsCustomConstraints(string $parent, array $optParams = [])

Retrieves all of the custom constraints that exist on a particular organization resource. (customConstraints.listOrganizationsCustomConstraints)

Parameters

string $parent

Required. The target Google Cloud resource that parents the set of custom constraints that will be returned from this call. Must be in one of the following forms: * organizations/{organization_id}

array $optParams

Optional parameters.

Return Value

GoogleCloudOrgpolicyV2ListCustomConstraintsResponse

Exceptions

Exception

GoogleCloudOrgpolicyV2CustomConstraint patch(string $name, GoogleCloudOrgpolicyV2CustomConstraint $postBody, array $optParams = [])

Updates a custom constraint. Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the constraint does not exist. Note: the supplied policy will perform a full overwrite of all fields.

(customConstraints.patch)

Parameters

string $name

Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * organizations/{organization_id}/customConstraints/{custom_constraint_id} Example: organizations/123/customConstraints/custom.createOnlyE2TypeVms The max length is 70 characters and the minimum length is 1. Note that the prefix organizations/{organization_id}/customConstraints/ is not counted.

GoogleCloudOrgpolicyV2CustomConstraint $postBody
array $optParams

Optional parameters.

Return Value

GoogleCloudOrgpolicyV2CustomConstraint

Exceptions

Exception