pub struct Policies { /* private fields */ }Expand description
Implements a client for the Identity and Access Management (IAM) API.
§Example
let client = Policies::builder().build().await?;
// use `client` to make requests to the Identity and Access Management (IAM) API.§Service Description
An interface for managing Identity and Access Management (IAM) policies.
§Configuration
To configure Policies use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://iam.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
Policies holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Policies in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Policies
impl Policies
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Policies.
let client = Policies::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Policies + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Policies + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn list_policies(&self) -> ListPolicies
pub fn list_policies(&self) -> ListPolicies
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.
Sourcepub fn get_policy(&self) -> GetPolicy
pub fn get_policy(&self) -> GetPolicy
Gets a policy.
Sourcepub fn create_policy(&self) -> CreatePolicy
pub fn create_policy(&self) -> CreatePolicy
Creates a policy.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn update_policy(&self) -> UpdatePolicy
pub fn update_policy(&self) -> UpdatePolicy
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
UpdatePolicyto write the updated policy.
This pattern helps prevent conflicts between concurrent updates.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn delete_policy(&self) -> DeletePolicy
pub fn delete_policy(&self) -> DeletePolicy
Deletes a policy. This action is permanent.
§Long running operations
This method is used to start, and/or poll a long-running Operation. The Working with long-running operations chapter in the user guide covers these operations in detail.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.