pub struct CaseService { /* private fields */ }Expand description
Implements a client for the Google Cloud Support API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = CaseService::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_cases()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
A service to manage Google Cloud support cases.
§Configuration
To configure CaseService 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 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
CaseService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap CaseService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl CaseService
impl CaseService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for CaseService.
let client = CaseService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: CaseService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: CaseService + '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_case(&self) -> GetCase
pub fn get_case(&self) -> GetCase
Retrieve a case.
§Example
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService, name: &str
) -> Result<()> {
let response = client.get_case()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_cases(&self) -> ListCases
pub fn list_cases(&self) -> ListCases
Retrieve all cases under a parent, but not its children.
For example, listing cases under an organization only returns the cases
that are directly parented by that organization. To retrieve cases
under an organization and its projects, use cases.search.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService, parent: &str
) -> Result<()> {
let mut list = client.list_cases()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn search_cases(&self) -> SearchCases
pub fn search_cases(&self) -> SearchCases
Search for cases using a query.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService
) -> Result<()> {
let mut list = client.search_cases()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn create_case(&self) -> CreateCase
pub fn create_case(&self) -> CreateCase
Create a new case and associate it with a parent.
It must have the following fields set: display_name, description,
classification, and priority. If you’re just testing the API and don’t
want to route your case to an agent, set testCase=true.
§Example
use google_cloud_support_v2::model::Case;
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService, parent: &str
) -> Result<()> {
let response = client.create_case()
.set_parent(parent)
.set_case(
Case::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn update_case(&self) -> UpdateCase
pub fn update_case(&self) -> UpdateCase
Update a case. Only some fields can be updated.
§Example
use google_cloud_wkt::FieldMask;
use google_cloud_support_v2::model::Case;
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService, name: &str
) -> Result<()> {
let response = client.update_case()
.set_case(
Case::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 escalate_case(&self) -> EscalateCase
pub fn escalate_case(&self) -> EscalateCase
Escalate a case, starting the Google Cloud Support escalation management process.
This operation is only available for some support services. Go to https://cloud.google.com/support and look for ‘Technical support escalations’ in the feature list to find out which ones let you do that.
§Example
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService
) -> Result<()> {
let response = client.escalate_case()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn close_case(&self) -> CloseCase
pub fn close_case(&self) -> CloseCase
Close a case.
§Example
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService
) -> Result<()> {
let response = client.close_case()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn search_case_classifications(&self) -> SearchCaseClassifications
pub fn search_case_classifications(&self) -> SearchCaseClassifications
Retrieve valid classifications to use when creating a support case.
Classifications are hierarchical. Each classification is a string
containing all levels of the hierarchy separated by " > ". For example,
"Technical Issue > Compute > Compute Engine".
Classification IDs returned by this endpoint are valid for at least six
months. When a classification is deactivated, this endpoint immediately
stops returning it. After six months, case.create requests using the
classification will fail.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_support_v2::Result;
async fn sample(
client: &CaseService
) -> Result<()> {
let mut list = client.search_case_classifications()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Trait Implementations§
Source§impl Clone for CaseService
impl Clone for CaseService
Source§fn clone(&self) -> CaseService
fn clone(&self) -> CaseService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more