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(NoAwaitTag, std::string const &, google::iam::v2::Policy const &, std::string const &, Options)
Creates a policy.
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
|
parent |
std::string const &
|
policy |
google::iam::v2::Policy const &
|
policy_id |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
CreatePolicy(NoAwaitTag, google::iam::v2::CreatePolicyRequest const &, Options)
Creates a policy.
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::iam::v2::CreatePolicyRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
CreatePolicy(google::longrunning::Operation const &, Options)
Creates a policy.
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::iam::v2::Policy > > |
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 |
UpdatePolicy(NoAwaitTag, google::iam::v2::UpdatePolicyRequest const &, Options)
Updates the specified policy.
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::iam::v2::UpdatePolicyRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
UpdatePolicy(google::longrunning::Operation const &, Options)
Updates the specified policy.
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::iam::v2::Policy > > |
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(NoAwaitTag, std::string const &, Options)
Deletes a policy.
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
|
name |
std::string const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
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 |
DeletePolicy(NoAwaitTag, google::iam::v2::DeletePolicyRequest const &, Options)
Deletes a policy.
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::iam::v2::DeletePolicyRequest const &
|
opts |
Options
|
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
DeletePolicy(google::longrunning::Operation const &, Options)
Deletes a policy.
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::iam::v2::Policy > > |
GetOperation(std::string const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
The name of the operation resource. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetOperation(google::longrunning::GetOperationRequest const &, Options)
Gets the latest state of a long-running operation.
Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters | |
---|---|
Name | Description |
request |
google::longrunning::GetOperationRequest 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::longrunning::Operation > |
the result of the RPC. The response message type (google.longrunning.Operation) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |