#[non_exhaustive]pub struct DeviceSession {
pub name: String,
pub display_name: String,
pub state: SessionState,
pub state_histories: Vec<SessionStateEvent>,
pub inactivity_timeout: Option<Duration>,
pub create_time: Option<Timestamp>,
pub active_start_time: Option<Timestamp>,
pub android_device: Option<AndroidDevice>,
pub expiration: Option<Expiration>,
/* private fields */
}Expand description
Protobuf message describing the device message, used from several RPCs.
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: StringOptional. Name of the DeviceSession, e.g. “projects/{project_id}/deviceSessions/{session_id}”
display_name: StringOutput only. The title of the DeviceSession to be presented in the UI.
state: SessionStateOutput only. Current state of the DeviceSession.
state_histories: Vec<SessionStateEvent>Output only. The historical state transitions of the session_state message including the current session state.
inactivity_timeout: Option<Duration>Output only. The interval of time that this device must be interacted with before it transitions from ACTIVE to TIMEOUT_INACTIVITY.
create_time: Option<Timestamp>Output only. The time that the Session was created.
active_start_time: Option<Timestamp>Output only. The timestamp that the session first became ACTIVE.
android_device: Option<AndroidDevice>Required. The requested device
expiration: Option<Expiration>The amount of time that a device will be initially allocated for.
Implementations§
Source§impl DeviceSession
impl DeviceSession
pub fn new() -> Self
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_state<T: Into<SessionState>>(self, v: T) -> Self
pub fn set_state<T: Into<SessionState>>(self, v: T) -> Self
Sets the value of state.
§Example
use google_cloud_devicestreaming_v1::model::device_session::SessionState;
let x0 = DeviceSession::new().set_state(SessionState::Requested);
let x1 = DeviceSession::new().set_state(SessionState::Pending);
let x2 = DeviceSession::new().set_state(SessionState::Active);Sourcepub fn set_state_histories<T, V>(self, v: T) -> Self
pub fn set_state_histories<T, V>(self, v: T) -> Self
Sets the value of state_histories.
§Example
use google_cloud_devicestreaming_v1::model::device_session::SessionStateEvent;
let x = DeviceSession::new()
.set_state_histories([
SessionStateEvent::default()/* use setters */,
SessionStateEvent::default()/* use (different) setters */,
]);Sourcepub fn set_inactivity_timeout<T>(self, v: T) -> Self
pub fn set_inactivity_timeout<T>(self, v: T) -> Self
Sets the value of inactivity_timeout.
§Example
use wkt::Duration;
let x = DeviceSession::new().set_inactivity_timeout(Duration::default()/* use setters */);Sourcepub fn set_or_clear_inactivity_timeout<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_inactivity_timeout<T>(self, v: Option<T>) -> Self
Sets or clears the value of inactivity_timeout.
§Example
use wkt::Duration;
let x = DeviceSession::new().set_or_clear_inactivity_timeout(Some(Duration::default()/* use setters */));
let x = DeviceSession::new().set_or_clear_inactivity_timeout(None::<Duration>);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 = DeviceSession::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 = DeviceSession::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = DeviceSession::new().set_or_clear_create_time(None::<Timestamp>);Sourcepub fn set_active_start_time<T>(self, v: T) -> Self
pub fn set_active_start_time<T>(self, v: T) -> Self
Sets the value of active_start_time.
§Example
use wkt::Timestamp;
let x = DeviceSession::new().set_active_start_time(Timestamp::default()/* use setters */);Sourcepub fn set_or_clear_active_start_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_active_start_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of active_start_time.
§Example
use wkt::Timestamp;
let x = DeviceSession::new().set_or_clear_active_start_time(Some(Timestamp::default()/* use setters */));
let x = DeviceSession::new().set_or_clear_active_start_time(None::<Timestamp>);Sourcepub fn set_android_device<T>(self, v: T) -> Selfwhere
T: Into<AndroidDevice>,
pub fn set_android_device<T>(self, v: T) -> Selfwhere
T: Into<AndroidDevice>,
Sets the value of android_device.
§Example
use google_cloud_devicestreaming_v1::model::AndroidDevice;
let x = DeviceSession::new().set_android_device(AndroidDevice::default()/* use setters */);Sourcepub fn set_or_clear_android_device<T>(self, v: Option<T>) -> Selfwhere
T: Into<AndroidDevice>,
pub fn set_or_clear_android_device<T>(self, v: Option<T>) -> Selfwhere
T: Into<AndroidDevice>,
Sets or clears the value of android_device.
§Example
use google_cloud_devicestreaming_v1::model::AndroidDevice;
let x = DeviceSession::new().set_or_clear_android_device(Some(AndroidDevice::default()/* use setters */));
let x = DeviceSession::new().set_or_clear_android_device(None::<AndroidDevice>);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::Duration;
let x = DeviceSession::new().set_expiration(Some(
google_cloud_devicestreaming_v1::model::device_session::Expiration::Ttl(Duration::default().into())));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 = DeviceSession::new().set_ttl(Duration::default()/* use setters */);
assert!(x.ttl().is_some());
assert!(x.expire_time().is_none());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 = DeviceSession::new().set_expire_time(Timestamp::default()/* use setters */);
assert!(x.expire_time().is_some());
assert!(x.ttl().is_none());Trait Implementations§
Source§impl Clone for DeviceSession
impl Clone for DeviceSession
Source§fn clone(&self) -> DeviceSession
fn clone(&self) -> DeviceSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more