Engine

Struct Engine 

Source
#[non_exhaustive]
pub struct Engine { pub name: String, pub display_name: String, pub create_time: Option<Timestamp>, pub update_time: Option<Timestamp>, pub data_store_ids: Vec<String>, pub solution_type: SolutionType, pub industry_vertical: IndustryVertical, pub common_config: Option<CommonConfig>, pub disable_analytics: bool, pub engine_config: Option<EngineConfig>, pub engine_metadata: Option<EngineMetadata>, /* private fields */ }
Available on crate feature engine-service only.
Expand description

Metadata that describes the training and serving parameters of an Engine.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Immutable. Identifier. The fully qualified resource name of the engine.

This field must be a UTF-8 encoded string with a length limit of 1024 characters.

Format: projects/{project}/locations/{location}/collections/{collection}/engines/{engine} engine should be 1-63 characters, and valid characters are /[a-z0-9][a-z0-9-_]*/. Otherwise, an INVALID_ARGUMENT error is returned.

§display_name: String

Required. The display name of the engine. Should be human readable. UTF-8 encoded string with limit of 1024 characters.

§create_time: Option<Timestamp>

Output only. Timestamp the Recommendation Engine was created at.

§update_time: Option<Timestamp>

Output only. Timestamp the Recommendation Engine was last updated.

§data_store_ids: Vec<String>

Optional. The data stores associated with this engine.

For SOLUTION_TYPE_SEARCH and SOLUTION_TYPE_RECOMMENDATION type of engines, they can only associate with at most one data store.

If solution_type is SOLUTION_TYPE_CHAT, multiple DataStores in the same [Collection][google.cloud.discoveryengine.v1.Collection] can be associated here.

Note that when used in CreateEngineRequest, one DataStore id must be provided as the system will use it for necessary initializations.

§solution_type: SolutionType

Required. The solutions of the engine.

§industry_vertical: IndustryVertical

Optional. The industry vertical that the engine registers. The restriction of the Engine industry vertical is based on DataStore: Vertical on Engine has to match vertical of the DataStore linked to the engine.

§common_config: Option<CommonConfig>

Common config spec that specifies the metadata of the engine.

§disable_analytics: bool

Optional. Whether to disable analytics for searches performed on this engine.

§engine_config: Option<EngineConfig>

Additional config specs that defines the behavior of the engine.

§engine_metadata: Option<EngineMetadata>

Engine metadata to monitor the status of the engine.

Implementations§

Source§

impl Engine

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Engine::new().set_name("example");
Source

pub fn set_display_name<T: Into<String>>(self, v: T) -> Self

Sets the value of display_name.

§Example
let x = Engine::new().set_display_name("example");
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Engine::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of create_time.

§Example
use wkt::Timestamp;
let x = Engine::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Engine::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_update_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of update_time.

§Example
use wkt::Timestamp;
let x = Engine::new().set_update_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of update_time.

§Example
use wkt::Timestamp;
let x = Engine::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Engine::new().set_or_clear_update_time(None::<Timestamp>);
Source

pub fn set_data_store_ids<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of data_store_ids.

§Example
let x = Engine::new().set_data_store_ids(["a", "b", "c"]);
Source

pub fn set_solution_type<T: Into<SolutionType>>(self, v: T) -> Self

Sets the value of solution_type.

§Example
use google_cloud_discoveryengine_v1::model::SolutionType;
let x0 = Engine::new().set_solution_type(SolutionType::Recommendation);
let x1 = Engine::new().set_solution_type(SolutionType::Search);
let x2 = Engine::new().set_solution_type(SolutionType::Chat);
Source

pub fn set_industry_vertical<T: Into<IndustryVertical>>(self, v: T) -> Self

Sets the value of industry_vertical.

§Example
use google_cloud_discoveryengine_v1::model::IndustryVertical;
let x0 = Engine::new().set_industry_vertical(IndustryVertical::Generic);
let x1 = Engine::new().set_industry_vertical(IndustryVertical::Media);
let x2 = Engine::new().set_industry_vertical(IndustryVertical::HealthcareFhir);
Source

pub fn set_common_config<T>(self, v: T) -> Self
where T: Into<CommonConfig>,

Sets the value of common_config.

§Example
use google_cloud_discoveryengine_v1::model::engine::CommonConfig;
let x = Engine::new().set_common_config(CommonConfig::default()/* use setters */);
Source

pub fn set_or_clear_common_config<T>(self, v: Option<T>) -> Self
where T: Into<CommonConfig>,

Sets or clears the value of common_config.

§Example
use google_cloud_discoveryengine_v1::model::engine::CommonConfig;
let x = Engine::new().set_or_clear_common_config(Some(CommonConfig::default()/* use setters */));
let x = Engine::new().set_or_clear_common_config(None::<CommonConfig>);
Source

pub fn set_disable_analytics<T: Into<bool>>(self, v: T) -> Self

