pub struct ControlService { /* private fields */ }Expand description
Implements a client for the Vertex AI Search for commerce API.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
let client = ControlService::builder().build().await?;
let parent = "parent_value";
let mut list = client.list_controls()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}§Service Description
Service for modifying Control.
§Configuration
To configure ControlService 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://retail.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
ControlService holds a connection pool internally, it is advised to
create one and reuse it. You do not need to wrap ControlService in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl ControlService
impl ControlService
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for ControlService.
let client = ControlService::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: ControlService + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: ControlService + '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_control(&self) -> CreateControl
pub fn create_control(&self) -> CreateControl
Creates a Control.
If the Control to create already exists, an ALREADY_EXISTS error is returned.
§Example
use google_cloud_retail_v2::model::Control;
use google_cloud_retail_v2::Result;
async fn sample(
client: &ControlService, parent: &str
) -> Result<()> {
let response = client.create_control()
.set_parent(parent)
.set_control_id("control_id_value")
.set_control(
Control::new()/* set fields */
)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn delete_control(&self) -> DeleteControl
pub fn delete_control(&self) -> DeleteControl
Sourcepub fn update_control(&self) -> UpdateControl
pub fn update_control(&self) -> UpdateControl
Updates a Control.
Control cannot be set to a different oneof field, if so an INVALID_ARGUMENT is returned. If the Control to update does not exist, a NOT_FOUND error is returned.
§Example
use google_cloud_wkt::FieldMask;
use google_cloud_retail_v2::model::Control;
use google_cloud_retail_v2::Result;
async fn sample(
client: &ControlService, name: &str
) -> Result<()> {
let response = client.update_control()
.set_control(
Control::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 get_control(&self) -> GetControl
pub fn get_control(&self) -> GetControl
Gets a Control.
§Example
use google_cloud_retail_v2::Result;
async fn sample(
client: &ControlService, name: &str
) -> Result<()> {
let response = client.get_control()
.set_name(name)
.send().await?;
println!("response {:?}", response);
Ok(())
}Sourcepub fn list_controls(&self) -> ListControls
pub fn list_controls(&self) -> ListControls
Lists all Controls by their parent Catalog.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_retail_v2::Result;
async fn sample(
client: &ControlService, parent: &str
) -> Result<()> {
let mut list = client.list_controls()
.set_parent(parent)
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn list_operations(&self) -> ListOperations
pub fn list_operations(&self) -> ListOperations
Provides the Operations service functionality in this service.
§Example
use google_cloud_gax::paginator::ItemPaginator as _;
use google_cloud_retail_v2::Result;
async fn sample(
client: &ControlService
) -> Result<()> {
let mut list = client.list_operations()
/* set fields */
.by_item();
while let Some(item) = list.next().await.transpose()? {
println!("{:?}", item);
}
Ok(())
}Sourcepub fn get_operation(&self) -> GetOperation
pub fn get_operation(&self) -> GetOperation
Provides the Operations service functionality in this service.
§Example
use google_cloud_retail_v2::Result;
async fn sample(
client: &ControlService
) -> Result<()> {
let response = client.get_operation()
/* set fields */
.send().await?;
println!("response {:?}", response);
Ok(())
}Trait Implementations§
Source§impl Clone for ControlService
impl Clone for ControlService
Source§fn clone(&self) -> ControlService
fn clone(&self) -> ControlService
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more