pub struct SupportEventSubscriptionService { /* private fields */ }Expand description
Implements a client for the Google Cloud Support API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
async fn sample(
organization_id: &str,
) -> anyhow::Result<()> {
let client = SupportEventSubscriptionService::builder().build().await?;
let mut list = client.list_support_event_subscriptions()
.set_parent(format!("organizations/{organization_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}§Service Description
Service for managing customer support event subscriptions.
§Configuration
To configure SupportEventSubscriptionService 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://cloudsupport.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured with Private Google Access with VPC Service Controls) may want to 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
SupportEventSubscriptionService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap SupportEventSubscriptionService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl SupportEventSubscriptionService
impl SupportEventSubscriptionService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for SupportEventSubscriptionService.
let client = SupportEventSubscriptionService::builder().build().await?;Sourcepub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: SupportEventSubscriptionService + 'static,
pub fn from_stub<T>(stub: impl Into<Arc<T>>) -> Selfwhere
T: SupportEventSubscriptionService + '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_support_event_subscription(
&self,
) -> CreateSupportEventSubscription
pub fn create_support_event_subscription( &self, ) -> CreateSupportEventSubscription
Creates a support event subscription for an organization.
§Example
use google_cloud_support_v2::model::SupportEventSubscription;
use google_cloud_support_v2::Result;
async fn sample(
client: &SupportEventSubscriptionService, organization_id: &str
) -> Result<()> {
let response = client.create_support_event_subscription()
.set_parent(format!("organizations/{organization_id}"))
.set_support_event_subscription(
SupportEventSubscription::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn get_support_event_subscription(&self) -> GetSupportEventSubscription
pub fn get_support_event_subscription(&self) -> GetSupportEventSubscription
Gets a support event subscription.
§Example
use google_cloud_support_v2::Result;
async fn sample(
client: &SupportEventSubscriptionService, organization_id: &str, support_event_subscription_id: &str
) -> Result<()> {
let response = client.get_support_event_subscription()
.set_name(format!("organizations/{organization_id}/supportEventSubscriptions/{support_event_subscription_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_support_event_subscriptions(&self) -> ListSupportEventSubscriptions
pub fn list_support_event_subscriptions(&self) -> ListSupportEventSubscriptions
Lists support event subscriptions.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_support_v2::Result;
async fn sample(
client: &SupportEventSubscriptionService, organization_id: &str
) -> Result<()> {
let mut list = client.list_support_event_subscriptions()
.set_parent(format!("organizations/{organization_id}"))
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn update_support_event_subscription(
&self,
) -> UpdateSupportEventSubscription
pub fn update_support_event_subscription( &self, ) -> UpdateSupportEventSubscription
Updates a support event subscription.
§Example
use google_cloud_wkt::FieldMask;
use google_cloud_support_v2::model::SupportEventSubscription;
use google_cloud_support_v2::Result;
async fn sample(
client: &SupportEventSubscriptionService, organization_id: &str, support_event_subscription_id: &str
) -> Result<()> {
let response = client.update_support_event_subscription()
.set_support_event_subscription(
SupportEventSubscription::new().set_name(format!("organizations/{organization_id}/supportEventSubscriptions/{support_event_subscription_id}"))/* set fields */
)
.set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_support_event_subscription(
&self,
) -> DeleteSupportEventSubscription
pub fn delete_support_event_subscription( &self, ) -> DeleteSupportEventSubscription
Soft deletes a support event subscription.
§Example
use google_cloud_support_v2::Result;
async fn sample(
client: &SupportEventSubscriptionService, organization_id: &str, support_event_subscription_id: &str
) -> Result<()> {
let response = client.delete_support_event_subscription()
.set_name(format!("organizations/{organization_id}/supportEventSubscriptions/{support_event_subscription_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn undelete_support_event_subscription(
&self,
) -> UndeleteSupportEventSubscription
pub fn undelete_support_event_subscription( &self, ) -> UndeleteSupportEventSubscription
Undeletes a support event subscription.
§Example
use google_cloud_support_v2::Result;
async fn sample(
client: &SupportEventSubscriptionService, organization_id: &str, support_event_subscription_id: &str
) -> Result<()> {
let response = client.undelete_support_event_subscription()
.set_name(format!("organizations/{organization_id}/supportEventSubscriptions/{support_event_subscription_id}"))
.send().await?;
println!("response {:?}", response);
Ok(())
}Trait Implementations§
Source§impl Clone for SupportEventSubscriptionService
impl Clone for SupportEventSubscriptionService
Source§fn clone(&self) -> SupportEventSubscriptionService
fn clone(&self) -> SupportEventSubscriptionService
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more