#![allow(rustdoc::bare_urls)]
#![allow(rustdoc::broken_intra_doc_links)]
#![allow(rustdoc::invalid_html_tags)]
#![allow(rustdoc::redundant_explicit_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_apps_card_v1;
extern crate google_cloud_gax;
extern crate google_cloud_rpc;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ActionStatus {
pub status_code: google_cloud_rpc::model::Code,
pub user_facing_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ActionStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_status_code<T: std::convert::Into<google_cloud_rpc::model::Code>>(
mut self,
v: T,
) -> Self {
self.status_code = v.into();
self
}
pub fn set_user_facing_message<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.user_facing_message = v.into();
self
}
}
impl wkt::message::Message for ActionStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ActionStatus"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Annotation {
pub r#type: crate::model::AnnotationType,
pub start_index: std::option::Option<i32>,
pub length: i32,
pub metadata: std::option::Option<crate::model::annotation::Metadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Annotation {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::AnnotationType>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_start_index<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.start_index = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_start_index<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.start_index = v.map(|x| x.into());
self
}
pub fn set_length<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.length = v.into();
self
}
pub fn set_metadata<
T: std::convert::Into<std::option::Option<crate::model::annotation::Metadata>>,
>(
mut self,
v: T,
) -> Self {
self.metadata = v.into();
self
}
pub fn user_mention(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::UserMentionMetadata>> {
#[allow(unreachable_patterns)]
self.metadata.as_ref().and_then(|v| match v {
crate::model::annotation::Metadata::UserMention(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_user_mention<
T: std::convert::Into<std::boxed::Box<crate::model::UserMentionMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.metadata =
std::option::Option::Some(crate::model::annotation::Metadata::UserMention(v.into()));
self
}
pub fn slash_command(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SlashCommandMetadata>> {
#[allow(unreachable_patterns)]
self.metadata.as_ref().and_then(|v| match v {
crate::model::annotation::Metadata::SlashCommand(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_slash_command<
T: std::convert::Into<std::boxed::Box<crate::model::SlashCommandMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.metadata =
std::option::Option::Some(crate::model::annotation::Metadata::SlashCommand(v.into()));
self
}
pub fn rich_link_metadata(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::RichLinkMetadata>> {
#[allow(unreachable_patterns)]
self.metadata.as_ref().and_then(|v| match v {
crate::model::annotation::Metadata::RichLinkMetadata(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_rich_link_metadata<
T: std::convert::Into<std::boxed::Box<crate::model::RichLinkMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.metadata = std::option::Option::Some(
crate::model::annotation::Metadata::RichLinkMetadata(v.into()),
);
self
}
pub fn custom_emoji_metadata(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CustomEmojiMetadata>> {
#[allow(unreachable_patterns)]
self.metadata.as_ref().and_then(|v| match v {
crate::model::annotation::Metadata::CustomEmojiMetadata(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_custom_emoji_metadata<
T: std::convert::Into<std::boxed::Box<crate::model::CustomEmojiMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.metadata = std::option::Option::Some(
crate::model::annotation::Metadata::CustomEmojiMetadata(v.into()),
);
self
}
}
impl wkt::message::Message for Annotation {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Annotation"
}
}
pub mod annotation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Metadata {
UserMention(std::boxed::Box<crate::model::UserMentionMetadata>),
SlashCommand(std::boxed::Box<crate::model::SlashCommandMetadata>),
RichLinkMetadata(std::boxed::Box<crate::model::RichLinkMetadata>),
CustomEmojiMetadata(std::boxed::Box<crate::model::CustomEmojiMetadata>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UserMentionMetadata {
pub user: std::option::Option<crate::model::User>,
pub r#type: crate::model::user_mention_metadata::Type,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UserMentionMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_user<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.user = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_user<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.user = v.map(|x| x.into());
self
}
pub fn set_type<T: std::convert::Into<crate::model::user_mention_metadata::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for UserMentionMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UserMentionMetadata"
}
}
pub mod user_mention_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Add,
Mention,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Add => std::option::Option::Some(1),
Self::Mention => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Add => std::option::Option::Some("ADD"),
Self::Mention => std::option::Option::Some("MENTION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Add,
2 => Self::Mention,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"ADD" => Self::Add,
"MENTION" => Self::Mention,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Add => serializer.serialize_i32(1),
Self::Mention => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.chat.v1.UserMentionMetadata.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SlashCommandMetadata {
pub bot: std::option::Option<crate::model::User>,
pub r#type: crate::model::slash_command_metadata::Type,
pub command_name: std::string::String,
pub command_id: i64,
pub triggers_dialog: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SlashCommandMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_bot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.bot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_bot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.bot = v.map(|x| x.into());
self
}
pub fn set_type<T: std::convert::Into<crate::model::slash_command_metadata::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_command_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.command_name = v.into();
self
}
pub fn set_command_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.command_id = v.into();
self
}
pub fn set_triggers_dialog<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.triggers_dialog = v.into();
self
}
}
impl wkt::message::Message for SlashCommandMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SlashCommandMetadata"
}
}
pub mod slash_command_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Add,
Invoke,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Add => std::option::Option::Some(1),
Self::Invoke => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Add => std::option::Option::Some("ADD"),
Self::Invoke => std::option::Option::Some("INVOKE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Add,
2 => Self::Invoke,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"ADD" => Self::Add,
"INVOKE" => Self::Invoke,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Add => serializer.serialize_i32(1),
Self::Invoke => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.chat.v1.SlashCommandMetadata.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RichLinkMetadata {
pub uri: std::string::String,
pub rich_link_type: crate::model::rich_link_metadata::RichLinkType,
pub data: std::option::Option<crate::model::rich_link_metadata::Data>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl RichLinkMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
pub fn set_rich_link_type<
T: std::convert::Into<crate::model::rich_link_metadata::RichLinkType>,
>(
mut self,
v: T,
) -> Self {
self.rich_link_type = v.into();
self
}
pub fn set_data<
T: std::convert::Into<std::option::Option<crate::model::rich_link_metadata::Data>>,
>(
mut self,
v: T,
) -> Self {
self.data = v.into();
self
}
pub fn drive_link_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DriveLinkData>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::rich_link_metadata::Data::DriveLinkData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_drive_link_data<
T: std::convert::Into<std::boxed::Box<crate::model::DriveLinkData>>,
>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(
crate::model::rich_link_metadata::Data::DriveLinkData(v.into()),
);
self
}
pub fn chat_space_link_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ChatSpaceLinkData>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::rich_link_metadata::Data::ChatSpaceLinkData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_chat_space_link_data<
T: std::convert::Into<std::boxed::Box<crate::model::ChatSpaceLinkData>>,
>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(
crate::model::rich_link_metadata::Data::ChatSpaceLinkData(v.into()),
);
self
}
pub fn meet_space_link_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MeetSpaceLinkData>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::rich_link_metadata::Data::MeetSpaceLinkData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_meet_space_link_data<
T: std::convert::Into<std::boxed::Box<crate::model::MeetSpaceLinkData>>,
>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(
crate::model::rich_link_metadata::Data::MeetSpaceLinkData(v.into()),
);
self
}
pub fn calendar_event_link_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::CalendarEventLinkData>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::rich_link_metadata::Data::CalendarEventLinkData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_calendar_event_link_data<
T: std::convert::Into<std::boxed::Box<crate::model::CalendarEventLinkData>>,
>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(
crate::model::rich_link_metadata::Data::CalendarEventLinkData(v.into()),
);
self
}
}
impl wkt::message::Message for RichLinkMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.RichLinkMetadata"
}
}
pub mod rich_link_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RichLinkType {
Unspecified,
DriveFile,
ChatSpace,
GmailMessage,
MeetSpace,
CalendarEvent,
UnknownValue(rich_link_type::UnknownValue),
}
#[doc(hidden)]
pub mod rich_link_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RichLinkType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DriveFile => std::option::Option::Some(1),
Self::ChatSpace => std::option::Option::Some(2),
Self::GmailMessage => std::option::Option::Some(3),
Self::MeetSpace => std::option::Option::Some(4),
Self::CalendarEvent => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("RICH_LINK_TYPE_UNSPECIFIED"),
Self::DriveFile => std::option::Option::Some("DRIVE_FILE"),
Self::ChatSpace => std::option::Option::Some("CHAT_SPACE"),
Self::GmailMessage => std::option::Option::Some("GMAIL_MESSAGE"),
Self::MeetSpace => std::option::Option::Some("MEET_SPACE"),
Self::CalendarEvent => std::option::Option::Some("CALENDAR_EVENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RichLinkType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RichLinkType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RichLinkType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DriveFile,
2 => Self::ChatSpace,
3 => Self::GmailMessage,
4 => Self::MeetSpace,
5 => Self::CalendarEvent,
_ => Self::UnknownValue(rich_link_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RichLinkType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"RICH_LINK_TYPE_UNSPECIFIED" => Self::Unspecified,
"DRIVE_FILE" => Self::DriveFile,
"CHAT_SPACE" => Self::ChatSpace,
"GMAIL_MESSAGE" => Self::GmailMessage,
"MEET_SPACE" => Self::MeetSpace,
"CALENDAR_EVENT" => Self::CalendarEvent,
_ => Self::UnknownValue(rich_link_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RichLinkType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DriveFile => serializer.serialize_i32(1),
Self::ChatSpace => serializer.serialize_i32(2),
Self::GmailMessage => serializer.serialize_i32(3),
Self::MeetSpace => serializer.serialize_i32(4),
Self::CalendarEvent => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RichLinkType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RichLinkType>::new(
".google.chat.v1.RichLinkMetadata.RichLinkType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Data {
DriveLinkData(std::boxed::Box<crate::model::DriveLinkData>),
ChatSpaceLinkData(std::boxed::Box<crate::model::ChatSpaceLinkData>),
MeetSpaceLinkData(std::boxed::Box<crate::model::MeetSpaceLinkData>),
CalendarEventLinkData(std::boxed::Box<crate::model::CalendarEventLinkData>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomEmojiMetadata {
pub custom_emoji: std::option::Option<crate::model::CustomEmoji>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomEmojiMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_emoji<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomEmoji>,
{
self.custom_emoji = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_emoji<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomEmoji>,
{
self.custom_emoji = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CustomEmojiMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CustomEmojiMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DriveLinkData {
pub drive_data_ref: std::option::Option<crate::model::DriveDataRef>,
pub mime_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DriveLinkData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_drive_data_ref<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DriveDataRef>,
{
self.drive_data_ref = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_drive_data_ref<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DriveDataRef>,
{
self.drive_data_ref = v.map(|x| x.into());
self
}
pub fn set_mime_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.mime_type = v.into();
self
}
}
impl wkt::message::Message for DriveLinkData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DriveLinkData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ChatSpaceLinkData {
pub space: std::string::String,
pub thread: std::string::String,
pub message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ChatSpaceLinkData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.space = v.into();
self
}
pub fn set_thread<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.thread = v.into();
self
}
pub fn set_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message = v.into();
self
}
}
impl wkt::message::Message for ChatSpaceLinkData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ChatSpaceLinkData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MeetSpaceLinkData {
pub meeting_code: std::string::String,
pub r#type: crate::model::meet_space_link_data::Type,
pub huddle_status: crate::model::meet_space_link_data::HuddleStatus,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MeetSpaceLinkData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_meeting_code<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.meeting_code = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::meet_space_link_data::Type>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_huddle_status<
T: std::convert::Into<crate::model::meet_space_link_data::HuddleStatus>,
>(
mut self,
v: T,
) -> Self {
self.huddle_status = v.into();
self
}
}
impl wkt::message::Message for MeetSpaceLinkData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MeetSpaceLinkData"
}
}
pub mod meet_space_link_data {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Meeting,
Huddle,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Meeting => std::option::Option::Some(1),
Self::Huddle => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Meeting => std::option::Option::Some("MEETING"),
Self::Huddle => std::option::Option::Some("HUDDLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Meeting,
2 => Self::Huddle,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"MEETING" => Self::Meeting,
"HUDDLE" => Self::Huddle,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Meeting => serializer.serialize_i32(1),
Self::Huddle => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.chat.v1.MeetSpaceLinkData.Type",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HuddleStatus {
Unspecified,
Started,
Ended,
Missed,
UnknownValue(huddle_status::UnknownValue),
}
#[doc(hidden)]
pub mod huddle_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HuddleStatus {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Started => std::option::Option::Some(1),
Self::Ended => std::option::Option::Some(2),
Self::Missed => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("HUDDLE_STATUS_UNSPECIFIED"),
Self::Started => std::option::Option::Some("STARTED"),
Self::Ended => std::option::Option::Some("ENDED"),
Self::Missed => std::option::Option::Some("MISSED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HuddleStatus {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HuddleStatus {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for HuddleStatus {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Started,
2 => Self::Ended,
3 => Self::Missed,
_ => Self::UnknownValue(huddle_status::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HuddleStatus {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HUDDLE_STATUS_UNSPECIFIED" => Self::Unspecified,
"STARTED" => Self::Started,
"ENDED" => Self::Ended,
"MISSED" => Self::Missed,
_ => Self::UnknownValue(huddle_status::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HuddleStatus {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Started => serializer.serialize_i32(1),
Self::Ended => serializer.serialize_i32(2),
Self::Missed => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HuddleStatus {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<HuddleStatus>::new(
".google.chat.v1.MeetSpaceLinkData.HuddleStatus",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CalendarEventLinkData {
pub calendar_id: std::string::String,
pub event_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CalendarEventLinkData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_calendar_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.calendar_id = v.into();
self
}
pub fn set_event_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.event_id = v.into();
self
}
}
impl wkt::message::Message for CalendarEventLinkData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CalendarEventLinkData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Attachment {
pub name: std::string::String,
pub content_name: std::string::String,
pub content_type: std::string::String,
pub thumbnail_uri: std::string::String,
pub download_uri: std::string::String,
pub source: crate::model::attachment::Source,
pub data_ref: std::option::Option<crate::model::attachment::DataRef>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Attachment {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_content_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.content_name = v.into();
self
}
pub fn set_content_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.content_type = v.into();
self
}
pub fn set_thumbnail_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.thumbnail_uri = v.into();
self
}
pub fn set_download_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.download_uri = v.into();
self
}
pub fn set_source<T: std::convert::Into<crate::model::attachment::Source>>(
mut self,
v: T,
) -> Self {
self.source = v.into();
self
}
pub fn set_data_ref<
T: std::convert::Into<std::option::Option<crate::model::attachment::DataRef>>,
>(
mut self,
v: T,
) -> Self {
self.data_ref = v.into();
self
}
pub fn attachment_data_ref(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::AttachmentDataRef>> {
#[allow(unreachable_patterns)]
self.data_ref.as_ref().and_then(|v| match v {
crate::model::attachment::DataRef::AttachmentDataRef(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_attachment_data_ref<
T: std::convert::Into<std::boxed::Box<crate::model::AttachmentDataRef>>,
>(
mut self,
v: T,
) -> Self {
self.data_ref = std::option::Option::Some(
crate::model::attachment::DataRef::AttachmentDataRef(v.into()),
);
self
}
pub fn drive_data_ref(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DriveDataRef>> {
#[allow(unreachable_patterns)]
self.data_ref.as_ref().and_then(|v| match v {
crate::model::attachment::DataRef::DriveDataRef(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_drive_data_ref<
T: std::convert::Into<std::boxed::Box<crate::model::DriveDataRef>>,
>(
mut self,
v: T,
) -> Self {
self.data_ref =
std::option::Option::Some(crate::model::attachment::DataRef::DriveDataRef(v.into()));
self
}
}
impl wkt::message::Message for Attachment {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Attachment"
}
}
pub mod attachment {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Source {
Unspecified,
DriveFile,
UploadedContent,
UnknownValue(source::UnknownValue),
}
#[doc(hidden)]
pub mod source {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Source {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::DriveFile => std::option::Option::Some(1),
Self::UploadedContent => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SOURCE_UNSPECIFIED"),
Self::DriveFile => std::option::Option::Some("DRIVE_FILE"),
Self::UploadedContent => std::option::Option::Some("UPLOADED_CONTENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Source {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Source {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Source {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::DriveFile,
2 => Self::UploadedContent,
_ => Self::UnknownValue(source::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Source {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SOURCE_UNSPECIFIED" => Self::Unspecified,
"DRIVE_FILE" => Self::DriveFile,
"UPLOADED_CONTENT" => Self::UploadedContent,
_ => Self::UnknownValue(source::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Source {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::DriveFile => serializer.serialize_i32(1),
Self::UploadedContent => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Source {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Source>::new(
".google.chat.v1.Attachment.Source",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DataRef {
AttachmentDataRef(std::boxed::Box<crate::model::AttachmentDataRef>),
DriveDataRef(std::boxed::Box<crate::model::DriveDataRef>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DriveDataRef {
pub drive_file_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DriveDataRef {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_drive_file_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.drive_file_id = v.into();
self
}
}
impl wkt::message::Message for DriveDataRef {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DriveDataRef"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttachmentDataRef {
pub resource_name: std::string::String,
pub attachment_upload_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttachmentDataRef {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource_name = v.into();
self
}
pub fn set_attachment_upload_token<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.attachment_upload_token = v.into();
self
}
}
impl wkt::message::Message for AttachmentDataRef {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.AttachmentDataRef"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAttachmentRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAttachmentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAttachmentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetAttachmentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UploadAttachmentRequest {
pub parent: std::string::String,
pub filename: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UploadAttachmentRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filename = v.into();
self
}
}
impl wkt::message::Message for UploadAttachmentRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UploadAttachmentRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UploadAttachmentResponse {
pub attachment_data_ref: std::option::Option<crate::model::AttachmentDataRef>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UploadAttachmentResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_attachment_data_ref<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::AttachmentDataRef>,
{
self.attachment_data_ref = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_attachment_data_ref<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::AttachmentDataRef>,
{
self.attachment_data_ref = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UploadAttachmentResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UploadAttachmentResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Audience {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Audience {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Audience {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Audience"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Availability {
pub name: std::string::String,
pub state: crate::model::availability::State,
pub custom_status: std::option::Option<crate::model::CustomStatus>,
pub state_metadata: std::option::Option<crate::model::availability::StateMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Availability {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::availability::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_custom_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomStatus>,
{
self.custom_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomStatus>,
{
self.custom_status = v.map(|x| x.into());
self
}
pub fn set_state_metadata<
T: std::convert::Into<std::option::Option<crate::model::availability::StateMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.state_metadata = v.into();
self
}
pub fn do_not_disturb_metadata(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::DoNotDisturbMetadata>> {
#[allow(unreachable_patterns)]
self.state_metadata.as_ref().and_then(|v| match v {
crate::model::availability::StateMetadata::DoNotDisturbMetadata(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_do_not_disturb_metadata<
T: std::convert::Into<std::boxed::Box<crate::model::DoNotDisturbMetadata>>,
>(
mut self,
v: T,
) -> Self {
self.state_metadata = std::option::Option::Some(
crate::model::availability::StateMetadata::DoNotDisturbMetadata(v.into()),
);
self
}
}
impl wkt::message::Message for Availability {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Availability"
}
}
pub mod availability {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
Idle,
Away,
DoNotDisturb,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::Idle => std::option::Option::Some(2),
Self::Away => std::option::Option::Some(3),
Self::DoNotDisturb => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::Idle => std::option::Option::Some("IDLE"),
Self::Away => std::option::Option::Some("AWAY"),
Self::DoNotDisturb => std::option::Option::Some("DO_NOT_DISTURB"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::Idle,
3 => Self::Away,
4 => Self::DoNotDisturb,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"IDLE" => Self::Idle,
"AWAY" => Self::Away,
"DO_NOT_DISTURB" => Self::DoNotDisturb,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Active => serializer.serialize_i32(1),
Self::Idle => serializer.serialize_i32(2),
Self::Away => serializer.serialize_i32(3),
Self::DoNotDisturb => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.chat.v1.Availability.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum StateMetadata {
DoNotDisturbMetadata(std::boxed::Box<crate::model::DoNotDisturbMetadata>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomStatus {
pub text: std::string::String,
pub emoji: std::option::Option<crate::model::Emoji>,
pub expiration: std::option::Option<crate::model::custom_status::Expiration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomStatus {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_emoji<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Emoji>,
{
self.emoji = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_emoji<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Emoji>,
{
self.emoji = v.map(|x| x.into());
self
}
pub fn set_expiration<
T: std::convert::Into<std::option::Option<crate::model::custom_status::Expiration>>,
>(
mut self,
v: T,
) -> Self {
self.expiration = v.into();
self
}
pub fn expire_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::custom_status::Expiration::ExpireTime(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.expiration = std::option::Option::Some(
crate::model::custom_status::Expiration::ExpireTime(v.into()),
);
self
}
pub fn ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::custom_status::Expiration::Ttl(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(mut self, v: T) -> Self {
self.expiration =
std::option::Option::Some(crate::model::custom_status::Expiration::Ttl(v.into()));
self
}
}
impl wkt::message::Message for CustomStatus {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CustomStatus"
}
}
pub mod custom_status {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
ExpireTime(std::boxed::Box<wkt::Timestamp>),
Ttl(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DoNotDisturbMetadata {
pub expiration_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DoNotDisturbMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_expiration_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiration_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_expiration_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.expiration_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for DoNotDisturbMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DoNotDisturbMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAvailabilityRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetAvailabilityRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetAvailabilityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetAvailabilityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAvailabilityRequest {
pub availability: std::option::Option<crate::model::Availability>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateAvailabilityRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_availability<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Availability>,
{
self.availability = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_availability<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Availability>,
{
self.availability = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateAvailabilityRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UpdateAvailabilityRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MarkAsActiveRequest {
pub name: std::string::String,
pub expiration: std::option::Option<crate::model::mark_as_active_request::Expiration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MarkAsActiveRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_expiration<
T: std::convert::Into<std::option::Option<crate::model::mark_as_active_request::Expiration>>,
>(
mut self,
v: T,
) -> Self {
self.expiration = v.into();
self
}
pub fn expire_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::mark_as_active_request::Expiration::ExpireTime(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.expiration = std::option::Option::Some(
crate::model::mark_as_active_request::Expiration::ExpireTime(v.into()),
);
self
}
pub fn ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::mark_as_active_request::Expiration::Ttl(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(mut self, v: T) -> Self {
self.expiration = std::option::Option::Some(
crate::model::mark_as_active_request::Expiration::Ttl(v.into()),
);
self
}
}
impl wkt::message::Message for MarkAsActiveRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MarkAsActiveRequest"
}
}
pub mod mark_as_active_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
ExpireTime(std::boxed::Box<wkt::Timestamp>),
Ttl(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MarkAsAwayRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MarkAsAwayRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for MarkAsAwayRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MarkAsAwayRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MarkAsDoNotDisturbRequest {
pub name: std::string::String,
pub expiration: std::option::Option<crate::model::mark_as_do_not_disturb_request::Expiration>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MarkAsDoNotDisturbRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_expiration<
T: std::convert::Into<
std::option::Option<crate::model::mark_as_do_not_disturb_request::Expiration>,
>,
>(
mut self,
v: T,
) -> Self {
self.expiration = v.into();
self
}
pub fn expire_time(&self) -> std::option::Option<&std::boxed::Box<wkt::Timestamp>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::mark_as_do_not_disturb_request::Expiration::ExpireTime(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_expire_time<T: std::convert::Into<std::boxed::Box<wkt::Timestamp>>>(
mut self,
v: T,
) -> Self {
self.expiration = std::option::Option::Some(
crate::model::mark_as_do_not_disturb_request::Expiration::ExpireTime(v.into()),
);
self
}
pub fn ttl(&self) -> std::option::Option<&std::boxed::Box<wkt::Duration>> {
#[allow(unreachable_patterns)]
self.expiration.as_ref().and_then(|v| match v {
crate::model::mark_as_do_not_disturb_request::Expiration::Ttl(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_ttl<T: std::convert::Into<std::boxed::Box<wkt::Duration>>>(mut self, v: T) -> Self {
self.expiration = std::option::Option::Some(
crate::model::mark_as_do_not_disturb_request::Expiration::Ttl(v.into()),
);
self
}
}
impl wkt::message::Message for MarkAsDoNotDisturbRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MarkAsDoNotDisturbRequest"
}
}
pub mod mark_as_do_not_disturb_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Expiration {
ExpireTime(std::boxed::Box<wkt::Timestamp>),
Ttl(std::boxed::Box<wkt::Duration>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ContextualAddOnMarkup {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ContextualAddOnMarkup {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for ContextualAddOnMarkup {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ContextualAddOnMarkup"
}
}
pub mod contextual_add_on_markup {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Card {
pub header: std::option::Option<crate::model::contextual_add_on_markup::card::CardHeader>,
pub sections: std::vec::Vec<crate::model::contextual_add_on_markup::card::Section>,
pub card_actions: std::vec::Vec<crate::model::contextual_add_on_markup::card::CardAction>,
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Card {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_header<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::contextual_add_on_markup::card::CardHeader>,
{
self.header = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_header<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::contextual_add_on_markup::card::CardHeader>,
{
self.header = v.map(|x| x.into());
self
}
pub fn set_sections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::contextual_add_on_markup::card::Section>,
{
use std::iter::Iterator;
self.sections = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_card_actions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::contextual_add_on_markup::card::CardAction>,
{
use std::iter::Iterator;
self.card_actions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Card {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ContextualAddOnMarkup.Card"
}
}
pub mod card {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CardHeader {
pub title: std::string::String,
pub subtitle: std::string::String,
pub image_style: crate::model::contextual_add_on_markup::card::card_header::ImageStyle,
pub image_url: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CardHeader {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.title = v.into();
self
}
pub fn set_subtitle<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.subtitle = v.into();
self
}
pub fn set_image_style<
T: std::convert::Into<
crate::model::contextual_add_on_markup::card::card_header::ImageStyle,
>,
>(
mut self,
v: T,
) -> Self {
self.image_style = v.into();
self
}
pub fn set_image_url<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.image_url = v.into();
self
}
}
impl wkt::message::Message for CardHeader {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ContextualAddOnMarkup.Card.CardHeader"
}
}
pub mod card_header {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ImageStyle {
#[allow(missing_docs)]
Unspecified,
Image,
Avatar,
UnknownValue(image_style::UnknownValue),
}
#[doc(hidden)]
pub mod image_style {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ImageStyle {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Image => std::option::Option::Some(1),
Self::Avatar => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("IMAGE_STYLE_UNSPECIFIED"),
Self::Image => std::option::Option::Some("IMAGE"),
Self::Avatar => std::option::Option::Some("AVATAR"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ImageStyle {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ImageStyle {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ImageStyle {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Image,
2 => Self::Avatar,
_ => Self::UnknownValue(image_style::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ImageStyle {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"IMAGE_STYLE_UNSPECIFIED" => Self::Unspecified,
"IMAGE" => Self::Image,
"AVATAR" => Self::Avatar,
_ => Self::UnknownValue(image_style::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ImageStyle {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Image => serializer.serialize_i32(1),
Self::Avatar => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ImageStyle {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ImageStyle>::new(
".google.chat.v1.ContextualAddOnMarkup.Card.CardHeader.ImageStyle",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Section {
pub header: std::string::String,
pub widgets: std::vec::Vec<crate::model::WidgetMarkup>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Section {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_header<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.header = v.into();
self
}
pub fn set_widgets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::WidgetMarkup>,
{
use std::iter::Iterator;
self.widgets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Section {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ContextualAddOnMarkup.Card.Section"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CardAction {
pub action_label: std::string::String,
pub on_click: std::option::Option<crate::model::widget_markup::OnClick>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CardAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action_label<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.action_label = v.into();
self
}
pub fn set_on_click<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_on_click<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CardAction {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ContextualAddOnMarkup.Card.CardAction"
}
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeletionMetadata {
pub deletion_type: crate::model::deletion_metadata::DeletionType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeletionMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_deletion_type<
T: std::convert::Into<crate::model::deletion_metadata::DeletionType>,
>(
mut self,
v: T,
) -> Self {
self.deletion_type = v.into();
self
}
}
impl wkt::message::Message for DeletionMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DeletionMetadata"
}
}
pub mod deletion_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum DeletionType {
Unspecified,
Creator,
SpaceOwner,
Admin,
AppMessageExpiry,
CreatorViaApp,
SpaceOwnerViaApp,
SpaceMember,
UnknownValue(deletion_type::UnknownValue),
}
#[doc(hidden)]
pub mod deletion_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl DeletionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Creator => std::option::Option::Some(1),
Self::SpaceOwner => std::option::Option::Some(2),
Self::Admin => std::option::Option::Some(3),
Self::AppMessageExpiry => std::option::Option::Some(4),
Self::CreatorViaApp => std::option::Option::Some(5),
Self::SpaceOwnerViaApp => std::option::Option::Some(6),
Self::SpaceMember => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("DELETION_TYPE_UNSPECIFIED"),
Self::Creator => std::option::Option::Some("CREATOR"),
Self::SpaceOwner => std::option::Option::Some("SPACE_OWNER"),
Self::Admin => std::option::Option::Some("ADMIN"),
Self::AppMessageExpiry => std::option::Option::Some("APP_MESSAGE_EXPIRY"),
Self::CreatorViaApp => std::option::Option::Some("CREATOR_VIA_APP"),
Self::SpaceOwnerViaApp => std::option::Option::Some("SPACE_OWNER_VIA_APP"),
Self::SpaceMember => std::option::Option::Some("SPACE_MEMBER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for DeletionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for DeletionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for DeletionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Creator,
2 => Self::SpaceOwner,
3 => Self::Admin,
4 => Self::AppMessageExpiry,
5 => Self::CreatorViaApp,
6 => Self::SpaceOwnerViaApp,
7 => Self::SpaceMember,
_ => Self::UnknownValue(deletion_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for DeletionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"DELETION_TYPE_UNSPECIFIED" => Self::Unspecified,
"CREATOR" => Self::Creator,
"SPACE_OWNER" => Self::SpaceOwner,
"ADMIN" => Self::Admin,
"APP_MESSAGE_EXPIRY" => Self::AppMessageExpiry,
"CREATOR_VIA_APP" => Self::CreatorViaApp,
"SPACE_OWNER_VIA_APP" => Self::SpaceOwnerViaApp,
"SPACE_MEMBER" => Self::SpaceMember,
_ => Self::UnknownValue(deletion_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for DeletionType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Creator => serializer.serialize_i32(1),
Self::SpaceOwner => serializer.serialize_i32(2),
Self::Admin => serializer.serialize_i32(3),
Self::AppMessageExpiry => serializer.serialize_i32(4),
Self::CreatorViaApp => serializer.serialize_i32(5),
Self::SpaceOwnerViaApp => serializer.serialize_i32(6),
Self::SpaceMember => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for DeletionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<DeletionType>::new(
".google.chat.v1.DeletionMetadata.DeletionType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipCreatedEventData {
pub membership: std::option::Option<crate::model::Membership>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MembershipCreatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_membership<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_membership<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MembershipCreatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MembershipCreatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipDeletedEventData {
pub membership: std::option::Option<crate::model::Membership>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MembershipDeletedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_membership<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_membership<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MembershipDeletedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MembershipDeletedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipUpdatedEventData {
pub membership: std::option::Option<crate::model::Membership>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MembershipUpdatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_membership<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_membership<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MembershipUpdatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MembershipUpdatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipBatchCreatedEventData {
pub memberships: std::vec::Vec<crate::model::MembershipCreatedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MembershipBatchCreatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_memberships<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MembershipCreatedEventData>,
{
use std::iter::Iterator;
self.memberships = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MembershipBatchCreatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MembershipBatchCreatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipBatchUpdatedEventData {
pub memberships: std::vec::Vec<crate::model::MembershipUpdatedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MembershipBatchUpdatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_memberships<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MembershipUpdatedEventData>,
{
use std::iter::Iterator;
self.memberships = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MembershipBatchUpdatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MembershipBatchUpdatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipBatchDeletedEventData {
pub memberships: std::vec::Vec<crate::model::MembershipDeletedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MembershipBatchDeletedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_memberships<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MembershipDeletedEventData>,
{
use std::iter::Iterator;
self.memberships = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MembershipBatchDeletedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MembershipBatchDeletedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MessageCreatedEventData {
pub message: std::option::Option<crate::model::Message>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MessageCreatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MessageCreatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MessageCreatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MessageUpdatedEventData {
pub message: std::option::Option<crate::model::Message>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MessageUpdatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MessageUpdatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MessageUpdatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MessageDeletedEventData {
pub message: std::option::Option<crate::model::Message>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MessageDeletedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MessageDeletedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MessageDeletedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MessageBatchCreatedEventData {
pub messages: std::vec::Vec<crate::model::MessageCreatedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MessageBatchCreatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MessageCreatedEventData>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MessageBatchCreatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MessageBatchCreatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MessageBatchUpdatedEventData {
pub messages: std::vec::Vec<crate::model::MessageUpdatedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MessageBatchUpdatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MessageUpdatedEventData>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MessageBatchUpdatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MessageBatchUpdatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MessageBatchDeletedEventData {
pub messages: std::vec::Vec<crate::model::MessageDeletedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MessageBatchDeletedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::MessageDeletedEventData>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for MessageBatchDeletedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MessageBatchDeletedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpaceUpdatedEventData {
pub space: std::option::Option<crate::model::Space>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpaceUpdatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SpaceUpdatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SpaceUpdatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpaceBatchUpdatedEventData {
pub spaces: std::vec::Vec<crate::model::SpaceUpdatedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpaceBatchUpdatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpaceUpdatedEventData>,
{
use std::iter::Iterator;
self.spaces = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SpaceBatchUpdatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SpaceBatchUpdatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReactionCreatedEventData {
pub reaction: std::option::Option<crate::model::Reaction>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReactionCreatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reaction<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Reaction>,
{
self.reaction = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reaction<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Reaction>,
{
self.reaction = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReactionCreatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ReactionCreatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReactionDeletedEventData {
pub reaction: std::option::Option<crate::model::Reaction>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReactionDeletedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reaction<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Reaction>,
{
self.reaction = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reaction<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Reaction>,
{
self.reaction = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ReactionDeletedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ReactionDeletedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReactionBatchCreatedEventData {
pub reactions: std::vec::Vec<crate::model::ReactionCreatedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReactionBatchCreatedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reactions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ReactionCreatedEventData>,
{
use std::iter::Iterator;
self.reactions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReactionBatchCreatedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ReactionBatchCreatedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ReactionBatchDeletedEventData {
pub reactions: std::vec::Vec<crate::model::ReactionDeletedEventData>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ReactionBatchDeletedEventData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reactions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ReactionDeletedEventData>,
{
use std::iter::Iterator;
self.reactions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ReactionBatchDeletedEventData {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ReactionBatchDeletedEventData"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Group {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Group {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for Group {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Group"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MatchedUrl {
pub url: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MatchedUrl {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.url = v.into();
self
}
}
impl wkt::message::Message for MatchedUrl {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MatchedUrl"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Membership {
pub name: std::string::String,
pub state: crate::model::membership::MembershipState,
pub role: crate::model::membership::MembershipRole,
pub create_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub affiliation: crate::model::membership::Affiliation,
pub member_type: std::option::Option<crate::model::membership::MemberType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Membership {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::membership::MembershipState>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_role<T: std::convert::Into<crate::model::membership::MembershipRole>>(
mut self,
v: T,
) -> Self {
self.role = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = v.map(|x| x.into());
self
}
pub fn set_affiliation<T: std::convert::Into<crate::model::membership::Affiliation>>(
mut self,
v: T,
) -> Self {
self.affiliation = v.into();
self
}
pub fn set_member_type<
T: std::convert::Into<std::option::Option<crate::model::membership::MemberType>>,
>(
mut self,
v: T,
) -> Self {
self.member_type = v.into();
self
}
pub fn member(&self) -> std::option::Option<&std::boxed::Box<crate::model::User>> {
#[allow(unreachable_patterns)]
self.member_type.as_ref().and_then(|v| match v {
crate::model::membership::MemberType::Member(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_member<T: std::convert::Into<std::boxed::Box<crate::model::User>>>(
mut self,
v: T,
) -> Self {
self.member_type =
std::option::Option::Some(crate::model::membership::MemberType::Member(v.into()));
self
}
pub fn group_member(&self) -> std::option::Option<&std::boxed::Box<crate::model::Group>> {
#[allow(unreachable_patterns)]
self.member_type.as_ref().and_then(|v| match v {
crate::model::membership::MemberType::GroupMember(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_group_member<T: std::convert::Into<std::boxed::Box<crate::model::Group>>>(
mut self,
v: T,
) -> Self {
self.member_type =
std::option::Option::Some(crate::model::membership::MemberType::GroupMember(v.into()));
self
}
}
impl wkt::message::Message for Membership {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Membership"
}
}
pub mod membership {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MembershipState {
Unspecified,
Joined,
Invited,
NotAMember,
UnknownValue(membership_state::UnknownValue),
}
#[doc(hidden)]
pub mod membership_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MembershipState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Joined => std::option::Option::Some(1),
Self::Invited => std::option::Option::Some(2),
Self::NotAMember => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MEMBERSHIP_STATE_UNSPECIFIED"),
Self::Joined => std::option::Option::Some("JOINED"),
Self::Invited => std::option::Option::Some("INVITED"),
Self::NotAMember => std::option::Option::Some("NOT_A_MEMBER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MembershipState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MembershipState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MembershipState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Joined,
2 => Self::Invited,
3 => Self::NotAMember,
_ => Self::UnknownValue(membership_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MembershipState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MEMBERSHIP_STATE_UNSPECIFIED" => Self::Unspecified,
"JOINED" => Self::Joined,
"INVITED" => Self::Invited,
"NOT_A_MEMBER" => Self::NotAMember,
_ => Self::UnknownValue(membership_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MembershipState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Joined => serializer.serialize_i32(1),
Self::Invited => serializer.serialize_i32(2),
Self::NotAMember => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MembershipState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MembershipState>::new(
".google.chat.v1.Membership.MembershipState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MembershipRole {
Unspecified,
RoleMember,
RoleManager,
RoleAssistantManager,
UnknownValue(membership_role::UnknownValue),
}
#[doc(hidden)]
pub mod membership_role {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MembershipRole {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::RoleMember => std::option::Option::Some(1),
Self::RoleManager => std::option::Option::Some(2),
Self::RoleAssistantManager => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MEMBERSHIP_ROLE_UNSPECIFIED"),
Self::RoleMember => std::option::Option::Some("ROLE_MEMBER"),
Self::RoleManager => std::option::Option::Some("ROLE_MANAGER"),
Self::RoleAssistantManager => std::option::Option::Some("ROLE_ASSISTANT_MANAGER"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MembershipRole {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MembershipRole {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MembershipRole {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::RoleMember,
2 => Self::RoleManager,
4 => Self::RoleAssistantManager,
_ => Self::UnknownValue(membership_role::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MembershipRole {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MEMBERSHIP_ROLE_UNSPECIFIED" => Self::Unspecified,
"ROLE_MEMBER" => Self::RoleMember,
"ROLE_MANAGER" => Self::RoleManager,
"ROLE_ASSISTANT_MANAGER" => Self::RoleAssistantManager,
_ => Self::UnknownValue(membership_role::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MembershipRole {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::RoleMember => serializer.serialize_i32(1),
Self::RoleManager => serializer.serialize_i32(2),
Self::RoleAssistantManager => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MembershipRole {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MembershipRole>::new(
".google.chat.v1.Membership.MembershipRole",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Affiliation {
Unspecified,
Internal,
External,
ManagedExternal,
UnknownValue(affiliation::UnknownValue),
}
#[doc(hidden)]
pub mod affiliation {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Affiliation {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Internal => std::option::Option::Some(1),
Self::External => std::option::Option::Some(2),
Self::ManagedExternal => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("AFFILIATION_UNSPECIFIED"),
Self::Internal => std::option::Option::Some("INTERNAL"),
Self::External => std::option::Option::Some("EXTERNAL"),
Self::ManagedExternal => std::option::Option::Some("MANAGED_EXTERNAL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Affiliation {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Affiliation {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Affiliation {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Internal,
2 => Self::External,
3 => Self::ManagedExternal,
_ => Self::UnknownValue(affiliation::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Affiliation {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"AFFILIATION_UNSPECIFIED" => Self::Unspecified,
"INTERNAL" => Self::Internal,
"EXTERNAL" => Self::External,
"MANAGED_EXTERNAL" => Self::ManagedExternal,
_ => Self::UnknownValue(affiliation::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Affiliation {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Internal => serializer.serialize_i32(1),
Self::External => serializer.serialize_i32(2),
Self::ManagedExternal => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Affiliation {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Affiliation>::new(
".google.chat.v1.Membership.Affiliation",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MemberType {
Member(std::boxed::Box<crate::model::User>),
GroupMember(std::boxed::Box<crate::model::Group>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMembershipRequest {
pub parent: std::string::String,
pub membership: std::option::Option<crate::model::Membership>,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMembershipRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_membership<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_membership<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = v.map(|x| x.into());
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for CreateMembershipRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CreateMembershipRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMembershipRequest {
pub membership: std::option::Option<crate::model::Membership>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMembershipRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_membership<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_membership<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Membership>,
{
self.membership = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for UpdateMembershipRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UpdateMembershipRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMembershipsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub show_groups: bool,
pub show_invited: bool,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMembershipsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_show_groups<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_groups = v.into();
self
}
pub fn set_show_invited<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_invited = v.into();
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for ListMembershipsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListMembershipsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMembershipsResponse {
pub memberships: std::vec::Vec<crate::model::Membership>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMembershipsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_memberships<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Membership>,
{
use std::iter::Iterator;
self.memberships = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListMembershipsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListMembershipsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMembershipsResponse {
type PageItem = crate::model::Membership;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.memberships
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMembershipRequest {
pub name: std::string::String,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMembershipRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for GetMembershipRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetMembershipRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMembershipRequest {
pub name: std::string::String,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMembershipRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for DeleteMembershipRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DeleteMembershipRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Message {
pub name: std::string::String,
pub sender: std::option::Option<crate::model::User>,
pub create_time: std::option::Option<wkt::Timestamp>,
pub last_update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub text: std::string::String,
pub formatted_text: std::string::String,
#[deprecated]
pub cards: std::vec::Vec<crate::model::contextual_add_on_markup::Card>,
pub cards_v2: std::vec::Vec<crate::model::CardWithId>,
pub annotations: std::vec::Vec<crate::model::Annotation>,
pub thread: std::option::Option<crate::model::Thread>,
pub space: std::option::Option<crate::model::Space>,
pub fallback_text: std::string::String,
pub action_response: std::option::Option<crate::model::ActionResponse>,
pub argument_text: std::string::String,
pub slash_command: std::option::Option<crate::model::SlashCommand>,
pub attachment: std::vec::Vec<crate::model::Attachment>,
pub matched_url: std::option::Option<crate::model::MatchedUrl>,
pub thread_reply: bool,
pub silent: bool,
pub client_assigned_message_id: std::string::String,
pub emoji_reaction_summaries: std::vec::Vec<crate::model::EmojiReactionSummary>,
pub private_message_viewer: std::option::Option<crate::model::User>,
pub deletion_metadata: std::option::Option<crate::model::DeletionMetadata>,
pub quoted_message_metadata: std::option::Option<crate::model::QuotedMessageMetadata>,
pub attached_gifs: std::vec::Vec<crate::model::AttachedGif>,
pub accessory_widgets: std::vec::Vec<crate::model::AccessoryWidget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Message {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_sender<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.sender = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_sender<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.sender = v.map(|x| x.into());
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_last_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_update_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = v.map(|x| x.into());
self
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_formatted_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.formatted_text = v.into();
self
}
#[deprecated]
pub fn set_cards<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::contextual_add_on_markup::Card>,
{
use std::iter::Iterator;
self.cards = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_cards_v2<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CardWithId>,
{
use std::iter::Iterator;
self.cards_v2 = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Annotation>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_thread<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Thread>,
{
self.thread = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_thread<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Thread>,
{
self.thread = v.map(|x| x.into());
self
}
pub fn set_space<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = v.map(|x| x.into());
self
}
pub fn set_fallback_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.fallback_text = v.into();
self
}
pub fn set_action_response<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ActionResponse>,
{
self.action_response = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_action_response<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ActionResponse>,
{
self.action_response = v.map(|x| x.into());
self
}
pub fn set_argument_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.argument_text = v.into();
self
}
pub fn set_slash_command<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SlashCommand>,
{
self.slash_command = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_slash_command<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SlashCommand>,
{
self.slash_command = v.map(|x| x.into());
self
}
pub fn set_attachment<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Attachment>,
{
use std::iter::Iterator;
self.attachment = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_matched_url<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::MatchedUrl>,
{
self.matched_url = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_matched_url<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::MatchedUrl>,
{
self.matched_url = v.map(|x| x.into());
self
}
pub fn set_thread_reply<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.thread_reply = v.into();
self
}
pub fn set_silent<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.silent = v.into();
self
}
pub fn set_client_assigned_message_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.client_assigned_message_id = v.into();
self
}
pub fn set_emoji_reaction_summaries<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EmojiReactionSummary>,
{
use std::iter::Iterator;
self.emoji_reaction_summaries = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_private_message_viewer<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.private_message_viewer = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_private_message_viewer<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.private_message_viewer = v.map(|x| x.into());
self
}
pub fn set_deletion_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DeletionMetadata>,
{
self.deletion_metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_deletion_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DeletionMetadata>,
{
self.deletion_metadata = v.map(|x| x.into());
self
}
pub fn set_quoted_message_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::QuotedMessageMetadata>,
{
self.quoted_message_metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_quoted_message_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::QuotedMessageMetadata>,
{
self.quoted_message_metadata = v.map(|x| x.into());
self
}
pub fn set_attached_gifs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AttachedGif>,
{
use std::iter::Iterator;
self.attached_gifs = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_accessory_widgets<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AccessoryWidget>,
{
use std::iter::Iterator;
self.accessory_widgets = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for Message {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Message"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AttachedGif {
pub uri: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AttachedGif {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uri = v.into();
self
}
}
impl wkt::message::Message for AttachedGif {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.AttachedGif"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QuotedMessageMetadata {
pub name: std::string::String,
pub last_update_time: std::option::Option<wkt::Timestamp>,
pub quote_type: crate::model::quoted_message_metadata::QuoteType,
pub quoted_message_snapshot: std::option::Option<crate::model::QuotedMessageSnapshot>,
pub forwarded_metadata: std::option::Option<crate::model::ForwardedMetadata>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QuotedMessageMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_last_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_update_time = v.map(|x| x.into());
self
}
pub fn set_quote_type<
T: std::convert::Into<crate::model::quoted_message_metadata::QuoteType>,
>(
mut self,
v: T,
) -> Self {
self.quote_type = v.into();
self
}
pub fn set_quoted_message_snapshot<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::QuotedMessageSnapshot>,
{
self.quoted_message_snapshot = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_quoted_message_snapshot<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::QuotedMessageSnapshot>,
{
self.quoted_message_snapshot = v.map(|x| x.into());
self
}
pub fn set_forwarded_metadata<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ForwardedMetadata>,
{
self.forwarded_metadata = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_forwarded_metadata<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ForwardedMetadata>,
{
self.forwarded_metadata = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for QuotedMessageMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.QuotedMessageMetadata"
}
}
pub mod quoted_message_metadata {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum QuoteType {
Unspecified,
Reply,
Forward,
UnknownValue(quote_type::UnknownValue),
}
#[doc(hidden)]
pub mod quote_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl QuoteType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Reply => std::option::Option::Some(1),
Self::Forward => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("QUOTE_TYPE_UNSPECIFIED"),
Self::Reply => std::option::Option::Some("REPLY"),
Self::Forward => std::option::Option::Some("FORWARD"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for QuoteType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for QuoteType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for QuoteType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Reply,
2 => Self::Forward,
_ => Self::UnknownValue(quote_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for QuoteType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"QUOTE_TYPE_UNSPECIFIED" => Self::Unspecified,
"REPLY" => Self::Reply,
"FORWARD" => Self::Forward,
_ => Self::UnknownValue(quote_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for QuoteType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Reply => serializer.serialize_i32(1),
Self::Forward => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for QuoteType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<QuoteType>::new(
".google.chat.v1.QuotedMessageMetadata.QuoteType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QuotedMessageSnapshot {
pub sender: std::string::String,
pub text: std::string::String,
pub formatted_text: std::string::String,
pub annotations: std::vec::Vec<crate::model::Annotation>,
pub attachments: std::vec::Vec<crate::model::Attachment>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QuotedMessageSnapshot {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sender<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.sender = v.into();
self
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_formatted_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.formatted_text = v.into();
self
}
pub fn set_annotations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Annotation>,
{
use std::iter::Iterator;
self.annotations = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_attachments<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Attachment>,
{
use std::iter::Iterator;
self.attachments = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for QuotedMessageSnapshot {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.QuotedMessageSnapshot"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ForwardedMetadata {
pub space: std::string::String,
pub space_display_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ForwardedMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.space = v.into();
self
}
pub fn set_space_display_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.space_display_name = v.into();
self
}
}
impl wkt::message::Message for ForwardedMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ForwardedMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Thread {
pub name: std::string::String,
pub thread_key: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Thread {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_thread_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.thread_key = v.into();
self
}
}
impl wkt::message::Message for Thread {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Thread"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ActionResponse {
pub r#type: crate::model::action_response::ResponseType,
pub url: std::string::String,
pub dialog_action: std::option::Option<crate::model::DialogAction>,
pub updated_widget: std::option::Option<crate::model::action_response::UpdatedWidget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ActionResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<T: std::convert::Into<crate::model::action_response::ResponseType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.url = v.into();
self
}
pub fn set_dialog_action<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::DialogAction>,
{
self.dialog_action = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_dialog_action<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::DialogAction>,
{
self.dialog_action = v.map(|x| x.into());
self
}
pub fn set_updated_widget<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::action_response::UpdatedWidget>,
{
self.updated_widget = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_updated_widget<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::action_response::UpdatedWidget>,
{
self.updated_widget = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ActionResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ActionResponse"
}
}
pub mod action_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SelectionItems {
pub items: std::vec::Vec<google_apps_card_v1::model::selection_input::SelectionItem>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SelectionItems {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<google_apps_card_v1::model::selection_input::SelectionItem>,
{
use std::iter::Iterator;
self.items = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SelectionItems {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ActionResponse.SelectionItems"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdatedWidget {
pub widget: std::string::String,
pub updated_widget:
std::option::Option<crate::model::action_response::updated_widget::UpdatedWidget>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdatedWidget {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_widget<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.widget = v.into();
self
}
pub fn set_updated_widget<
T: std::convert::Into<
std::option::Option<
crate::model::action_response::updated_widget::UpdatedWidget,
>,
>,
>(
mut self,
v: T,
) -> Self {
self.updated_widget = v.into();
self
}
pub fn suggestions(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::action_response::SelectionItems>>
{
#[allow(unreachable_patterns)]
self.updated_widget.as_ref().and_then(|v| match v {
crate::model::action_response::updated_widget::UpdatedWidget::Suggestions(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_suggestions<
T: std::convert::Into<std::boxed::Box<crate::model::action_response::SelectionItems>>,
>(
mut self,
v: T,
) -> Self {
self.updated_widget = std::option::Option::Some(
crate::model::action_response::updated_widget::UpdatedWidget::Suggestions(v.into()),
);
self
}
}
impl wkt::message::Message for UpdatedWidget {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ActionResponse.UpdatedWidget"
}
}
pub mod updated_widget {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum UpdatedWidget {
Suggestions(std::boxed::Box<crate::model::action_response::SelectionItems>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ResponseType {
TypeUnspecified,
NewMessage,
UpdateMessage,
UpdateUserMessageCards,
RequestConfig,
Dialog,
UpdateWidget,
UnknownValue(response_type::UnknownValue),
}
#[doc(hidden)]
pub mod response_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ResponseType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::TypeUnspecified => std::option::Option::Some(0),
Self::NewMessage => std::option::Option::Some(1),
Self::UpdateMessage => std::option::Option::Some(2),
Self::UpdateUserMessageCards => std::option::Option::Some(6),
Self::RequestConfig => std::option::Option::Some(3),
Self::Dialog => std::option::Option::Some(4),
Self::UpdateWidget => std::option::Option::Some(7),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::TypeUnspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::NewMessage => std::option::Option::Some("NEW_MESSAGE"),
Self::UpdateMessage => std::option::Option::Some("UPDATE_MESSAGE"),
Self::UpdateUserMessageCards => {
std::option::Option::Some("UPDATE_USER_MESSAGE_CARDS")
}
Self::RequestConfig => std::option::Option::Some("REQUEST_CONFIG"),
Self::Dialog => std::option::Option::Some("DIALOG"),
Self::UpdateWidget => std::option::Option::Some("UPDATE_WIDGET"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ResponseType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ResponseType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ResponseType {
fn from(value: i32) -> Self {
match value {
0 => Self::TypeUnspecified,
1 => Self::NewMessage,
2 => Self::UpdateMessage,
3 => Self::RequestConfig,
4 => Self::Dialog,
6 => Self::UpdateUserMessageCards,
7 => Self::UpdateWidget,
_ => Self::UnknownValue(response_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ResponseType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::TypeUnspecified,
"NEW_MESSAGE" => Self::NewMessage,
"UPDATE_MESSAGE" => Self::UpdateMessage,
"UPDATE_USER_MESSAGE_CARDS" => Self::UpdateUserMessageCards,
"REQUEST_CONFIG" => Self::RequestConfig,
"DIALOG" => Self::Dialog,
"UPDATE_WIDGET" => Self::UpdateWidget,
_ => Self::UnknownValue(response_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ResponseType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::TypeUnspecified => serializer.serialize_i32(0),
Self::NewMessage => serializer.serialize_i32(1),
Self::UpdateMessage => serializer.serialize_i32(2),
Self::UpdateUserMessageCards => serializer.serialize_i32(6),
Self::RequestConfig => serializer.serialize_i32(3),
Self::Dialog => serializer.serialize_i32(4),
Self::UpdateWidget => serializer.serialize_i32(7),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ResponseType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ResponseType>::new(
".google.chat.v1.ActionResponse.ResponseType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessoryWidget {
pub action: std::option::Option<crate::model::accessory_widget::Action>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessoryWidget {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action<
T: std::convert::Into<std::option::Option<crate::model::accessory_widget::Action>>,
>(
mut self,
v: T,
) -> Self {
self.action = v.into();
self
}
pub fn button_list(
&self,
) -> std::option::Option<&std::boxed::Box<google_apps_card_v1::model::ButtonList>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::accessory_widget::Action::ButtonList(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_button_list<
T: std::convert::Into<std::boxed::Box<google_apps_card_v1::model::ButtonList>>,
>(
mut self,
v: T,
) -> Self {
self.action =
std::option::Option::Some(crate::model::accessory_widget::Action::ButtonList(v.into()));
self
}
}
impl wkt::message::Message for AccessoryWidget {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.AccessoryWidget"
}
}
pub mod accessory_widget {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Action {
ButtonList(std::boxed::Box<google_apps_card_v1::model::ButtonList>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetMessageRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetMessageRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetMessageRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetMessageRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteMessageRequest {
pub name: std::string::String,
pub force: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteMessageRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_force<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.force = v.into();
self
}
}
impl wkt::message::Message for DeleteMessageRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DeleteMessageRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateMessageRequest {
pub message: std::option::Option<crate::model::Message>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub allow_missing: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateMessageRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_allow_missing<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.allow_missing = v.into();
self
}
}
impl wkt::message::Message for UpdateMessageRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UpdateMessageRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMessageRequest {
pub parent: std::string::String,
pub message: std::option::Option<crate::model::Message>,
#[deprecated]
pub thread_key: std::string::String,
pub request_id: std::string::String,
pub message_reply_option: crate::model::create_message_request::MessageReplyOption,
pub message_id: std::string::String,
pub create_message_notification_options:
std::option::Option<crate::model::CreateMessageNotificationOptions>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMessageRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_message<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_message<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Message>,
{
self.message = v.map(|x| x.into());
self
}
#[deprecated]
pub fn set_thread_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.thread_key = v.into();
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_message_reply_option<
T: std::convert::Into<crate::model::create_message_request::MessageReplyOption>,
>(
mut self,
v: T,
) -> Self {
self.message_reply_option = v.into();
self
}
pub fn set_message_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.message_id = v.into();
self
}
pub fn set_create_message_notification_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CreateMessageNotificationOptions>,
{
self.create_message_notification_options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_message_notification_options<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::CreateMessageNotificationOptions>,
{
self.create_message_notification_options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateMessageRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CreateMessageRequest"
}
}
pub mod create_message_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MessageReplyOption {
Unspecified,
ReplyMessageFallbackToNewThread,
ReplyMessageOrFail,
UnknownValue(message_reply_option::UnknownValue),
}
#[doc(hidden)]
pub mod message_reply_option {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MessageReplyOption {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ReplyMessageFallbackToNewThread => std::option::Option::Some(1),
Self::ReplyMessageOrFail => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MESSAGE_REPLY_OPTION_UNSPECIFIED"),
Self::ReplyMessageFallbackToNewThread => {
std::option::Option::Some("REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD")
}
Self::ReplyMessageOrFail => std::option::Option::Some("REPLY_MESSAGE_OR_FAIL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MessageReplyOption {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MessageReplyOption {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MessageReplyOption {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::ReplyMessageFallbackToNewThread,
2 => Self::ReplyMessageOrFail,
_ => Self::UnknownValue(message_reply_option::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MessageReplyOption {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MESSAGE_REPLY_OPTION_UNSPECIFIED" => Self::Unspecified,
"REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD" => Self::ReplyMessageFallbackToNewThread,
"REPLY_MESSAGE_OR_FAIL" => Self::ReplyMessageOrFail,
_ => Self::UnknownValue(message_reply_option::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MessageReplyOption {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ReplyMessageFallbackToNewThread => serializer.serialize_i32(1),
Self::ReplyMessageOrFail => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MessageReplyOption {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MessageReplyOption>::new(
".google.chat.v1.CreateMessageRequest.MessageReplyOption",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateMessageNotificationOptions {
pub notification_type: crate::model::create_message_notification_options::NotificationType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateMessageNotificationOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_notification_type<
T: std::convert::Into<crate::model::create_message_notification_options::NotificationType>,
>(
mut self,
v: T,
) -> Self {
self.notification_type = v.into();
self
}
}
impl wkt::message::Message for CreateMessageNotificationOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CreateMessageNotificationOptions"
}
}
pub mod create_message_notification_options {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NotificationType {
None,
ForceNotify,
Silent,
UnknownValue(notification_type::UnknownValue),
}
#[doc(hidden)]
pub mod notification_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NotificationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::None => std::option::Option::Some(0),
Self::ForceNotify => std::option::Option::Some(2),
Self::Silent => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::None => std::option::Option::Some("NOTIFICATION_TYPE_NONE"),
Self::ForceNotify => std::option::Option::Some("NOTIFICATION_TYPE_FORCE_NOTIFY"),
Self::Silent => std::option::Option::Some("NOTIFICATION_TYPE_SILENT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NotificationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NotificationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for NotificationType {
fn from(value: i32) -> Self {
match value {
0 => Self::None,
2 => Self::ForceNotify,
3 => Self::Silent,
_ => Self::UnknownValue(notification_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NotificationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NOTIFICATION_TYPE_NONE" => Self::None,
"NOTIFICATION_TYPE_FORCE_NOTIFY" => Self::ForceNotify,
"NOTIFICATION_TYPE_SILENT" => Self::Silent,
_ => Self::UnknownValue(notification_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NotificationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::None => serializer.serialize_i32(0),
Self::ForceNotify => serializer.serialize_i32(2),
Self::Silent => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NotificationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NotificationType>::new(
".google.chat.v1.CreateMessageNotificationOptions.NotificationType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMessagesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub order_by: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMessagesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListMessagesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListMessagesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListMessagesResponse {
pub messages: std::vec::Vec<crate::model::Message>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListMessagesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_messages<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Message>,
{
use std::iter::Iterator;
self.messages = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListMessagesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListMessagesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListMessagesResponse {
type PageItem = crate::model::Message;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.messages
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DialogAction {
pub action_status: std::option::Option<crate::model::ActionStatus>,
pub action: std::option::Option<crate::model::dialog_action::Action>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DialogAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action_status<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ActionStatus>,
{
self.action_status = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_action_status<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ActionStatus>,
{
self.action_status = v.map(|x| x.into());
self
}
pub fn set_action<
T: std::convert::Into<std::option::Option<crate::model::dialog_action::Action>>,
>(
mut self,
v: T,
) -> Self {
self.action = v.into();
self
}
pub fn dialog(&self) -> std::option::Option<&std::boxed::Box<crate::model::Dialog>> {
#[allow(unreachable_patterns)]
self.action.as_ref().and_then(|v| match v {
crate::model::dialog_action::Action::Dialog(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_dialog<T: std::convert::Into<std::boxed::Box<crate::model::Dialog>>>(
mut self,
v: T,
) -> Self {
self.action =
std::option::Option::Some(crate::model::dialog_action::Action::Dialog(v.into()));
self
}
}
impl wkt::message::Message for DialogAction {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DialogAction"
}
}
pub mod dialog_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Action {
Dialog(std::boxed::Box<crate::model::Dialog>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Dialog {
pub body: std::option::Option<google_apps_card_v1::model::Card>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Dialog {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_body<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_apps_card_v1::model::Card>,
{
self.body = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_apps_card_v1::model::Card>,
{
self.body = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Dialog {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Dialog"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CardWithId {
pub card_id: std::string::String,
pub card: std::option::Option<google_apps_card_v1::model::Card>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CardWithId {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_card_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.card_id = v.into();
self
}
pub fn set_card<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_apps_card_v1::model::Card>,
{
self.card = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_card<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_apps_card_v1::model::Card>,
{
self.card = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CardWithId {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CardWithId"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Reaction {
pub name: std::string::String,
pub user: std::option::Option<crate::model::User>,
pub emoji: std::option::Option<crate::model::Emoji>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Reaction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_user<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.user = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_user<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::User>,
{
self.user = v.map(|x| x.into());
self
}
pub fn set_emoji<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Emoji>,
{
self.emoji = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_emoji<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Emoji>,
{
self.emoji = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Reaction {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Reaction"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Emoji {
pub content: std::option::Option<crate::model::emoji::Content>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Emoji {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_content<T: std::convert::Into<std::option::Option<crate::model::emoji::Content>>>(
mut self,
v: T,
) -> Self {
self.content = v.into();
self
}
pub fn unicode(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.content.as_ref().and_then(|v| match v {
crate::model::emoji::Content::Unicode(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_unicode<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.content = std::option::Option::Some(crate::model::emoji::Content::Unicode(v.into()));
self
}
pub fn custom_emoji(&self) -> std::option::Option<&std::boxed::Box<crate::model::CustomEmoji>> {
#[allow(unreachable_patterns)]
self.content.as_ref().and_then(|v| match v {
crate::model::emoji::Content::CustomEmoji(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_custom_emoji<T: std::convert::Into<std::boxed::Box<crate::model::CustomEmoji>>>(
mut self,
v: T,
) -> Self {
self.content =
std::option::Option::Some(crate::model::emoji::Content::CustomEmoji(v.into()));
self
}
}
impl wkt::message::Message for Emoji {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Emoji"
}
}
pub mod emoji {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Content {
Unicode(std::string::String),
CustomEmoji(std::boxed::Box<crate::model::CustomEmoji>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomEmoji {
pub name: std::string::String,
pub uid: std::string::String,
pub emoji_name: std::string::String,
pub temporary_image_uri: std::string::String,
pub payload: std::option::Option<crate::model::custom_emoji::CustomEmojiPayload>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomEmoji {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_uid<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.uid = v.into();
self
}
pub fn set_emoji_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.emoji_name = v.into();
self
}
pub fn set_temporary_image_uri<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.temporary_image_uri = v.into();
self
}
pub fn set_payload<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::custom_emoji::CustomEmojiPayload>,
{
self.payload = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_payload<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::custom_emoji::CustomEmojiPayload>,
{
self.payload = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CustomEmoji {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CustomEmoji"
}
}
pub mod custom_emoji {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CustomEmojiPayload {
pub file_content: ::bytes::Bytes,
pub filename: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CustomEmojiPayload {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_file_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.file_content = v.into();
self
}
pub fn set_filename<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filename = v.into();
self
}
}
impl wkt::message::Message for CustomEmojiPayload {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CustomEmoji.CustomEmojiPayload"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EmojiReactionSummary {
pub emoji: std::option::Option<crate::model::Emoji>,
pub reaction_count: std::option::Option<i32>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EmojiReactionSummary {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_emoji<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Emoji>,
{
self.emoji = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_emoji<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Emoji>,
{
self.emoji = v.map(|x| x.into());
self
}
pub fn set_reaction_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<i32>,
{
self.reaction_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reaction_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<i32>,
{
self.reaction_count = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for EmojiReactionSummary {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.EmojiReactionSummary"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateReactionRequest {
pub parent: std::string::String,
pub reaction: std::option::Option<crate::model::Reaction>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateReactionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_reaction<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Reaction>,
{
self.reaction = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reaction<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Reaction>,
{
self.reaction = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateReactionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CreateReactionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReactionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReactionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListReactionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListReactionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListReactionsResponse {
pub reactions: std::vec::Vec<crate::model::Reaction>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListReactionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_reactions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Reaction>,
{
use std::iter::Iterator;
self.reactions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListReactionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListReactionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListReactionsResponse {
type PageItem = crate::model::Reaction;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.reactions
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteReactionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteReactionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteReactionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DeleteReactionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateCustomEmojiRequest {
pub custom_emoji: std::option::Option<crate::model::CustomEmoji>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateCustomEmojiRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_emoji<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::CustomEmoji>,
{
self.custom_emoji = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_custom_emoji<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::CustomEmoji>,
{
self.custom_emoji = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateCustomEmojiRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CreateCustomEmojiRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetCustomEmojiRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetCustomEmojiRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetCustomEmojiRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetCustomEmojiRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCustomEmojisRequest {
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCustomEmojisRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListCustomEmojisRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListCustomEmojisRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListCustomEmojisResponse {
pub custom_emojis: std::vec::Vec<crate::model::CustomEmoji>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListCustomEmojisResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_custom_emojis<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::CustomEmoji>,
{
use std::iter::Iterator;
self.custom_emojis = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListCustomEmojisResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListCustomEmojisResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListCustomEmojisResponse {
type PageItem = crate::model::CustomEmoji;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.custom_emojis
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteCustomEmojiRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteCustomEmojiRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteCustomEmojiRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DeleteCustomEmojiRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Section {
pub name: std::string::String,
pub display_name: std::string::String,
pub sort_order: i32,
pub r#type: crate::model::section::SectionType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Section {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_sort_order<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.sort_order = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::section::SectionType>>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
}
impl wkt::message::Message for Section {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Section"
}
}
pub mod section {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SectionType {
Unspecified,
CustomSection,
DefaultDirectMessages,
DefaultSpaces,
DefaultApps,
UnknownValue(section_type::UnknownValue),
}
#[doc(hidden)]
pub mod section_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SectionType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CustomSection => std::option::Option::Some(1),
Self::DefaultDirectMessages => std::option::Option::Some(2),
Self::DefaultSpaces => std::option::Option::Some(3),
Self::DefaultApps => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SECTION_TYPE_UNSPECIFIED"),
Self::CustomSection => std::option::Option::Some("CUSTOM_SECTION"),
Self::DefaultDirectMessages => std::option::Option::Some("DEFAULT_DIRECT_MESSAGES"),
Self::DefaultSpaces => std::option::Option::Some("DEFAULT_SPACES"),
Self::DefaultApps => std::option::Option::Some("DEFAULT_APPS"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SectionType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SectionType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SectionType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CustomSection,
2 => Self::DefaultDirectMessages,
3 => Self::DefaultSpaces,
6 => Self::DefaultApps,
_ => Self::UnknownValue(section_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SectionType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SECTION_TYPE_UNSPECIFIED" => Self::Unspecified,
"CUSTOM_SECTION" => Self::CustomSection,
"DEFAULT_DIRECT_MESSAGES" => Self::DefaultDirectMessages,
"DEFAULT_SPACES" => Self::DefaultSpaces,
"DEFAULT_APPS" => Self::DefaultApps,
_ => Self::UnknownValue(section_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SectionType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CustomSection => serializer.serialize_i32(1),
Self::DefaultDirectMessages => serializer.serialize_i32(2),
Self::DefaultSpaces => serializer.serialize_i32(3),
Self::DefaultApps => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SectionType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SectionType>::new(
".google.chat.v1.Section.SectionType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SectionItem {
pub name: std::string::String,
pub item: std::option::Option<crate::model::section_item::Item>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SectionItem {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_item<
T: std::convert::Into<std::option::Option<crate::model::section_item::Item>>,
>(
mut self,
v: T,
) -> Self {
self.item = v.into();
self
}
pub fn space(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.item.as_ref().and_then(|v| match v {
crate::model::section_item::Item::Space(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_space<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.item = std::option::Option::Some(crate::model::section_item::Item::Space(v.into()));
self
}
}
impl wkt::message::Message for SectionItem {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SectionItem"
}
}
pub mod section_item {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Item {
Space(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSectionRequest {
pub parent: std::string::String,
pub section: std::option::Option<crate::model::Section>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSectionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_section<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Section>,
{
self.section = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_section<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Section>,
{
self.section = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateSectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CreateSectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSectionRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSectionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteSectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DeleteSectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSectionRequest {
pub section: std::option::Option<crate::model::Section>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSectionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_section<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Section>,
{
self.section = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_section<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Section>,
{
self.section = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UpdateSectionRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSectionsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSectionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListSectionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSectionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSectionsResponse {
pub sections: std::vec::Vec<crate::model::Section>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSectionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_sections<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Section>,
{
use std::iter::Iterator;
self.sections = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSectionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSectionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSectionsResponse {
type PageItem = crate::model::Section;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.sections
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PositionSectionRequest {
pub name: std::string::String,
pub position: std::option::Option<crate::model::position_section_request::PositionOneof>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PositionSectionRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_position<
T: std::convert::Into<
std::option::Option<crate::model::position_section_request::PositionOneof>,
>,
>(
mut self,
v: T,
) -> Self {
self.position = v.into();
self
}
pub fn sort_order(&self) -> std::option::Option<&i32> {
#[allow(unreachable_patterns)]
self.position.as_ref().and_then(|v| match v {
crate::model::position_section_request::PositionOneof::SortOrder(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_sort_order<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.position = std::option::Option::Some(
crate::model::position_section_request::PositionOneof::SortOrder(v.into()),
);
self
}
pub fn relative_position(
&self,
) -> std::option::Option<&crate::model::position_section_request::Position> {
#[allow(unreachable_patterns)]
self.position.as_ref().and_then(|v| match v {
crate::model::position_section_request::PositionOneof::RelativePosition(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_relative_position<
T: std::convert::Into<crate::model::position_section_request::Position>,
>(
mut self,
v: T,
) -> Self {
self.position = std::option::Option::Some(
crate::model::position_section_request::PositionOneof::RelativePosition(v.into()),
);
self
}
}
impl wkt::message::Message for PositionSectionRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.PositionSectionRequest"
}
}
pub mod position_section_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Position {
Unspecified,
Start,
End,
UnknownValue(position::UnknownValue),
}
#[doc(hidden)]
pub mod position {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Position {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Start => std::option::Option::Some(1),
Self::End => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("POSITION_UNSPECIFIED"),
Self::Start => std::option::Option::Some("START"),
Self::End => std::option::Option::Some("END"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Position {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Position {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Position {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Start,
2 => Self::End,
_ => Self::UnknownValue(position::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Position {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"POSITION_UNSPECIFIED" => Self::Unspecified,
"START" => Self::Start,
"END" => Self::End,
_ => Self::UnknownValue(position::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Position {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Start => serializer.serialize_i32(1),
Self::End => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Position {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Position>::new(
".google.chat.v1.PositionSectionRequest.Position",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PositionOneof {
SortOrder(i32),
RelativePosition(crate::model::position_section_request::Position),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PositionSectionResponse {
pub section: std::option::Option<crate::model::Section>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PositionSectionResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_section<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Section>,
{
self.section = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_section<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Section>,
{
self.section = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PositionSectionResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.PositionSectionResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSectionItemsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSectionItemsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListSectionItemsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSectionItemsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSectionItemsResponse {
pub section_items: std::vec::Vec<crate::model::SectionItem>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSectionItemsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_section_items<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SectionItem>,
{
use std::iter::Iterator;
self.section_items = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSectionItemsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSectionItemsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSectionItemsResponse {
type PageItem = crate::model::SectionItem;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.section_items
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveSectionItemRequest {
pub name: std::string::String,
pub target_section: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MoveSectionItemRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_target_section<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.target_section = v.into();
self
}
}
impl wkt::message::Message for MoveSectionItemRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MoveSectionItemRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveSectionItemResponse {
pub section_item: std::option::Option<crate::model::SectionItem>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MoveSectionItemResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_section_item<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SectionItem>,
{
self.section_item = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_section_item<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SectionItem>,
{
self.section_item = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for MoveSectionItemResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.MoveSectionItemResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SlashCommand {
pub command_id: i64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SlashCommand {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_command_id<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
self.command_id = v.into();
self
}
}
impl wkt::message::Message for SlashCommand {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SlashCommand"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Space {
pub name: std::string::String,
#[deprecated]
pub r#type: crate::model::space::Type,
pub space_type: crate::model::space::SpaceType,
pub single_user_bot_dm: bool,
#[deprecated]
pub threaded: bool,
pub display_name: std::string::String,
pub external_user_allowed: bool,
pub space_threading_state: crate::model::space::SpaceThreadingState,
pub space_details: std::option::Option<crate::model::space::SpaceDetails>,
pub space_history_state: crate::model::HistoryState,
pub import_mode: bool,
pub create_time: std::option::Option<wkt::Timestamp>,
pub last_active_time: std::option::Option<wkt::Timestamp>,
pub admin_installed: bool,
pub membership_count: std::option::Option<crate::model::space::MembershipCount>,
pub access_settings: std::option::Option<crate::model::space::AccessSettings>,
pub customer: std::option::Option<std::string::String>,
pub space_uri: std::string::String,
pub import_mode_expire_time: std::option::Option<wkt::Timestamp>,
pub space_permission_settings:
std::option::Option<crate::model::space::SpacePermissionSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Space {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
#[deprecated]
pub fn set_type<T: std::convert::Into<crate::model::space::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_space_type<T: std::convert::Into<crate::model::space::SpaceType>>(
mut self,
v: T,
) -> Self {
self.space_type = v.into();
self
}
pub fn set_single_user_bot_dm<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.single_user_bot_dm = v.into();
self
}
#[deprecated]
pub fn set_threaded<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.threaded = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_external_user_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.external_user_allowed = v.into();
self
}
pub fn set_space_threading_state<
T: std::convert::Into<crate::model::space::SpaceThreadingState>,
>(
mut self,
v: T,
) -> Self {
self.space_threading_state = v.into();
self
}
pub fn set_space_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::SpaceDetails>,
{
self.space_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::SpaceDetails>,
{
self.space_details = v.map(|x| x.into());
self
}
pub fn set_space_history_state<T: std::convert::Into<crate::model::HistoryState>>(
mut self,
v: T,
) -> Self {
self.space_history_state = v.into();
self
}
pub fn set_import_mode<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.import_mode = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_last_active_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_active_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_active_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_active_time = v.map(|x| x.into());
self
}
pub fn set_admin_installed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.admin_installed = v.into();
self
}
pub fn set_membership_count<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::MembershipCount>,
{
self.membership_count = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_membership_count<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::MembershipCount>,
{
self.membership_count = v.map(|x| x.into());
self
}
pub fn set_access_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::AccessSettings>,
{
self.access_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_access_settings<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::AccessSettings>,
{
self.access_settings = v.map(|x| x.into());
self
}
pub fn set_customer<T>(mut self, v: T) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.customer = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_customer<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<std::string::String>,
{
self.customer = v.map(|x| x.into());
self
}
pub fn set_space_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.space_uri = v.into();
self
}
pub fn set_import_mode_expire_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.import_mode_expire_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_import_mode_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.import_mode_expire_time = v.map(|x| x.into());
self
}
pub fn set_space_permission_settings<
T: std::convert::Into<std::option::Option<crate::model::space::SpacePermissionSettings>>,
>(
mut self,
v: T,
) -> Self {
self.space_permission_settings = v.into();
self
}
pub fn predefined_permission_settings(
&self,
) -> std::option::Option<&crate::model::space::PredefinedPermissionSettings> {
#[allow(unreachable_patterns)]
self.space_permission_settings
.as_ref()
.and_then(|v| match v {
crate::model::space::SpacePermissionSettings::PredefinedPermissionSettings(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_predefined_permission_settings<
T: std::convert::Into<crate::model::space::PredefinedPermissionSettings>,
>(
mut self,
v: T,
) -> Self {
self.space_permission_settings = std::option::Option::Some(
crate::model::space::SpacePermissionSettings::PredefinedPermissionSettings(v.into()),
);
self
}
pub fn permission_settings(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::space::PermissionSettings>> {
#[allow(unreachable_patterns)]
self.space_permission_settings
.as_ref()
.and_then(|v| match v {
crate::model::space::SpacePermissionSettings::PermissionSettings(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_permission_settings<
T: std::convert::Into<std::boxed::Box<crate::model::space::PermissionSettings>>,
>(
mut self,
v: T,
) -> Self {
self.space_permission_settings = std::option::Option::Some(
crate::model::space::SpacePermissionSettings::PermissionSettings(v.into()),
);
self
}
}
impl wkt::message::Message for Space {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space"
}
}
pub mod space {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpaceDetails {
pub description: std::string::String,
pub guidelines: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpaceDetails {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_guidelines<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.guidelines = v.into();
self
}
}
impl wkt::message::Message for SpaceDetails {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.SpaceDetails"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MembershipCount {
pub joined_direct_human_user_count: i32,
pub joined_group_count: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MembershipCount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_joined_direct_human_user_count<T: std::convert::Into<i32>>(
mut self,
v: T,
) -> Self {
self.joined_direct_human_user_count = v.into();
self
}
pub fn set_joined_group_count<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.joined_group_count = v.into();
self
}
}
impl wkt::message::Message for MembershipCount {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.MembershipCount"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessSettings {
pub access_state: crate::model::space::access_settings::AccessState,
pub audience: std::string::String,
pub access_permission_settings:
std::option::Option<crate::model::space::AccessPermissionSettings>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_access_state<
T: std::convert::Into<crate::model::space::access_settings::AccessState>,
>(
mut self,
v: T,
) -> Self {
self.access_state = v.into();
self
}
pub fn set_audience<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.audience = v.into();
self
}
pub fn set_access_permission_settings<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::AccessPermissionSettings>,
{
self.access_permission_settings = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_access_permission_settings<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::space::AccessPermissionSettings>,
{
self.access_permission_settings = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AccessSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.AccessSettings"
}
}
pub mod access_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AccessState {
Unspecified,
Private,
Discoverable,
UnknownValue(access_state::UnknownValue),
}
#[doc(hidden)]
pub mod access_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AccessState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Private => std::option::Option::Some(1),
Self::Discoverable => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ACCESS_STATE_UNSPECIFIED"),
Self::Private => std::option::Option::Some("PRIVATE"),
Self::Discoverable => std::option::Option::Some("DISCOVERABLE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AccessState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AccessState {
fn fmt(
&self,
f: &mut std::fmt::Formatter<'_>,
) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AccessState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Private,
2 => Self::Discoverable,
_ => Self::UnknownValue(access_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AccessState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACCESS_STATE_UNSPECIFIED" => Self::Unspecified,
"PRIVATE" => Self::Private,
"DISCOVERABLE" => Self::Discoverable,
_ => Self::UnknownValue(access_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AccessState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Private => serializer.serialize_i32(1),
Self::Discoverable => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AccessState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AccessState>::new(
".google.chat.v1.Space.AccessSettings.AccessState",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessPermissionSettings {
pub discover_space_setting:
std::option::Option<crate::model::space::AccessPermissionSetting>,
pub join_space_setting: std::option::Option<crate::model::space::AccessPermissionSetting>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessPermissionSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_discover_space_setting<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::AccessPermissionSetting>,
{
self.discover_space_setting = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_discover_space_setting<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::AccessPermissionSetting>,
{
self.discover_space_setting = v.map(|x| x.into());
self
}
pub fn set_join_space_setting<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::AccessPermissionSetting>,
{
self.join_space_setting = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_join_space_setting<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::AccessPermissionSetting>,
{
self.join_space_setting = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AccessPermissionSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.AccessPermissionSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AccessPermissionSetting {
pub principals: std::vec::Vec<crate::model::space::Principal>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AccessPermissionSetting {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_principals<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::space::Principal>,
{
use std::iter::Iterator;
self.principals = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AccessPermissionSetting {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.AccessPermissionSetting"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Principal {
pub principal_type: std::option::Option<crate::model::space::principal::PrincipalType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Principal {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_principal_type<
T: std::convert::Into<std::option::Option<crate::model::space::principal::PrincipalType>>,
>(
mut self,
v: T,
) -> Self {
self.principal_type = v.into();
self
}
pub fn audience(&self) -> std::option::Option<&std::boxed::Box<crate::model::Audience>> {
#[allow(unreachable_patterns)]
self.principal_type.as_ref().and_then(|v| match v {
crate::model::space::principal::PrincipalType::Audience(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_audience<T: std::convert::Into<std::boxed::Box<crate::model::Audience>>>(
mut self,
v: T,
) -> Self {
self.principal_type = std::option::Option::Some(
crate::model::space::principal::PrincipalType::Audience(v.into()),
);
self
}
}
impl wkt::message::Message for Principal {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.Principal"
}
}
pub mod principal {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PrincipalType {
Audience(std::boxed::Box<crate::model::Audience>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PermissionSettings {
pub manage_members_and_groups: std::option::Option<crate::model::space::PermissionSetting>,
pub modify_space_details: std::option::Option<crate::model::space::PermissionSetting>,
pub toggle_history: std::option::Option<crate::model::space::PermissionSetting>,
pub use_at_mention_all: std::option::Option<crate::model::space::PermissionSetting>,
pub manage_apps: std::option::Option<crate::model::space::PermissionSetting>,
pub manage_webhooks: std::option::Option<crate::model::space::PermissionSetting>,
pub post_messages: std::option::Option<crate::model::space::PermissionSetting>,
pub reply_messages: std::option::Option<crate::model::space::PermissionSetting>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PermissionSettings {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_manage_members_and_groups<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.manage_members_and_groups = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_manage_members_and_groups<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.manage_members_and_groups = v.map(|x| x.into());
self
}
pub fn set_modify_space_details<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.modify_space_details = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_modify_space_details<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.modify_space_details = v.map(|x| x.into());
self
}
pub fn set_toggle_history<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.toggle_history = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_toggle_history<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.toggle_history = v.map(|x| x.into());
self
}
pub fn set_use_at_mention_all<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.use_at_mention_all = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_use_at_mention_all<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.use_at_mention_all = v.map(|x| x.into());
self
}
pub fn set_manage_apps<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.manage_apps = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_manage_apps<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.manage_apps = v.map(|x| x.into());
self
}
pub fn set_manage_webhooks<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.manage_webhooks = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_manage_webhooks<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.manage_webhooks = v.map(|x| x.into());
self
}
pub fn set_post_messages<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.post_messages = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_post_messages<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.post_messages = v.map(|x| x.into());
self
}
pub fn set_reply_messages<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.reply_messages = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_reply_messages<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space::PermissionSetting>,
{
self.reply_messages = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PermissionSettings {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.PermissionSettings"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PermissionSetting {
pub managers_allowed: bool,
pub assistant_managers_allowed: std::option::Option<bool>,
pub members_allowed: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PermissionSetting {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_managers_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.managers_allowed = v.into();
self
}
pub fn set_assistant_managers_allowed<T>(mut self, v: T) -> Self
where
T: std::convert::Into<bool>,
{
self.assistant_managers_allowed = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_assistant_managers_allowed<T>(
mut self,
v: std::option::Option<T>,
) -> Self
where
T: std::convert::Into<bool>,
{
self.assistant_managers_allowed = v.map(|x| x.into());
self
}
pub fn set_members_allowed<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.members_allowed = v.into();
self
}
}
impl wkt::message::Message for PermissionSetting {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.Space.PermissionSetting"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Room,
Dm,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Room => std::option::Option::Some(1),
Self::Dm => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Room => std::option::Option::Some("ROOM"),
Self::Dm => std::option::Option::Some("DM"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Room,
2 => Self::Dm,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"ROOM" => Self::Room,
"DM" => Self::Dm,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Room => serializer.serialize_i32(1),
Self::Dm => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.chat.v1.Space.Type",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpaceType {
Unspecified,
Space,
GroupChat,
DirectMessage,
UnknownValue(space_type::UnknownValue),
}
#[doc(hidden)]
pub mod space_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SpaceType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Space => std::option::Option::Some(1),
Self::GroupChat => std::option::Option::Some(2),
Self::DirectMessage => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SPACE_TYPE_UNSPECIFIED"),
Self::Space => std::option::Option::Some("SPACE"),
Self::GroupChat => std::option::Option::Some("GROUP_CHAT"),
Self::DirectMessage => std::option::Option::Some("DIRECT_MESSAGE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SpaceType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SpaceType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SpaceType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Space,
2 => Self::GroupChat,
3 => Self::DirectMessage,
_ => Self::UnknownValue(space_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SpaceType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SPACE_TYPE_UNSPECIFIED" => Self::Unspecified,
"SPACE" => Self::Space,
"GROUP_CHAT" => Self::GroupChat,
"DIRECT_MESSAGE" => Self::DirectMessage,
_ => Self::UnknownValue(space_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SpaceType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Space => serializer.serialize_i32(1),
Self::GroupChat => serializer.serialize_i32(2),
Self::DirectMessage => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SpaceType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpaceType>::new(
".google.chat.v1.Space.SpaceType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpaceThreadingState {
Unspecified,
ThreadedMessages,
GroupedMessages,
UnthreadedMessages,
UnknownValue(space_threading_state::UnknownValue),
}
#[doc(hidden)]
pub mod space_threading_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SpaceThreadingState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ThreadedMessages => std::option::Option::Some(2),
Self::GroupedMessages => std::option::Option::Some(3),
Self::UnthreadedMessages => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SPACE_THREADING_STATE_UNSPECIFIED"),
Self::ThreadedMessages => std::option::Option::Some("THREADED_MESSAGES"),
Self::GroupedMessages => std::option::Option::Some("GROUPED_MESSAGES"),
Self::UnthreadedMessages => std::option::Option::Some("UNTHREADED_MESSAGES"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SpaceThreadingState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SpaceThreadingState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SpaceThreadingState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
2 => Self::ThreadedMessages,
3 => Self::GroupedMessages,
4 => Self::UnthreadedMessages,
_ => Self::UnknownValue(space_threading_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SpaceThreadingState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SPACE_THREADING_STATE_UNSPECIFIED" => Self::Unspecified,
"THREADED_MESSAGES" => Self::ThreadedMessages,
"GROUPED_MESSAGES" => Self::GroupedMessages,
"UNTHREADED_MESSAGES" => Self::UnthreadedMessages,
_ => Self::UnknownValue(space_threading_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SpaceThreadingState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ThreadedMessages => serializer.serialize_i32(2),
Self::GroupedMessages => serializer.serialize_i32(3),
Self::UnthreadedMessages => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SpaceThreadingState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpaceThreadingState>::new(
".google.chat.v1.Space.SpaceThreadingState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PredefinedPermissionSettings {
Unspecified,
CollaborationSpace,
AnnouncementSpace,
UnknownValue(predefined_permission_settings::UnknownValue),
}
#[doc(hidden)]
pub mod predefined_permission_settings {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PredefinedPermissionSettings {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::CollaborationSpace => std::option::Option::Some(1),
Self::AnnouncementSpace => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => {
std::option::Option::Some("PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED")
}
Self::CollaborationSpace => std::option::Option::Some("COLLABORATION_SPACE"),
Self::AnnouncementSpace => std::option::Option::Some("ANNOUNCEMENT_SPACE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PredefinedPermissionSettings {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PredefinedPermissionSettings {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PredefinedPermissionSettings {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::CollaborationSpace,
2 => Self::AnnouncementSpace,
_ => Self::UnknownValue(predefined_permission_settings::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PredefinedPermissionSettings {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED" => Self::Unspecified,
"COLLABORATION_SPACE" => Self::CollaborationSpace,
"ANNOUNCEMENT_SPACE" => Self::AnnouncementSpace,
_ => Self::UnknownValue(predefined_permission_settings::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PredefinedPermissionSettings {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::CollaborationSpace => serializer.serialize_i32(1),
Self::AnnouncementSpace => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PredefinedPermissionSettings {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<PredefinedPermissionSettings>::new(
".google.chat.v1.Space.PredefinedPermissionSettings",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpacePermissionSettings {
PredefinedPermissionSettings(crate::model::space::PredefinedPermissionSettings),
PermissionSettings(std::boxed::Box<crate::model::space::PermissionSettings>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateSpaceRequest {
pub space: std::option::Option<crate::model::Space>,
pub request_id: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateSpaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
}
impl wkt::message::Message for CreateSpaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CreateSpaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpacesRequest {
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSpacesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListSpacesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSpacesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpacesResponse {
pub spaces: std::vec::Vec<crate::model::Space>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSpacesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Space>,
{
use std::iter::Iterator;
self.spaces = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSpacesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSpacesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSpacesResponse {
type PageItem = crate::model::Space;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.spaces
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpaceRequest {
pub name: std::string::String,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSpaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for GetSpaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetSpaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FindDirectMessageRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FindDirectMessageRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for FindDirectMessageRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.FindDirectMessageRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FindGroupChatsRequest {
pub users: std::vec::Vec<std::string::String>,
pub page_size: i32,
pub page_token: std::string::String,
pub space_view: crate::model::SpaceView,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FindGroupChatsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_users<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.users = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_space_view<T: std::convert::Into<crate::model::SpaceView>>(mut self, v: T) -> Self {
self.space_view = v.into();
self
}
}
impl wkt::message::Message for FindGroupChatsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.FindGroupChatsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FindGroupChatsResponse {
pub spaces: std::vec::Vec<crate::model::Space>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FindGroupChatsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Space>,
{
use std::iter::Iterator;
self.spaces = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for FindGroupChatsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.FindGroupChatsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for FindGroupChatsResponse {
type PageItem = crate::model::Space;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.spaces
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSpaceRequest {
pub space: std::option::Option<crate::model::Space>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSpaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for UpdateSpaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UpdateSpaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchSpacesRequest {
pub use_admin_access: bool,
pub page_size: i32,
pub page_token: std::string::String,
pub query: std::string::String,
pub order_by: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchSpacesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
pub fn set_order_by<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.order_by = v.into();
self
}
}
impl wkt::message::Message for SearchSpacesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SearchSpacesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchSpacesResponse {
pub spaces: std::vec::Vec<crate::model::Space>,
pub next_page_token: std::string::String,
pub total_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchSpacesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_spaces<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Space>,
{
use std::iter::Iterator;
self.spaces = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
pub fn set_total_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.total_size = v.into();
self
}
}
impl wkt::message::Message for SearchSpacesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SearchSpacesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchSpacesResponse {
type PageItem = crate::model::Space;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.spaces
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteSpaceRequest {
pub name: std::string::String,
pub use_admin_access: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteSpaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_use_admin_access<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.use_admin_access = v.into();
self
}
}
impl wkt::message::Message for DeleteSpaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.DeleteSpaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CompleteImportSpaceRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CompleteImportSpaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for CompleteImportSpaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CompleteImportSpaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CompleteImportSpaceResponse {
pub space: std::option::Option<crate::model::Space>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CompleteImportSpaceResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CompleteImportSpaceResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.CompleteImportSpaceResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpaceEvent {
pub name: std::string::String,
pub event_time: std::option::Option<wkt::Timestamp>,
pub event_type: std::string::String,
#[allow(missing_docs)]
pub payload: std::option::Option<crate::model::space_event::Payload>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpaceEvent {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_event_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_event_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.event_time = v.map(|x| x.into());
self
}
pub fn set_event_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.event_type = v.into();
self
}
pub fn set_payload<
T: std::convert::Into<std::option::Option<crate::model::space_event::Payload>>,
>(
mut self,
v: T,
) -> Self {
self.payload = v.into();
self
}
pub fn message_created_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MessageCreatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MessageCreatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_message_created_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MessageCreatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MessageCreatedEventData(v.into()),
);
self
}
pub fn message_updated_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MessageUpdatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MessageUpdatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_message_updated_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MessageUpdatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MessageUpdatedEventData(v.into()),
);
self
}
pub fn message_deleted_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MessageDeletedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MessageDeletedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_message_deleted_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MessageDeletedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MessageDeletedEventData(v.into()),
);
self
}
pub fn message_batch_created_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MessageBatchCreatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MessageBatchCreatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_message_batch_created_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MessageBatchCreatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MessageBatchCreatedEventData(v.into()),
);
self
}
pub fn message_batch_updated_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MessageBatchUpdatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MessageBatchUpdatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_message_batch_updated_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MessageBatchUpdatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MessageBatchUpdatedEventData(v.into()),
);
self
}
pub fn message_batch_deleted_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MessageBatchDeletedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MessageBatchDeletedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_message_batch_deleted_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MessageBatchDeletedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MessageBatchDeletedEventData(v.into()),
);
self
}
pub fn space_updated_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SpaceUpdatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::SpaceUpdatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_space_updated_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::SpaceUpdatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::SpaceUpdatedEventData(v.into()),
);
self
}
pub fn space_batch_updated_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::SpaceBatchUpdatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::SpaceBatchUpdatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_space_batch_updated_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::SpaceBatchUpdatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::SpaceBatchUpdatedEventData(v.into()),
);
self
}
pub fn membership_created_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MembershipCreatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MembershipCreatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_membership_created_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MembershipCreatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MembershipCreatedEventData(v.into()),
);
self
}
pub fn membership_updated_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MembershipUpdatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MembershipUpdatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_membership_updated_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MembershipUpdatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MembershipUpdatedEventData(v.into()),
);
self
}
pub fn membership_deleted_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MembershipDeletedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MembershipDeletedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_membership_deleted_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MembershipDeletedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MembershipDeletedEventData(v.into()),
);
self
}
pub fn membership_batch_created_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MembershipBatchCreatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MembershipBatchCreatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_membership_batch_created_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MembershipBatchCreatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MembershipBatchCreatedEventData(v.into()),
);
self
}
pub fn membership_batch_updated_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MembershipBatchUpdatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MembershipBatchUpdatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_membership_batch_updated_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MembershipBatchUpdatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MembershipBatchUpdatedEventData(v.into()),
);
self
}
pub fn membership_batch_deleted_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::MembershipBatchDeletedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::MembershipBatchDeletedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_membership_batch_deleted_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::MembershipBatchDeletedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::MembershipBatchDeletedEventData(v.into()),
);
self
}
pub fn reaction_created_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReactionCreatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::ReactionCreatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_reaction_created_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::ReactionCreatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::ReactionCreatedEventData(v.into()),
);
self
}
pub fn reaction_deleted_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReactionDeletedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::ReactionDeletedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_reaction_deleted_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::ReactionDeletedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::ReactionDeletedEventData(v.into()),
);
self
}
pub fn reaction_batch_created_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReactionBatchCreatedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::ReactionBatchCreatedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_reaction_batch_created_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::ReactionBatchCreatedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::ReactionBatchCreatedEventData(v.into()),
);
self
}
pub fn reaction_batch_deleted_event_data(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::ReactionBatchDeletedEventData>> {
#[allow(unreachable_patterns)]
self.payload.as_ref().and_then(|v| match v {
crate::model::space_event::Payload::ReactionBatchDeletedEventData(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_reaction_batch_deleted_event_data<
T: std::convert::Into<std::boxed::Box<crate::model::ReactionBatchDeletedEventData>>,
>(
mut self,
v: T,
) -> Self {
self.payload = std::option::Option::Some(
crate::model::space_event::Payload::ReactionBatchDeletedEventData(v.into()),
);
self
}
}
impl wkt::message::Message for SpaceEvent {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SpaceEvent"
}
}
pub mod space_event {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Payload {
MessageCreatedEventData(std::boxed::Box<crate::model::MessageCreatedEventData>),
MessageUpdatedEventData(std::boxed::Box<crate::model::MessageUpdatedEventData>),
MessageDeletedEventData(std::boxed::Box<crate::model::MessageDeletedEventData>),
MessageBatchCreatedEventData(std::boxed::Box<crate::model::MessageBatchCreatedEventData>),
MessageBatchUpdatedEventData(std::boxed::Box<crate::model::MessageBatchUpdatedEventData>),
MessageBatchDeletedEventData(std::boxed::Box<crate::model::MessageBatchDeletedEventData>),
SpaceUpdatedEventData(std::boxed::Box<crate::model::SpaceUpdatedEventData>),
SpaceBatchUpdatedEventData(std::boxed::Box<crate::model::SpaceBatchUpdatedEventData>),
MembershipCreatedEventData(std::boxed::Box<crate::model::MembershipCreatedEventData>),
MembershipUpdatedEventData(std::boxed::Box<crate::model::MembershipUpdatedEventData>),
MembershipDeletedEventData(std::boxed::Box<crate::model::MembershipDeletedEventData>),
MembershipBatchCreatedEventData(
std::boxed::Box<crate::model::MembershipBatchCreatedEventData>,
),
MembershipBatchUpdatedEventData(
std::boxed::Box<crate::model::MembershipBatchUpdatedEventData>,
),
MembershipBatchDeletedEventData(
std::boxed::Box<crate::model::MembershipBatchDeletedEventData>,
),
ReactionCreatedEventData(std::boxed::Box<crate::model::ReactionCreatedEventData>),
ReactionDeletedEventData(std::boxed::Box<crate::model::ReactionDeletedEventData>),
ReactionBatchCreatedEventData(std::boxed::Box<crate::model::ReactionBatchCreatedEventData>),
ReactionBatchDeletedEventData(std::boxed::Box<crate::model::ReactionBatchDeletedEventData>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpaceEventRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSpaceEventRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSpaceEventRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetSpaceEventRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpaceEventsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSpaceEventsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListSpaceEventsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSpaceEventsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListSpaceEventsResponse {
pub space_events: std::vec::Vec<crate::model::SpaceEvent>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListSpaceEventsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space_events<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::SpaceEvent>,
{
use std::iter::Iterator;
self.space_events = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListSpaceEventsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ListSpaceEventsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListSpaceEventsResponse {
type PageItem = crate::model::SpaceEvent;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.space_events
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpaceNotificationSetting {
pub name: std::string::String,
pub notification_setting:
std::option::Option<crate::model::space_notification_setting::NotificationSetting>,
pub mute_setting: std::option::Option<crate::model::space_notification_setting::MuteSetting>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpaceNotificationSetting {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_notification_setting<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space_notification_setting::NotificationSetting>,
{
self.notification_setting = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_notification_setting<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space_notification_setting::NotificationSetting>,
{
self.notification_setting = v.map(|x| x.into());
self
}
pub fn set_mute_setting<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::space_notification_setting::MuteSetting>,
{
self.mute_setting = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_mute_setting<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::space_notification_setting::MuteSetting>,
{
self.mute_setting = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SpaceNotificationSetting {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SpaceNotificationSetting"
}
}
pub mod space_notification_setting {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum NotificationSetting {
Unspecified,
All,
MainConversations,
ForYou,
Off,
UnknownValue(notification_setting::UnknownValue),
}
#[doc(hidden)]
pub mod notification_setting {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl NotificationSetting {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::All => std::option::Option::Some(1),
Self::MainConversations => std::option::Option::Some(2),
Self::ForYou => std::option::Option::Some(3),
Self::Off => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("NOTIFICATION_SETTING_UNSPECIFIED"),
Self::All => std::option::Option::Some("ALL"),
Self::MainConversations => std::option::Option::Some("MAIN_CONVERSATIONS"),
Self::ForYou => std::option::Option::Some("FOR_YOU"),
Self::Off => std::option::Option::Some("OFF"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for NotificationSetting {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for NotificationSetting {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for NotificationSetting {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::All,
2 => Self::MainConversations,
3 => Self::ForYou,
4 => Self::Off,
_ => Self::UnknownValue(notification_setting::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for NotificationSetting {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"NOTIFICATION_SETTING_UNSPECIFIED" => Self::Unspecified,
"ALL" => Self::All,
"MAIN_CONVERSATIONS" => Self::MainConversations,
"FOR_YOU" => Self::ForYou,
"OFF" => Self::Off,
_ => Self::UnknownValue(notification_setting::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for NotificationSetting {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::All => serializer.serialize_i32(1),
Self::MainConversations => serializer.serialize_i32(2),
Self::ForYou => serializer.serialize_i32(3),
Self::Off => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for NotificationSetting {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<NotificationSetting>::new(
".google.chat.v1.SpaceNotificationSetting.NotificationSetting",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum MuteSetting {
Unspecified,
Unmuted,
Muted,
UnknownValue(mute_setting::UnknownValue),
}
#[doc(hidden)]
pub mod mute_setting {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl MuteSetting {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Unmuted => std::option::Option::Some(1),
Self::Muted => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("MUTE_SETTING_UNSPECIFIED"),
Self::Unmuted => std::option::Option::Some("UNMUTED"),
Self::Muted => std::option::Option::Some("MUTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for MuteSetting {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for MuteSetting {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for MuteSetting {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Unmuted,
2 => Self::Muted,
_ => Self::UnknownValue(mute_setting::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for MuteSetting {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"MUTE_SETTING_UNSPECIFIED" => Self::Unspecified,
"UNMUTED" => Self::Unmuted,
"MUTED" => Self::Muted,
_ => Self::UnknownValue(mute_setting::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for MuteSetting {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Unmuted => serializer.serialize_i32(1),
Self::Muted => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for MuteSetting {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<MuteSetting>::new(
".google.chat.v1.SpaceNotificationSetting.MuteSetting",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpaceNotificationSettingRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSpaceNotificationSettingRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSpaceNotificationSettingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetSpaceNotificationSettingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSpaceNotificationSettingRequest {
pub space_notification_setting: std::option::Option<crate::model::SpaceNotificationSetting>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSpaceNotificationSettingRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space_notification_setting<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SpaceNotificationSetting>,
{
self.space_notification_setting = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space_notification_setting<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SpaceNotificationSetting>,
{
self.space_notification_setting = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSpaceNotificationSettingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UpdateSpaceNotificationSettingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SpaceReadState {
pub name: std::string::String,
pub last_read_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SpaceReadState {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_last_read_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_read_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_read_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_read_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for SpaceReadState {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SpaceReadState"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetSpaceReadStateRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetSpaceReadStateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetSpaceReadStateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetSpaceReadStateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateSpaceReadStateRequest {
pub space_read_state: std::option::Option<crate::model::SpaceReadState>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateSpaceReadStateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space_read_state<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::SpaceReadState>,
{
self.space_read_state = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space_read_state<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::SpaceReadState>,
{
self.space_read_state = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateSpaceReadStateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.UpdateSpaceReadStateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SetUpSpaceRequest {
pub space: std::option::Option<crate::model::Space>,
pub request_id: std::string::String,
pub memberships: std::vec::Vec<crate::model::Membership>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SetUpSpaceRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_space<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_space<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Space>,
{
self.space = v.map(|x| x.into());
self
}
pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.request_id = v.into();
self
}
pub fn set_memberships<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Membership>,
{
use std::iter::Iterator;
self.memberships = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for SetUpSpaceRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.SetUpSpaceRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ThreadReadState {
pub name: std::string::String,
pub last_read_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ThreadReadState {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_last_read_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_read_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_last_read_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.last_read_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for ThreadReadState {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.ThreadReadState"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetThreadReadStateRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetThreadReadStateRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetThreadReadStateRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.GetThreadReadStateRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct User {
pub name: std::string::String,
pub display_name: std::string::String,
pub domain_id: std::string::String,
pub r#type: crate::model::user::Type,
pub is_anonymous: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl User {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_domain_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.domain_id = v.into();
self
}
pub fn set_type<T: std::convert::Into<crate::model::user::Type>>(mut self, v: T) -> Self {
self.r#type = v.into();
self
}
pub fn set_is_anonymous<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.is_anonymous = v.into();
self
}
}
impl wkt::message::Message for User {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.User"
}
}
pub mod user {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
Unspecified,
Human,
Bot,
UnknownValue(r#type::UnknownValue),
}
#[doc(hidden)]
pub mod r#type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Type {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Human => std::option::Option::Some(1),
Self::Bot => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::Human => std::option::Option::Some("HUMAN"),
Self::Bot => std::option::Option::Some("BOT"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Type {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Type {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Type {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Human,
2 => Self::Bot,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Type {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::Unspecified,
"HUMAN" => Self::Human,
"BOT" => Self::Bot,
_ => Self::UnknownValue(r#type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Type {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Human => serializer.serialize_i32(1),
Self::Bot => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Type {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Type>::new(
".google.chat.v1.User.Type",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct WidgetMarkup {
pub buttons: std::vec::Vec<crate::model::widget_markup::Button>,
pub data: std::option::Option<crate::model::widget_markup::Data>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl WidgetMarkup {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_buttons<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::widget_markup::Button>,
{
use std::iter::Iterator;
self.buttons = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_data<
T: std::convert::Into<std::option::Option<crate::model::widget_markup::Data>>,
>(
mut self,
v: T,
) -> Self {
self.data = v.into();
self
}
pub fn text_paragraph(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::TextParagraph>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::widget_markup::Data::TextParagraph(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_text_paragraph<
T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::TextParagraph>>,
>(
mut self,
v: T,
) -> Self {
self.data =
std::option::Option::Some(crate::model::widget_markup::Data::TextParagraph(v.into()));
self
}
pub fn image(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::Image>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::widget_markup::Data::Image(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_image<T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::Image>>>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(crate::model::widget_markup::Data::Image(v.into()));
self
}
pub fn key_value(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::KeyValue>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::widget_markup::Data::KeyValue(v) => std::option::Option::Some(v),
_ => std::option::Option::None,
})
}
pub fn set_key_value<
T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::KeyValue>>,
>(
mut self,
v: T,
) -> Self {
self.data =
std::option::Option::Some(crate::model::widget_markup::Data::KeyValue(v.into()));
self
}
}
impl wkt::message::Message for WidgetMarkup {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup"
}
}
pub mod widget_markup {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextParagraph {
#[allow(missing_docs)]
pub text: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TextParagraph {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
}
impl wkt::message::Message for TextParagraph {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.TextParagraph"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Button {
#[allow(missing_docs)]
pub r#type: std::option::Option<crate::model::widget_markup::button::Type>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Button {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_type<
T: std::convert::Into<std::option::Option<crate::model::widget_markup::button::Type>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = v.into();
self
}
pub fn text_button(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::TextButton>>
{
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::widget_markup::button::Type::TextButton(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_text_button<
T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::TextButton>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::widget_markup::button::Type::TextButton(v.into()),
);
self
}
pub fn image_button(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::ImageButton>>
{
#[allow(unreachable_patterns)]
self.r#type.as_ref().and_then(|v| match v {
crate::model::widget_markup::button::Type::ImageButton(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_image_button<
T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::ImageButton>>,
>(
mut self,
v: T,
) -> Self {
self.r#type = std::option::Option::Some(
crate::model::widget_markup::button::Type::ImageButton(v.into()),
);
self
}
}
impl wkt::message::Message for Button {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.Button"
}
}
pub mod button {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Type {
TextButton(std::boxed::Box<crate::model::widget_markup::TextButton>),
ImageButton(std::boxed::Box<crate::model::widget_markup::ImageButton>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TextButton {
pub text: std::string::String,
pub on_click: std::option::Option<crate::model::widget_markup::OnClick>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TextButton {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_text<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.text = v.into();
self
}
pub fn set_on_click<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_on_click<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TextButton {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.TextButton"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct KeyValue {
pub top_label: std::string::String,
pub content: std::string::String,
pub content_multiline: bool,
pub bottom_label: std::string::String,
pub on_click: std::option::Option<crate::model::widget_markup::OnClick>,
pub icons: std::option::Option<crate::model::widget_markup::key_value::Icons>,
pub control: std::option::Option<crate::model::widget_markup::key_value::Control>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl KeyValue {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_top_label<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.top_label = v.into();
self
}
pub fn set_content<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.content = v.into();
self
}
pub fn set_content_multiline<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.content_multiline = v.into();
self
}
pub fn set_bottom_label<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.bottom_label = v.into();
self
}
pub fn set_on_click<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_on_click<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = v.map(|x| x.into());
self
}
pub fn set_icons<
T: std::convert::Into<std::option::Option<crate::model::widget_markup::key_value::Icons>>,
>(
mut self,
v: T,
) -> Self {
self.icons = v.into();
self
}
pub fn icon(&self) -> std::option::Option<&crate::model::widget_markup::Icon> {
#[allow(unreachable_patterns)]
self.icons.as_ref().and_then(|v| match v {
crate::model::widget_markup::key_value::Icons::Icon(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_icon<T: std::convert::Into<crate::model::widget_markup::Icon>>(
mut self,
v: T,
) -> Self {
self.icons = std::option::Option::Some(
crate::model::widget_markup::key_value::Icons::Icon(v.into()),
);
self
}
pub fn icon_url(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.icons.as_ref().and_then(|v| match v {
crate::model::widget_markup::key_value::Icons::IconUrl(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_icon_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.icons = std::option::Option::Some(
crate::model::widget_markup::key_value::Icons::IconUrl(v.into()),
);
self
}
pub fn set_control<
T: std::convert::Into<
std::option::Option<crate::model::widget_markup::key_value::Control>,
>,
>(
mut self,
v: T,
) -> Self {
self.control = v.into();
self
}
pub fn button(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::Button>> {
#[allow(unreachable_patterns)]
self.control.as_ref().and_then(|v| match v {
crate::model::widget_markup::key_value::Control::Button(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_button<
T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::Button>>,
>(
mut self,
v: T,
) -> Self {
self.control = std::option::Option::Some(
crate::model::widget_markup::key_value::Control::Button(v.into()),
);
self
}
}
impl wkt::message::Message for KeyValue {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.KeyValue"
}
}
pub mod key_value {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Icons {
Icon(crate::model::widget_markup::Icon),
IconUrl(std::string::String),
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Control {
Button(std::boxed::Box<crate::model::widget_markup::Button>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Image {
pub image_url: std::string::String,
pub on_click: std::option::Option<crate::model::widget_markup::OnClick>,
pub aspect_ratio: f64,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Image {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_image_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.image_url = v.into();
self
}
pub fn set_on_click<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_on_click<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = v.map(|x| x.into());
self
}
pub fn set_aspect_ratio<T: std::convert::Into<f64>>(mut self, v: T) -> Self {
self.aspect_ratio = v.into();
self
}
}
impl wkt::message::Message for Image {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.Image"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ImageButton {
pub on_click: std::option::Option<crate::model::widget_markup::OnClick>,
pub name: std::string::String,
pub icons: std::option::Option<crate::model::widget_markup::image_button::Icons>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ImageButton {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_on_click<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_on_click<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::widget_markup::OnClick>,
{
self.on_click = v.map(|x| x.into());
self
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_icons<
T: std::convert::Into<
std::option::Option<crate::model::widget_markup::image_button::Icons>,
>,
>(
mut self,
v: T,
) -> Self {
self.icons = v.into();
self
}
pub fn icon(&self) -> std::option::Option<&crate::model::widget_markup::Icon> {
#[allow(unreachable_patterns)]
self.icons.as_ref().and_then(|v| match v {
crate::model::widget_markup::image_button::Icons::Icon(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_icon<T: std::convert::Into<crate::model::widget_markup::Icon>>(
mut self,
v: T,
) -> Self {
self.icons = std::option::Option::Some(
crate::model::widget_markup::image_button::Icons::Icon(v.into()),
);
self
}
pub fn icon_url(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.icons.as_ref().and_then(|v| match v {
crate::model::widget_markup::image_button::Icons::IconUrl(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_icon_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.icons = std::option::Option::Some(
crate::model::widget_markup::image_button::Icons::IconUrl(v.into()),
);
self
}
}
impl wkt::message::Message for ImageButton {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.ImageButton"
}
}
pub mod image_button {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Icons {
Icon(crate::model::widget_markup::Icon),
IconUrl(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OnClick {
#[allow(missing_docs)]
pub data: std::option::Option<crate::model::widget_markup::on_click::Data>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OnClick {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_data<
T: std::convert::Into<std::option::Option<crate::model::widget_markup::on_click::Data>>,
>(
mut self,
v: T,
) -> Self {
self.data = v.into();
self
}
pub fn action(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::FormAction>>
{
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::widget_markup::on_click::Data::Action(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_action<
T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::FormAction>>,
>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(
crate::model::widget_markup::on_click::Data::Action(v.into()),
);
self
}
pub fn open_link(
&self,
) -> std::option::Option<&std::boxed::Box<crate::model::widget_markup::OpenLink>> {
#[allow(unreachable_patterns)]
self.data.as_ref().and_then(|v| match v {
crate::model::widget_markup::on_click::Data::OpenLink(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_open_link<
T: std::convert::Into<std::boxed::Box<crate::model::widget_markup::OpenLink>>,
>(
mut self,
v: T,
) -> Self {
self.data = std::option::Option::Some(
crate::model::widget_markup::on_click::Data::OpenLink(v.into()),
);
self
}
}
impl wkt::message::Message for OnClick {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.OnClick"
}
}
pub mod on_click {
#[allow(unused_imports)]
use super::*;
#[allow(missing_docs)]
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Data {
Action(std::boxed::Box<crate::model::widget_markup::FormAction>),
OpenLink(std::boxed::Box<crate::model::widget_markup::OpenLink>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct OpenLink {
pub url: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl OpenLink {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_url<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.url = v.into();
self
}
}
impl wkt::message::Message for OpenLink {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.OpenLink"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct FormAction {
pub action_method_name: std::string::String,
pub parameters: std::vec::Vec<crate::model::widget_markup::form_action::ActionParameter>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl FormAction {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action_method_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.action_method_name = v.into();
self
}
pub fn set_parameters<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::widget_markup::form_action::ActionParameter>,
{
use std::iter::Iterator;
self.parameters = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for FormAction {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.FormAction"
}
}
pub mod form_action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ActionParameter {
pub key: std::string::String,
pub value: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ActionParameter {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key = v.into();
self
}
pub fn set_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.value = v.into();
self
}
}
impl wkt::message::Message for ActionParameter {
fn typename() -> &'static str {
"type.googleapis.com/google.chat.v1.WidgetMarkup.FormAction.ActionParameter"
}
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Icon {
#[allow(missing_docs)]
Unspecified,
#[allow(missing_docs)]
Airplane,
#[allow(missing_docs)]
Bookmark,
#[allow(missing_docs)]
Bus,
#[allow(missing_docs)]
Car,
#[allow(missing_docs)]
Clock,
#[allow(missing_docs)]
ConfirmationNumberIcon,
#[allow(missing_docs)]
Dollar,
#[allow(missing_docs)]
Description,
#[allow(missing_docs)]
Email,
#[allow(missing_docs)]
EventPerformer,
#[allow(missing_docs)]
EventSeat,
#[allow(missing_docs)]
FlightArrival,
#[allow(missing_docs)]
FlightDeparture,
#[allow(missing_docs)]
Hotel,
#[allow(missing_docs)]
HotelRoomType,
#[allow(missing_docs)]
Invite,
#[allow(missing_docs)]
MapPin,
#[allow(missing_docs)]
Membership,
#[allow(missing_docs)]
MultiplePeople,
#[allow(missing_docs)]
Offer,
#[allow(missing_docs)]
Person,
#[allow(missing_docs)]
Phone,
#[allow(missing_docs)]
RestaurantIcon,
#[allow(missing_docs)]
ShoppingCart,
#[allow(missing_docs)]
Star,
#[allow(missing_docs)]
Store,
#[allow(missing_docs)]
Ticket,
#[allow(missing_docs)]
Train,
#[allow(missing_docs)]
VideoCamera,
#[allow(missing_docs)]
VideoPlay,
UnknownValue(icon::UnknownValue),
}
#[doc(hidden)]
pub mod icon {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Icon {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Airplane => std::option::Option::Some(1),
Self::Bookmark => std::option::Option::Some(26),
Self::Bus => std::option::Option::Some(25),
Self::Car => std::option::Option::Some(9),
Self::Clock => std::option::Option::Some(2),
Self::ConfirmationNumberIcon => std::option::Option::Some(12),
Self::Dollar => std::option::Option::Some(14),
Self::Description => std::option::Option::Some(27),
Self::Email => std::option::Option::Some(10),
Self::EventPerformer => std::option::Option::Some(20),
Self::EventSeat => std::option::Option::Some(21),
Self::FlightArrival => std::option::Option::Some(16),
Self::FlightDeparture => std::option::Option::Some(15),
Self::Hotel => std::option::Option::Some(6),
Self::HotelRoomType => std::option::Option::Some(17),
Self::Invite => std::option::Option::Some(19),
Self::MapPin => std::option::Option::Some(3),
Self::Membership => std::option::Option::Some(24),
Self::MultiplePeople => std::option::Option::Some(18),
Self::Offer => std::option::Option::Some(30),
Self::Person => std::option::Option::Some(11),
Self::Phone => std::option::Option::Some(13),
Self::RestaurantIcon => std::option::Option::Some(7),
Self::ShoppingCart => std::option::Option::Some(8),
Self::Star => std::option::Option::Some(5),
Self::Store => std::option::Option::Some(22),
Self::Ticket => std::option::Option::Some(4),
Self::Train => std::option::Option::Some(23),
Self::VideoCamera => std::option::Option::Some(28),
Self::VideoPlay => std::option::Option::Some(29),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ICON_UNSPECIFIED"),
Self::Airplane => std::option::Option::Some("AIRPLANE"),
Self::Bookmark => std::option::Option::Some("BOOKMARK"),
Self::Bus => std::option::Option::Some("BUS"),
Self::Car => std::option::Option::Some("CAR"),
Self::Clock => std::option::Option::Some("CLOCK"),
Self::ConfirmationNumberIcon => {
std::option::Option::Some("CONFIRMATION_NUMBER_ICON")
}
Self::Dollar => std::option::Option::Some("DOLLAR"),
Self::Description => std::option::Option::Some("DESCRIPTION"),
Self::Email => std::option::Option::Some("EMAIL"),
Self::EventPerformer => std::option::Option::Some("EVENT_PERFORMER"),
Self::EventSeat => std::option::Option::Some("EVENT_SEAT"),
Self::FlightArrival => std::option::Option::Some("FLIGHT_ARRIVAL"),
Self::FlightDeparture => std::option::Option::Some("FLIGHT_DEPARTURE"),
Self::Hotel => std::option::Option::Some("HOTEL"),
Self::HotelRoomType => std::option::Option::Some("HOTEL_ROOM_TYPE"),
Self::Invite => std::option::Option::Some("INVITE"),
Self::MapPin => std::option::Option::Some("MAP_PIN"),
Self::Membership => std::option::Option::Some("MEMBERSHIP"),
Self::MultiplePeople => std::option::Option::Some("MULTIPLE_PEOPLE"),
Self::Offer => std::option::Option::Some("OFFER"),
Self::Person => std::option::Option::Some("PERSON"),
Self::Phone => std::option::Option::Some("PHONE"),
Self::RestaurantIcon => std::option::Option::Some("RESTAURANT_ICON"),
Self::ShoppingCart => std::option::Option::Some("SHOPPING_CART"),
Self::Star => std::option::Option::Some("STAR"),
Self::Store => std::option::Option::Some("STORE"),
Self::Ticket => std::option::Option::Some("TICKET"),
Self::Train => std::option::Option::Some("TRAIN"),
Self::VideoCamera => std::option::Option::Some("VIDEO_CAMERA"),
Self::VideoPlay => std::option::Option::Some("VIDEO_PLAY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Icon {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Icon {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Icon {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Airplane,
2 => Self::Clock,
3 => Self::MapPin,
4 => Self::Ticket,
5 => Self::Star,
6 => Self::Hotel,
7 => Self::RestaurantIcon,
8 => Self::ShoppingCart,
9 => Self::Car,
10 => Self::Email,
11 => Self::Person,
12 => Self::ConfirmationNumberIcon,
13 => Self::Phone,
14 => Self::Dollar,
15 => Self::FlightDeparture,
16 => Self::FlightArrival,
17 => Self::HotelRoomType,
18 => Self::MultiplePeople,
19 => Self::Invite,
20 => Self::EventPerformer,
21 => Self::EventSeat,
22 => Self::Store,
23 => Self::Train,
24 => Self::Membership,
25 => Self::Bus,
26 => Self::Bookmark,
27 => Self::Description,
28 => Self::VideoCamera,
29 => Self::VideoPlay,
30 => Self::Offer,
_ => Self::UnknownValue(icon::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Icon {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ICON_UNSPECIFIED" => Self::Unspecified,
"AIRPLANE" => Self::Airplane,
"BOOKMARK" => Self::Bookmark,
"BUS" => Self::Bus,
"CAR" => Self::Car,
"CLOCK" => Self::Clock,
"CONFIRMATION_NUMBER_ICON" => Self::ConfirmationNumberIcon,
"DOLLAR" => Self::Dollar,
"DESCRIPTION" => Self::Description,
"EMAIL" => Self::Email,
"EVENT_PERFORMER" => Self::EventPerformer,
"EVENT_SEAT" => Self::EventSeat,
"FLIGHT_ARRIVAL" => Self::FlightArrival,
"FLIGHT_DEPARTURE" => Self::FlightDeparture,
"HOTEL" => Self::Hotel,
"HOTEL_ROOM_TYPE" => Self::HotelRoomType,
"INVITE" => Self::Invite,
"MAP_PIN" => Self::MapPin,
"MEMBERSHIP" => Self::Membership,
"MULTIPLE_PEOPLE" => Self::MultiplePeople,
"OFFER" => Self::Offer,
"PERSON" => Self::Person,
"PHONE" => Self::Phone,
"RESTAURANT_ICON" => Self::RestaurantIcon,
"SHOPPING_CART" => Self::ShoppingCart,
"STAR" => Self::Star,
"STORE" => Self::Store,
"TICKET" => Self::Ticket,
"TRAIN" => Self::Train,
"VIDEO_CAMERA" => Self::VideoCamera,
"VIDEO_PLAY" => Self::VideoPlay,
_ => Self::UnknownValue(icon::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Icon {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Airplane => serializer.serialize_i32(1),
Self::Bookmark => serializer.serialize_i32(26),
Self::Bus => serializer.serialize_i32(25),
Self::Car => serializer.serialize_i32(9),
Self::Clock => serializer.serialize_i32(2),
Self::ConfirmationNumberIcon => serializer.serialize_i32(12),
Self::Dollar => serializer.serialize_i32(14),
Self::Description => serializer.serialize_i32(27),
Self::Email => serializer.serialize_i32(10),
Self::EventPerformer => serializer.serialize_i32(20),
Self::EventSeat => serializer.serialize_i32(21),
Self::FlightArrival => serializer.serialize_i32(16),
Self::FlightDeparture => serializer.serialize_i32(15),
Self::Hotel => serializer.serialize_i32(6),
Self::HotelRoomType => serializer.serialize_i32(17),
Self::Invite => serializer.serialize_i32(19),
Self::MapPin => serializer.serialize_i32(3),
Self::Membership => serializer.serialize_i32(24),
Self::MultiplePeople => serializer.serialize_i32(18),
Self::Offer => serializer.serialize_i32(30),
Self::Person => serializer.serialize_i32(11),
Self::Phone => serializer.serialize_i32(13),
Self::RestaurantIcon => serializer.serialize_i32(7),
Self::ShoppingCart => serializer.serialize_i32(8),
Self::Star => serializer.serialize_i32(5),
Self::Store => serializer.serialize_i32(22),
Self::Ticket => serializer.serialize_i32(4),
Self::Train => serializer.serialize_i32(23),
Self::VideoCamera => serializer.serialize_i32(28),
Self::VideoPlay => serializer.serialize_i32(29),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Icon {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Icon>::new(
".google.chat.v1.WidgetMarkup.Icon",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Data {
TextParagraph(std::boxed::Box<crate::model::widget_markup::TextParagraph>),
Image(std::boxed::Box<crate::model::widget_markup::Image>),
KeyValue(std::boxed::Box<crate::model::widget_markup::KeyValue>),
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AnnotationType {
Unspecified,
UserMention,
SlashCommand,
RichLink,
CustomEmoji,
UnknownValue(annotation_type::UnknownValue),
}
#[doc(hidden)]
pub mod annotation_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl AnnotationType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::UserMention => std::option::Option::Some(1),
Self::SlashCommand => std::option::Option::Some(2),
Self::RichLink => std::option::Option::Some(3),
Self::CustomEmoji => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("ANNOTATION_TYPE_UNSPECIFIED"),
Self::UserMention => std::option::Option::Some("USER_MENTION"),
Self::SlashCommand => std::option::Option::Some("SLASH_COMMAND"),
Self::RichLink => std::option::Option::Some("RICH_LINK"),
Self::CustomEmoji => std::option::Option::Some("CUSTOM_EMOJI"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for AnnotationType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for AnnotationType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for AnnotationType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::UserMention,
2 => Self::SlashCommand,
3 => Self::RichLink,
4 => Self::CustomEmoji,
_ => Self::UnknownValue(annotation_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for AnnotationType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ANNOTATION_TYPE_UNSPECIFIED" => Self::Unspecified,
"USER_MENTION" => Self::UserMention,
"SLASH_COMMAND" => Self::SlashCommand,
"RICH_LINK" => Self::RichLink,
"CUSTOM_EMOJI" => Self::CustomEmoji,
_ => Self::UnknownValue(annotation_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for AnnotationType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::UserMention => serializer.serialize_i32(1),
Self::SlashCommand => serializer.serialize_i32(2),
Self::RichLink => serializer.serialize_i32(3),
Self::CustomEmoji => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for AnnotationType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<AnnotationType>::new(
".google.chat.v1.AnnotationType",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum HistoryState {
Unspecified,
HistoryOff,
HistoryOn,
UnknownValue(history_state::UnknownValue),
}
#[doc(hidden)]
pub mod history_state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl HistoryState {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::HistoryOff => std::option::Option::Some(1),
Self::HistoryOn => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("HISTORY_STATE_UNSPECIFIED"),
Self::HistoryOff => std::option::Option::Some("HISTORY_OFF"),
Self::HistoryOn => std::option::Option::Some("HISTORY_ON"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for HistoryState {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for HistoryState {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for HistoryState {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::HistoryOff,
2 => Self::HistoryOn,
_ => Self::UnknownValue(history_state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for HistoryState {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"HISTORY_STATE_UNSPECIFIED" => Self::Unspecified,
"HISTORY_OFF" => Self::HistoryOff,
"HISTORY_ON" => Self::HistoryOn,
_ => Self::UnknownValue(history_state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for HistoryState {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::HistoryOff => serializer.serialize_i32(1),
Self::HistoryOn => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for HistoryState {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<HistoryState>::new(
".google.chat.v1.HistoryState",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum SpaceView {
Unspecified,
ResourceNameOnly,
Expanded,
UnknownValue(space_view::UnknownValue),
}
#[doc(hidden)]
pub mod space_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl SpaceView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::ResourceNameOnly => std::option::Option::Some(3),
Self::Expanded => std::option::Option::Some(4),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SPACE_VIEW_UNSPECIFIED"),
Self::ResourceNameOnly => std::option::Option::Some("SPACE_VIEW_RESOURCE_NAME_ONLY"),
Self::Expanded => std::option::Option::Some("SPACE_VIEW_EXPANDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for SpaceView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for SpaceView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for SpaceView {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
3 => Self::ResourceNameOnly,
4 => Self::Expanded,
_ => Self::UnknownValue(space_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for SpaceView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SPACE_VIEW_UNSPECIFIED" => Self::Unspecified,
"SPACE_VIEW_RESOURCE_NAME_ONLY" => Self::ResourceNameOnly,
"SPACE_VIEW_EXPANDED" => Self::Expanded,
_ => Self::UnknownValue(space_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for SpaceView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::ResourceNameOnly => serializer.serialize_i32(3),
Self::Expanded => serializer.serialize_i32(4),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for SpaceView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<SpaceView>::new(
".google.chat.v1.SpaceView",
))
}
}