An interface for managing Identity and Access Management (IAM) policies.
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
PoliciesClient(PoliciesClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
PoliciesClient const &
|
PoliciesClient(PoliciesClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
PoliciesClient &&
|
PoliciesClient(std::shared_ptr< PoliciesConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< PoliciesConnection >
|
opts |
Options
|
Operators
operator=(PoliciesClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
PoliciesClient const &
|
Returns | |
---|---|
Type | Description |
PoliciesClient & |
operator=(PoliciesClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
PoliciesClient &&
|
Returns | |
---|---|
Type | Description |
PoliciesClient & |
Functions
ListPolicies(std::string const &, Options)
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.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource that the policy is attached to, along with the kind of policy to list. Format: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::iam::v2::Policy > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListPolicies(google::iam::v2::ListPoliciesRequest, Options)
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.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v2::ListPoliciesRequest
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::iam::v2::Policy > | a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetPolicy(std::string const &, Options)
Gets a policy.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the policy to retrieve. Format: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v2::Policy > | the result of the RPC. The response message type (google.iam.v2.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetPolicy(google::iam::v2::GetPolicyRequest const &, Options)
Gets a policy.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v2::GetPolicyRequest 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::v2::Policy > | the result of the RPC. The response message type (google.iam.v2.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreatePolicy(std::string const &, google::iam::v2::Policy const &, std::string const &, Options)
Creates a policy.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource that the policy is attached to, along with the kind of policy to create. Format: |
policy |
google::iam::v2::Policy const &
Required. The policy to create. |
policy_id |
std::string const &
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 ( |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::iam::v2::Policy > > | A |
CreatePolicy(google::iam::v2::CreatePolicyRequest const &, Options)
Creates a policy.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v2::CreatePolicyRequest 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::iam::v2::Policy > > | A |
UpdatePolicy(google::iam::v2::UpdatePolicyRequest const &, Options)
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:
- Use GetPolicy to read the current version of the policy.
- Modify the policy as needed.
- Use
UpdatePolicy
to write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v2::UpdatePolicyRequest 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::iam::v2::Policy > > | A |
DeletePolicy(std::string const &, Options)
Deletes a policy.
This action is permanent.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The resource name of the policy to delete. Format: |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
future< StatusOr< google::iam::v2::Policy > > | A |
DeletePolicy(google::iam::v2::DeletePolicyRequest const &, Options)
Deletes a policy.
This action is permanent.
Parameters | |
---|---|
Name | Description |
request |
google::iam::v2::DeletePolicyRequest 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::iam::v2::Policy > > | A |