Sets the value of disable_analytics.

§Example
let x = Engine::new().set_disable_analytics(true);
Source

pub fn set_engine_config<T: Into<Option<EngineConfig>>>(self, v: T) -> Self

Sets the value of engine_config.

Note that all the setters affecting engine_config are mutually exclusive.

§Example
use google_cloud_discoveryengine_v1::model::engine::ChatEngineConfig;
let x = Engine::new().set_engine_config(Some(
    google_cloud_discoveryengine_v1::model::engine::EngineConfig::ChatEngineConfig(ChatEngineConfig::default().into())));
Source

pub fn chat_engine_config(&self) -> Option<&Box<ChatEngineConfig>>

The value of engine_config if it holds a ChatEngineConfig, None if the field is not set or holds a different branch.

Source

pub fn set_chat_engine_config<T: Into<Box<ChatEngineConfig>>>( self, v: T, ) -> Self

Sets the value of engine_config to hold a ChatEngineConfig.

Note that all the setters affecting engine_config are mutually exclusive.

§Example
use google_cloud_discoveryengine_v1::model::engine::ChatEngineConfig;
let x = Engine::new().set_chat_engine_config(ChatEngineConfig::default()/* use setters */);
assert!(x.chat_engine_config().is_some());
assert!(x.search_engine_config().is_none());
assert!(x.media_recommendation_engine_config().is_none());
Source

pub fn search_engine_config(&self) -> Option<&Box<SearchEngineConfig>>

The value of engine_config if it holds a SearchEngineConfig, None if the field is not set or holds a different branch.

Source

pub fn set_search_engine_config<T: Into<Box<SearchEngineConfig>>>( self, v: T, ) -> Self

Sets the value of engine_config to hold a SearchEngineConfig.

Note that all the setters affecting engine_config are mutually exclusive.

§Example
use google_cloud_discoveryengine_v1::model::engine::SearchEngineConfig;
let x = Engine::new().set_search_engine_config(SearchEngineConfig::default()/* use setters */);
assert!(x.search_engine_config().is_some());
assert!(x.chat_engine_config().is_none());
assert!(x.media_recommendation_engine_config().is_none());
Source

pub fn media_recommendation_engine_config( &self, ) -> Option<&Box<MediaRecommendationEngineConfig>>

The value of engine_config if it holds a MediaRecommendationEngineConfig, None if the field is not set or holds a different branch.

Source

pub fn set_media_recommendation_engine_config<T: Into<Box<MediaRecommendationEngineConfig>>>( self, v: T, ) -> Self

Sets the value of engine_config to hold a MediaRecommendationEngineConfig.

Note that all the setters affecting engine_config are mutually exclusive.

§Example
use google_cloud_discoveryengine_v1::model::engine::MediaRecommendationEngineConfig;
let x = Engine::new().set_media_recommendation_engine_config(MediaRecommendationEngineConfig::default()/* use setters */);
assert!(x.media_recommendation_engine_config().is_some());
assert!(x.chat_engine_config().is_none());
assert!(x.search_engine_config().is_none());
Source

pub fn set_engine_metadata<T: Into<Option<EngineMetadata>>>(self, v: T) -> Self

Sets the value of engine_metadata.

Note that all the setters affecting engine_metadata are mutually exclusive.

§Example
use google_cloud_discoveryengine_v1::model::engine::ChatEngineMetadata;
let x = Engine::new().set_engine_metadata(Some(
    google_cloud_discoveryengine_v1::model::engine::EngineMetadata::ChatEngineMetadata(ChatEngineMetadata::default().into())));
Source

pub fn chat_engine_metadata(&self) -> Option<&Box<ChatEngineMetadata>>

The value of engine_metadata if it holds a ChatEngineMetadata, None if the field is not set or holds a different branch.

Source

pub fn set_chat_engine_metadata<T: Into<Box<ChatEngineMetadata>>>( self, v: T, ) -> Self

Sets the value of engine_metadata to hold a ChatEngineMetadata.

Note that all the setters affecting engine_metadata are mutually exclusive.

§Example
use google_cloud_discoveryengine_v1::model::engine::ChatEngineMetadata;
let x = Engine::new().set_chat_engine_metadata(ChatEngineMetadata::default()/* use setters */);
assert!(x.chat_engine_metadata().is_some());

Trait Implementations§

Source§

impl Clone for Engine

Source§

fn clone(&self) -> Engine

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Engine

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Engine

Source§

fn default() -> Engine

Returns the “default value” for a type. Read more
Source§

impl Message for Engine

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Engine

Source§

fn eq(&self, other: &Engine) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Engine

Auto Trait Implementations§

§

impl Freeze for Engine

§

impl RefUnwindSafe for Engine

§

impl Send for Engine

§

impl Sync for Engine

§

impl Unpin for Engine

§

impl UnwindSafe for Engine

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,