pub struct TagHolds { /* private fields */ }Expand description
Implements a client for the Cloud Resource Manager API.
§Example
let client = TagHolds::builder().build().await?;
// use `client` to make requests to the Cloud Resource Manager API.§Service Description
Allow users to create and manage TagHolds for TagValues. TagHolds represent the use of a Tag Value that is not captured by TagBindings but should still block TagValue deletion (such as a reference in a policy condition). This service provides isolated failure domains by cloud location so that TagHolds can be managed in the same location as their usage.
§Configuration
To configure TagHolds 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://cloudresourcemanager.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
TagHolds holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap TagHolds in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl TagHolds
impl TagHolds
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for TagHolds.
let client = TagHolds::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: TagHolds + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: TagHolds + '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 create_tag_hold(&self) -> CreateTagHold
pub fn create_tag_hold(&self) -> CreateTagHold
Creates a TagHold. Returns ALREADY_EXISTS if a TagHold with the same resource and origin exists under the same TagValue.
§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.
§Example
use google_cloud_resourcemanager_v3::Result;
async fn sample(
client: &TagHolds
) -> Result<()> {
let response = client
.create_tag_hold()
/* set fields */
.poller()
.until_done()
.await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_tag_hold(&self) -> DeleteTagHold
pub fn delete_tag_hold(&self) -> DeleteTagHold
Deletes a TagHold.
§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.
§Example
use google_cloud_resourcemanager_v3::Result;
async fn sample(
client: &TagHolds,
resource_name: &str
) -> Result<()> {
client
.delete_tag_hold()
.set_name(resource_name)
.poller()
.until_done()
.await?;
Ok(())
}Sourcepub fn list_tag_holds(&self) -> ListTagHolds
pub fn list_tag_holds(&self) -> ListTagHolds
Lists TagHolds under a TagValue.
Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_resourcemanager_v3::Result;
async fn sample(
client: &TagHolds
) -> Result<()> {
let response = client
.get_operation()
/* set fields */
.send()
.await?;
println!("response {:?}", response);
Ok(())
}