pub struct CloudControlsPartnerCore { /* private fields */ }Expand description
Implements a client for the Cloud Controls Partner API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = CloudControlsPartnerCore::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_workloads()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
Service describing handlers for resources
§Configuration
To configure CloudControlsPartnerCore 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://cloudcontrolspartner.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
CloudControlsPartnerCore holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap CloudControlsPartnerCore in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl CloudControlsPartnerCore
impl CloudControlsPartnerCore
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for CloudControlsPartnerCore.
let client = CloudControlsPartnerCore::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: CloudControlsPartnerCore + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: CloudControlsPartnerCore + '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 get_workload(&self) -> GetWorkload
pub fn get_workload(&self) -> GetWorkload
Gets details of a single workload
§Example
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, name: &str
) -> Result<()> {
let response = client.get_workload()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_workloads(&self) -> ListWorkloads
pub fn list_workloads(&self) -> ListWorkloads
Lists customer workloads for a given customer org id
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, parent: &str
) -> Result<()> {
let mut list = client.list_workloads()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_customer(&self) -> GetCustomer
pub fn get_customer(&self) -> GetCustomer
Gets details of a single customer
§Example
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, name: &str
) -> Result<()> {
let response = client.get_customer()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_customers(&self) -> ListCustomers
pub fn list_customers(&self) -> ListCustomers
Lists customers of a partner identified by its Google Cloud organization ID
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, parent: &str
) -> Result<()> {
let mut list = client.list_customers()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_ekm_connections(&self) -> GetEkmConnections
pub fn get_ekm_connections(&self) -> GetEkmConnections
Gets the EKM connections associated with a workload
§Example
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, name: &str
) -> Result<()> {
let response = client.get_ekm_connections()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_partner_permissions(&self) -> GetPartnerPermissions
pub fn get_partner_permissions(&self) -> GetPartnerPermissions
Gets the partner permissions granted for a workload
§Example
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, name: &str
) -> Result<()> {
let response = client.get_partner_permissions()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_access_approval_requests(&self) -> ListAccessApprovalRequests
👎Deprecated
pub fn list_access_approval_requests(&self) -> ListAccessApprovalRequests
Deprecated: Only returns access approval requests directly associated with an assured workload folder.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, parent: &str
) -> Result<()> {
let mut list = client.list_access_approval_requests()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_partner(&self) -> GetPartner
pub fn get_partner(&self) -> GetPartner
Get details of a Partner.
§Example
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, name: &str
) -> Result<()> {
let response = client.get_partner()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn create_customer(&self) -> CreateCustomer
pub fn create_customer(&self) -> CreateCustomer
Creates a new customer.
§Example
use google_cloud_cloudcontrolspartner_v1::model::Customer;
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, parent: &str
) -> Result<()> {
let response = client.create_customer()
.set_parent(parent)
.set_customer_id("customer_id_value")
.set_customer(
Customer::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_customer(&self) -> UpdateCustomer
pub fn update_customer(&self) -> UpdateCustomer
Update details of a single customer
§Example
use google_cloud_wkt::FieldMask;
use google_cloud_cloudcontrolspartner_v1::model::Customer;
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, name: &str
) -> Result<()> {
let response = client.update_customer()
.set_customer(
Customer::new().set_name(name)/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_customer(&self) -> DeleteCustomer
pub fn delete_customer(&self) -> DeleteCustomer
Delete details of a single customer
§Example
use google_cloud_cloudcontrolspartner_v1::Result;
async fn sample(
client: &CloudControlsPartnerCore, name: &str
) -> Result<()> {
client.delete_customer()
.set_name(name)
.send().await?;
Ok(())
}Trait Implementations§
Source§impl Clone for CloudControlsPartnerCore
impl Clone for CloudControlsPartnerCore
Source§fn clone(&self) -> CloudControlsPartnerCore
fn clone(&self) -> CloudControlsPartnerCore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more