Class TagKeysClient (2.31.0)

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 organizations/{org_id} or projects/{project_id} or projects/{project_number}

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 begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.resourcemanager.v3.TagKey, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

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 request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.resourcemanager.v3.ListTagKeysRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

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 begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.resourcemanager.v3.TagKey, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

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 tagKeys/{id}, such as tagKeys/123.

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 StatusOr contains the error details.

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 request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.resourcemanager.v3.GetTagKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

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 StatusOr contains the error details.

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 {parentId}/{tagKeyShort}, such as 42/foo for a key with short name "foo" under the organization with ID 42 or r2-d2/bar for a key with short name "bar" under the project r2-d2.

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 StatusOr contains the error details.

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 request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

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 StatusOr contains the error details.

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 short_name, description, and parent are considered during the creation request.

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 future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.resourcemanager.v3.TagKey proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateTagKey(NoAwaitTag, google::cloud::resourcemanager::v3::TagKey const &, Options)

Creates a new TagKey.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
tag_key google::cloud::resourcemanager::v3::TagKey const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

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 request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.resourcemanager.v3.CreateTagKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

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 future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.resourcemanager.v3.TagKey proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateTagKey(NoAwaitTag, google::cloud::resourcemanager::v3::CreateTagKeyRequest const &, Options)

Creates a new TagKey.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::cloud::resourcemanager::v3::CreateTagKeyRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

CreateTagKey(google::longrunning::Operation const &, Options)

Creates a new TagKey.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

Parameters
Name Description
operation google::longrunning::Operation const &
opts Options
Returns
Type Description
future< StatusOr< google::cloud::resourcemanager::v3::TagKey > >

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 description and etag fields can be updated by this request. If the etag field is not empty, it must match the etag field of the existing tag key. Otherwise, ABORTED will be returned.

update_mask google::protobuf::FieldMask const &

Fields to be updated. The mask may only contain description or etag. If omitted entirely, both description and etag are assumed to be significant.

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 future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.resourcemanager.v3.TagKey proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateTagKey(NoAwaitTag, google::cloud::resourcemanager::v3::TagKey const &, google::protobuf::FieldMask const &, Options)

Updates the attributes of the TagKey resource.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
tag_key google::cloud::resourcemanager::v3::TagKey const &
update_mask google::protobuf::FieldMask const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

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 request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.resourcemanager.v3.UpdateTagKeyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

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 future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.resourcemanager.v3.TagKey proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateTagKey(NoAwaitTag, google::cloud::resourcemanager::v3::UpdateTagKeyRequest const &, Options)

Updates the attributes of the TagKey resource.

Specifying the NoAwaitTag immediately returns the [google::longrunning::Operation] that corresponds to the Long Running Operation that has been started. No polling for operation status occurs.

Parameters
Name Description
NoAwaitTag
request google::cloud::resourcemanager::v3::UpdateTagKeyRequest const &
opts Options
Returns
Type Description
StatusOr< google::longrunning::Operation >

UpdateTagKey(google::longrunning::Operation const &, Options)

Updates the attributes of the TagKey resource.

This method accepts a google::longrunning::Operation that corresponds to a previously started Long Running Operation (LRO) and polls the status of the LRO in the background.

<
Parameters
Name Description