#[non_exhaustive]pub struct Session {
pub name: String,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub display_name: String,
pub labels: HashMap<String, String>,
pub session_state: Option<Struct>,
pub user_id: String,
pub expiration: Option<Expiration>,
/* private fields */
}session-service only.Expand description
A session contains a set of actions between users and Vertex agents.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringIdentifier. The resource name of the session. Format: ‘projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}’.
create_time: Option<Timestamp>Output only. Timestamp when the session was created.
update_time: Option<Timestamp>Output only. Timestamp when the session was updated.
display_name: StringOptional. The display name of the session.
labels: HashMap<String, String>The labels with user-defined metadata to organize your Sessions.
Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed.
See https://goo.gl/xmQnxf for more information and examples of labels.
session_state: Option<Struct>Optional. Session specific memory which stores key conversation points.
user_id: StringRequired. Immutable. String id provided by the user
expiration: Option<Expiration>The expiration of the session.
Implementations§
Source§impl Session
impl Session
pub fn new() -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
§Example
use wkt::Timestamp;
let x = Session::new().set_create_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
§Example
use wkt::Timestamp;
let x = Session::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Session::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
§Example
use wkt::Timestamp;
let x = Session::new().set_update_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
§Example
use wkt::Timestamp;
let x = Session::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = Session::new().set_or_clear_update_time(None::<Timestamp>);Sourcepub fn set_display_name<T: Into<String>>(self, v: T) -> Self
pub fn set_display_name<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_labels<T, K, V>(self, v: T) -> Self
pub fn set_labels<T, K, V>(self, v: T) -> Self
Sourcepub fn set_session_state<T>(self, v: T) -> Self
pub fn set_session_state<T>(self, v: T) -> Self
Sets the value of session_state.
§Example
use wkt::Struct;
let x = Session::new().set_session_state(Struct::default()/* use setters */);Sourcepub fn set_or_clear_session_state<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_session_state<T>(self, v: Option<T>) -> Self
Sets or clears the value of session_state.
§Example
use wkt::Struct;
let x = Session::new().set_or_clear_session_state(Some(Struct::default()/* use setters */));
let x = Session::new().set_or_clear_session_state(None::<Struct>);Sourcepub fn set_user_id<T: Into<String>>(self, v: T) -> Self
pub fn set_user_id<T: Into<String>>(self, v: T) -> Self
Sourcepub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
pub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
Sets the value of expiration.
Note that all the setters affecting expiration are mutually
exclusive.
§Example
use wkt::Timestamp;
let x = Session::new().set_expiration(Some(
google_cloud_aiplatform_v1::model::session::Expiration::ExpireTime(Timestamp::default().into())));Sourcepub fn expire_time(&self) -> Option<&Box<Timestamp>>
pub fn expire_time(&self) -> Option<&Box<Timestamp>>
The value of expiration
if it holds a ExpireTime, None if the field is not set or
holds a different branch.
Sourcepub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
pub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
Sets the value of expiration
to hold a ExpireTime.
Note that all the setters affecting expiration are
mutually exclusive.
§Example
use wkt::Timestamp;
let x = Session::new().set_expire_time(Timestamp::default()/* use setters */);
assert!(x.expire_time().is_some());
assert!(x.ttl().is_none());Sourcepub fn ttl(&self) -> Option<&Box<Duration>>
pub fn ttl(&self) -> Option<&Box<Duration>>
The value of expiration
if it holds a Ttl, None if the field is not set or
holds a different branch.
Sourcepub fn set_ttl<T: Into<Box<Duration>>>(self, v: T) -> Self
pub fn set_ttl<T: Into<Box<Duration>>>(self, v: T) -> Self
Sets the value of expiration
to hold a Ttl.
Note that all the setters affecting expiration are
mutually exclusive.
§Example
use wkt::Duration;
let x = Session::new().set_ttl(Duration::default()/* use setters */);
assert!(x.ttl().is_some());
assert!(x.expire_time().is_none());