pub struct ModelArmor { /* private fields */ }Expand description
Implements a client for the Model Armor API.
§Example
let client = ModelArmor::builder().build().await?;
// use `client` to make requests to the Model Armor API.§Service Description
Service describing handlers for resources
§Configuration
To configure ModelArmor 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://modelarmor.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
ModelArmor holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap ModelArmor in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl ModelArmor
impl ModelArmor
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for ModelArmor.
let client = ModelArmor::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: ModelArmor + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: ModelArmor + '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 list_templates(&self) -> ListTemplates
pub fn list_templates(&self) -> ListTemplates
Lists Templates in a given project and location.
Sourcepub fn get_template(&self) -> GetTemplate
pub fn get_template(&self) -> GetTemplate
Gets details of a single Template.
Sourcepub fn create_template(&self) -> CreateTemplate
pub fn create_template(&self) -> CreateTemplate
Creates a new Template in a given project and location.
Sourcepub fn update_template(&self) -> UpdateTemplate
pub fn update_template(&self) -> UpdateTemplate
Updates the parameters of a single Template.
Sourcepub fn delete_template(&self) -> DeleteTemplate
pub fn delete_template(&self) -> DeleteTemplate
Deletes a single Template.
Sourcepub fn get_floor_setting(&self) -> GetFloorSetting
pub fn get_floor_setting(&self) -> GetFloorSetting
Gets details of a single floor setting of a project
Sourcepub fn update_floor_setting(&self) -> UpdateFloorSetting
pub fn update_floor_setting(&self) -> UpdateFloorSetting
Updates the parameters of a single floor setting of a project
Sourcepub fn sanitize_user_prompt(&self) -> SanitizeUserPrompt
pub fn sanitize_user_prompt(&self) -> SanitizeUserPrompt
Sanitizes User Prompt.
Sourcepub fn sanitize_model_response(&self) -> SanitizeModelResponse
pub fn sanitize_model_response(&self) -> SanitizeModelResponse
Sanitizes Model Response.
Sourcepub fn list_locations(&self) -> ListLocations
pub fn list_locations(&self) -> ListLocations
Lists information about the supported locations for this service.
Sourcepub fn get_location(&self) -> GetLocation
pub fn get_location(&self) -> GetLocation
Gets information about a location.
Trait Implementations§
Source§impl Clone for ModelArmor
impl Clone for ModelArmor
Source§fn clone(&self) -> ModelArmor
fn clone(&self) -> ModelArmor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more