#[non_exhaustive]pub struct Availability {
pub name: String,
pub state: State,
pub custom_status: Option<CustomStatus>,
pub state_metadata: Option<StateMetadata>,
/* private fields */
}Expand description
Represents a user’s current availability information in Google Chat, including their state (for example, Active, Away, Do Not Disturb) and any custom status.
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. Resource name of the user’s availability.
Format: users/{user}/availability
{user} is the id for the Person in the People API or Admin SDK directory
API. For example, users/123456789.
The user’s email address or me can also be used as an alias to refer to
the caller. For example, users/user@example.com or users/me.
state: StateOutput only. The user’s current availability state.
custom_status: Option<CustomStatus>Optional. The user’s custom status.
state_metadata: Option<StateMetadata>Additional metadata associated with the user’s availability state.
Implementations§
Source§impl Availability
impl Availability
Sourcepub fn set_custom_status<T>(self, v: T) -> Selfwhere
T: Into<CustomStatus>,
pub fn set_custom_status<T>(self, v: T) -> Selfwhere
T: Into<CustomStatus>,
Sets the value of custom_status.
§Example
use google_chat_v1::model::CustomStatus;
let x = Availability::new().set_custom_status(CustomStatus::default()/* use setters */);Sourcepub fn set_or_clear_custom_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomStatus>,
pub fn set_or_clear_custom_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<CustomStatus>,
Sets or clears the value of custom_status.
§Example
use google_chat_v1::model::CustomStatus;
let x = Availability::new().set_or_clear_custom_status(Some(CustomStatus::default()/* use setters */));
let x = Availability::new().set_or_clear_custom_status(None::<CustomStatus>);Sourcepub fn set_state_metadata<T: Into<Option<StateMetadata>>>(self, v: T) -> Self
pub fn set_state_metadata<T: Into<Option<StateMetadata>>>(self, v: T) -> Self
Sets the value of state_metadata.
Note that all the setters affecting state_metadata are mutually
exclusive.
§Example
use google_chat_v1::model::DoNotDisturbMetadata;
let x = Availability::new().set_state_metadata(Some(
google_chat_v1::model::availability::StateMetadata::DoNotDisturbMetadata(DoNotDisturbMetadata::default().into())));Sourcepub fn do_not_disturb_metadata(&self) -> Option<&Box<DoNotDisturbMetadata>>
pub fn do_not_disturb_metadata(&self) -> Option<&Box<DoNotDisturbMetadata>>
The value of state_metadata
if it holds a DoNotDisturbMetadata, None if the field is not set or
holds a different branch.
Sourcepub fn set_do_not_disturb_metadata<T: Into<Box<DoNotDisturbMetadata>>>(
self,
v: T,
) -> Self
pub fn set_do_not_disturb_metadata<T: Into<Box<DoNotDisturbMetadata>>>( self, v: T, ) -> Self
Sets the value of state_metadata
to hold a DoNotDisturbMetadata.
Note that all the setters affecting state_metadata are
mutually exclusive.
§Example
use google_chat_v1::model::DoNotDisturbMetadata;
let x = Availability::new().set_do_not_disturb_metadata(DoNotDisturbMetadata::default()/* use setters */);
assert!(x.do_not_disturb_metadata().is_some());Trait Implementations§
Source§impl Clone for Availability
impl Clone for Availability
Source§fn clone(&self) -> Availability
fn clone(&self) -> Availability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more