Google Cloud IAM C++ Client 2.13.0
A C++ Client Library for Google Cloud IAM
|
API Overview. More...
#include <google/cloud/iam/v1/iam_policy_client.h>
Public Member Functions | |
IAMPolicyClient (std::shared_ptr< IAMPolicyConnection > connection, Options opts={}) | |
~IAMPolicyClient () | |
StatusOr< google::iam::v1::Policy > | SetIamPolicy (google::iam::v1::SetIamPolicyRequest const &request, Options opts={}) |
Sets the access control policy on the specified resource. More... | |
StatusOr< google::iam::v1::Policy > | GetIamPolicy (google::iam::v1::GetIamPolicyRequest const &request, Options opts={}) |
Gets the access control policy for a resource. More... | |
StatusOr< google::iam::v1::TestIamPermissionsResponse > | TestIamPermissions (google::iam::v1::TestIamPermissionsRequest const &request, Options opts={}) |
Returns permissions that a caller has on the specified resource. More... | |
Copy and move support | |
IAMPolicyClient (IAMPolicyClient const &)=default | |
IAMPolicyClient & | operator= (IAMPolicyClient const &)=default |
IAMPolicyClient (IAMPolicyClient &&)=default | |
IAMPolicyClient & | operator= (IAMPolicyClient &&)=default |
Friends | |
Equality | |
bool | operator== (IAMPolicyClient const &a, IAMPolicyClient const &b) |
bool | operator!= (IAMPolicyClient const &a, IAMPolicyClient const &b) |
API Overview.
Manages Identity and Access Management (IAM) policies.
Any implementation of an API that offers access control features implements the google.iam.v1.IAMPolicy interface.
Access control is applied when a principal (user or service account), takes some action on a resource exposed by a service. Resources, identified by URI-like names, are the unit of access control specification. Service implementations can choose the granularity of access control and the supported permissions for their resources. For example one database service may allow access control to be specified only at the Table level, whereas another might allow access control to also be specified at the Column level.
See google.iam.v1.Policy
This is intentionally not a CRUD style API because access control policies are created and deleted implicitly with the resources to which they are attached.
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_v1::IAMPolicyClient::~IAMPolicyClient | ( | ) |
|
default |
|
default |
StatusOr< google::iam::v1::Policy > google::cloud::iam_v1::IAMPolicyClient::GetIamPolicy | ( | google::iam::v1::GetIamPolicyRequest const & | request, |
Options | opts = {} |
||
) |
Gets the access control policy for a resource.
Returns an empty policy if the resource exists and does not have a policy set.
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.v1.GetIamPolicyRequest. 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. |
|
default |
|
default |
StatusOr< google::iam::v1::Policy > google::cloud::iam_v1::IAMPolicyClient::SetIamPolicy | ( | google::iam::v1::SetIamPolicyRequest const & | request, |
Options | opts = {} |
||
) |
Sets the access control policy on the specified resource.
Replaces any existing policy.
Can return NOT_FOUND
, INVALID_ARGUMENT
, and PERMISSION_DENIED
errors.
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.v1.SetIamPolicyRequest. 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::v1::TestIamPermissionsResponse > google::cloud::iam_v1::IAMPolicyClient::TestIamPermissions | ( | google::iam::v1::TestIamPermissionsRequest const & | request, |
Options | opts = {} |
||
) |
Returns permissions that a caller has on the specified resource.
If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND
error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
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.v1.TestIamPermissionsRequest. 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 |