Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
|
An interface for managing Identity and Access Management (IAM) policies. More...
#include <google/cloud/iam/v2/policies_client.h>
Public Member Functions | |
PoliciesClient (std::shared_ptr< PoliciesConnection > connection, Options opts={}) | |
~PoliciesClient () | |
StreamRange< google::iam::v2::Policy > | ListPolicies (std::string const &parent, Options opts={}) |
Retrieves the policies of the specified kind that are attached to a resource. More... | |
StreamRange< google::iam::v2::Policy > | ListPolicies (google::iam::v2::ListPoliciesRequest request, Options opts={}) |
Retrieves the policies of the specified kind that are attached to a resource. More... | |
StatusOr< google::iam::v2::Policy > | GetPolicy (std::string const &name, Options opts={}) |
Gets a policy. More... | |
StatusOr< google::iam::v2::Policy > | GetPolicy (google::iam::v2::GetPolicyRequest const &request, Options opts={}) |
Gets a policy. More... | |
future< StatusOr< google::iam::v2::Policy > > | CreatePolicy (std::string const &parent, google::iam::v2::Policy const &policy, std::string const &policy_id, Options opts={}) |
Creates a policy. More... | |
future< StatusOr< google::iam::v2::Policy > > | CreatePolicy (google::iam::v2::CreatePolicyRequest const &request, Options opts={}) |
Creates a policy. More... | |
future< StatusOr< google::iam::v2::Policy > > | UpdatePolicy (google::iam::v2::UpdatePolicyRequest const &request, Options opts={}) |
Updates the specified policy. More... | |
future< StatusOr< google::iam::v2::Policy > > | DeletePolicy (std::string const &name, Options opts={}) |
Deletes a policy. More... | |
future< StatusOr< google::iam::v2::Policy > > | DeletePolicy (google::iam::v2::DeletePolicyRequest const &request, Options opts={}) |
Deletes a policy. More... | |
Copy and move support | |
PoliciesClient (PoliciesClient const &)=default | |
PoliciesClient & | operator= (PoliciesClient const &)=default |
PoliciesClient (PoliciesClient &&)=default | |
PoliciesClient & | operator= (PoliciesClient &&)=default |
Friends | |
Equality | |
bool | operator== (PoliciesClient const &a, PoliciesClient const &b) |
bool | operator!= (PoliciesClient const &a, PoliciesClient const &b) |
An interface for managing Identity and Access Management (IAM) policies.
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.
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.
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.
|
explicit |
google::cloud::iam_v2::PoliciesClient::~PoliciesClient | ( | ) |
|
default |
|
default |
future< StatusOr< google::iam::v2::Policy > > google::cloud::iam_v2::PoliciesClient::CreatePolicy | ( | google::iam::v2::CreatePolicyRequest const & | request, |
Options | opts = {} |
||
) |
Creates a policy.
request | 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.v2.CreatePolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::iam::v2::Policy > > google::cloud::iam_v2::PoliciesClient::CreatePolicy | ( | std::string const & | parent, |
google::iam::v2::Policy const & | policy, | ||
std::string const & | policy_id, | ||
Options | opts = {} |
||
) |
Creates a policy.
parent | Required. The resource that the policy is attached to, along with the kind of policy to create. Format: policies/{attachment_point}/denypolicies The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, / , must be written as %2F . For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies . For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID. |
policy | Required. The policy to create. |
policy_id | The ID to use for this policy, which will become the final component of the policy's resource name. The ID must contain 3 to 63 characters. It can contain lowercase letters and numbers, as well as dashes (- ) and periods (. ). The first character must be a lowercase letter. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::iam::v2::Policy > > google::cloud::iam_v2::PoliciesClient::DeletePolicy | ( | google::iam::v2::DeletePolicyRequest const & | request, |
Options | opts = {} |
||
) |
Deletes a policy.
This action is permanent.
request | 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.v2.DeletePolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
future< StatusOr< google::iam::v2::Policy > > google::cloud::iam_v2::PoliciesClient::DeletePolicy | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Deletes a policy.
This action is permanent.
name | Required. The resource name of the policy to delete. Format: policies/{attachment_point}/denypolicies/{policy_id} Use the URL-encoded full resource name, which means that the forward-slash character, / , must be written as %2F . For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy . For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::iam::v2::Policy > google::cloud::iam_v2::PoliciesClient::GetPolicy | ( | google::iam::v2::GetPolicyRequest const & | request, |
Options | opts = {} |
||
) |
Gets a policy.
request | 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.v2.GetPolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StatusOr< google::iam::v2::Policy > google::cloud::iam_v2::PoliciesClient::GetPolicy | ( | std::string const & | name, |
Options | opts = {} |
||
) |
Gets a policy.
name | Required. The resource name of the policy to retrieve. Format: policies/{attachment_point}/denypolicies/{policy_id} Use the URL-encoded full resource name, which means that the forward-slash character, / , must be written as %2F . For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy . For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
StreamRange< google::iam::v2::Policy > google::cloud::iam_v2::PoliciesClient::ListPolicies | ( | google::iam::v2::ListPoliciesRequest | request, |
Options | opts = {} |
||
) |
Retrieves the policies of the specified kind that are attached to a resource.
The response lists only policy metadata. In particular, policy rules are omitted.
request | 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.v2.ListPoliciesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
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.iam.v2.Policy, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules. StreamRange< google::iam::v2::Policy > google::cloud::iam_v2::PoliciesClient::ListPolicies | ( | std::string const & | parent, |
Options | opts = {} |
||
) |
Retrieves the policies of the specified kind that are attached to a resource.
The response lists only policy metadata. In particular, policy rules are omitted.
parent | Required. The resource that the policy is attached to, along with the kind of policy to list. Format: policies/{attachment_point}/denypolicies The attachment point is identified by its URL-encoded full resource name, which means that the forward-slash character, / , must be written as %2F . For example, policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies . For organizations and folders, use the numeric ID in the full resource name. For projects, you can use the alphanumeric or the numeric ID. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
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.iam.v2.Policy, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.
|
default |
|
default |
future< StatusOr< google::iam::v2::Policy > > google::cloud::iam_v2::PoliciesClient::UpdatePolicy | ( | google::iam::v2::UpdatePolicyRequest const & | request, |
Options | opts = {} |
||
) |
Updates the specified policy.
You can update only the rules and the display name for the policy.
To update a policy, you should use a read-modify-write loop:
UpdatePolicy
to write the updated policy.This pattern helps prevent conflicts between concurrent updates.
request | 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.v2.UpdatePolicyRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules. |
opts | Optional. Override the class-level options, such as retry and backoff policies. |
|
friend |
|
friend |