class TagKeys extends Resource (View source)

The "tagKeys" collection of methods.

Typical usage is:

 $cloudresourcemanagerService = new Google\Service\CloudResourceManager(...);
 $tagKeys = $cloudresourcemanagerService->tagKeys;

Methods

create(TagKey $postBody, array $optParams = [])

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

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

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

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

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it. (tagKeys.get)

getIamPolicy(string $resource, GetIamPolicyRequest $postBody, array $optParams = [])

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey. (tagKeys.getIamPolicy)

getNamespaced(array $optParams = [])

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it. (tagKeys.getNamespaced)

listTagKeys(array $optParams = [])

Lists all TagKeys for a parent resource. (tagKeys.listTagKeys)

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

Updates the attributes of the TagKey resource. (tagKeys.patch)

setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on a TagKey, replacing any existing policy.

testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified TagKey. The resource field should be the TagKey's resource name. For example, "tagKeys/1234".

Details

Operation create(TagKey $postBody, array $optParams = [])

Creates a new TagKey. If another request with the same parameters is sent while the original request is in process, the second request will receive an error. A maximum of 1000 TagKeys can exist under a parent at any given time.

(tagKeys.create)

Parameters

TagKey $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

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

Deletes a TagKey. The TagKey cannot be deleted if it has any child TagValues.

(tagKeys.delete)

Parameters

string $name

Required. The resource name of a TagKey to be deleted in the format tagKeys/123. The TagKey cannot be a parent of any existing TagValues or it will not be deleted successfully.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

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

Retrieves a TagKey. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it. (tagKeys.get)

Parameters

string $name

Required. A resource name in the format tagKeys/{id}, such as tagKeys/123.

array $optParams

Optional parameters.

Return Value

TagKey

Exceptions

Exception

Policy getIamPolicy(string $resource, GetIamPolicyRequest $postBody, array $optParams = [])

Gets the access control policy for a TagKey. The returned policy may be empty if no such policy or resource exists. The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have cloudresourcemanager.googleapis.com/tagKeys.getIamPolicy permission on the specified TagKey. (tagKeys.getIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

GetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TagKey getNamespaced(array $optParams = [])

Retrieves a TagKey by its namespaced name. This method will return PERMISSION_DENIED if the key does not exist or the user does not have permission to view it. (tagKeys.getNamespaced)

Parameters

array $optParams

Optional parameters.

Return Value

TagKey

Exceptions

Exception

ListTagKeysResponse listTagKeys(array $optParams = [])

Lists all TagKeys for a parent resource. (tagKeys.listTagKeys)

Parameters

array $optParams

Optional parameters.

Return Value

ListTagKeysResponse

Exceptions

Exception

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

Updates the attributes of the TagKey resource. (tagKeys.patch)

Parameters

string $name

Immutable. The resource name for a TagKey. Must be in the format tagKeys/{tag_key_id}, where tag_key_id is the generated numeric id for the TagKey.

TagKey $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Policy setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy on a TagKey, replacing any existing policy.

The resource field should be the TagKey's resource name. For example, "tagKeys/1234". The caller must have resourcemanager.tagKeys.setIamPolicy permission on the identified tagValue. (tagKeys.setIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

SetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestIamPermissionsResponse testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on the specified TagKey. The resource field should be the TagKey's resource name. For example, "tagKeys/1234".

There are no permissions required for making this API call. (tagKeys.testIamPermissions)

Parameters

string $resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

TestIamPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestIamPermissionsResponse

Exceptions

Exception