Class TagValuesClient (2.21.0)

Allow users to create and manage tag values.

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

TagValuesClient(TagValuesClient const &)

Copy and move support

Parameter
NameDescription
TagValuesClient const &

TagValuesClient(TagValuesClient &&)

Copy and move support

Parameter
NameDescription
TagValuesClient &&

TagValuesClient(std::shared_ptr< TagValuesConnection >, Options)

Parameters
NameDescription
connection std::shared_ptr< TagValuesConnection >
opts Options

Operators

operator=(TagValuesClient const &)

Copy and move support

Parameter
NameDescription
TagValuesClient const &
Returns
TypeDescription
TagValuesClient &

operator=(TagValuesClient &&)

Copy and move support

Parameter
NameDescription
TagValuesClient &&
Returns
TypeDescription
TagValuesClient &

Functions

ListTagValues(std::string const &, Options)

Lists all TagValues for a specific TagKey.

Parameters
NameDescription
parent std::string const &

Required.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::cloud::resourcemanager::v3::TagValue >

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.TagValue, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListTagValues(google::cloud::resourcemanager::v3::ListTagValuesRequest, Options)

Lists all TagValues for a specific TagKey.

Parameters
NameDescription
request google::cloud::resourcemanager::v3::ListTagValuesRequest

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.ListTagValuesRequest. 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
TypeDescription
StreamRange< google::cloud::resourcemanager::v3::TagValue >

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.TagValue, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetTagValue(std::string const &, Options)

Retrieves a TagValue.

This method will return PERMISSION_DENIED if the value does not exist or the user does not have permission to view it.

Parameters
NameDescription
name std::string const &

Required. Resource name for TagValue to be fetched in the format tagValues/456.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::resourcemanager::v3::TagValue >

the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagValue) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetTagValue(google::cloud::resourcemanager::v3::GetTagValueRequest const &, Options)

Retrieves a TagValue.

This method will return PERMISSION_DENIED if the value does not exist or the user does not have permission to view it.

Parameters
NameDescription
request google::cloud::resourcemanager::v3::GetTagValueRequest 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.GetTagValueRequest. 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
TypeDescription
StatusOr< google::cloud::resourcemanager::v3::TagValue >

the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagValue) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetNamespacedTagValue(std::string const &, Options)

Retrieves a TagValue by its namespaced name.

This method will return PERMISSION_DENIED if the value does not exist or the user does not have permission to view it.

Parameters
NameDescription
name std::string const &

Required. A namespaced tag value name in the following format:
{parentId}/{tagKeyShort}/{tagValueShort}
Examples:

  • 42/foo/abc for a value with short name "abc" under the key with short name "foo" under the organization with ID 42
  • r2-d2/bar/xyz for a value with short name "xyz" under the key with short name "bar" under the project with ID "r2-d2"
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::cloud::resourcemanager::v3::TagValue >

the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagValue) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetNamespacedTagValue(google::cloud::resourcemanager::v3::GetNamespacedTagValueRequest const &, Options)

Retrieves a TagValue by its namespaced name.

This method will return PERMISSION_DENIED if the value does not exist or the user does not have permission to view it.

Parameters
NameDescription
request google::cloud::resourcemanager::v3::GetNamespacedTagValueRequest 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.GetNamespacedTagValueRequest. 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
TypeDescription
StatusOr< google::cloud::resourcemanager::v3::TagValue >

the result of the RPC. The response message type (google.cloud.resourcemanager.v3.TagValue) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateTagValue(google::cloud::resourcemanager::v3::TagValue const &, Options)

Creates a TagValue as a child of the specified TagKey.

If a 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 TagValues can exist under a TagKey at any given time.

Parameters
NameDescription
tag_value google::cloud::resourcemanager::v3::TagValue const &

Required. The TagValue 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
TypeDescription
future< StatusOr< google::cloud::resourcemanager::v3::TagValue > >

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.TagValue proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateTagValue(google::cloud::resourcemanager::v3::CreateTagValueRequest const &, Options)

Creates a TagValue as a child of the specified TagKey.

If a 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 TagValues can exist under a TagKey at any given time.

Parameters
NameDescription
request google::cloud::resourcemanager::v3::CreateTagValueRequest 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.CreateTagValueRequest. 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
TypeDescription
future< StatusOr< google::cloud::resourcemanager::v3::TagValue > >

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.TagValue proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateTagValue(google::cloud::resourcemanager::v3::TagValue const &, google::protobuf::FieldMask const &, Options)

Updates the attributes of the TagValue resource.

Parameters
NameDescription
tag_value google::cloud::resourcemanager::v3::TagValue const &

Required. The new definition of the TagValue. Only fields description and etag fields can be updated by this request. If the etag field is nonempty, it must match the etag field of the existing ControlGroup. Otherwise, ABORTED will be returned.

update_mask google::protobuf::FieldMask const &

Optional. Fields to be updated.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::resourcemanager::v3::TagValue > >

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.TagValue proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateTagValue(google::cloud::resourcemanager::v3::UpdateTagValueRequest const &, Options)

Updates the attributes of the TagValue resource.

Parameters
NameDescription
request google::cloud::resourcemanager::v3::UpdateTagValueRequest 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.UpdateTagValueRequest. 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
TypeDescription
future< StatusOr< google::cloud::resourcemanager::v3::TagValue > >

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.TagValue proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteTagValue(std::string const &, Options)

Deletes a TagValue.

The TagValue cannot have any bindings when it is deleted.

Parameters
NameDescription
name std::string const &

Required. Resource name for TagValue to be deleted in the format tagValues/456.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::cloud::resourcemanager::v3::TagValue > >

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.TagValue proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteTagValue(google::cloud::resourcemanager::v3::DeleteTagValueRequest const &, Options)

Deletes a TagValue.

The TagValue cannot have any bindings when it is deleted.

Parameters
NameDescription
request google::cloud::resourcemanager::v3::DeleteTagValueRequest 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.DeleteTagValueRequest. 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
TypeDescription
future< StatusOr< google::cloud::resourcemanager::v3::TagValue > >

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.TagValue proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GetIamPolicy(std::string const &, Options)

Gets the access control policy for a TagValue.

The returned policy may be empty if no such policy or resource exists. The resource field should be the TagValue's resource name. For example: tagValues/1234. The caller must have the cloudresourcemanager.googleapis.com/tagValues.getIamPolicy permission on the identified TagValue to get the access control policy.

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

GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)

Gets the access control policy for a TagValue.

The returned policy may be empty if no such policy or resource exists. The resource field should be the TagValue's resource name. For example: tagValues/1234. The caller must have the cloudresourcemanager.googleapis.com/tagValues.getIamPolicy permission on the identified TagValue to get the access control policy.

Parameters
NameDescription
request google::iam::v1::GetIamPolicyRequest 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.iam.v1.GetIamPolicyRequest. 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
TypeDescription
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 StatusOr contains the error details.

SetIamPolicy(std::string const &, google::iam::v1::Policy const &, Options)

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

The resource field should be the TagValue's resource name. For example: tagValues/1234. The caller must have resourcemanager.tagValues.setIamPolicy permission on the identified tagValue.

Parameters
NameDescription
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 resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

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

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
NameDescription
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
TypeDescription
StatusOr< google::iam::v1::Policy >

google::iam::v1::Policy

SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)

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

The resource field should be the TagValue's resource name. For example: tagValues/1234. The caller must have resourcemanager.tagValues.setIamPolicy permission on the identified tagValue.

Parameters
NameDescription
request google::iam::v1::SetIamPolicyRequest 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.iam.v1.SetIamPolicyRequest. 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
TypeDescription
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 StatusOr contains the error details.

TestIamPermissions(std::string const &, std::vector< std::string > const &, Options)

Returns permissions that a caller has on the specified TagValue.

The resource field should be the TagValue's resource name. For example: tagValues/1234.

There are no permissions required for making this API call.

Parameters
NameDescription
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 resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

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

TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)

Returns permissions that a caller has on the specified TagValue.

The resource field should be the TagValue's resource name. For example: tagValues/1234.

There are no permissions required for making this API call.

Parameters
NameDescription
request google::iam::v1::TestIamPermissionsRequest 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.iam.v1.TestIamPermissionsRequest. 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
TypeDescription
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 StatusOr contains the error details.