Allow users to create and manage tag keys.
Equality
Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection>
objects compare equal. Objects that compare equal share the same underlying resources.
Performance
Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.
Thread Safety
Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.
Constructors
TagKeysClient(TagKeysClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TagKeysClient const &
|
TagKeysClient(TagKeysClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TagKeysClient &&
|
TagKeysClient(std::shared_ptr< TagKeysConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< TagKeysConnection >
|
opts |
Options
|
Operators
operator=(TagKeysClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TagKeysClient const &
|
Returns | |
---|---|
Type | Description |
TagKeysClient & |
operator=(TagKeysClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
TagKeysClient &&
|
Returns | |
---|---|
Type | Description |
TagKeysClient & |
Functions
ListTagKeys(std::string const &, Options)
Lists all TagKeys for a parent resource.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the TagKey's parent. Must be of the form |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::resourcemanager::v3::TagKey > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListTagKeys(google::cloud::resourcemanager::v3::ListTagKeysRequest, Options)
Lists all TagKeys for a parent resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::resourcemanager::v3::ListTagKeysRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::resourcemanager::v3::TagKey > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetTagKey(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. A resource name in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::resourcemanager::v3::TagKey > |
the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetTagKey(google::cloud::resourcemanager::v3::GetTagKeyRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::resourcemanager::v3::GetTagKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::resourcemanager::v3::TagKey > |
the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNamespacedTagKey(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. A namespaced tag key name in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::resourcemanager::v3::TagKey > |
the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNamespacedTagKey(google::cloud::resourcemanager::v3::GetNamespacedTagKeyRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::resourcemanager::v3::GetNamespacedTagKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::resourcemanager::v3::TagKey > |
the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagKey) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateTagKey(google::cloud::resourcemanager::v3::TagKey const &, Options)
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.
Parameters | |
---|---|
Name | Description |
tag_key |
google::cloud::resourcemanager::v3::TagKey const &
Required. The TagKey to be created. Only fields |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::resourcemanager::v3::TagKey > > |
A |
CreateTagKey(google::cloud::resourcemanager::v3::CreateTagKeyRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::resourcemanager::v3::CreateTagKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::resourcemanager::v3::TagKey > > |
A |
UpdateTagKey(google::cloud::resourcemanager::v3::TagKey const &, google::protobuf::FieldMask const &, Options)
Updates the attributes of the TagKey resource.
Parameters | |
---|---|
Name | Description |
tag_key |
google::cloud::resourcemanager::v3::TagKey const &
Required. The new definition of the TagKey. Only the |
update_mask |
google::protobuf::FieldMask const &
Fields to be updated. The mask may only contain |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::resourcemanager::v3::TagKey > > |
A |
UpdateTagKey(google::cloud::resourcemanager::v3::UpdateTagKeyRequest const &, Options)
Updates the attributes of the TagKey resource.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::resourcemanager::v3::UpdateTagKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::resourcemanager::v3::TagKey > > |
A |
DeleteTagKey(std::string const &, Options)
Deletes a TagKey.
The TagKey cannot be deleted if it has any child TagValues.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of a TagKey to be deleted in the format |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::resourcemanager::v3::TagKey > > |
A |
DeleteTagKey(google::cloud::resourcemanager::v3::DeleteTagKeyRequest const &, Options)
Deletes a TagKey.
The TagKey cannot be deleted if it has any child TagValues.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::resourcemanager::v3::DeleteTagKeyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::cloud::resourcemanager::v3::TagKey > > |
A |
GetIamPolicy(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
resource |
std::string const &
REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::GetIamPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SetIamPolicy(std::string const &, google::iam::v1::Policy const &, Options)
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.
Parameters | |
---|---|
Name | Description |
resource |
std::string const &
REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
policy |
google::iam::v1::Policy const &
REQUIRED: The complete policy to be applied to the |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SetIamPolicy(std::string const &, IamUpdater const &, Options)
Updates the IAM policy for resource
using an optimistic concurrency control loop.
The loop fetches the current policy for resource
, and passes it to updater
, which should return the new policy. This new policy should use the current etag so that the read-modify-write cycle can detect races and rerun the update when there is a mismatch. If the new policy does not have an etag, the existing policy will be blindly overwritten. If updater
does not yield a policy, the control loop is terminated and kCancelled is returned.
Parameters | |
---|---|
Name | Description |
resource |
std::string const &
Required. The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field. |
updater |
IamUpdater const &
Required. Functor to map the current policy to a new one. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
google::iam::v1::Policy |
SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::SetIamPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
TestIamPermissions(std::string const &, std::vector< std::string > const &, Options)
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.
Parameters | |
---|---|
Name | Description |
resource |
std::string const &
REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. |
permissions |
std::vector< std::string > const &
The set of permissions to check for the |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::TestIamPermissionsResponse > |
the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::TestIamPermissionsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::TestIamPermissionsResponse > |
the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |