// This file is @generated by prost-build.
/// Represents the status for a request to either invoke or submit a
/// [dialog](<https://developers.google.com/workspace/chat/dialogs>).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ActionStatus {
    /// The status code.
    #[prost(enumeration = "super::super::rpc::Code", tag = "1")]
    pub status_code: i32,
    /// The message to send users about the status of their request.
    /// If unset, a generic message based on the `status_code` is sent.
    #[prost(string, tag = "2")]
    pub user_facing_message: ::prost::alloc::string::String,
}
/// An attachment in Google Chat.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Attachment {
    /// Identifier. Resource name of the attachment.
    ///
    /// Format: `spaces/{space}/messages/{message}/attachments/{attachment}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The original file name for the content, not the full path.
    #[prost(string, tag = "2")]
    pub content_name: ::prost::alloc::string::String,
    /// Output only. The content type (MIME type) of the file.
    #[prost(string, tag = "3")]
    pub content_type: ::prost::alloc::string::String,
    /// Output only. The thumbnail URL which should be used to preview the
    /// attachment to a human user. Chat apps shouldn't use this URL to download
    /// attachment content.
    #[prost(string, tag = "5")]
    pub thumbnail_uri: ::prost::alloc::string::String,
    /// Output only. The download URL which should be used to allow a human user to
    /// download the attachment. Chat apps shouldn't use this URL to download
    /// attachment content.
    #[prost(string, tag = "6")]
    pub download_uri: ::prost::alloc::string::String,
    /// Output only. The source of the attachment.
    #[prost(enumeration = "attachment::Source", tag = "9")]
    pub source: i32,
    /// The data reference to the attachment.
    #[prost(oneof = "attachment::DataRef", tags = "4, 7")]
    pub data_ref: ::core::option::Option<attachment::DataRef>,
}
/// Nested message and enum types in `Attachment`.
pub mod attachment {
    /// The source of the attachment.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Source {
        /// Reserved.
        Unspecified = 0,
        /// The file is a Google Drive file.
        DriveFile = 1,
        /// The file is uploaded to Chat.
        UploadedContent = 2,
    }
    impl Source {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "SOURCE_UNSPECIFIED",
                Self::DriveFile => "DRIVE_FILE",
                Self::UploadedContent => "UPLOADED_CONTENT",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SOURCE_UNSPECIFIED" => Some(Self::Unspecified),
                "DRIVE_FILE" => Some(Self::DriveFile),
                "UPLOADED_CONTENT" => Some(Self::UploadedContent),
                _ => None,
            }
        }
    }
    /// The data reference to the attachment.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum DataRef {
        /// Optional. A reference to the attachment data. This field is used to
        /// create or update messages with attachments, or with the media API to
        /// download the attachment data.
        #[prost(message, tag = "4")]
        AttachmentDataRef(super::AttachmentDataRef),
        /// Output only. A reference to the Google Drive attachment. This field is
        /// used with the Google Drive API.
        #[prost(message, tag = "7")]
        DriveDataRef(super::DriveDataRef),
    }
}
/// A reference to the data of a drive attachment.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DriveDataRef {
    /// The ID for the drive file. Use with the Drive API.
    #[prost(string, tag = "2")]
    pub drive_file_id: ::prost::alloc::string::String,
}
/// A reference to the attachment data.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AttachmentDataRef {
    /// Optional. The resource name of the attachment data. This field is used with
    /// the media API to download the attachment data.
    #[prost(string, tag = "1")]
    pub resource_name: ::prost::alloc::string::String,
    /// Optional. Opaque token containing a reference to an uploaded attachment.
    /// Treated by clients as an opaque string and used to create or update Chat
    /// messages with attachments.
    #[prost(string, tag = "2")]
    pub attachment_upload_token: ::prost::alloc::string::String,
}
/// Request to get an attachment.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetAttachmentRequest {
    /// Required. Resource name of the attachment, in the form
    /// `spaces/{space}/messages/{message}/attachments/{attachment}`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request to upload an attachment.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadAttachmentRequest {
    /// Required. Resource name of the Chat space in which the attachment is
    /// uploaded. Format "spaces/{space}".
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The filename of the attachment, including the file extension.
    #[prost(string, tag = "4")]
    pub filename: ::prost::alloc::string::String,
}
/// Response of uploading an attachment.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UploadAttachmentResponse {
    /// Reference to the uploaded attachment.
    #[prost(message, optional, tag = "1")]
    pub attachment_data_ref: ::core::option::Option<AttachmentDataRef>,
}
/// A user in Google Chat.
/// When returned as an output from a request, if your Chat app [authenticates as
/// a
/// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
/// the output for a `User` resource only populates the user's `name` and `type`.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct User {
    /// Resource name for a Google Chat \[user\]\[google.chat.v1.User\].
    ///
    /// Format: `users/{user}`. `users/app` can be used as an alias for the calling
    /// app \[bot\]\[google.chat.v1.User.Type.BOT\] user.
    ///
    /// For \[human users\]\[google.chat.v1.User.Type.HUMAN\], `{user}` is the same
    /// user identifier as:
    ///
    /// * the `id` for the
    ///   [Person](<https://developers.google.com/people/api/rest/v1/people>) in the
    ///   People API. For example, `users/123456789` in Chat API represents the same
    ///   person as the `123456789` Person profile ID in People API.
    ///
    /// * the `id` for a
    ///   [user](<https://developers.google.com/admin-sdk/directory/reference/rest/v1/users>)
    ///   in the Admin SDK Directory API.
    ///
    /// * the user's email address can be used as an alias for `{user}` in API
    ///   requests. For example, if the People API Person profile ID for
    ///   `user@example.com` is `123456789`, you can use `users/user@example.com` as
    ///   an alias to reference `users/123456789`. Only the canonical resource name
    ///   (for example `users/123456789`) will be returned from the API.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The user's display name.
    #[prost(string, tag = "2")]
    pub display_name: ::prost::alloc::string::String,
    /// Unique identifier of the user's Google Workspace domain.
    #[prost(string, tag = "6")]
    pub domain_id: ::prost::alloc::string::String,
    /// User type.
    #[prost(enumeration = "user::Type", tag = "5")]
    pub r#type: i32,
    /// Output only. When `true`, the user is deleted or their profile is not
    /// visible.
    #[prost(bool, tag = "7")]
    pub is_anonymous: bool,
}
/// Nested message and enum types in `User`.
pub mod user {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        /// Default value for the enum. DO NOT USE.
        Unspecified = 0,
        /// Human user.
        Human = 1,
        /// Chat app user.
        Bot = 2,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "TYPE_UNSPECIFIED",
                Self::Human => "HUMAN",
                Self::Bot => "BOT",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "HUMAN" => Some(Self::Human),
                "BOT" => Some(Self::Bot),
                _ => None,
            }
        }
    }
}
/// A reaction to a message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Reaction {
    /// Identifier. The resource name of the reaction.
    ///
    /// Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The user who created the reaction.
    #[prost(message, optional, tag = "2")]
    pub user: ::core::option::Option<User>,
    /// Required. The emoji used in the reaction.
    #[prost(message, optional, tag = "3")]
    pub emoji: ::core::option::Option<Emoji>,
}
/// An emoji that is used as a reaction to a message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Emoji {
    /// Required. The content of the emoji.
    #[prost(oneof = "emoji::Content", tags = "1, 2")]
    pub content: ::core::option::Option<emoji::Content>,
}
/// Nested message and enum types in `Emoji`.
pub mod emoji {
    /// Required. The content of the emoji.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Content {
        /// Optional. A basic emoji represented by a unicode string.
        #[prost(string, tag = "1")]
        Unicode(::prost::alloc::string::String),
        /// A custom emoji.
        #[prost(message, tag = "2")]
        CustomEmoji(super::CustomEmoji),
    }
}
/// Represents a [custom emoji](<https://support.google.com/chat/answer/12800149>).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CustomEmoji {
    /// Identifier. The resource name of the custom emoji, assigned by the server.
    ///
    /// Format: `customEmojis/{customEmoji}`
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    /// Output only. Unique key for the custom emoji resource.
    #[prost(string, tag = "1")]
    pub uid: ::prost::alloc::string::String,
    /// Optional. Immutable. User-provided name for the custom emoji, which is
    /// unique within the organization.
    ///
    /// Required when the custom emoji is created, output only otherwise.
    ///
    /// Emoji names must start and end with colons, must be lowercase and can only
    /// contain alphanumeric characters, hyphens, and underscores.
    /// Hyphens and underscores should be used to separate words and cannot be used
    /// consecutively.
    ///
    /// Example: `:valid-emoji-name:`
    #[prost(string, tag = "3")]
    pub emoji_name: ::prost::alloc::string::String,
    /// Output only. A temporary image URL for the custom emoji, valid for at least
    /// 10 minutes. Note that this is not populated in the response when the custom
    /// emoji is created.
    #[prost(string, tag = "4")]
    pub temporary_image_uri: ::prost::alloc::string::String,
    /// Optional. Input only. Payload data.
    /// Required when the custom emoji is created.
    #[prost(message, optional, tag = "5")]
    pub payload: ::core::option::Option<custom_emoji::CustomEmojiPayload>,
}
/// Nested message and enum types in `CustomEmoji`.
pub mod custom_emoji {
    /// Payload data for the custom emoji.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct CustomEmojiPayload {
        /// Required. Input only. The image used for the custom emoji.
        ///
        /// The payload must be under 256 KB and the dimension of
        /// the image must be square and between 64 and 500 pixels. The
        /// restrictions are subject to change.
        #[prost(bytes = "vec", tag = "1")]
        pub file_content: ::prost::alloc::vec::Vec<u8>,
        /// Required. Input only. The image file name.
        ///
        /// Supported file extensions: `.png`, `.jpg`, `.gif`.
        #[prost(string, tag = "2")]
        pub filename: ::prost::alloc::string::String,
    }
}
/// The number of people who reacted to a message with a specific emoji.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EmojiReactionSummary {
    /// Output only. Emoji associated with the reactions.
    #[prost(message, optional, tag = "1")]
    pub emoji: ::core::option::Option<Emoji>,
    /// Output only. The total number of reactions using the associated emoji.
    #[prost(int32, optional, tag = "2")]
    pub reaction_count: ::core::option::Option<i32>,
}
/// Creates a reaction to a message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateReactionRequest {
    /// Required. The message where the reaction is created.
    ///
    /// Format: `spaces/{space}/messages/{message}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The reaction to create.
    #[prost(message, optional, tag = "2")]
    pub reaction: ::core::option::Option<Reaction>,
}
/// Lists reactions to a message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListReactionsRequest {
    /// Required. The message users reacted to.
    ///
    /// Format: `spaces/{space}/messages/{message}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of reactions returned. The service can return
    /// fewer reactions than this value. If unspecified, the default value is 25.
    /// The maximum value is 200; values above 200 are changed to 200.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. (If resuming from a previous query.)
    ///
    /// A page token received from a previous list reactions call. Provide this
    /// to retrieve the subsequent page.
    ///
    /// When paginating, the filter value should match the call that provided the
    /// page token. Passing a different value might lead to unexpected results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Optional. A query filter.
    ///
    /// You can filter reactions by
    /// [emoji](<https://developers.google.com/workspace/chat/api/reference/rest/v1/Emoji>)
    /// (either `emoji.unicode` or `emoji.custom_emoji.uid`) and
    /// [user](<https://developers.google.com/workspace/chat/api/reference/rest/v1/User>)
    /// (`user.name`).
    ///
    /// To filter reactions for multiple emojis or users, join similar fields
    /// with the `OR` operator, such as `emoji.unicode = "🙂" OR emoji.unicode =  "👍"` and `user.name = "users/AAAAAA" OR user.name = "users/BBBBBB"`.
    ///
    /// To filter reactions by emoji and user, use the `AND` operator, such as
    /// `emoji.unicode = "🙂" AND user.name = "users/AAAAAA"`.
    ///
    /// If your query uses both `AND` and `OR`, group them with parentheses.
    ///
    /// For example, the following queries are valid:
    ///
    /// ```text,
    /// user.name = "users/{user}"
    /// emoji.unicode = "🙂"
    /// emoji.custom_emoji.uid = "{uid}"
    /// emoji.unicode = "🙂" OR emoji.unicode = "👍"
    /// emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
    /// emoji.unicode = "🙂" AND user.name = "users/{user}"
    /// (emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}")
    /// AND user.name = "users/{user}"
    /// ```
    ///
    /// The following queries are invalid:
    ///
    /// ```text,
    /// emoji.unicode = "🙂" AND emoji.unicode = "👍"
    /// emoji.unicode = "🙂" AND emoji.custom_emoji.uid = "{uid}"
    /// emoji.unicode = "🙂" OR user.name = "users/{user}"
    /// emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}" OR
    /// user.name = "users/{user}"
    /// emoji.unicode = "🙂" OR emoji.custom_emoji.uid = "{uid}"
    /// AND user.name = "users/{user}"
    /// ```
    ///
    /// Invalid queries are rejected with an `INVALID_ARGUMENT` error.
    #[prost(string, tag = "4")]
    pub filter: ::prost::alloc::string::String,
}
/// Response to a list reactions request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListReactionsResponse {
    /// List of reactions in the requested (or first) page.
    #[prost(message, repeated, tag = "1")]
    pub reactions: ::prost::alloc::vec::Vec<Reaction>,
    /// Continuation token to retrieve the next page of results. It's empty
    /// for the last page of results.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Deletes a reaction to a message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteReactionRequest {
    /// Required. Name of the reaction to delete.
    ///
    /// Format: `spaces/{space}/messages/{message}/reactions/{reaction}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// A request to create a custom emoji.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateCustomEmojiRequest {
    /// Required. The custom emoji to create.
    #[prost(message, optional, tag = "1")]
    pub custom_emoji: ::core::option::Option<CustomEmoji>,
}
/// A request to return a single custom emoji.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetCustomEmojiRequest {
    /// Required. Resource name of the custom emoji.
    ///
    /// Format: `customEmojis/{customEmoji}`
    ///
    /// You can use the emoji name as an alias for `{customEmoji}`. For example,
    /// `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name
    /// for a custom emoji.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// A request to return a list of custom emojis.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListCustomEmojisRequest {
    /// Optional. The maximum number of custom emojis returned. The service can
    /// return fewer custom emojis than this value. If unspecified, the default
    /// value is 25. The maximum value is 200; values above 200 are changed to 200.
    #[prost(int32, tag = "1")]
    pub page_size: i32,
    /// Optional. (If resuming from a previous query.)
    ///
    /// A page token received from a previous list custom emoji call. Provide this
    /// to retrieve the subsequent page.
    ///
    /// When paginating, the filter value should match the call that provided the
    /// page token. Passing a different value might lead to unexpected results.
    #[prost(string, tag = "2")]
    pub page_token: ::prost::alloc::string::String,
    /// Optional. A query filter.
    ///
    /// Supports filtering by creator.
    ///
    /// To filter by creator, you must specify a valid value. Currently only
    /// `creator("users/me")` and `NOT creator("users/me")` are accepted to filter
    /// custom emojis by whether they were created by the calling user or not.
    ///
    /// For example, the following query returns custom emojis created by the
    /// caller:
    ///
    /// ```text,
    /// creator("users/me")
    /// ```
    ///
    /// Invalid queries are rejected with an `INVALID_ARGUMENT` error.
    #[prost(string, tag = "3")]
    pub filter: ::prost::alloc::string::String,
}
/// A response to list custom emojis.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListCustomEmojisResponse {
    /// Unordered list. List of custom emojis.
    #[prost(message, repeated, tag = "1")]
    pub custom_emojis: ::prost::alloc::vec::Vec<CustomEmoji>,
    /// A token that you can send as `pageToken` to retrieve the next page of
    /// results. If empty, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request for deleting a custom emoji.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteCustomEmojiRequest {
    /// Required. Resource name of the custom emoji to delete.
    ///
    /// Format: `customEmojis/{customEmoji}`
    ///
    /// You can use the emoji name as an alias for `{customEmoji}`. For example,
    /// `customEmojis/:example-emoji:` where `:example-emoji:` is the emoji name
    /// for a custom emoji.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Output only. Annotations can be associated with the plain-text body of the
/// message or with chips that link to Google Workspace resources like Google
/// Docs or Sheets with `start_index` and `length` of 0. To add basic formatting
/// to a text message, see [Format text
/// messages](<https://developers.google.com/workspace/chat/format-messages>).
///
/// Example plain-text message body:
///
/// ```text,
/// Hello @FooBot how are you!"
/// ```
///
/// The corresponding annotations metadata:
///
/// ```text,
/// "annotations":[{
///   "type":"USER_MENTION",
///   "startIndex":6,
///   "length":7,
///   "userMention": {
///     "user": {
///       "name":"users/{user}",
///       "displayName":"FooBot",
///       "avatarUrl":"<https://goo.gl/aeDtrS",>
///       "type":"BOT"
///     },
///     "type":"MENTION"
///    }
/// }]
/// ```
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Annotation {
    /// The type of this annotation.
    #[prost(enumeration = "AnnotationType", tag = "1")]
    pub r#type: i32,
    /// Start index (0-based, inclusive) in the plain-text message body this
    /// annotation corresponds to.
    #[prost(int32, optional, tag = "2")]
    pub start_index: ::core::option::Option<i32>,
    /// Length of the substring in the plain-text message body this annotation
    /// corresponds to. If not present, indicates a length of 0.
    #[prost(int32, tag = "3")]
    pub length: i32,
    /// Additional metadata about the annotation.
    #[prost(oneof = "annotation::Metadata", tags = "4, 5, 6, 7")]
    pub metadata: ::core::option::Option<annotation::Metadata>,
}
/// Nested message and enum types in `Annotation`.
pub mod annotation {
    /// Additional metadata about the annotation.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Metadata {
        /// The metadata of user mention.
        #[prost(message, tag = "4")]
        UserMention(super::UserMentionMetadata),
        /// The metadata for a slash command.
        #[prost(message, tag = "5")]
        SlashCommand(super::SlashCommandMetadata),
        /// The metadata for a rich link.
        #[prost(message, tag = "6")]
        RichLinkMetadata(super::RichLinkMetadata),
        /// The metadata for a custom emoji.
        #[prost(message, tag = "7")]
        CustomEmojiMetadata(super::CustomEmojiMetadata),
    }
}
/// Annotation metadata for user mentions (@).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UserMentionMetadata {
    /// The user mentioned.
    #[prost(message, optional, tag = "1")]
    pub user: ::core::option::Option<User>,
    /// The type of user mention.
    #[prost(enumeration = "user_mention_metadata::Type", tag = "2")]
    pub r#type: i32,
}
/// Nested message and enum types in `UserMentionMetadata`.
pub mod user_mention_metadata {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        /// Default value for the enum. Don't use.
        Unspecified = 0,
        /// Add user to space.
        Add = 1,
        /// Mention user in space.
        Mention = 2,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "TYPE_UNSPECIFIED",
                Self::Add => "ADD",
                Self::Mention => "MENTION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "ADD" => Some(Self::Add),
                "MENTION" => Some(Self::Mention),
                _ => None,
            }
        }
    }
}
/// Annotation metadata for slash commands (/).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlashCommandMetadata {
    /// The Chat app whose command was invoked.
    #[prost(message, optional, tag = "1")]
    pub bot: ::core::option::Option<User>,
    /// The type of slash command.
    #[prost(enumeration = "slash_command_metadata::Type", tag = "2")]
    pub r#type: i32,
    /// The name of the invoked slash command.
    #[prost(string, tag = "3")]
    pub command_name: ::prost::alloc::string::String,
    /// The command ID of the invoked slash command.
    #[prost(int64, tag = "4")]
    pub command_id: i64,
    /// Indicates whether the slash command is for a dialog.
    #[prost(bool, tag = "5")]
    pub triggers_dialog: bool,
}
/// Nested message and enum types in `SlashCommandMetadata`.
pub mod slash_command_metadata {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        /// Default value for the enum. Don't use.
        Unspecified = 0,
        /// Add Chat app to space.
        Add = 1,
        /// Invoke slash command in space.
        Invoke = 2,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "TYPE_UNSPECIFIED",
                Self::Add => "ADD",
                Self::Invoke => "INVOKE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "ADD" => Some(Self::Add),
                "INVOKE" => Some(Self::Invoke),
                _ => None,
            }
        }
    }
}
/// A rich link to a resource. Rich links can be associated with the plain-text
/// body of the message or represent chips that link to Google Workspace
/// resources like Google Docs or Sheets with `start_index` and `length`
/// of 0.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RichLinkMetadata {
    /// The URI of this link.
    #[prost(string, tag = "1")]
    pub uri: ::prost::alloc::string::String,
    /// The rich link type.
    #[prost(enumeration = "rich_link_metadata::RichLinkType", tag = "2")]
    pub rich_link_type: i32,
    /// Data for the linked resource.
    #[prost(oneof = "rich_link_metadata::Data", tags = "3, 4, 5, 6")]
    pub data: ::core::option::Option<rich_link_metadata::Data>,
}
/// Nested message and enum types in `RichLinkMetadata`.
pub mod rich_link_metadata {
    /// The rich link type. More types might be added in the future.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum RichLinkType {
        /// Default value for the enum. Don't use.
        Unspecified = 0,
        /// A Google Drive rich link type.
        DriveFile = 1,
        /// A Chat space rich link type. For example, a space smart chip.
        ChatSpace = 2,
        /// A Gmail message rich link type. Specifically, a Gmail chip from [Share to
        /// Chat](<https://support.google.com/chat?p=chat_gmail>). The API only
        /// supports reading messages with GMAIL_MESSAGE rich links.
        GmailMessage = 3,
        /// A Meet message rich link type. For example, a Meet chip.
        MeetSpace = 4,
        /// A Calendar message rich link type. For example, a Calendar chip.
        CalendarEvent = 5,
    }
    impl RichLinkType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "RICH_LINK_TYPE_UNSPECIFIED",
                Self::DriveFile => "DRIVE_FILE",
                Self::ChatSpace => "CHAT_SPACE",
                Self::GmailMessage => "GMAIL_MESSAGE",
                Self::MeetSpace => "MEET_SPACE",
                Self::CalendarEvent => "CALENDAR_EVENT",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "RICH_LINK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "DRIVE_FILE" => Some(Self::DriveFile),
                "CHAT_SPACE" => Some(Self::ChatSpace),
                "GMAIL_MESSAGE" => Some(Self::GmailMessage),
                "MEET_SPACE" => Some(Self::MeetSpace),
                "CALENDAR_EVENT" => Some(Self::CalendarEvent),
                _ => None,
            }
        }
    }
    /// Data for the linked resource.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Data {
        /// Data for a drive link.
        #[prost(message, tag = "3")]
        DriveLinkData(super::DriveLinkData),
        /// Data for a chat space link.
        #[prost(message, tag = "4")]
        ChatSpaceLinkData(super::ChatSpaceLinkData),
        /// Data for a Meet space link.
        #[prost(message, tag = "5")]
        MeetSpaceLinkData(super::MeetSpaceLinkData),
        /// Data for a Calendar event link.
        #[prost(message, tag = "6")]
        CalendarEventLinkData(super::CalendarEventLinkData),
    }
}
/// Annotation metadata for custom emoji.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CustomEmojiMetadata {
    /// The custom emoji.
    #[prost(message, optional, tag = "1")]
    pub custom_emoji: ::core::option::Option<CustomEmoji>,
}
/// Data for Google Drive links.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DriveLinkData {
    /// A
    /// [DriveDataRef](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref>)
    /// which references a Google Drive file.
    #[prost(message, optional, tag = "1")]
    pub drive_data_ref: ::core::option::Option<DriveDataRef>,
    /// The mime type of the linked Google Drive resource.
    #[prost(string, tag = "2")]
    pub mime_type: ::prost::alloc::string::String,
}
/// Data for Chat space links.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ChatSpaceLinkData {
    /// The space of the linked Chat space resource.
    ///
    /// Format: `spaces/{space}`
    #[prost(string, tag = "1")]
    pub space: ::prost::alloc::string::String,
    /// The thread of the linked Chat space resource.
    ///
    /// Format: `spaces/{space}/threads/{thread}`
    #[prost(string, tag = "2")]
    pub thread: ::prost::alloc::string::String,
    /// The message of the linked Chat space resource.
    ///
    /// Format: `spaces/{space}/messages/{message}`
    #[prost(string, tag = "3")]
    pub message: ::prost::alloc::string::String,
}
/// Data for Meet space links.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MeetSpaceLinkData {
    /// Meeting code of the linked Meet space.
    #[prost(string, tag = "1")]
    pub meeting_code: ::prost::alloc::string::String,
    /// Indicates the type of the Meet space.
    #[prost(enumeration = "meet_space_link_data::Type", tag = "2")]
    pub r#type: i32,
    /// Optional. Output only. If the Meet is a Huddle, indicates the status of the
    /// huddle. Otherwise, this is unset.
    #[prost(enumeration = "meet_space_link_data::HuddleStatus", tag = "3")]
    pub huddle_status: i32,
}
/// Nested message and enum types in `MeetSpaceLinkData`.
pub mod meet_space_link_data {
    /// The type of the Meet space.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        /// Default value for the enum. Don't use.
        Unspecified = 0,
        /// The Meet space is a meeting.
        Meeting = 1,
        /// The Meet space is a huddle.
        Huddle = 2,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "TYPE_UNSPECIFIED",
                Self::Meeting => "MEETING",
                Self::Huddle => "HUDDLE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "MEETING" => Some(Self::Meeting),
                "HUDDLE" => Some(Self::Huddle),
                _ => None,
            }
        }
    }
    /// The status of the huddle
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum HuddleStatus {
        /// Default value for the enum. Don't use.
        Unspecified = 0,
        /// The huddle has started.
        Started = 1,
        /// The huddle has ended. In this case the Meet space URI and identifiers
        /// will no longer be valid.
        Ended = 2,
        /// The huddle has been missed. In this case the Meet space URI and
        /// identifiers will no longer be valid.
        Missed = 3,
    }
    impl HuddleStatus {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "HUDDLE_STATUS_UNSPECIFIED",
                Self::Started => "STARTED",
                Self::Ended => "ENDED",
                Self::Missed => "MISSED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "HUDDLE_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
                "STARTED" => Some(Self::Started),
                "ENDED" => Some(Self::Ended),
                "MISSED" => Some(Self::Missed),
                _ => None,
            }
        }
    }
}
/// Data for Calendar event links.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CalendarEventLinkData {
    /// The [Calendar
    /// identifier](<https://developers.google.com/workspace/calendar/api/v3/reference/calendars>)
    /// of the linked Calendar.
    #[prost(string, tag = "1")]
    pub calendar_id: ::prost::alloc::string::String,
    /// The [Event
    /// identifier](<https://developers.google.com/workspace/calendar/api/v3/reference/events>)
    /// of the linked Calendar event.
    #[prost(string, tag = "2")]
    pub event_id: ::prost::alloc::string::String,
}
/// Type of the annotation.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum AnnotationType {
    /// Default value for the enum. Don't use.
    Unspecified = 0,
    /// A user is mentioned.
    UserMention = 1,
    /// A slash command is invoked.
    SlashCommand = 2,
    /// A rich link annotation.
    RichLink = 3,
    /// A custom emoji annotation.
    CustomEmoji = 4,
}
impl AnnotationType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "ANNOTATION_TYPE_UNSPECIFIED",
            Self::UserMention => "USER_MENTION",
            Self::SlashCommand => "SLASH_COMMAND",
            Self::RichLink => "RICH_LINK",
            Self::CustomEmoji => "CUSTOM_EMOJI",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ANNOTATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "USER_MENTION" => Some(Self::UserMention),
            "SLASH_COMMAND" => Some(Self::SlashCommand),
            "RICH_LINK" => Some(Self::RichLink),
            "CUSTOM_EMOJI" => Some(Self::CustomEmoji),
            _ => None,
        }
    }
}
/// A Google Group in Google Chat.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Group {
    /// Resource name for a Google Group.
    ///
    /// Represents a
    /// [group](<https://cloud.google.com/identity/docs/reference/rest/v1/groups>) in
    /// Cloud Identity Groups API.
    ///
    /// Format: groups/{group}
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Represents a membership relation in Google Chat, such as whether a user or
/// Chat app is invited to, part of, or absent from a space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Membership {
    /// Identifier. Resource name of the membership, assigned by the server.
    ///
    /// Format: `spaces/{space}/members/{member}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. State of the membership.
    #[prost(enumeration = "membership::MembershipState", tag = "2")]
    pub state: i32,
    /// Optional. User's role within a Chat space, which determines their permitted
    /// actions in the space.
    ///
    /// This field can only be used as input in `UpdateMembership`.
    #[prost(enumeration = "membership::MembershipRole", tag = "7")]
    pub role: i32,
    /// Optional. Immutable. The creation time of the membership, such as when a
    /// member joined or was invited to join a space. This field is output only,
    /// except when used to import historical memberships in import mode spaces.
    #[prost(message, optional, tag = "4")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Optional. Immutable. The deletion time of the membership, such as when a
    /// member left or was removed from a space. This field is output only, except
    /// when used to import historical memberships in import mode spaces.
    #[prost(message, optional, tag = "8")]
    pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Member associated with this membership. Other member types might be
    /// supported in the future.
    #[prost(oneof = "membership::MemberType", tags = "3, 5")]
    pub member_type: ::core::option::Option<membership::MemberType>,
}
/// Nested message and enum types in `Membership`.
pub mod membership {
    /// Specifies the member's relationship with a space. Other membership states
    /// might be supported in the future.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum MembershipState {
        /// Default value. Don't use.
        Unspecified = 0,
        /// The user is added to the space, and can participate in the space.
        Joined = 1,
        /// The user is invited to join the space, but hasn't joined it.
        Invited = 2,
        /// The user doesn't belong to the space and doesn't have a pending
        /// invitation to join the space.
        NotAMember = 3,
    }
    impl MembershipState {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "MEMBERSHIP_STATE_UNSPECIFIED",
                Self::Joined => "JOINED",
                Self::Invited => "INVITED",
                Self::NotAMember => "NOT_A_MEMBER",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "MEMBERSHIP_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "JOINED" => Some(Self::Joined),
                "INVITED" => Some(Self::Invited),
                "NOT_A_MEMBER" => Some(Self::NotAMember),
                _ => None,
            }
        }
    }
    /// Represents a user's permitted actions in a Chat space. More enum values
    /// might be added in the future.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum MembershipRole {
        /// Default value. For \[users\]\[google.chat.v1.Membership.member\]: they
        /// aren't a member of the space, but can be invited. For
        /// \[Google Groups\]\[google.chat.v1.Membership.group_member\]: they're always
        /// assigned this role (other enum values might be used in the future).
        Unspecified = 0,
        /// A member of the space. In the Chat UI, this role is called Member.
        ///
        /// The user has basic permissions, like sending
        /// messages to the space.
        /// Managers and owners can grant members additional permissions in a space,
        /// including:
        ///
        /// * Add or remove members.
        /// * Modify space details.
        /// * Turn history on or off.
        /// * Mention everyone in the space with `@all`.
        /// * Manage Chat apps and webhooks installed in the space.
        ///
        /// In direct messages and unnamed group conversations, everyone
        /// has this role.
        RoleMember = 1,
        /// A space owner. In the Chat UI, this role is called Owner.
        ///
        /// The user has the complete set of space permissions to manage the space,
        /// including:
        ///
        /// * Change the role of other members in the space to member, manager, or
        ///   owner.
        /// * Delete the space.
        ///
        /// Only supported in
        /// \[SpaceType.SPACE\]\[google.chat.v1.Space.SpaceType\] (named spaces).
        ///
        /// To learn more, see
        /// [Learn more about your role as a space
        /// owner or manager](<https://support.google.com/chat/answer/11833441>).
        RoleManager = 2,
        /// A space manager. In the Chat UI, this role is called Manager.
        ///
        /// The user has all basic permissions of `ROLE_MEMBER`,
        /// and can be granted a subset of administrative permissions by an owner.
        /// By default, managers have all the permissions of an owner except for the
        /// ability to:
        ///
        /// * Delete the space.
        /// * Make another space member an owner.
        /// * Change an owner's role.
        ///
        /// By default, managers permissions include but aren't limited to:
        ///
        /// * Make another member a manager.
        /// * Delete messages in the space.
        /// * Manage space permissions.
        /// * Receive notifications for requests to join the space if the manager
        ///   has the "manage members" permission in the space settings.
        /// * Make a space discoverable.
        ///
        /// Only supported in
        /// \[SpaceType.SPACE\]\[google.chat.v1.Space.SpaceType\] (named spaces).
        ///
        /// To learn more, see
        /// [Manage space settings](<https://support.google.com/chat/answer/13340792>).
        RoleAssistantManager = 4,
    }
    impl MembershipRole {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "MEMBERSHIP_ROLE_UNSPECIFIED",
                Self::RoleMember => "ROLE_MEMBER",
                Self::RoleManager => "ROLE_MANAGER",
                Self::RoleAssistantManager => "ROLE_ASSISTANT_MANAGER",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "MEMBERSHIP_ROLE_UNSPECIFIED" => Some(Self::Unspecified),
                "ROLE_MEMBER" => Some(Self::RoleMember),
                "ROLE_MANAGER" => Some(Self::RoleManager),
                "ROLE_ASSISTANT_MANAGER" => Some(Self::RoleAssistantManager),
                _ => None,
            }
        }
    }
    /// Member associated with this membership. Other member types might be
    /// supported in the future.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum MemberType {
        /// Optional. The Google Chat user or app the membership corresponds to.
        /// If your Chat app [authenticates as a
        /// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
        /// the output populates the
        /// [user](<https://developers.google.com/workspace/chat/api/reference/rest/v1/User>)
        /// `name` and `type`.
        #[prost(message, tag = "3")]
        Member(super::User),
        /// Optional. The Google Group the membership corresponds to.
        ///
        /// Reading or mutating memberships for Google Groups requires [user
        /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>).
        #[prost(message, tag = "5")]
        GroupMember(super::Group),
    }
}
/// Request message for creating a membership.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateMembershipRequest {
    /// Required. The resource name of the space for which to create the
    /// membership.
    ///
    /// Format: spaces/{space}
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The membership relation to create.
    ///
    /// The `memberType` field must contain a user with the `user.name` and
    /// `user.type` fields populated. The server will assign a resource name
    /// and overwrite anything specified.
    ///
    /// When a Chat app creates a membership relation for a human user, it must use
    /// certain authorization scopes and set specific values for certain fields:
    ///
    /// * When [authenticating as a
    ///   user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
    ///   the `chat.memberships` authorization scope is required.
    ///
    /// * When [authenticating as an
    ///   app](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>),
    ///   the `chat.app.memberships` authorization scope is required.
    ///
    /// * Set `user.type` to `HUMAN`, and set `user.name` with format
    ///   `users/{user}`, where `{user}` can be the email address for the user. For
    ///   users in the same Workspace organization `{user}` can also be the `id` of
    ///   the [person](<https://developers.google.com/people/api/rest/v1/people>) from
    ///   the People API, or the `id` for the user in the Directory API. For example,
    ///   if the People API Person profile ID for `user@example.com` is `123456789`,
    ///   you can add the user to the space by setting the `membership.member.name`
    ///   to `users/user@example.com` or `users/123456789`.
    ///
    /// Inviting users external to the Workspace organization that owns the space
    /// requires [user
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>).
    ///
    /// When a Chat app creates a membership relation for itself, it must
    /// [authenticate as a
    /// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>)
    /// and use the `chat.memberships.app` scope, set `user.type` to `BOT`, and set
    /// `user.name` to `users/app`.
    #[prost(message, optional, tag = "2")]
    pub membership: ::core::option::Option<Membership>,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires the `chat.admin.memberships` [OAuth 2.0
    /// scope](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    ///
    /// Creating app memberships or creating memberships for users outside the
    /// administrator's Google Workspace organization isn't supported using admin
    /// access.
    #[prost(bool, tag = "5")]
    pub use_admin_access: bool,
}
/// Request message for updating a membership.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateMembershipRequest {
    /// Required. The membership to update. Only fields specified by `update_mask`
    /// are updated.
    #[prost(message, optional, tag = "1")]
    pub membership: ::core::option::Option<Membership>,
    /// Required. The field paths to update. Separate multiple values with commas
    /// or use `*` to update all field paths.
    ///
    /// Currently supported field paths:
    ///
    /// * `role`
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires the `chat.admin.memberships` [OAuth 2.0
    /// scope](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    #[prost(bool, tag = "3")]
    pub use_admin_access: bool,
}
/// Request message for listing memberships.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListMembershipsRequest {
    /// Required. The resource name of the space for which to fetch a membership
    /// list.
    ///
    /// Format: spaces/{space}
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of memberships to return. The service might
    /// return fewer than this value.
    ///
    /// If unspecified, at most 100 memberships are returned.
    ///
    /// The maximum value is 1000. If you use a value more than 1000, it's
    /// automatically changed to 1000.
    ///
    /// Negative values return an `INVALID_ARGUMENT` error.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous call to list memberships.
    /// Provide this parameter to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided should match the call that
    /// provided the page token. Passing different values to the other parameters
    /// might lead to unexpected results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Optional. A query filter.
    ///
    /// You can filter memberships by a member's role
    /// ([`role`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members#membershiprole>))
    /// and type
    /// ([`member.type`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/User#type>)).
    ///
    /// To filter by role, set `role` to `ROLE_MEMBER` or `ROLE_MANAGER`.
    ///
    /// To filter by type, set `member.type` to `HUMAN` or `BOT`. You can also
    /// filter for `member.type` using the `!=` operator.
    ///
    /// To filter by both role and type, use the `AND` operator. To filter by
    /// either role or type, use the `OR` operator.
    ///
    /// Either `member.type = "HUMAN"` or `member.type != "BOT"` is required
    /// when `use_admin_access` is set to true. Other member type filters will be
    /// rejected.
    ///
    /// For example, the following queries are valid:
    ///
    /// ```text,
    /// role = "ROLE_MANAGER" OR role = "ROLE_MEMBER"
    /// member.type = "HUMAN" AND role = "ROLE_MANAGER"
    ///
    /// member.type != "BOT"
    /// ```
    ///
    /// The following queries are invalid:
    ///
    /// ```text,
    /// member.type = "HUMAN" AND member.type = "BOT"
    /// role = "ROLE_MANAGER" AND role = "ROLE_MEMBER"
    /// ```
    ///
    /// Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
    /// error.
    #[prost(string, tag = "5")]
    pub filter: ::prost::alloc::string::String,
    /// Optional. When `true`, also returns memberships associated with a
    /// \[Google Group\]\[google.chat.v1.Membership.group_member\], in
    /// addition to other types of memberships. If a
    /// \[filter\]\[google.chat.v1.ListMembershipsRequest.filter\] is set,
    /// \[Google Group\]\[google.chat.v1.Membership.group_member\]
    /// memberships that don't match the filter criteria aren't returned.
    #[prost(bool, tag = "6")]
    pub show_groups: bool,
    /// Optional. When `true`, also returns memberships associated with
    /// \[invited\]\[google.chat.v1.Membership.MembershipState.INVITED\] members, in
    /// addition to other types of memberships. If a
    /// filter is set,
    /// \[invited\]\[google.chat.v1.Membership.MembershipState.INVITED\] memberships
    /// that don't match the filter criteria aren't returned.
    ///
    /// Currently requires [user
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>).
    #[prost(bool, tag = "7")]
    pub show_invited: bool,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires either the `chat.admin.memberships.readonly` or
    /// `chat.admin.memberships` [OAuth 2.0
    /// scope](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    ///
    /// Listing app memberships in a space isn't supported when using admin access.
    #[prost(bool, tag = "8")]
    pub use_admin_access: bool,
}
/// Response to list memberships of the space.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMembershipsResponse {
    /// Unordered list. List of memberships in the requested (or first) page.
    #[prost(message, repeated, tag = "1")]
    pub memberships: ::prost::alloc::vec::Vec<Membership>,
    /// A token that you can send as `pageToken` to retrieve the next page of
    /// results. If empty, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request to get a membership of a space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMembershipRequest {
    /// Required. Resource name of the membership to retrieve.
    ///
    /// To get the app's own membership [by using user
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
    /// you can optionally use `spaces/{space}/members/app`.
    ///
    /// Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`
    ///
    /// You can use the user's email as an alias for `{member}`. For example,
    /// `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
    /// email of the Google Chat user.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires the `chat.admin.memberships` or `chat.admin.memberships.readonly`
    /// [OAuth 2.0
    /// scopes](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    ///
    /// Getting app memberships in a space isn't supported when using admin access.
    #[prost(bool, tag = "3")]
    pub use_admin_access: bool,
}
/// Request to delete a membership in a space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteMembershipRequest {
    /// Required. Resource name of the membership to delete. Chat apps can delete
    /// human users' or their own memberships. Chat apps can't delete other apps'
    /// memberships.
    ///
    /// When deleting a human membership, requires the `chat.memberships` scope
    /// with [user
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>)
    /// or the `chat.memberships.app` scope with [app
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>)
    /// and the `spaces/{space}/members/{member}` format.
    /// You can use the email as an alias for `{member}`. For example,
    /// `spaces/{space}/members/example@gmail.com` where `example@gmail.com` is the
    /// email of the Google Chat user.
    ///
    /// When deleting an app membership, requires the `chat.memberships.app` scope
    /// and `spaces/{space}/members/app` format.
    ///
    /// Format: `spaces/{space}/members/{member}` or `spaces/{space}/members/app`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires the `chat.admin.memberships` [OAuth 2.0
    /// scope](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    ///
    /// Deleting app memberships in a space isn't supported using admin access.
    #[prost(bool, tag = "2")]
    pub use_admin_access: bool,
}
/// A widget is a UI element that presents text and images.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WidgetMarkup {
    /// A list of buttons. Buttons is also `oneof data` and only one of these
    /// fields should be set.
    #[prost(message, repeated, tag = "6")]
    pub buttons: ::prost::alloc::vec::Vec<widget_markup::Button>,
    /// A `WidgetMarkup` can only have one of the following items. You can use
    /// multiple `WidgetMarkup` fields to display more items.
    #[prost(oneof = "widget_markup::Data", tags = "1, 2, 3")]
    pub data: ::core::option::Option<widget_markup::Data>,
}
/// Nested message and enum types in `WidgetMarkup`.
pub mod widget_markup {
    /// A paragraph of text. Formatted text supported. For more information
    /// about formatting text, see
    /// [Formatting text in Google Chat
    /// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
    /// and
    /// [Formatting
    /// text in Google Workspace
    /// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct TextParagraph {
        #[prost(string, tag = "1")]
        pub text: ::prost::alloc::string::String,
    }
    /// A button. Can be a text button or an image button.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Button {
        #[prost(oneof = "button::Type", tags = "1, 2")]
        pub r#type: ::core::option::Option<button::Type>,
    }
    /// Nested message and enum types in `Button`.
    pub mod button {
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Type {
            /// A button with text and `onclick` action.
            #[prost(message, tag = "1")]
            TextButton(super::TextButton),
            /// A button with image and `onclick` action.
            #[prost(message, tag = "2")]
            ImageButton(super::ImageButton),
        }
    }
    /// A button with text and `onclick` action.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct TextButton {
        /// The text of the button.
        #[prost(string, tag = "1")]
        pub text: ::prost::alloc::string::String,
        /// The `onclick` action of the button.
        #[prost(message, optional, tag = "2")]
        pub on_click: ::core::option::Option<OnClick>,
    }
    /// A UI element contains a key (label) and a value (content). This
    /// element can also contain some actions such as `onclick` button.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct KeyValue {
        /// The text of the top label. Formatted text supported. For more information
        /// about formatting text, see
        /// [Formatting text in Google Chat
        /// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
        /// and
        /// [Formatting
        /// text in Google Workspace
        /// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
        #[prost(string, tag = "3")]
        pub top_label: ::prost::alloc::string::String,
        /// The text of the content. Formatted text supported and always required.
        /// For more information
        /// about formatting text, see
        /// [Formatting text in Google Chat
        /// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
        /// and
        /// [Formatting
        /// text in Google Workspace
        /// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
        #[prost(string, tag = "4")]
        pub content: ::prost::alloc::string::String,
        /// If the content should be multiline.
        #[prost(bool, tag = "9")]
        pub content_multiline: bool,
        /// The text of the bottom label. Formatted text supported. For more
        /// information about formatting text, see [Formatting text in Google Chat
        /// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
        /// and
        /// [Formatting
        /// text in Google Workspace
        /// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
        #[prost(string, tag = "5")]
        pub bottom_label: ::prost::alloc::string::String,
        /// The `onclick` action. Only the top label, bottom label, and content
        /// region are clickable.
        #[prost(message, optional, tag = "6")]
        pub on_click: ::core::option::Option<OnClick>,
        /// At least one of icons, `top_label` and `bottom_label` must be defined.
        #[prost(oneof = "key_value::Icons", tags = "1, 2")]
        pub icons: ::core::option::Option<key_value::Icons>,
        /// A control widget. You can set either `button` or `switch_widget`,
        /// but not both.
        #[prost(oneof = "key_value::Control", tags = "7")]
        pub control: ::core::option::Option<key_value::Control>,
    }
    /// Nested message and enum types in `KeyValue`.
    pub mod key_value {
        /// At least one of icons, `top_label` and `bottom_label` must be defined.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
        pub enum Icons {
            /// An enum value that's replaced by the Chat API with the
            /// corresponding icon image.
            #[prost(enumeration = "super::Icon", tag = "1")]
            Icon(i32),
            /// The icon specified by a URL.
            #[prost(string, tag = "2")]
            IconUrl(::prost::alloc::string::String),
        }
        /// A control widget. You can set either `button` or `switch_widget`,
        /// but not both.
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Control {
            /// A button that can be clicked to trigger an action.
            #[prost(message, tag = "7")]
            Button(super::Button),
        }
    }
    /// An image that's specified by a URL and can have an `onclick` action.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Image {
        /// The URL of the image.
        #[prost(string, tag = "1")]
        pub image_url: ::prost::alloc::string::String,
        /// The `onclick` action.
        #[prost(message, optional, tag = "2")]
        pub on_click: ::core::option::Option<OnClick>,
        /// The aspect ratio of this image (width and height). This field lets you
        /// reserve the right height for the image while waiting for it to load.
        /// It's not meant to override the built-in aspect ratio of the image.
        /// If unset, the server fills it by prefetching the image.
        #[prost(double, tag = "3")]
        pub aspect_ratio: f64,
    }
    /// An image button with an `onclick` action.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ImageButton {
        /// The `onclick` action.
        #[prost(message, optional, tag = "2")]
        pub on_click: ::core::option::Option<OnClick>,
        /// The name of this `image_button` that's used for accessibility.
        /// Default value is provided if this name isn't specified.
        #[prost(string, tag = "4")]
        pub name: ::prost::alloc::string::String,
        /// The icon can be specified by an `Icon` `enum` or a URL.
        #[prost(oneof = "image_button::Icons", tags = "1, 3")]
        pub icons: ::core::option::Option<image_button::Icons>,
    }
    /// Nested message and enum types in `ImageButton`.
    pub mod image_button {
        /// The icon can be specified by an `Icon` `enum` or a URL.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
        pub enum Icons {
            /// The icon specified by an `enum` that indices to an icon provided by
            /// Chat API.
            #[prost(enumeration = "super::Icon", tag = "1")]
            Icon(i32),
            /// The icon specified by a URL.
            #[prost(string, tag = "3")]
            IconUrl(::prost::alloc::string::String),
        }
    }
    /// An `onclick` action (for example, open a link).
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct OnClick {
        #[prost(oneof = "on_click::Data", tags = "1, 2")]
        pub data: ::core::option::Option<on_click::Data>,
    }
    /// Nested message and enum types in `OnClick`.
    pub mod on_click {
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum Data {
            /// A form action is triggered by this `onclick` action if specified.
            #[prost(message, tag = "1")]
            Action(super::FormAction),
            /// This `onclick` action triggers an open link action if specified.
            #[prost(message, tag = "2")]
            OpenLink(super::OpenLink),
        }
    }
    /// A link that opens a new window.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct OpenLink {
        /// The URL to open.
        #[prost(string, tag = "1")]
        pub url: ::prost::alloc::string::String,
    }
    /// A form action describes the behavior when the form is submitted.
    /// For example, you can invoke Apps Script to handle the form.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct FormAction {
        /// The method name is used to identify which part of the form triggered the
        /// form submission. This information is echoed back to the Chat app as part
        /// of the card click event. You can use the same method name for several
        /// elements that trigger a common behavior.
        #[prost(string, tag = "1")]
        pub action_method_name: ::prost::alloc::string::String,
        /// List of action parameters.
        #[prost(message, repeated, tag = "2")]
        pub parameters: ::prost::alloc::vec::Vec<form_action::ActionParameter>,
    }
    /// Nested message and enum types in `FormAction`.
    pub mod form_action {
        /// List of string parameters to supply when the action method is invoked.
        /// For example, consider three snooze buttons: snooze now, snooze one day,
        /// snooze next week. You might use `action method = snooze()`, passing the
        /// snooze type and snooze time in the list of string parameters.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct ActionParameter {
            /// The name of the parameter for the action script.
            #[prost(string, tag = "1")]
            pub key: ::prost::alloc::string::String,
            /// The value of the parameter.
            #[prost(string, tag = "2")]
            pub value: ::prost::alloc::string::String,
        }
    }
    /// The set of supported icons.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Icon {
        Unspecified = 0,
        Airplane = 1,
        Bookmark = 26,
        Bus = 25,
        Car = 9,
        Clock = 2,
        ConfirmationNumberIcon = 12,
        Dollar = 14,
        Description = 27,
        Email = 10,
        EventPerformer = 20,
        EventSeat = 21,
        FlightArrival = 16,
        FlightDeparture = 15,
        Hotel = 6,
        HotelRoomType = 17,
        Invite = 19,
        MapPin = 3,
        Membership = 24,
        MultiplePeople = 18,
        Offer = 30,
        Person = 11,
        Phone = 13,
        RestaurantIcon = 7,
        ShoppingCart = 8,
        Star = 5,
        Store = 22,
        Ticket = 4,
        Train = 23,
        VideoCamera = 28,
        VideoPlay = 29,
    }
    impl Icon {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "ICON_UNSPECIFIED",
                Self::Airplane => "AIRPLANE",
                Self::Bookmark => "BOOKMARK",
                Self::Bus => "BUS",
                Self::Car => "CAR",
                Self::Clock => "CLOCK",
                Self::ConfirmationNumberIcon => "CONFIRMATION_NUMBER_ICON",
                Self::Dollar => "DOLLAR",
                Self::Description => "DESCRIPTION",
                Self::Email => "EMAIL",
                Self::EventPerformer => "EVENT_PERFORMER",
                Self::EventSeat => "EVENT_SEAT",
                Self::FlightArrival => "FLIGHT_ARRIVAL",
                Self::FlightDeparture => "FLIGHT_DEPARTURE",
                Self::Hotel => "HOTEL",
                Self::HotelRoomType => "HOTEL_ROOM_TYPE",
                Self::Invite => "INVITE",
                Self::MapPin => "MAP_PIN",
                Self::Membership => "MEMBERSHIP",
                Self::MultiplePeople => "MULTIPLE_PEOPLE",
                Self::Offer => "OFFER",
                Self::Person => "PERSON",
                Self::Phone => "PHONE",
                Self::RestaurantIcon => "RESTAURANT_ICON",
                Self::ShoppingCart => "SHOPPING_CART",
                Self::Star => "STAR",
                Self::Store => "STORE",
                Self::Ticket => "TICKET",
                Self::Train => "TRAIN",
                Self::VideoCamera => "VIDEO_CAMERA",
                Self::VideoPlay => "VIDEO_PLAY",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ICON_UNSPECIFIED" => Some(Self::Unspecified),
                "AIRPLANE" => Some(Self::Airplane),
                "BOOKMARK" => Some(Self::Bookmark),
                "BUS" => Some(Self::Bus),
                "CAR" => Some(Self::Car),
                "CLOCK" => Some(Self::Clock),
                "CONFIRMATION_NUMBER_ICON" => Some(Self::ConfirmationNumberIcon),
                "DOLLAR" => Some(Self::Dollar),
                "DESCRIPTION" => Some(Self::Description),
                "EMAIL" => Some(Self::Email),
                "EVENT_PERFORMER" => Some(Self::EventPerformer),
                "EVENT_SEAT" => Some(Self::EventSeat),
                "FLIGHT_ARRIVAL" => Some(Self::FlightArrival),
                "FLIGHT_DEPARTURE" => Some(Self::FlightDeparture),
                "HOTEL" => Some(Self::Hotel),
                "HOTEL_ROOM_TYPE" => Some(Self::HotelRoomType),
                "INVITE" => Some(Self::Invite),
                "MAP_PIN" => Some(Self::MapPin),
                "MEMBERSHIP" => Some(Self::Membership),
                "MULTIPLE_PEOPLE" => Some(Self::MultiplePeople),
                "OFFER" => Some(Self::Offer),
                "PERSON" => Some(Self::Person),
                "PHONE" => Some(Self::Phone),
                "RESTAURANT_ICON" => Some(Self::RestaurantIcon),
                "SHOPPING_CART" => Some(Self::ShoppingCart),
                "STAR" => Some(Self::Star),
                "STORE" => Some(Self::Store),
                "TICKET" => Some(Self::Ticket),
                "TRAIN" => Some(Self::Train),
                "VIDEO_CAMERA" => Some(Self::VideoCamera),
                "VIDEO_PLAY" => Some(Self::VideoPlay),
                _ => None,
            }
        }
    }
    /// A `WidgetMarkup` can only have one of the following items. You can use
    /// multiple `WidgetMarkup` fields to display more items.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Data {
        /// Display a text paragraph in this widget.
        #[prost(message, tag = "1")]
        TextParagraph(TextParagraph),
        /// Display an image in this widget.
        #[prost(message, tag = "2")]
        Image(Image),
        /// Display a key value item in this widget.
        #[prost(message, tag = "3")]
        KeyValue(KeyValue),
    }
}
/// The markup for developers to specify the contents of a contextual AddOn.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ContextualAddOnMarkup {}
/// Nested message and enum types in `ContextualAddOnMarkup`.
pub mod contextual_add_on_markup {
    /// A card is a UI element that can contain UI widgets such as text and
    /// images.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Card {
        /// The header of the card. A header usually contains a title and an image.
        #[prost(message, optional, tag = "1")]
        pub header: ::core::option::Option<card::CardHeader>,
        /// Sections are separated by a line divider.
        #[prost(message, repeated, tag = "2")]
        pub sections: ::prost::alloc::vec::Vec<card::Section>,
        /// The actions of this card.
        #[prost(message, repeated, tag = "3")]
        pub card_actions: ::prost::alloc::vec::Vec<card::CardAction>,
        /// Name of the card.
        #[prost(string, tag = "4")]
        pub name: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `Card`.
    pub mod card {
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct CardHeader {
            /// The title must be specified. The header has a fixed height: if both a
            /// title and subtitle is specified, each takes up one line. If only the
            /// title is specified, it takes up both lines.
            #[prost(string, tag = "1")]
            pub title: ::prost::alloc::string::String,
            /// The subtitle of the card header.
            #[prost(string, tag = "2")]
            pub subtitle: ::prost::alloc::string::String,
            /// The image's type (for example, square border or circular border).
            #[prost(enumeration = "card_header::ImageStyle", tag = "3")]
            pub image_style: i32,
            /// The URL of the image in the card header.
            #[prost(string, tag = "4")]
            pub image_url: ::prost::alloc::string::String,
        }
        /// Nested message and enum types in `CardHeader`.
        pub mod card_header {
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum ImageStyle {
                Unspecified = 0,
                /// Square border.
                Image = 1,
                /// Circular border.
                Avatar = 2,
            }
            impl ImageStyle {
                /// String value of the enum field names used in the ProtoBuf definition.
                ///
                /// The values are not transformed in any way and thus are considered stable
                /// (if the ProtoBuf definition does not change) and safe for programmatic use.
                pub fn as_str_name(&self) -> &'static str {
                    match self {
                        Self::Unspecified => "IMAGE_STYLE_UNSPECIFIED",
                        Self::Image => "IMAGE",
                        Self::Avatar => "AVATAR",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "IMAGE_STYLE_UNSPECIFIED" => Some(Self::Unspecified),
                        "IMAGE" => Some(Self::Image),
                        "AVATAR" => Some(Self::Avatar),
                        _ => None,
                    }
                }
            }
        }
        /// A section contains a collection of widgets that are rendered
        /// (vertically) in the order that they are specified. Across all platforms,
        /// cards have a narrow fixed width, so
        /// there's currently no need for layout properties (for example, float).
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Section {
            /// The header of the section. Formatted text is
            /// supported. For more information
            /// about formatting text, see
            /// [Formatting text in Google Chat
            /// apps](<https://developers.google.com/workspace/chat/format-messages#card-formatting>)
            /// and
            /// [Formatting
            /// text in Google Workspace
            /// Add-ons](<https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting>).
            #[prost(string, tag = "1")]
            pub header: ::prost::alloc::string::String,
            /// A section must contain at least one widget.
            #[prost(message, repeated, tag = "2")]
            pub widgets: ::prost::alloc::vec::Vec<super::super::WidgetMarkup>,
        }
        /// A card action is
        /// the action associated with the card. For an invoice card, a
        /// typical action would be: delete invoice, email invoice or open the
        /// invoice in browser.
        ///
        /// Not supported by Google Chat apps.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct CardAction {
            /// The label used to be displayed in the action menu item.
            #[prost(string, tag = "1")]
            pub action_label: ::prost::alloc::string::String,
            /// The onclick action for this action item.
            #[prost(message, optional, tag = "2")]
            pub on_click: ::core::option::Option<super::super::widget_markup::OnClick>,
        }
    }
}
/// Information about a deleted message. A message is deleted when `delete_time`
/// is set.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeletionMetadata {
    /// Indicates who deleted the message.
    #[prost(enumeration = "deletion_metadata::DeletionType", tag = "1")]
    pub deletion_type: i32,
}
/// Nested message and enum types in `DeletionMetadata`.
pub mod deletion_metadata {
    /// Who deleted the message and how it was deleted. More values may be added in
    /// the future. See [Edit or delete a message in Google
    /// Chat](<https://support.google.com/chat/answer/7653281>) for details on when
    /// messages can be deleted.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum DeletionType {
        /// This value is unused.
        Unspecified = 0,
        /// User deleted their own message.
        Creator = 1,
        /// An owner or manager deleted the message.
        SpaceOwner = 2,
        /// A Google Workspace administrator deleted the message. Administrators can
        /// delete any message in the space, including messages sent by any space
        /// member or Chat app.
        Admin = 3,
        /// A Chat app deleted its own message when it expired.
        AppMessageExpiry = 4,
        /// A Chat app deleted the message on behalf of the creator (using user
        /// authentication).
        CreatorViaApp = 5,
        /// A Chat app deleted the message on behalf of a space manager (using user
        /// authentication).
        SpaceOwnerViaApp = 6,
        /// A member of the space deleted the message. Users can delete messages sent
        /// by apps.
        SpaceMember = 7,
    }
    impl DeletionType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "DELETION_TYPE_UNSPECIFIED",
                Self::Creator => "CREATOR",
                Self::SpaceOwner => "SPACE_OWNER",
                Self::Admin => "ADMIN",
                Self::AppMessageExpiry => "APP_MESSAGE_EXPIRY",
                Self::CreatorViaApp => "CREATOR_VIA_APP",
                Self::SpaceOwnerViaApp => "SPACE_OWNER_VIA_APP",
                Self::SpaceMember => "SPACE_MEMBER",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DELETION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "CREATOR" => Some(Self::Creator),
                "SPACE_OWNER" => Some(Self::SpaceOwner),
                "ADMIN" => Some(Self::Admin),
                "APP_MESSAGE_EXPIRY" => Some(Self::AppMessageExpiry),
                "CREATOR_VIA_APP" => Some(Self::CreatorViaApp),
                "SPACE_OWNER_VIA_APP" => Some(Self::SpaceOwnerViaApp),
                "SPACE_MEMBER" => Some(Self::SpaceMember),
                _ => None,
            }
        }
    }
}
/// A matched URL in a Chat message. Chat apps can preview matched URLs. For more
/// information, see [Preview
/// links](<https://developers.google.com/chat/how-tos/preview-links>).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MatchedUrl {
    /// Output only. The URL that was matched.
    #[prost(string, tag = "2")]
    pub url: ::prost::alloc::string::String,
}
/// Metadata about a [slash
/// command](<https://developers.google.com/workspace/chat/commands>) in
/// Google Chat.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SlashCommand {
    /// The ID of the slash command.
    #[prost(int64, tag = "1")]
    pub command_id: i64,
}
/// The history state for messages and spaces. Specifies how long messages and
/// conversation threads are kept after creation.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum HistoryState {
    /// Default value. Do not use.
    Unspecified = 0,
    /// History off. [Messages and threads are kept for 24
    /// hours](<https://support.google.com/chat/answer/7664687>).
    HistoryOff = 1,
    /// History on. The organization's [Vault retention
    /// rules](<https://support.google.com/vault/answer/7657597>) specify for
    /// how long messages and threads are kept.
    HistoryOn = 2,
}
impl HistoryState {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "HISTORY_STATE_UNSPECIFIED",
            Self::HistoryOff => "HISTORY_OFF",
            Self::HistoryOn => "HISTORY_ON",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "HISTORY_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "HISTORY_OFF" => Some(Self::HistoryOff),
            "HISTORY_ON" => Some(Self::HistoryOn),
            _ => None,
        }
    }
}
/// A space in Google Chat. Spaces are conversations between two or more users
/// or 1:1 messages between a user and a Chat app.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Space {
    /// Identifier. Resource name of the space.
    ///
    /// Format: `spaces/{space}`
    ///
    /// Where `{space}` represents the system-assigned ID for the space. You can
    /// obtain the space ID by calling the
    /// [`spaces.list()`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/list>)
    /// method or from the space URL. For example, if the space URL
    /// is `<https://mail.google.com/mail/u/0/#chat/space/AAAAAAAAA`,> the space ID
    /// is `AAAAAAAAA`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. Deprecated: Use `space_type` instead.
    /// The type of a space.
    #[deprecated]
    #[prost(enumeration = "space::Type", tag = "2")]
    pub r#type: i32,
    /// Optional. The type of space. Required when creating a space or updating the
    /// space type of a space. Output only for other usage.
    #[prost(enumeration = "space::SpaceType", tag = "10")]
    pub space_type: i32,
    /// Optional. Whether the space is a DM between a Chat app and a single
    /// human.
    #[prost(bool, tag = "4")]
    pub single_user_bot_dm: bool,
    /// Output only. Deprecated: Use `spaceThreadingState` instead.
    /// Whether messages are threaded in this space.
    #[deprecated]
    #[prost(bool, tag = "5")]
    pub threaded: bool,
    /// Optional. The space's display name. Required when [creating a
    /// space](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/create>)
    /// with a `spaceType` of `SPACE`. If you receive the error message
    /// `ALREADY_EXISTS` when creating a space or updating the `displayName`, try a
    /// different `displayName`. An existing space within the Google Workspace
    /// organization might already use this display name.
    ///
    /// For direct messages, this field might be empty.
    ///
    /// Supports up to 128 characters.
    #[prost(string, tag = "3")]
    pub display_name: ::prost::alloc::string::String,
    /// Optional. Immutable. Whether this space permits any Google Chat user as a
    /// member. Input when creating a space in a Google Workspace organization.
    /// Omit this field when creating spaces in the following conditions:
    ///
    /// * The authenticated user uses a consumer account (unmanaged user
    ///   account). By default, a space created by a consumer account permits any
    ///   Google Chat user.
    ///
    /// For existing spaces, this field is output only.
    #[prost(bool, tag = "8")]
    pub external_user_allowed: bool,
    /// Output only. The threading state in the Chat space.
    #[prost(enumeration = "space::SpaceThreadingState", tag = "9")]
    pub space_threading_state: i32,
    /// Optional. Details about the space including description and rules.
    #[prost(message, optional, tag = "11")]
    pub space_details: ::core::option::Option<space::SpaceDetails>,
    /// Optional. The message history state for messages and threads in this space.
    #[prost(enumeration = "HistoryState", tag = "13")]
    pub space_history_state: i32,
    /// Optional. Whether this space is created in `Import Mode` as part of a data
    /// migration into Google Workspace. While spaces are being imported, they
    /// aren't visible to users until the import is complete.
    ///
    /// Creating a space in `Import Mode`requires [user
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>).
    #[prost(bool, tag = "16")]
    pub import_mode: bool,
    /// Optional. Immutable. For spaces created in Chat, the time the space was
    /// created. This field is output only, except when used in import mode spaces.
    ///
    /// For import mode spaces, set this field to the historical timestamp at which
    /// the space was created in the source in order to preserve the original
    /// creation time.
    ///
    /// Only populated in the output when `spaceType` is `GROUP_CHAT` or `SPACE`.
    #[prost(message, optional, tag = "17")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. Timestamp of the last message in the space.
    #[prost(message, optional, tag = "18")]
    pub last_active_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. For direct message (DM) spaces with a Chat app, whether the
    /// space was created by a Google Workspace administrator. Administrators can
    /// install and set up a direct message with a Chat app on behalf of users in
    /// their organization.
    ///
    /// To support admin install, your Chat app must feature direct messaging.
    #[prost(bool, tag = "19")]
    pub admin_installed: bool,
    /// Output only. The count of joined memberships grouped by member type.
    /// Populated when the `space_type` is `SPACE`, `DIRECT_MESSAGE` or
    /// `GROUP_CHAT`.
    #[prost(message, optional, tag = "20")]
    pub membership_count: ::core::option::Option<space::MembershipCount>,
    /// Optional. Specifies the [access
    /// setting](<https://support.google.com/chat/answer/11971020>) of the space.
    /// Only populated when the `space_type` is `SPACE`.
    #[prost(message, optional, tag = "23")]
    pub access_settings: ::core::option::Option<space::AccessSettings>,
    /// Optional. Immutable. The customer id of the domain of the space.
    /// Required only when creating a space with [app
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>)
    /// and `SpaceType` is `SPACE`, otherwise should not be set.
    ///
    /// In the format `customers/{customer}`, where `customer` is the `id` from the
    /// [Admin SDK customer
    /// resource](<https://developers.google.com/admin-sdk/directory/reference/rest/v1/customers>).
    /// Private apps can also use the `customers/my_customer` alias to create
    /// the space in the same Google Workspace organization as the app.
    ///
    /// This field isn't populated for direct messages (DMs) or when the space is
    /// created by non-Google Workspace users.
    #[prost(string, optional, tag = "24")]
    pub customer: ::core::option::Option<::prost::alloc::string::String>,
    /// Output only. The URI for a user to access the space.
    #[prost(string, tag = "25")]
    pub space_uri: ::prost::alloc::string::String,
    /// Output only. The time when the space will be automatically deleted by the
    /// system if it remains in import mode.
    ///
    /// Each space created in import mode must exit this mode before this expire
    /// time using `spaces.completeImport`.
    ///
    /// This field is only populated for spaces that were created with import mode.
    #[prost(message, optional, tag = "28")]
    pub import_mode_expire_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Represents the \[permission settings\]
    /// (<https://support.google.com/chat/answer/13340792>) of a space. Only
    /// populated when the `space_type` is `SPACE`.
    #[prost(oneof = "space::SpacePermissionSettings", tags = "26, 27")]
    pub space_permission_settings: ::core::option::Option<
        space::SpacePermissionSettings,
    >,
}
/// Nested message and enum types in `Space`.
pub mod space {
    /// Details about the space including description and rules.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct SpaceDetails {
        /// Optional. A description of the space. For example, describe the space's
        /// discussion topic, functional purpose, or participants.
        ///
        /// Supports up to 150 characters.
        #[prost(string, tag = "1")]
        pub description: ::prost::alloc::string::String,
        /// Optional. The space's rules, expectations, and etiquette.
        ///
        /// Supports up to 5,000 characters.
        #[prost(string, tag = "2")]
        pub guidelines: ::prost::alloc::string::String,
    }
    /// Represents the count of memberships of a space, grouped into categories.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct MembershipCount {
        /// Output only. Count of human users that have directly joined the space,
        /// not counting users joined by having membership in a joined group.
        #[prost(int32, tag = "4")]
        pub joined_direct_human_user_count: i32,
        /// Output only. Count of all groups that have directly joined the space.
        #[prost(int32, tag = "5")]
        pub joined_group_count: i32,
    }
    /// Represents the [access
    /// setting](<https://support.google.com/chat/answer/11971020>) of the space.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct AccessSettings {
        /// Output only. Indicates the access state of the space.
        #[prost(enumeration = "access_settings::AccessState", tag = "1")]
        pub access_state: i32,
        /// Optional. The resource name of the [target
        /// audience](<https://support.google.com/a/answer/9934697>) who can discover
        /// the space, join the space, and preview the messages in the space. If
        /// unset, only users or Google Groups who have been individually invited or
        /// added to the space can access it. For details, see [Make a space
        /// discoverable to a target
        /// audience](<https://developers.google.com/workspace/chat/space-target-audience>).
        ///
        /// Format: `audiences/{audience}`
        ///
        /// To use the default target audience for the Google Workspace organization,
        /// set to `audiences/default`.
        ///
        /// Reading the target audience supports:
        ///
        /// * [User
        ///   authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>)
        ///
        /// * [App
        ///   authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>)
        ///   with [administrator
        ///   approval](<https://support.google.com/a?p=chat-app-auth>)
        ///   with the `chat.app.spaces` scope.
        ///
        /// This field is not populated when using the `chat.bot` scope with [app
        /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>).
        ///
        /// Setting the target audience requires [user
        /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>).
        #[prost(string, tag = "3")]
        pub audience: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `AccessSettings`.
    pub mod access_settings {
        /// Represents the access state of the space.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum AccessState {
            /// Access state is unknown or not supported in this API.
            Unspecified = 0,
            /// Only users or Google Groups that have been individually added or
            /// invited by other users or Google Workspace administrators can discover
            /// and access the space.
            Private = 1,
            /// A space manager has granted a target audience access to
            /// the space. Users or Google Groups that have been individually added or
            /// invited to the space can also discover and access the space. To learn
            /// more, see [Make a space discoverable to specific
            /// users](<https://developers.google.com/workspace/chat/space-target-audience>).
            ///
            /// Creating discoverable spaces requires [user
            /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>).
            Discoverable = 2,
        }
        impl AccessState {
            /// String value of the enum field names used in the ProtoBuf definition.
            ///
            /// The values are not transformed in any way and thus are considered stable
            /// (if the ProtoBuf definition does not change) and safe for programmatic use.
            pub fn as_str_name(&self) -> &'static str {
                match self {
                    Self::Unspecified => "ACCESS_STATE_UNSPECIFIED",
                    Self::Private => "PRIVATE",
                    Self::Discoverable => "DISCOVERABLE",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "ACCESS_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                    "PRIVATE" => Some(Self::Private),
                    "DISCOVERABLE" => Some(Self::Discoverable),
                    _ => None,
                }
            }
        }
    }
    /// [Permission settings](<https://support.google.com/chat/answer/13340792>)
    /// that you can specify when updating an existing named space.
    ///
    /// To set permission settings when creating a space, specify the
    /// `PredefinedPermissionSettings` field in your request.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct PermissionSettings {
        /// Optional. Setting for managing members and groups in a space.
        #[prost(message, optional, tag = "1")]
        pub manage_members_and_groups: ::core::option::Option<PermissionSetting>,
        /// Optional. Setting for updating space name, avatar, description and
        /// guidelines.
        #[prost(message, optional, tag = "2")]
        pub modify_space_details: ::core::option::Option<PermissionSetting>,
        /// Optional. Setting for toggling space history on and off.
        #[prost(message, optional, tag = "3")]
        pub toggle_history: ::core::option::Option<PermissionSetting>,
        /// Optional. Setting for using @all in a space.
        #[prost(message, optional, tag = "4")]
        pub use_at_mention_all: ::core::option::Option<PermissionSetting>,
        /// Optional. Setting for managing apps in a space.
        #[prost(message, optional, tag = "5")]
        pub manage_apps: ::core::option::Option<PermissionSetting>,
        /// Optional. Setting for managing webhooks in a space.
        #[prost(message, optional, tag = "6")]
        pub manage_webhooks: ::core::option::Option<PermissionSetting>,
        /// Output only. Setting for posting messages in a space.
        #[prost(message, optional, tag = "7")]
        pub post_messages: ::core::option::Option<PermissionSetting>,
        /// Optional. Setting for replying to messages in a space.
        #[prost(message, optional, tag = "8")]
        pub reply_messages: ::core::option::Option<PermissionSetting>,
    }
    /// Represents a space permission setting.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct PermissionSetting {
        /// Optional. Whether space owners
        /// (\[`ROLE_MANAGER`\]\[google.chat.v1.Membership.MembershipRole.ROLE_MANAGER\])
        /// have this permission.
        #[prost(bool, tag = "1")]
        pub managers_allowed: bool,
        /// Optional. Whether space managers
        /// \[`ROLE_ASSISTANT_MANAGER`\]\[google.chat.v1.Membership.MembershipRole.ROLE_ASSISTANT_MANAGER\])
        /// have this permission.
        #[prost(bool, optional, tag = "3")]
        pub assistant_managers_allowed: ::core::option::Option<bool>,
        /// Optional. Whether basic space members
        /// (\[`ROLE_MEMBER`\]\[google.chat.v1.Membership.MembershipRole.ROLE_MEMBER\])
        /// have this permission.
        #[prost(bool, tag = "2")]
        pub members_allowed: bool,
    }
    /// Deprecated: Use `SpaceType` instead.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Type {
        /// Reserved.
        Unspecified = 0,
        /// Conversations between two or more humans.
        Room = 1,
        /// 1:1 Direct Message between a human and a Chat app, where all messages are
        /// flat. Note that this doesn't include direct messages between two humans.
        Dm = 2,
    }
    impl Type {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "TYPE_UNSPECIFIED",
                Self::Room => "ROOM",
                Self::Dm => "DM",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "ROOM" => Some(Self::Room),
                "DM" => Some(Self::Dm),
                _ => None,
            }
        }
    }
    /// The type of space. Required when creating or updating a space. Output only
    /// for other usage.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum SpaceType {
        /// Reserved.
        Unspecified = 0,
        /// A place where people send messages, share files, and collaborate.
        /// A `SPACE` can include Chat apps.
        Space = 1,
        /// Group conversations between 3 or more people.
        /// A `GROUP_CHAT` can include Chat apps.
        GroupChat = 2,
        /// 1:1 messages between two humans or a human and a Chat app.
        DirectMessage = 3,
    }
    impl SpaceType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "SPACE_TYPE_UNSPECIFIED",
                Self::Space => "SPACE",
                Self::GroupChat => "GROUP_CHAT",
                Self::DirectMessage => "DIRECT_MESSAGE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SPACE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "SPACE" => Some(Self::Space),
                "GROUP_CHAT" => Some(Self::GroupChat),
                "DIRECT_MESSAGE" => Some(Self::DirectMessage),
                _ => None,
            }
        }
    }
    /// Specifies the type of threading state in the Chat space.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum SpaceThreadingState {
        /// Reserved.
        Unspecified = 0,
        /// Named spaces that support message threads. When users respond to a
        /// message, they can reply in-thread, which keeps their response in the
        /// context of the original message.
        ThreadedMessages = 2,
        /// Named spaces where the conversation is organized by topic. Topics and
        /// their replies are grouped together.
        GroupedMessages = 3,
        /// Direct messages (DMs) between two people and group conversations between
        /// 3 or more people.
        UnthreadedMessages = 4,
    }
    impl SpaceThreadingState {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "SPACE_THREADING_STATE_UNSPECIFIED",
                Self::ThreadedMessages => "THREADED_MESSAGES",
                Self::GroupedMessages => "GROUPED_MESSAGES",
                Self::UnthreadedMessages => "UNTHREADED_MESSAGES",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SPACE_THREADING_STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "THREADED_MESSAGES" => Some(Self::ThreadedMessages),
                "GROUPED_MESSAGES" => Some(Self::GroupedMessages),
                "UNTHREADED_MESSAGES" => Some(Self::UnthreadedMessages),
                _ => None,
            }
        }
    }
    /// Predefined permission settings that you can only specify when creating a
    /// named space. More settings might be added in the future.
    /// For details about permission settings for named spaces, see [Learn about
    /// spaces](<https://support.google.com/chat/answer/7659784>).
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum PredefinedPermissionSettings {
        /// Unspecified. Don't use.
        Unspecified = 0,
        /// Setting to make the space a collaboration space where all members can
        /// post messages.
        CollaborationSpace = 1,
        /// Setting to make the space an announcement space where only space managers
        /// can post messages.
        AnnouncementSpace = 2,
    }
    impl PredefinedPermissionSettings {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED",
                Self::CollaborationSpace => "COLLABORATION_SPACE",
                Self::AnnouncementSpace => "ANNOUNCEMENT_SPACE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "PREDEFINED_PERMISSION_SETTINGS_UNSPECIFIED" => Some(Self::Unspecified),
                "COLLABORATION_SPACE" => Some(Self::CollaborationSpace),
                "ANNOUNCEMENT_SPACE" => Some(Self::AnnouncementSpace),
                _ => None,
            }
        }
    }
    /// Represents the \[permission settings\]
    /// (<https://support.google.com/chat/answer/13340792>) of a space. Only
    /// populated when the `space_type` is `SPACE`.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum SpacePermissionSettings {
        /// Optional. Input only. Predefined space permission settings, input only
        /// when creating a space. If the field is not set, a collaboration space is
        /// created. After you create the space, settings are populated in the
        /// `PermissionSettings` field.
        ///
        /// Setting predefined permission settings supports:
        ///
        /// * [App
        ///   authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>)
        ///   with [administrator
        ///   approval](<https://support.google.com/a?p=chat-app-auth>) with the
        ///   `chat.app.spaces` or `chat.app.spaces.create` scopes.
        ///
        /// * [User
        ///   authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>)
        #[prost(enumeration = "PredefinedPermissionSettings", tag = "26")]
        PredefinedPermissionSettings(i32),
        /// Optional. Space permission settings for existing spaces. Input for
        /// updating exact space permission settings, where existing permission
        /// settings are replaced. Output lists current permission settings.
        ///
        /// Reading and updating permission settings supports:
        ///
        /// * [App
        ///   authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>)
        ///   with [administrator
        ///   approval](<https://support.google.com/a?p=chat-app-auth>) with the
        ///   `chat.app.spaces` scope. Only populated and settable when the Chat app
        ///   created the space.
        ///
        /// * [User
        ///   authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>)
        #[prost(message, tag = "27")]
        PermissionSettings(PermissionSettings),
    }
}
/// A request to create a named space with no members.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateSpaceRequest {
    /// Required. The `displayName` and `spaceType` fields must be populated.  Only
    /// `SpaceType.SPACE`  and `SpaceType.GROUP_CHAT` are supported.
    /// `SpaceType.GROUP_CHAT` can only be used if `importMode` is set to true.
    ///
    /// If you receive the error message `ALREADY_EXISTS`,
    /// try a different `displayName`. An existing space within the Google
    /// Workspace organization might already use this display name.
    ///
    /// The space `name` is assigned on the server so anything specified in this
    /// field will be ignored.
    #[prost(message, optional, tag = "1")]
    pub space: ::core::option::Option<Space>,
    /// Optional. A unique identifier for this request.
    /// A random UUID is recommended.
    /// Specifying an existing request ID returns the space created with that ID
    /// instead of creating a new space.
    /// Specifying an existing request ID from the same Chat app with a different
    /// authenticated user returns an error.
    #[prost(string, tag = "2")]
    pub request_id: ::prost::alloc::string::String,
}
/// A request to list the spaces the caller is a member of.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSpacesRequest {
    /// Optional. The maximum number of spaces to return. The service might return
    /// fewer than this value.
    ///
    /// If unspecified, at most 100 spaces are returned.
    ///
    /// The maximum value is 1000. If you use a value more than 1000, it's
    /// automatically changed to 1000.
    ///
    /// Negative values return an `INVALID_ARGUMENT` error.
    #[prost(int32, tag = "1")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous list spaces call.
    /// Provide this parameter to retrieve the subsequent page.
    ///
    /// When paginating, the filter value should match the call that provided the
    /// page token. Passing a different value may lead to unexpected results.
    #[prost(string, tag = "2")]
    pub page_token: ::prost::alloc::string::String,
    /// Optional. A query filter.
    ///
    /// You can filter spaces by the space type
    /// ([`space_type`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype>)).
    ///
    /// To filter by space type, you must specify valid enum value, such as
    /// `SPACE` or `GROUP_CHAT` (the `space_type` can't be
    /// `SPACE_TYPE_UNSPECIFIED`). To query for multiple space types, use the `OR`
    /// operator.
    ///
    /// For example, the following queries are valid:
    ///
    /// ```text,
    /// space_type = "SPACE"
    /// spaceType = "GROUP_CHAT" OR spaceType = "DIRECT_MESSAGE"
    /// ```
    ///
    /// Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
    /// error.
    #[prost(string, tag = "3")]
    pub filter: ::prost::alloc::string::String,
}
/// The response for a list spaces request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSpacesResponse {
    /// List of spaces in the requested (or first) page.
    /// Note: The `permissionSettings` field is not returned in the Space
    /// object for list requests.
    #[prost(message, repeated, tag = "1")]
    pub spaces: ::prost::alloc::vec::Vec<Space>,
    /// You can send a token as `pageToken` to retrieve the next page of
    /// results. If empty, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// A request to return a single space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSpaceRequest {
    /// Required. Resource name of the space, in the form `spaces/{space}`.
    ///
    /// Format: `spaces/{space}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires the `chat.admin.spaces` or `chat.admin.spaces.readonly` [OAuth 2.0
    /// scopes](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    #[prost(bool, tag = "2")]
    pub use_admin_access: bool,
}
/// A request to get direct message space based on the user resource.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FindDirectMessageRequest {
    /// Required. Resource name of the user to find direct message with.
    ///
    /// Format: `users/{user}`, where `{user}` is either the `id` for the
    /// [person](<https://developers.google.com/people/api/rest/v1/people>) from the
    /// People API, or the `id` for the
    /// [user](<https://developers.google.com/admin-sdk/directory/reference/rest/v1/users>)
    /// in the Directory API. For example, if the People API profile ID is
    /// `123456789`, you can find a direct message with that person by using
    /// `users/123456789` as the `name`. When [authenticated as a
    /// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
    /// you can use the email as an alias for `{user}`. For example,
    /// `users/example@gmail.com` where `example@gmail.com` is the email of the
    /// Google Chat user.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// A request to get group chat spaces based on user resources.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FindGroupChatsRequest {
    /// Optional. Resource names of all human users in group chat with the calling
    /// user. Chat apps can't be included in the request.
    ///
    /// The maximum number of users that can be specified in a single request is
    /// `49`.
    ///
    /// Format: `users/{user}`, where `{user}` is either the `id` for the
    /// [person](<https://developers.google.com/people/api/rest/v1/people>) from the
    /// People API, or the `id` for the
    /// [user](<https://developers.google.com/admin-sdk/directory/reference/rest/v1/users>)
    /// in the Directory API. For example, to find all group chats with the calling
    /// user and two other users, with People API profile IDs `123456789` and
    /// `987654321`, you can use `users/123456789` and `users/987654321`.
    /// You can also use the email as an alias for `{user}`. For example,
    /// `users/example@gmail.com` where `example@gmail.com` is the email of the
    /// Google Chat user.
    #[prost(string, repeated, tag = "5")]
    pub users: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Optional. The maximum number of spaces to return. The service might return
    /// fewer than this value.
    ///
    /// If unspecified, at most 10 spaces are returned.
    ///
    /// The maximum value is 30. If you use a value more than 30, it's
    /// automatically changed to 30.
    ///
    /// Negative values return an `INVALID_ARGUMENT` error.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous call to find group chats.
    /// Provide this parameter to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided should match the call that
    /// provided the token. Passing different values may lead to unexpected
    /// results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Requested space view type. If unset, defaults to
    /// `SPACE_VIEW_RESOURCE_NAME_ONLY`. Requests that specify
    /// `SPACE_VIEW_EXPANDED` must include scopes that allow reading space data,
    /// for example,
    /// <https://www.googleapis.com/auth/chat.spaces> or
    /// <https://www.googleapis.com/auth/chat.spaces.readonly.>
    #[prost(enumeration = "SpaceView", tag = "4")]
    pub space_view: i32,
}
/// A response containing group chat spaces with exactly the calling user and the
/// requested users.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindGroupChatsResponse {
    /// List of spaces in the requested (or first) page.
    #[prost(message, repeated, tag = "1")]
    pub spaces: ::prost::alloc::vec::Vec<Space>,
    /// A token that you can send as `pageToken` to retrieve the next page of
    /// results. If empty, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// A request to update a single space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateSpaceRequest {
    /// Required. Space with fields to be updated. `Space.name` must be
    /// populated in the form of `spaces/{space}`. Only fields
    /// specified by `update_mask` are updated.
    #[prost(message, optional, tag = "1")]
    pub space: ::core::option::Option<Space>,
    /// Required. The updated field paths, comma separated if there are
    /// multiple.
    ///
    /// You can update the following fields for a space:
    ///
    /// `space_details`: Updates the space's description and guidelines. You must
    /// pass both description and guidelines in the update request as
    /// \[`SpaceDetails`\]\[google.chat.v1.Space.SpaceDetails\]. If you only want to
    /// update one of the fields, pass the existing value for the other field.
    ///
    /// `display_name`: Only supports updating the display name for spaces where
    /// `spaceType` field is `SPACE`.
    /// If you receive the error message `ALREADY_EXISTS`, try a different
    /// value. An existing space within the
    /// Google Workspace organization might already use this display name.
    ///
    /// `space_type`: Only supports changing a `GROUP_CHAT` space type to
    /// `SPACE`. Include `display_name` together
    /// with `space_type` in the update mask and ensure that the specified space
    /// has a non-empty display name and the `SPACE` space type. Including the
    /// `space_type` mask and the `SPACE` type in the specified space when updating
    /// the display name is optional if the existing space already has the `SPACE`
    /// type. Trying to update the space type in other ways results in an invalid
    /// argument error.
    /// `space_type` is not supported with `useAdminAccess`.
    ///
    /// `space_history_state`: Updates [space history
    /// settings](<https://support.google.com/chat/answer/7664687>) by turning
    /// history on or off for the space. Only supported if history settings are
    /// enabled for the Google Workspace organization. To update the
    /// space history state, you must omit all other field masks in your request.
    /// `space_history_state` is not supported with `useAdminAccess`.
    ///
    /// `access_settings.audience`: Updates the [access
    /// setting](<https://support.google.com/chat/answer/11971020>) of who can
    /// discover the space, join the space, and preview the messages in named space
    /// where `spaceType` field is `SPACE`. If the existing space has a
    /// target audience, you can remove the audience and restrict space access by
    /// omitting a value for this field mask. To update access settings for a
    /// space, the authenticating user must be a space manager and omit all other
    /// field masks in your request. You can't update this field if the space is in
    /// [import
    /// mode](<https://developers.google.com/workspace/chat/import-data-overview>).
    /// To learn more, see [Make a space discoverable to specific
    /// users](<https://developers.google.com/workspace/chat/space-target-audience>).
    /// `access_settings.audience` is not supported with `useAdminAccess`.
    ///
    /// `permission_settings`: Supports changing the
    /// [permission settings](<https://support.google.com/chat/answer/13340792>)
    /// of a space.
    /// When updating permission settings, you can only specify
    /// `permissionSettings` field masks; you cannot update other field masks
    /// at the same time.
    /// The supported field masks include:
    ///
    /// * `permission_settings.manageMembersAndGroups`
    /// * `permission_settings.modifySpaceDetails`
    /// * `permission_settings.toggleHistory`
    /// * `permission_settings.useAtMentionAll`
    /// * `permission_settings.manageApps`
    /// * `permission_settings.manageWebhooks`
    /// * `permission_settings.replyMessages`
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires the `chat.admin.spaces` [OAuth 2.0
    /// scope](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    ///
    /// Some `FieldMask` values are not supported using admin access. For details,
    /// see the description of `update_mask`.
    #[prost(bool, tag = "3")]
    pub use_admin_access: bool,
}
/// Request to search for a list of spaces based on a query.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SearchSpacesRequest {
    /// When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires either the `chat.admin.spaces.readonly` or `chat.admin.spaces`
    /// [OAuth 2.0
    /// scope](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    ///
    /// This method currently only supports admin access, thus only `true` is
    /// accepted for this field.
    #[prost(bool, tag = "1")]
    pub use_admin_access: bool,
    /// The maximum number of spaces to return. The service may return fewer than
    /// this value.
    ///
    /// If unspecified, at most 100 spaces are returned.
    ///
    /// The maximum value is 1000. If you use a value more than 1000, it's
    /// automatically changed to 1000.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// A token, received from the previous search spaces call. Provide this
    /// parameter to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided should match the call that
    /// provided the page token. Passing different values to the other parameters
    /// might lead to unexpected results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Required. A search query.
    ///
    /// You can search by using the following parameters:
    ///
    /// * `create_time`
    /// * `customer`
    /// * `display_name`
    /// * `external_user_allowed`
    /// * `last_active_time`
    /// * `space_history_state`
    /// * `space_type`
    ///
    /// `create_time` and `last_active_time` accept a timestamp in
    /// [RFC-3339](<https://www.rfc-editor.org/rfc/rfc3339>) format and the supported
    /// comparison operators are: `=`, `<`, `>`, `<=`, `>=`.
    ///
    /// `customer` is required and is used to indicate which customer
    /// to fetch spaces from. `customers/my_customer` is the only supported value.
    ///
    /// `display_name` only accepts the `HAS` (`:`) operator. The text to
    /// match is first tokenized into tokens and each token is prefix-matched
    /// case-insensitively and independently as a substring anywhere in the space's
    /// `display_name`. For example, `Fun Eve` matches `Fun event` or `The  evening was fun`, but not `notFun event` or `even`.
    ///
    /// `external_user_allowed` accepts either `true` or `false`.
    ///
    /// `space_history_state` only accepts values from the \[`historyState`\]
    /// (<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#Space.HistoryState>)
    /// field of a `space` resource.
    ///
    /// `space_type` is required and the only valid value is `SPACE`.
    ///
    /// Across different fields, only `AND` operators are supported. A valid
    /// example is `space_type = "SPACE" AND display_name:"Hello"` and an invalid
    /// example is `space_type = "SPACE" OR display_name:"Hello"`.
    ///
    /// Among the same field,
    /// `space_type` doesn't support `AND` or `OR` operators.
    /// `display_name`, 'space_history_state', and 'external_user_allowed' only
    /// support `OR` operators.
    /// `last_active_time` and `create_time` support both `AND` and `OR` operators.
    /// `AND` can only be used to represent an interval, such as `last_active_time  < "2022-01-01T00:00:00+00:00" AND last_active_time >  "2023-01-01T00:00:00+00:00"`.
    ///
    /// The following example queries are valid:
    ///
    /// ```text,
    /// customer = "customers/my_customer" AND space_type = "SPACE"
    ///
    /// customer = "customers/my_customer" AND space_type = "SPACE" AND
    /// display_name:"Hello World"
    ///
    /// customer = "customers/my_customer" AND space_type = "SPACE" AND
    /// (last_active_time < "2020-01-01T00:00:00+00:00" OR last_active_time >
    /// "2022-01-01T00:00:00+00:00")
    ///
    /// customer = "customers/my_customer" AND space_type = "SPACE" AND
    /// (display_name:"Hello World" OR display_name:"Fun event") AND
    /// (last_active_time > "2020-01-01T00:00:00+00:00" AND last_active_time <
    /// "2022-01-01T00:00:00+00:00")
    ///
    /// customer = "customers/my_customer" AND space_type = "SPACE" AND
    /// (create_time > "2019-01-01T00:00:00+00:00" AND create_time <
    /// "2020-01-01T00:00:00+00:00") AND (external_user_allowed = "true") AND
    /// (space_history_state = "HISTORY_ON" OR space_history_state = "HISTORY_OFF")
    /// ```
    #[prost(string, tag = "4")]
    pub query: ::prost::alloc::string::String,
    /// Optional. How the list of spaces is ordered.
    ///
    /// Supported attributes to order by are:
    ///
    /// * `membership_count.joined_direct_human_user_count` — Denotes the count of
    ///   human users that have directly joined a space.
    /// * `last_active_time` — Denotes the time when last eligible item is added to
    ///   any topic of this space.
    /// * `create_time` — Denotes the time of the space creation.
    ///
    /// Valid ordering operation values are:
    ///
    /// * `ASC` for ascending. Default value.
    ///
    /// * `DESC` for descending.
    ///
    /// The supported syntax are:
    ///
    /// * `membership_count.joined_direct_human_user_count DESC`
    /// * `membership_count.joined_direct_human_user_count ASC`
    /// * `last_active_time DESC`
    /// * `last_active_time ASC`
    /// * `create_time DESC`
    /// * `create_time ASC`
    #[prost(string, tag = "5")]
    pub order_by: ::prost::alloc::string::String,
}
/// Response with a list of spaces corresponding to the search spaces request.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSpacesResponse {
    /// A page of the requested spaces.
    #[prost(message, repeated, tag = "1")]
    pub spaces: ::prost::alloc::vec::Vec<Space>,
    /// A token that can be used to retrieve the next page. If this field is empty,
    /// there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
    /// The total number of spaces that match the query, across all pages. If the
    /// result is over 10,000 spaces, this value is an estimate.
    #[prost(int32, tag = "3")]
    pub total_size: i32,
}
/// Request for deleting a space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteSpaceRequest {
    /// Required. Resource name of the space to delete.
    ///
    /// Format: `spaces/{space}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. When `true`, the method runs using the user's Google Workspace
    /// administrator privileges.
    ///
    /// The calling user must be a Google Workspace administrator with the
    /// [manage chat and spaces conversations
    /// privilege](<https://support.google.com/a/answer/13369245>).
    ///
    /// Requires the `chat.admin.delete` [OAuth 2.0
    /// scope](<https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes>).
    #[prost(bool, tag = "2")]
    pub use_admin_access: bool,
}
/// Request message for completing the import process for a space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CompleteImportSpaceRequest {
    /// Required. Resource name of the import mode space.
    ///
    /// Format: `spaces/{space}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Response message for completing the import process for a space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CompleteImportSpaceResponse {
    /// The import mode space.
    #[prost(message, optional, tag = "1")]
    pub space: ::core::option::Option<Space>,
}
/// A view that specifies which fields should be populated on the
/// [`Space`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces>)
/// resource.
/// To ensure compatibility with future releases, we recommend that your code
/// account for additional values.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SpaceView {
    /// The default / unset value.
    Unspecified = 0,
    /// Populates only the Space resource name.
    ResourceNameOnly = 3,
    /// Populates Space resource fields.  Note: the `permissionSettings` field
    /// will not be populated.
    /// Requests that specify SPACE_VIEW_EXPANDED must include scopes that allow
    /// reading space data, for example,
    /// <https://www.googleapis.com/auth/chat.spaces> or
    /// <https://www.googleapis.com/auth/chat.spaces.readonly.>
    Expanded = 4,
}
impl SpaceView {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "SPACE_VIEW_UNSPECIFIED",
            Self::ResourceNameOnly => "SPACE_VIEW_RESOURCE_NAME_ONLY",
            Self::Expanded => "SPACE_VIEW_EXPANDED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "SPACE_VIEW_UNSPECIFIED" => Some(Self::Unspecified),
            "SPACE_VIEW_RESOURCE_NAME_ONLY" => Some(Self::ResourceNameOnly),
            "SPACE_VIEW_EXPANDED" => Some(Self::Expanded),
            _ => None,
        }
    }
}
/// A message in a Google Chat space.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
    /// Identifier. Resource name of the message.
    ///
    /// Format: `spaces/{space}/messages/{message}`
    ///
    /// Where `{space}` is the ID of the space where the message is posted and
    /// `{message}` is a system-assigned ID for the message. For example,
    /// `spaces/AAAAAAAAAAA/messages/BBBBBBBBBBB.BBBBBBBBBBB`.
    ///
    /// If you set a custom ID when you create a message, you can use this ID to
    /// specify the message in a request by replacing `{message}` with the value
    /// from the `clientAssignedMessageId` field. For example,
    /// `spaces/AAAAAAAAAAA/messages/client-custom-name`. For details, see [Name
    /// a
    /// message](<https://developers.google.com/workspace/chat/create-messages#name_a_created_message>).
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Output only. The user who created the message.
    /// If your Chat app [authenticates as a
    /// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
    /// the output populates the
    /// [user](<https://developers.google.com/workspace/chat/api/reference/rest/v1/User>)
    /// `name` and `type`.
    #[prost(message, optional, tag = "2")]
    pub sender: ::core::option::Option<User>,
    /// Optional. Immutable. For spaces created in Chat, the time at which the
    /// message was created. This field is output only, except when used in import
    /// mode spaces.
    ///
    /// For import mode spaces, set this field to the historical timestamp at which
    /// the message was created in the source in order to preserve the original
    /// creation time.
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time at which the message was last edited by a user. If
    /// the message has never been edited, this field is empty.
    #[prost(message, optional, tag = "23")]
    pub last_update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Output only. The time at which the message was deleted in
    /// Google Chat. If the message is never deleted, this field is empty.
    #[prost(message, optional, tag = "26")]
    pub delete_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Optional. Plain-text body of the message. The first link to an image,
    /// video, or web page generates a [preview
    /// chip](<https://developers.google.com/workspace/chat/preview-links>). You can
    /// also [@mention a Google Chat
    /// user](<https://developers.google.com/workspace/chat/format-messages#messages-@mention>),
    /// or everyone in the space.
    ///
    /// To learn about creating text messages, see [Send a
    /// message](<https://developers.google.com/workspace/chat/create-messages>).
    #[prost(string, tag = "4")]
    pub text: ::prost::alloc::string::String,
    /// Output only. Contains the message `text` with markups added to communicate
    /// formatting. This field might not capture all formatting visible in the UI,
    /// but includes the following:
    ///
    /// * [Markup
    ///   syntax](<https://developers.google.com/workspace/chat/format-messages>)
    ///   for bold, italic, strikethrough, monospace, monospace block, and bulleted
    ///   list.
    ///
    /// * [User
    ///   mentions](<https://developers.google.com/workspace/chat/format-messages#messages-@mention>)
    ///   using the format `<users/{user}>`.
    ///
    /// * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the
    ///   first string is the URL and the second is the rendered text—for example,
    ///   `<<http://example.com|custom> text>`.
    ///
    /// * Custom emoji using the format `:{emoji_name}:`—for example, `:smile:`.
    ///   This doesn't apply to Unicode emoji, such as `U+1F600` for a grinning
    ///   face emoji.
    ///
    /// * Bullet list items using asterisks (`*`)—for example, `* item`.
    ///
    /// For more information, see [View text formatting sent in a
    /// message](<https://developers.google.com/workspace/chat/format-messages#view_text_formatting_sent_in_a_message>)
    #[prost(string, tag = "43")]
    pub formatted_text: ::prost::alloc::string::String,
    /// Deprecated: Use `cards_v2` instead.
    ///
    /// Rich, formatted, and interactive cards that you can use to display UI
    /// elements such as: formatted texts, buttons, and clickable images. Cards are
    /// normally displayed below the plain-text body of the message. `cards` and
    /// `cards_v2` can have a maximum size of 32 KB.
    #[deprecated]
    #[prost(message, repeated, tag = "5")]
    pub cards: ::prost::alloc::vec::Vec<contextual_add_on_markup::Card>,
    /// Optional. An array of
    /// [cards](<https://developers.google.com/workspace/chat/api/reference/rest/v1/cards>).
    ///
    /// Only Chat apps can create cards. If your Chat app [authenticates as a
    /// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
    /// the messages can't contain cards.
    ///
    /// To learn how to create a message that contains cards, see [Send a
    /// message](<https://developers.google.com/workspace/chat/create-messages>).
    ///
    /// [Card builder](<https://addons.gsuite.google.com/uikit/builder>)
    #[prost(message, repeated, tag = "22")]
    pub cards_v2: ::prost::alloc::vec::Vec<CardWithId>,
    /// Output only. Annotations can be associated with the plain-text body of the
    /// message or with chips that link to Google Workspace resources like Google
    /// Docs or Sheets with `start_index` and `length` of 0.
    #[prost(message, repeated, tag = "10")]
    pub annotations: ::prost::alloc::vec::Vec<Annotation>,
    /// The thread the message belongs to. For example usage, see
    /// [Start or reply to a message
    /// thread](<https://developers.google.com/workspace/chat/create-messages#create-message-thread>).
    #[prost(message, optional, tag = "11")]
    pub thread: ::core::option::Option<Thread>,
    /// Output only. If your Chat app [authenticates as a
    /// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
    /// the output only populates the
    /// [space](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces>)
    /// `name`.
    #[prost(message, optional, tag = "12")]
    pub space: ::core::option::Option<Space>,
    /// Optional. A plain-text description of the message's cards, used when the
    /// actual cards can't be displayed—for example, mobile notifications.
    #[prost(string, tag = "13")]
    pub fallback_text: ::prost::alloc::string::String,
    /// Input only. Parameters that a Chat app can use to configure how its
    /// response is posted.
    #[prost(message, optional, tag = "14")]
    pub action_response: ::core::option::Option<ActionResponse>,
    /// Output only. Plain-text body of the message with all Chat app mentions
    /// stripped out.
    #[prost(string, tag = "15")]
    pub argument_text: ::prost::alloc::string::String,
    /// Output only. Slash command information, if applicable.
    #[prost(message, optional, tag = "17")]
    pub slash_command: ::core::option::Option<SlashCommand>,
    /// Optional. User-uploaded attachment.
    #[prost(message, repeated, tag = "18")]
    pub attachment: ::prost::alloc::vec::Vec<Attachment>,
    /// Output only. A URL in `spaces.messages.text` that matches a link preview
    /// pattern. For more information, see [Preview
    /// links](<https://developers.google.com/workspace/chat/preview-links>).
    #[prost(message, optional, tag = "20")]
    pub matched_url: ::core::option::Option<MatchedUrl>,
    /// Output only. When `true`, the message is a response in a reply thread. When
    /// `false`, the message is visible in the space's top-level conversation as
    /// either the first message of a thread or a message with no threaded replies.
    ///
    /// If the space doesn't support reply in threads, this field is always
    /// `false`.
    #[prost(bool, tag = "25")]
    pub thread_reply: bool,
    /// Optional. A custom ID for the message. You can use field to identify a
    /// message, or to get, delete, or update a message. To set a custom ID,
    /// specify the
    /// [`messageId`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#body.QUERY_PARAMETERS.message_id>)
    /// field when you create the message. For details, see [Name a
    /// message](<https://developers.google.com/workspace/chat/create-messages#name_a_created_message>).
    #[prost(string, tag = "32")]
    pub client_assigned_message_id: ::prost::alloc::string::String,
    /// Output only. The list of emoji reaction summaries on the message.
    #[prost(message, repeated, tag = "33")]
    pub emoji_reaction_summaries: ::prost::alloc::vec::Vec<EmojiReactionSummary>,
    /// Optional. Immutable. Input for creating a message, otherwise output only.
    /// The user that can view the message. When set, the message is private and
    /// only visible to the specified user and the Chat app. To include this field
    /// in your request, you must call the Chat API using [app
    /// authentication](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>)
    /// and omit the following:
    ///
    /// * [Attachments](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments>)
    ///
    /// For details, see [Send a message
    /// privately](<https://developers.google.com/workspace/chat/create-messages#private>).
    #[prost(message, optional, tag = "36")]
    pub private_message_viewer: ::core::option::Option<User>,
    /// Output only. Information about a deleted message. A message is deleted when
    /// `delete_time` is set.
    #[prost(message, optional, tag = "38")]
    pub deletion_metadata: ::core::option::Option<DeletionMetadata>,
    /// Optional. Information about a message that another message quotes.
    ///
    /// When you create a message, you can quote messages within the same
    /// thread, or quote a root message to create a new root message.
    /// However, you can't quote a message reply from a different thread.
    ///
    /// When you update a message, you can't add or replace the
    /// `quotedMessageMetadata` field, but you can remove it.
    ///
    /// For example usage, see [Quote another
    /// message](<https://developers.google.com/workspace/chat/create-messages#quote-a-message>).
    #[prost(message, optional, tag = "39")]
    pub quoted_message_metadata: ::core::option::Option<QuotedMessageMetadata>,
    /// Output only. GIF images that are attached to the message.
    #[prost(message, repeated, tag = "42")]
    pub attached_gifs: ::prost::alloc::vec::Vec<AttachedGif>,
    /// Optional. One or more interactive widgets that appear at the bottom of a
    /// message. You can add accessory widgets to messages that contain text,
    /// cards, or both text and cards. Not supported for messages that contain
    /// dialogs. For details, see [Add interactive widgets at the bottom of a
    /// message](<https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets>).
    ///
    /// Creating a message with accessory widgets requires \[app
    /// authentication\]
    /// (<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>).
    #[prost(message, repeated, tag = "44")]
    pub accessory_widgets: ::prost::alloc::vec::Vec<AccessoryWidget>,
}
/// A GIF image that's specified by a URL.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct AttachedGif {
    /// Output only. The URL that hosts the GIF image.
    #[prost(string, tag = "1")]
    pub uri: ::prost::alloc::string::String,
}
/// Information about a message that another message quotes.
///
/// When you create a message, you can quote messages within the same
/// thread, or quote a root message to create a new root message.
/// However, you can't quote a message reply from a different thread.
///
/// When you update a message, you can't add or replace the
/// `quotedMessageMetadata` field, but you can remove it.
///
/// For example usage, see [Quote another
/// message](<https://developers.google.com/workspace/chat/create-messages#quote-a-message>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuotedMessageMetadata {
    /// Required. Resource name of the message that is quoted.
    ///
    /// Format: `spaces/{space}/messages/{message}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The timestamp when the quoted message was created or when the
    /// quoted message was last updated.
    ///
    /// If the message was edited, use this field, `last_update_time`.
    /// If the message was never edited, use `create_time`.
    ///
    /// If `last_update_time` doesn't match the latest version of the quoted
    /// message, the request fails.
    #[prost(message, optional, tag = "2")]
    pub last_update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Optional. Specifies the quote type. If not set, defaults to REPLY in the
    /// message read/write path for backward compatibility.
    #[prost(enumeration = "quoted_message_metadata::QuoteType", tag = "4")]
    pub quote_type: i32,
    /// Output only. A snapshot of the quoted message's content.
    #[prost(message, optional, tag = "5")]
    pub quoted_message_snapshot: ::core::option::Option<QuotedMessageSnapshot>,
    /// Output only. Metadata about the source space of the quoted message.
    /// Populated only for FORWARD quote type.
    #[prost(message, optional, tag = "6")]
    pub forwarded_metadata: ::core::option::Option<ForwardedMetadata>,
}
/// Nested message and enum types in `QuotedMessageMetadata`.
pub mod quoted_message_metadata {
    /// The quote type of the quoted message.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum QuoteType {
        /// Reserved. This value is unused.
        Unspecified = 0,
        /// If quote_type is `REPLY`, you can do the following:
        ///
        /// * If you're replying in a thread, you can quote another message in that
        ///   thread.
        ///
        /// * If you're creating a root message, you can quote another root message
        ///   in that space.
        ///
        /// You can't quote a message reply from a different thread.
        Reply = 1,
    }
    impl QuoteType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "QUOTE_TYPE_UNSPECIFIED",
                Self::Reply => "REPLY",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "QUOTE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "REPLY" => Some(Self::Reply),
                _ => None,
            }
        }
    }
}
/// Provides a snapshot of the content of the quoted message at the time of
/// quoting or forwarding
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuotedMessageSnapshot {
    /// Output only. The quoted message's author name.
    /// Populated for both REPLY & FORWARD quote types.
    #[prost(string, tag = "1")]
    pub sender: ::prost::alloc::string::String,
    /// Output only. Snapshot of the quoted message's text content.
    #[prost(string, tag = "2")]
    pub text: ::prost::alloc::string::String,
    /// Output only. Contains the quoted message `text` with markups added to
    /// support rich formatting like hyperlinks,custom emojis, markup, etc.
    /// Populated only for FORWARD quote type.
    #[prost(string, tag = "3")]
    pub formatted_text: ::prost::alloc::string::String,
    /// Output only. Annotations parsed from the text body of the quoted message.
    /// Populated only for FORWARD quote type.
    #[prost(message, repeated, tag = "4")]
    pub annotations: ::prost::alloc::vec::Vec<Annotation>,
    /// Output only. Attachments that were part of the quoted message. These are
    /// copies of the quoted message's attachment metadata. Populated only for
    /// FORWARD quote type.
    #[prost(message, repeated, tag = "5")]
    pub attachments: ::prost::alloc::vec::Vec<Attachment>,
}
/// Metadata about the source space from which a message was forwarded.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ForwardedMetadata {
    /// Output only. The resource name of the source space.
    /// Format: spaces/{space}
    #[prost(string, tag = "1")]
    pub space: ::prost::alloc::string::String,
    /// Output only. The display name of the source space or DM at the time of
    /// forwarding. For `SPACE`, this is the space name. For `DIRECT_MESSAGE`, this
    /// is the other participant's name (e.g., "User A"). For `GROUP_CHAT`, this is
    /// a generated name based on members' first names, limited to 5 including the
    /// creator (e.g., "User A, User B").
    #[prost(string, tag = "2")]
    pub space_display_name: ::prost::alloc::string::String,
}
/// A thread in a Google Chat space. For example usage, see
/// [Start or reply to a message
/// thread](<https://developers.google.com/workspace/chat/create-messages#create-message-thread>).
///
/// If you specify a thread when creating a message, you can set the
/// [`messageReplyOption`](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages/create#messagereplyoption>)
/// field to determine what happens if no matching thread is found.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Thread {
    /// Identifier. Resource name of the thread.
    ///
    /// Example: `spaces/{space}/threads/{thread}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. Input for creating or updating a thread. Otherwise, output only.
    /// ID for the thread. Supports up to 4000 characters.
    ///
    /// This ID is unique to the Chat app that sets it. For example, if
    /// multiple Chat apps create a message using the same thread key,
    /// the messages are posted in different threads. To reply in a
    /// thread created by a person or another Chat app, specify the thread `name`
    /// field instead.
    #[prost(string, tag = "3")]
    pub thread_key: ::prost::alloc::string::String,
}
/// Parameters that a Chat app can use to configure how its response is posted.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ActionResponse {
    /// Input only. The type of Chat app response.
    #[prost(enumeration = "action_response::ResponseType", tag = "1")]
    pub r#type: i32,
    /// Input only. URL for users to authenticate or configure. (Only for
    /// `REQUEST_CONFIG` response types.)
    #[prost(string, tag = "2")]
    pub url: ::prost::alloc::string::String,
    /// Input only. A response to an interaction event related to a
    /// [dialog](<https://developers.google.com/workspace/chat/dialogs>). Must be
    /// accompanied by `ResponseType.Dialog`.
    #[prost(message, optional, tag = "3")]
    pub dialog_action: ::core::option::Option<DialogAction>,
    /// Input only. The response of the updated widget.
    #[prost(message, optional, tag = "4")]
    pub updated_widget: ::core::option::Option<action_response::UpdatedWidget>,
}
/// Nested message and enum types in `ActionResponse`.
pub mod action_response {
    /// List of widget autocomplete results.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct SelectionItems {
        /// An array of the SelectionItem objects.
        #[prost(message, repeated, tag = "1")]
        pub items: ::prost::alloc::vec::Vec<
            super::super::super::apps::card::v1::selection_input::SelectionItem,
        >,
    }
    /// For `selectionInput` widgets, returns autocomplete suggestions for a
    /// multiselect menu.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct UpdatedWidget {
        /// The ID of the updated widget. The ID must match the one for the
        /// widget that triggered the update request.
        #[prost(string, tag = "2")]
        pub widget: ::prost::alloc::string::String,
        /// The widget updated in response to a user action.
        #[prost(oneof = "updated_widget::UpdatedWidget", tags = "1")]
        pub updated_widget: ::core::option::Option<updated_widget::UpdatedWidget>,
    }
    /// Nested message and enum types in `UpdatedWidget`.
    pub mod updated_widget {
        /// The widget updated in response to a user action.
        #[derive(Clone, PartialEq, ::prost::Oneof)]
        pub enum UpdatedWidget {
            /// List of widget autocomplete results
            #[prost(message, tag = "1")]
            Suggestions(super::SelectionItems),
        }
    }
    /// The type of Chat app response.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ResponseType {
        /// Default type that's handled as `NEW_MESSAGE`.
        TypeUnspecified = 0,
        /// Post as a new message in the topic.
        NewMessage = 1,
        /// Update the Chat app's message. This is only permitted on a `CARD_CLICKED`
        /// event where the message sender type is `BOT`.
        UpdateMessage = 2,
        /// Update the cards on a user's message. This is only permitted as a
        /// response to a `MESSAGE` event with a matched url, or a `CARD_CLICKED`
        /// event where the message sender type is `HUMAN`. Text is ignored.
        UpdateUserMessageCards = 6,
        /// Privately ask the user for additional authentication or configuration.
        RequestConfig = 3,
        /// Presents a
        /// [dialog](<https://developers.google.com/workspace/chat/dialogs>).
        Dialog = 4,
        /// Widget text autocomplete options query.
        UpdateWidget = 7,
    }
    impl ResponseType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::TypeUnspecified => "TYPE_UNSPECIFIED",
                Self::NewMessage => "NEW_MESSAGE",
                Self::UpdateMessage => "UPDATE_MESSAGE",
                Self::UpdateUserMessageCards => "UPDATE_USER_MESSAGE_CARDS",
                Self::RequestConfig => "REQUEST_CONFIG",
                Self::Dialog => "DIALOG",
                Self::UpdateWidget => "UPDATE_WIDGET",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
                "NEW_MESSAGE" => Some(Self::NewMessage),
                "UPDATE_MESSAGE" => Some(Self::UpdateMessage),
                "UPDATE_USER_MESSAGE_CARDS" => Some(Self::UpdateUserMessageCards),
                "REQUEST_CONFIG" => Some(Self::RequestConfig),
                "DIALOG" => Some(Self::Dialog),
                "UPDATE_WIDGET" => Some(Self::UpdateWidget),
                _ => None,
            }
        }
    }
}
/// One or more interactive widgets that appear at the bottom of a message. For
/// details, see [Add interactive widgets at the bottom of a
/// message](<https://developers.google.com/workspace/chat/create-messages#add-accessory-widgets>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccessoryWidget {
    /// The type of action.
    #[prost(oneof = "accessory_widget::Action", tags = "1")]
    pub action: ::core::option::Option<accessory_widget::Action>,
}
/// Nested message and enum types in `AccessoryWidget`.
pub mod accessory_widget {
    /// The type of action.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Action {
        /// A list of buttons.
        #[prost(message, tag = "1")]
        ButtonList(super::super::super::apps::card::v1::ButtonList),
    }
}
/// Request to get a message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetMessageRequest {
    /// Required. Resource name of the message.
    ///
    /// Format: `spaces/{space}/messages/{message}`
    ///
    /// If you've set a custom ID for your message, you can use the value from the
    /// `clientAssignedMessageId` field for `{message}`. For details, see \[Name a
    /// message\]
    /// (<https://developers.google.com/workspace/chat/create-messages#name_a_created_message>).
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request to delete a message.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteMessageRequest {
    /// Required. Resource name of the message.
    ///
    /// Format: `spaces/{space}/messages/{message}`
    ///
    /// If you've set a custom ID for your message, you can use the value from the
    /// `clientAssignedMessageId` field for `{message}`. For details, see \[Name a
    /// message\]
    /// (<https://developers.google.com/workspace/chat/create-messages#name_a_created_message>).
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. When `true`, deleting a message also deletes its threaded
    /// replies. When `false`, if a message has threaded replies, deletion fails.
    ///
    /// Only applies when [authenticating as a
    /// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>).
    /// Has no effect when \[authenticating as a Chat app\]
    /// (<https://developers.google.com/workspace/chat/authenticate-authorize-chat-app>).
    #[prost(bool, tag = "2")]
    pub force: bool,
}
/// Request to update a message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateMessageRequest {
    /// Required. Message with fields updated.
    #[prost(message, optional, tag = "1")]
    pub message: ::core::option::Option<Message>,
    /// Required. The field paths to update. Separate multiple values with commas
    /// or use `*` to update all field paths.
    ///
    /// Currently supported field paths:
    ///
    /// * `text`
    ///
    /// * `attachment`
    ///
    /// * `cards` (Requires [app
    ///   authentication](/chat/api/guides/auth/service-accounts).)
    ///
    /// * `cards_v2`  (Requires [app
    ///   authentication](/chat/api/guides/auth/service-accounts).)
    ///
    /// * `accessory_widgets`  (Requires [app
    ///   authentication](/chat/api/guides/auth/service-accounts).)
    ///
    /// * `quoted_message_metadata` (Only allows removal of the quoted message.)
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Optional. If `true` and the message isn't found, a new message is created
    /// and `updateMask` is ignored. The specified message ID must be
    /// [client-assigned](<https://developers.google.com/workspace/chat/create-messages#name_a_created_message>)
    /// or the request fails.
    #[prost(bool, tag = "4")]
    pub allow_missing: bool,
}
/// Creates a message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateMessageRequest {
    /// Required. The resource name of the space in which to create a message.
    ///
    /// Format: `spaces/{space}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. Message body.
    #[prost(message, optional, tag = "4")]
    pub message: ::core::option::Option<Message>,
    /// Optional. Deprecated: Use
    /// \[thread.thread_key\]\[google.chat.v1.Thread.thread_key\] instead. ID for the
    /// thread. Supports up to 4000 characters. To start or add to a thread, create
    /// a message and specify a `threadKey` or the
    /// \[thread.name\]\[google.chat.v1.Thread.name\]. For example usage, see [Start or
    /// reply to a message
    /// thread](<https://developers.google.com/workspace/chat/create-messages#create-message-thread>).
    #[deprecated]
    #[prost(string, tag = "6")]
    pub thread_key: ::prost::alloc::string::String,
    /// Optional. A unique request ID for this message. Specifying an existing
    /// request ID returns the message created with that ID instead of creating a
    /// new message.
    #[prost(string, tag = "7")]
    pub request_id: ::prost::alloc::string::String,
    /// Optional. Specifies whether a message starts a thread or replies to one.
    /// Only supported in named spaces.
    ///
    /// When [responding to user
    /// interactions](<https://developers.google.com/workspace/chat/receive-respond-interactions>),
    /// this field is ignored. For interactions within a thread, the reply is
    /// created in the same thread. Otherwise, the reply is created as a new
    /// thread.
    #[prost(enumeration = "create_message_request::MessageReplyOption", tag = "8")]
    pub message_reply_option: i32,
    /// Optional. A custom ID for a message. Lets Chat apps get, update, or delete
    /// a message without needing to store the system-assigned ID in the message's
    /// resource name (represented in the message `name` field).
    ///
    /// The value for this field must meet the following requirements:
    ///
    /// * Begins with `client-`. For example, `client-custom-name` is a valid
    ///   custom ID, but `custom-name` is not.
    /// * Contains up to 63 characters and only lowercase letters, numbers, and
    ///   hyphens.
    /// * Is unique within a space. A Chat app can't use the same custom ID for
    ///   different messages.
    ///
    /// For details, see [Name a
    /// message](<https://developers.google.com/workspace/chat/create-messages#name_a_created_message>).
    #[prost(string, tag = "9")]
    pub message_id: ::prost::alloc::string::String,
}
/// Nested message and enum types in `CreateMessageRequest`.
pub mod create_message_request {
    /// Specifies how to reply to a message.
    /// More states might be added in the future.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum MessageReplyOption {
        /// Default. Starts a new thread. Using this option ignores any \[thread
        /// ID\]\[google.chat.v1.Thread.name\] or
        /// \[`thread_key`\]\[google.chat.v1.Thread.thread_key\] that's included.
        Unspecified = 0,
        /// Creates the message as a reply to the thread specified by \[thread
        /// ID\]\[google.chat.v1.Thread.name\] or
        /// \[`thread_key`\]\[google.chat.v1.Thread.thread_key\]. If it fails, the
        /// message starts a new thread instead.
        ReplyMessageFallbackToNewThread = 1,
        /// Creates the message as a reply to the thread specified by \[thread
        /// ID\]\[google.chat.v1.Thread.name\] or
        /// \[`thread_key`\]\[google.chat.v1.Thread.thread_key\]. If a new `thread_key`
        /// is used, a new thread is created. If the message creation fails, a
        /// `NOT_FOUND` error is returned instead.
        ReplyMessageOrFail = 2,
    }
    impl MessageReplyOption {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "MESSAGE_REPLY_OPTION_UNSPECIFIED",
                Self::ReplyMessageFallbackToNewThread => {
                    "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD"
                }
                Self::ReplyMessageOrFail => "REPLY_MESSAGE_OR_FAIL",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "MESSAGE_REPLY_OPTION_UNSPECIFIED" => Some(Self::Unspecified),
                "REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD" => {
                    Some(Self::ReplyMessageFallbackToNewThread)
                }
                "REPLY_MESSAGE_OR_FAIL" => Some(Self::ReplyMessageOrFail),
                _ => None,
            }
        }
    }
}
/// Lists messages in the specified space, that the user is a member of.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListMessagesRequest {
    /// Required. The resource name of the space to list messages from.
    ///
    /// Format: `spaces/{space}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of messages returned. The service might return
    /// fewer messages than this value.
    ///
    /// If unspecified, at most 25 are returned.
    ///
    /// The maximum value is 1000. If you use a value more than 1000, it's
    /// automatically changed to 1000.
    ///
    /// Negative values return an `INVALID_ARGUMENT` error.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token received from a previous list messages call. Provide
    /// this parameter to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided should match the call that
    /// provided the page token. Passing different values to the other parameters
    /// might lead to unexpected results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Optional. A query filter.
    ///
    /// You can filter messages by date (`create_time`) and thread (`thread.name`).
    ///
    /// To filter messages by the date they were created, specify the `create_time`
    /// with a timestamp in [RFC-3339](<https://www.rfc-editor.org/rfc/rfc3339>)
    /// format and double quotation marks. For example,
    /// `"2023-04-21T11:30:00-04:00"`. You can use the greater than operator `>` to
    /// list messages that were created after a timestamp, or the less than
    /// operator `<` to list messages that were created before a timestamp. To
    /// filter messages within a time interval, use the `AND` operator between two
    /// timestamps.
    ///
    /// To filter by thread, specify the `thread.name`, formatted as
    /// `spaces/{space}/threads/{thread}`. You can only specify one
    /// `thread.name` per query.
    ///
    /// To filter by both thread and date, use the `AND` operator in your query.
    ///
    /// For example, the following queries are valid:
    ///
    /// ```text,
    /// create_time > "2012-04-21T11:30:00-04:00"
    ///
    /// create_time > "2012-04-21T11:30:00-04:00" AND
    ///   thread.name = spaces/AAAAAAAAAAA/threads/123
    ///
    /// create_time > "2012-04-21T11:30:00+00:00" AND
    ///
    /// create_time < "2013-01-01T00:00:00+00:00" AND
    ///   thread.name = spaces/AAAAAAAAAAA/threads/123
    ///
    /// thread.name = spaces/AAAAAAAAAAA/threads/123
    /// ```
    ///
    /// Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
    /// error.
    #[prost(string, tag = "4")]
    pub filter: ::prost::alloc::string::String,
    /// Optional. How the list of messages is ordered. Specify a value to order by
    /// an ordering operation. Valid ordering operation values are as follows:
    ///
    /// * `ASC` for ascending.
    ///
    /// * `DESC` for descending.
    ///
    /// The default ordering is `create_time ASC`.
    #[prost(string, tag = "5")]
    pub order_by: ::prost::alloc::string::String,
    /// Optional. Whether to include deleted messages. Deleted messages include
    /// deleted time and metadata about their deletion, but message content is
    /// unavailable.
    #[prost(bool, tag = "6")]
    pub show_deleted: bool,
}
/// Response message for listing messages.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListMessagesResponse {
    /// List of messages.
    #[prost(message, repeated, tag = "1")]
    pub messages: ::prost::alloc::vec::Vec<Message>,
    /// You can send a token as `pageToken` to retrieve the next page of
    /// results. If empty, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Contains a
/// [dialog](<https://developers.google.com/workspace/chat/dialogs>) and request
/// status code.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DialogAction {
    /// Input only. Status for a request to either invoke or submit a
    /// [dialog](<https://developers.google.com/workspace/chat/dialogs>). Displays
    /// a status and message to users, if necessary.
    /// For example, in case of an error or success.
    #[prost(message, optional, tag = "2")]
    pub action_status: ::core::option::Option<ActionStatus>,
    /// Action to perform.
    #[prost(oneof = "dialog_action::Action", tags = "1")]
    pub action: ::core::option::Option<dialog_action::Action>,
}
/// Nested message and enum types in `DialogAction`.
pub mod dialog_action {
    /// Action to perform.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Action {
        /// Input only.
        /// [Dialog](<https://developers.google.com/workspace/chat/dialogs>) for the
        /// request.
        #[prost(message, tag = "1")]
        Dialog(super::Dialog),
    }
}
/// Wrapper around the card body of the dialog.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Dialog {
    /// Input only. Body of the dialog, which is rendered in a modal.
    /// Google Chat apps don't support the following card entities:
    /// `DateTimePicker`, `OnChangeAction`.
    #[prost(message, optional, tag = "1")]
    pub body: ::core::option::Option<super::super::apps::card::v1::Card>,
}
/// A
/// [card](<https://developers.google.com/workspace/chat/api/reference/rest/v1/cards>)
/// in a Google Chat message.
///
/// Only Chat apps can create cards. If your Chat app [authenticates as a
/// user](<https://developers.google.com/workspace/chat/authenticate-authorize-chat-user>),
/// the message can't contain cards.
///
/// [Card builder](<https://addons.gsuite.google.com/uikit/builder>)
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CardWithId {
    /// Required if the message contains multiple cards. A unique identifier for
    /// a card in a message.
    #[prost(string, tag = "1")]
    pub card_id: ::prost::alloc::string::String,
    /// A card. Maximum size is 32 KB.
    #[prost(message, optional, tag = "2")]
    pub card: ::core::option::Option<super::super::apps::card::v1::Card>,
}
/// Represents a [section](<https://support.google.com/chat/answer/16059854>) in
/// Google Chat. Sections help users organize their spaces. There are two types
/// of sections:
///
/// 1. **System Sections:** These are predefined sections managed by Google
///    Chat.
///    Their resource names are fixed, and they cannot be created, deleted, or
///    have their `display_name` modified. Examples include:
///
///    * `users/{user}/sections/default-direct-messages`
///    * `users/{user}/sections/default-spaces`
///    * `users/{user}/sections/default-apps`
/// 1. **Custom Sections:** These are sections created and managed by the user.
///    Creating a custom section using `CreateSection` **requires** a
///    `display_name`. Custom sections can be updated using `UpdateSection` and
///    deleted using `DeleteSection`.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Section {
    /// Identifier. Resource name of the section.
    ///
    /// For system sections, the section ID is a constant string:
    ///
    /// * DEFAULT_DIRECT_MESSAGES: `users/{user}/sections/default-direct-messages`
    /// * DEFAULT_SPACES: `users/{user}/sections/default-spaces`
    /// * DEFAULT_APPS: `users/{user}/sections/default-apps`
    ///
    /// Format: `users/{user}/sections/{section}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. The section's display name. Only populated for sections of type
    /// `CUSTOM_SECTION`. Supports up to 80 characters. Required when creating a
    /// `CUSTOM_SECTION`.
    #[prost(string, tag = "2")]
    pub display_name: ::prost::alloc::string::String,
    /// Output only. The order of the section in relation to other sections.
    /// Sections with a lower `sort_order` value appear before sections with a
    /// higher value.
    #[prost(int32, tag = "3")]
    pub sort_order: i32,
    /// Required. The type of the section.
    #[prost(enumeration = "section::SectionType", tag = "4")]
    pub r#type: i32,
}
/// Nested message and enum types in `Section`.
pub mod section {
    /// Section types.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum SectionType {
        /// Unspecified section type.
        Unspecified = 0,
        /// Custom section.
        CustomSection = 1,
        /// Default section containing
        /// [DIRECT_MESSAGE](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype>)
        /// between two human users or
        /// [GROUP_CHAT](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces#spacetype>)
        /// spaces that don't belong to any custom section.
        DefaultDirectMessages = 2,
        /// Default spaces that don't belong to any custom section.
        DefaultSpaces = 3,
        /// Default section containing a user's installed apps.
        DefaultApps = 6,
    }
    impl SectionType {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "SECTION_TYPE_UNSPECIFIED",
                Self::CustomSection => "CUSTOM_SECTION",
                Self::DefaultDirectMessages => "DEFAULT_DIRECT_MESSAGES",
                Self::DefaultSpaces => "DEFAULT_SPACES",
                Self::DefaultApps => "DEFAULT_APPS",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SECTION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "CUSTOM_SECTION" => Some(Self::CustomSection),
                "DEFAULT_DIRECT_MESSAGES" => Some(Self::DefaultDirectMessages),
                "DEFAULT_SPACES" => Some(Self::DefaultSpaces),
                "DEFAULT_APPS" => Some(Self::DefaultApps),
                _ => None,
            }
        }
    }
}
/// A user's defined section item. This is used to represent section items, such
/// as spaces, grouped under a section.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SectionItem {
    /// Identifier. The resource name of the section item.
    ///
    /// Format: `users/{user}/sections/{section}/items/{item}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The section item.
    #[prost(oneof = "section_item::Item", tags = "2")]
    pub item: ::core::option::Option<section_item::Item>,
}
/// Nested message and enum types in `SectionItem`.
pub mod section_item {
    /// Required. The section item.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Item {
        /// Optional. The space resource name.
        ///
        /// Format: `spaces/{space}`
        #[prost(string, tag = "2")]
        Space(::prost::alloc::string::String),
    }
}
/// Request message for creating a section.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CreateSectionRequest {
    /// Required. The parent resource name where the section is created.
    ///
    /// Format: `users/{user}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The section to create.
    #[prost(message, optional, tag = "2")]
    pub section: ::core::option::Option<Section>,
}
/// Request message for deleting a section.
/// [Developer Preview](<https://developers.google.com/workspace/preview>).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteSectionRequest {
    /// Required. The name of the section to delete.
    ///
    /// Format: `users/{user}/sections/{section}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for updating a section.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateSectionRequest {
    /// Required. The section to update.
    #[prost(message, optional, tag = "1")]
    pub section: ::core::option::Option<Section>,
    /// Required. The mask to specify which fields to update.
    ///
    /// Currently supported field paths:
    ///
    /// * `display_name`
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request message for listing sections.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSectionsRequest {
    /// Required. The parent, which is the user resource name that owns this
    /// collection of sections. Only supports listing sections for the calling
    /// user. To refer to the calling user, set one of the following:
    ///
    /// * The `me` alias. For example, `users/me`.
    ///
    /// * Their Workspace email address. For example, `users/user@example.com`.
    ///
    /// * Their user id. For example, `users/123456789`.
    ///
    /// Format: `users/{user}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of sections to return. The service may return
    /// fewer than this value.
    ///
    /// If unspecified, at most 10 sections will be returned.
    ///
    /// The maximum value is 100. If you use a value more than 100, it's
    /// automatically changed to 100.
    ///
    /// Negative values return an `INVALID_ARGUMENT` error.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous list sections call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided should match the call that
    /// provided the page token. Passing different values to the other parameters
    /// might lead to unexpected results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for listing sections.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSectionsResponse {
    /// The sections from the specified user.
    #[prost(message, repeated, tag = "1")]
    pub sections: ::prost::alloc::vec::Vec<Section>,
    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for positioning a section.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PositionSectionRequest {
    /// Required. The resource name of the section to position.
    ///
    /// Format: `users/{user}/sections/{section}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The new position of the section.
    #[prost(oneof = "position_section_request::PositionOneOf", tags = "2, 3")]
    pub position: ::core::option::Option<position_section_request::PositionOneOf>,
}
/// Nested message and enum types in `PositionSectionRequest`.
pub mod position_section_request {
    /// The position of the section.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Position {
        /// Unspecified position.
        Unspecified = 0,
        /// Start of the list of sections.
        Start = 1,
        /// End of the list of sections.
        End = 2,
    }
    impl Position {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "POSITION_UNSPECIFIED",
                Self::Start => "START",
                Self::End => "END",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "POSITION_UNSPECIFIED" => Some(Self::Unspecified),
                "START" => Some(Self::Start),
                "END" => Some(Self::End),
                _ => None,
            }
        }
    }
    /// Required. The new position of the section.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum PositionOneOf {
        /// Optional. The absolute position of the section in the list of sections.
        /// The position must be greater than 0. If the position is greater than the
        /// number of sections, the section will be appended to the end of the list.
        /// This operation inserts the section at the given position and shifts the
        /// original section at that position, and those below it, to the next
        /// position.
        #[prost(int32, tag = "2")]
        SortOrder(i32),
        /// Optional. The relative position of the section in the list of sections.
        #[prost(enumeration = "Position", tag = "3")]
        RelativePosition(i32),
    }
}
/// Response message for positioning a section.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PositionSectionResponse {
    /// The updated section.
    #[prost(message, optional, tag = "1")]
    pub section: ::core::option::Option<Section>,
}
/// Request message for listing section items.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSectionItemsRequest {
    /// Required. The parent, which is the section resource name that owns this
    /// collection of section items. Only supports listing section items for the
    /// calling user.
    ///
    /// When you're filtering by space, use the wildcard `-` to search across all
    /// sections. For example, `users/{user}/sections/-`.
    ///
    /// Format: `users/{user}/sections/{section}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of section items to return. The service may
    /// return fewer than this value.
    ///
    /// If unspecified, at most 10 section items will be returned.
    ///
    /// The maximum value is 100. If you use a value more than 100, it's
    /// automatically changed to 100.
    ///
    /// Negative values return an `INVALID_ARGUMENT` error.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous list section items call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided should match the call that
    /// provided the page token. Passing different values to the other parameters
    /// might lead to unexpected results.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Optional. A query filter.
    ///
    /// Currently only supports filtering by space.
    ///
    /// For example, `space = spaces/{space}`.
    ///
    /// Invalid queries are rejected with an `INVALID_ARGUMENT` error.
    #[prost(string, tag = "4")]
    pub filter: ::prost::alloc::string::String,
}
/// Response message for listing section items.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSectionItemsResponse {
    /// The section items from the specified section.
    #[prost(message, repeated, tag = "1")]
    pub section_items: ::prost::alloc::vec::Vec<SectionItem>,
    /// A token, which can be sent as `page_token` to retrieve the next page. If
    /// this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for moving a section item across sections.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MoveSectionItemRequest {
    /// Required. The resource name of the section item to move.
    ///
    /// Format: `users/{user}/sections/{section}/items/{item}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. The resource name of the section to move the section item to.
    ///
    /// Format: `users/{user}/sections/{section}`
    #[prost(string, tag = "2")]
    pub target_section: ::prost::alloc::string::String,
}
/// Response message for moving a section item.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MoveSectionItemResponse {
    /// The updated section item.
    #[prost(message, optional, tag = "1")]
    pub section_item: ::core::option::Option<SectionItem>,
}
/// Event payload for a new membership.
///
/// Event type: `google.workspace.chat.membership.v1.created`.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MembershipCreatedEventData {
    /// The new membership.
    #[prost(message, optional, tag = "1")]
    pub membership: ::core::option::Option<Membership>,
}
/// Event payload for a deleted membership.
///
/// Event type: `google.workspace.chat.membership.v1.deleted`
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MembershipDeletedEventData {
    /// The deleted membership. Only the `name` and `state` fields are populated.
    #[prost(message, optional, tag = "1")]
    pub membership: ::core::option::Option<Membership>,
}
/// Event payload for an updated membership.
///
/// Event type: `google.workspace.chat.membership.v1.updated`
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct MembershipUpdatedEventData {
    /// The updated membership.
    #[prost(message, optional, tag = "1")]
    pub membership: ::core::option::Option<Membership>,
}
/// Event payload for multiple new memberships.
///
/// Event type: `google.workspace.chat.membership.v1.batchCreated`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MembershipBatchCreatedEventData {
    /// A list of new memberships.
    #[prost(message, repeated, tag = "1")]
    pub memberships: ::prost::alloc::vec::Vec<MembershipCreatedEventData>,
}
/// Event payload for multiple updated memberships.
///
/// Event type: `google.workspace.chat.membership.v1.batchUpdated`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MembershipBatchUpdatedEventData {
    /// A list of updated memberships.
    #[prost(message, repeated, tag = "1")]
    pub memberships: ::prost::alloc::vec::Vec<MembershipUpdatedEventData>,
}
/// Event payload for multiple deleted memberships.
///
/// Event type: `google.workspace.chat.membership.v1.batchDeleted`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MembershipBatchDeletedEventData {
    /// A list of deleted memberships.
    #[prost(message, repeated, tag = "1")]
    pub memberships: ::prost::alloc::vec::Vec<MembershipDeletedEventData>,
}
/// Event payload for a new message.
///
/// Event type: `google.workspace.chat.message.v1.created`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageCreatedEventData {
    /// The new message.
    #[prost(message, optional, tag = "1")]
    pub message: ::core::option::Option<Message>,
}
/// Event payload for an updated message.
///
/// Event type: `google.workspace.chat.message.v1.updated`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageUpdatedEventData {
    /// The updated message.
    #[prost(message, optional, tag = "1")]
    pub message: ::core::option::Option<Message>,
}
/// Event payload for a deleted message.
///
/// Event type: `google.workspace.chat.message.v1.deleted`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageDeletedEventData {
    /// The deleted message. Only the `name`, `createTime`, and
    /// `deletionMetadata` fields are populated.
    #[prost(message, optional, tag = "1")]
    pub message: ::core::option::Option<Message>,
}
/// Event payload for multiple new messages.
///
/// Event type: `google.workspace.chat.message.v1.batchCreated`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageBatchCreatedEventData {
    /// A list of new messages.
    #[prost(message, repeated, tag = "1")]
    pub messages: ::prost::alloc::vec::Vec<MessageCreatedEventData>,
}
/// Event payload for multiple updated messages.
///
/// Event type: `google.workspace.chat.message.v1.batchUpdated`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageBatchUpdatedEventData {
    /// A list of updated messages.
    #[prost(message, repeated, tag = "1")]
    pub messages: ::prost::alloc::vec::Vec<MessageUpdatedEventData>,
}
/// Event payload for multiple deleted messages.
///
/// Event type: `google.workspace.chat.message.v1.batchDeleted`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MessageBatchDeletedEventData {
    /// A list of deleted messages.
    #[prost(message, repeated, tag = "1")]
    pub messages: ::prost::alloc::vec::Vec<MessageDeletedEventData>,
}
/// Event payload for an updated space.
///
/// Event type: `google.workspace.chat.space.v1.updated`
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SpaceUpdatedEventData {
    /// The updated space.
    #[prost(message, optional, tag = "1")]
    pub space: ::core::option::Option<Space>,
}
/// Event payload for multiple updates to a space.
///
/// Event type: `google.workspace.chat.space.v1.batchUpdated`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpaceBatchUpdatedEventData {
    /// A list of updated spaces.
    #[prost(message, repeated, tag = "1")]
    pub spaces: ::prost::alloc::vec::Vec<SpaceUpdatedEventData>,
}
/// Event payload for a new reaction.
///
/// Event type: `google.workspace.chat.reaction.v1.created`
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReactionCreatedEventData {
    /// The new reaction.
    #[prost(message, optional, tag = "1")]
    pub reaction: ::core::option::Option<Reaction>,
}
/// Event payload for a deleted reaction.
///
/// Type: `google.workspace.chat.reaction.v1.deleted`
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReactionDeletedEventData {
    /// The deleted reaction.
    #[prost(message, optional, tag = "1")]
    pub reaction: ::core::option::Option<Reaction>,
}
/// Event payload for multiple new reactions.
///
/// Event type: `google.workspace.chat.reaction.v1.batchCreated`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReactionBatchCreatedEventData {
    /// A list of new reactions.
    #[prost(message, repeated, tag = "1")]
    pub reactions: ::prost::alloc::vec::Vec<ReactionCreatedEventData>,
}
/// Event payload for multiple deleted reactions.
///
/// Event type: `google.workspace.chat.reaction.v1.batchDeleted`
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReactionBatchDeletedEventData {
    /// A list of deleted reactions.
    #[prost(message, repeated, tag = "1")]
    pub reactions: ::prost::alloc::vec::Vec<ReactionDeletedEventData>,
}
/// An event that represents a change or activity in a Google Chat space. To
/// learn more, see [Work with events from Google
/// Chat](<https://developers.google.com/workspace/chat/events-overview>).
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SpaceEvent {
    /// Resource name of the space event.
    ///
    /// Format: `spaces/{space}/spaceEvents/{spaceEvent}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Time when the event occurred.
    #[prost(message, optional, tag = "3")]
    pub event_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Type of space event. Each event type has a batch version, which
    /// represents multiple instances of the event type that occur in a short
    /// period of time. For `spaceEvents.list()` requests, omit batch event types
    /// in your query filter. By default, the server returns both event type and
    /// its batch version.
    ///
    /// Supported event types for
    /// [messages](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages>):
    ///
    /// ```text
    /// * New message: `google.workspace.chat.message.v1.created`
    /// * Updated message: `google.workspace.chat.message.v1.updated`
    /// * Deleted message: `google.workspace.chat.message.v1.deleted`
    /// * Multiple new messages: `google.workspace.chat.message.v1.batchCreated`
    /// * Multiple updated messages:
    /// `google.workspace.chat.message.v1.batchUpdated`
    /// * Multiple deleted messages:
    /// `google.workspace.chat.message.v1.batchDeleted`
    /// ```
    ///
    /// Supported event types for
    /// [memberships](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.members>):
    ///
    /// * New membership: `google.workspace.chat.membership.v1.created`
    /// * Updated membership: `google.workspace.chat.membership.v1.updated`
    /// * Deleted membership: `google.workspace.chat.membership.v1.deleted`
    /// * Multiple new memberships:
    ///   `google.workspace.chat.membership.v1.batchCreated`
    /// * Multiple updated memberships:
    ///   `google.workspace.chat.membership.v1.batchUpdated`
    /// * Multiple deleted memberships:
    ///   `google.workspace.chat.membership.v1.batchDeleted`
    ///
    /// Supported event types for
    /// [reactions](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.reactions>):
    ///
    /// * New reaction: `google.workspace.chat.reaction.v1.created`
    /// * Deleted reaction: `google.workspace.chat.reaction.v1.deleted`
    /// * Multiple new reactions:
    ///   `google.workspace.chat.reaction.v1.batchCreated`
    /// * Multiple deleted reactions:
    ///   `google.workspace.chat.reaction.v1.batchDeleted`
    ///
    /// Supported event types about the
    /// [space](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces>):
    ///
    /// * Updated space: `google.workspace.chat.space.v1.updated`
    /// * Multiple space updates: `google.workspace.chat.space.v1.batchUpdated`
    #[prost(string, tag = "6")]
    pub event_type: ::prost::alloc::string::String,
    #[prost(
        oneof = "space_event::Payload",
        tags = "12, 13, 14, 26, 27, 28, 15, 29, 17, 18, 219, 31, 32, 33, 21, 22, 34, 35"
    )]
    pub payload: ::core::option::Option<space_event::Payload>,
}
/// Nested message and enum types in `SpaceEvent`.
pub mod space_event {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Payload {
        /// Event payload for a new message.
        ///
        /// Event type: `google.workspace.chat.message.v1.created`
        #[prost(message, tag = "12")]
        MessageCreatedEventData(super::MessageCreatedEventData),
        /// Event payload for an updated message.
        ///
        /// Event type: `google.workspace.chat.message.v1.updated`
        #[prost(message, tag = "13")]
        MessageUpdatedEventData(super::MessageUpdatedEventData),
        /// Event payload for a deleted message.
        ///
        /// Event type: `google.workspace.chat.message.v1.deleted`
        #[prost(message, tag = "14")]
        MessageDeletedEventData(super::MessageDeletedEventData),
        /// Event payload for multiple new messages.
        ///
        /// Event type: `google.workspace.chat.message.v1.batchCreated`
        #[prost(message, tag = "26")]
        MessageBatchCreatedEventData(super::MessageBatchCreatedEventData),
        /// Event payload for multiple updated messages.
        ///
        /// Event type: `google.workspace.chat.message.v1.batchUpdated`
        #[prost(message, tag = "27")]
        MessageBatchUpdatedEventData(super::MessageBatchUpdatedEventData),
        /// Event payload for multiple deleted messages.
        ///
        /// Event type: `google.workspace.chat.message.v1.batchDeleted`
        #[prost(message, tag = "28")]
        MessageBatchDeletedEventData(super::MessageBatchDeletedEventData),
        /// Event payload for a space update.
        ///
        /// Event type: `google.workspace.chat.space.v1.updated`
        #[prost(message, tag = "15")]
        SpaceUpdatedEventData(super::SpaceUpdatedEventData),
        /// Event payload for multiple updates to a space.
        ///
        /// Event type: `google.workspace.chat.space.v1.batchUpdated`
        #[prost(message, tag = "29")]
        SpaceBatchUpdatedEventData(super::SpaceBatchUpdatedEventData),
        /// Event payload for a new membership.
        ///
        /// Event type: `google.workspace.chat.membership.v1.created`
        #[prost(message, tag = "17")]
        MembershipCreatedEventData(super::MembershipCreatedEventData),
        /// Event payload for an updated membership.
        ///
        /// Event type: `google.workspace.chat.membership.v1.updated`
        #[prost(message, tag = "18")]
        MembershipUpdatedEventData(super::MembershipUpdatedEventData),
        /// Event payload for a deleted membership.
        ///
        /// Event type: `google.workspace.chat.membership.v1.deleted`
        #[prost(message, tag = "219")]
        MembershipDeletedEventData(super::MembershipDeletedEventData),
        /// Event payload for multiple new memberships.
        ///
        /// Event type: `google.workspace.chat.membership.v1.batchCreated`
        #[prost(message, tag = "31")]
        MembershipBatchCreatedEventData(super::MembershipBatchCreatedEventData),
        /// Event payload for multiple updated memberships.
        ///
        /// Event type: `google.workspace.chat.membership.v1.batchUpdated`
        #[prost(message, tag = "32")]
        MembershipBatchUpdatedEventData(super::MembershipBatchUpdatedEventData),
        /// Event payload for multiple deleted memberships.
        ///
        /// Event type: `google.workspace.chat.membership.v1.batchDeleted`
        #[prost(message, tag = "33")]
        MembershipBatchDeletedEventData(super::MembershipBatchDeletedEventData),
        /// Event payload for a new reaction.
        ///
        /// Event type: `google.workspace.chat.reaction.v1.created`
        #[prost(message, tag = "21")]
        ReactionCreatedEventData(super::ReactionCreatedEventData),
        /// Event payload for a deleted reaction.
        ///
        /// Event type: `google.workspace.chat.reaction.v1.deleted`
        #[prost(message, tag = "22")]
        ReactionDeletedEventData(super::ReactionDeletedEventData),
        /// Event payload for multiple new reactions.
        ///
        /// Event type: `google.workspace.chat.reaction.v1.batchCreated`
        #[prost(message, tag = "34")]
        ReactionBatchCreatedEventData(super::ReactionBatchCreatedEventData),
        /// Event payload for multiple deleted reactions.
        ///
        /// Event type: `google.workspace.chat.reaction.v1.batchDeleted`
        #[prost(message, tag = "35")]
        ReactionBatchDeletedEventData(super::ReactionBatchDeletedEventData),
    }
}
/// Request message for getting a space event.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSpaceEventRequest {
    /// Required. The resource name of the space event.
    ///
    /// Format: `spaces/{space}/spaceEvents/{spaceEvent}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for listing space events.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListSpaceEventsRequest {
    /// Required. Resource name of the [Google Chat
    /// space](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces>)
    /// where the events occurred.
    ///
    /// Format: `spaces/{space}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Optional. The maximum number of space events returned. The service might
    /// return fewer than this value.
    ///
    /// Negative values return an `INVALID_ARGUMENT` error.
    #[prost(int32, tag = "5")]
    pub page_size: i32,
    /// Optional. A page token, received from a previous list space events call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to list space events must
    /// match the call that provided the page token. Passing different values to
    /// the other parameters might lead to unexpected results.
    #[prost(string, tag = "6")]
    pub page_token: ::prost::alloc::string::String,
    /// Required. A query filter.
    ///
    /// You must specify at least one event type (`event_type`)
    /// using the has `:` operator. To filter by multiple event types, use the `OR`
    /// operator. Omit batch event types in your filter. The request automatically
    /// returns any related batch events. For example, if you filter by new
    /// reactions
    /// (`google.workspace.chat.reaction.v1.created`), the server also returns
    /// batch new reactions events
    /// (`google.workspace.chat.reaction.v1.batchCreated`). For a list of supported
    /// event types, see the [`SpaceEvents` reference
    /// documentation](<https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.event_type>).
    ///
    /// Optionally, you can also filter by start time (`start_time`) and
    /// end time (`end_time`):
    ///
    /// * `start_time`: Exclusive timestamp from which to start listing space
    ///   events.
    ///   You can list events that occurred up to 28 days ago. If unspecified, lists
    ///   space events from the past 28 days.
    /// * `end_time`: Inclusive timestamp until which space events are listed.
    ///   If unspecified, lists events up to the time of the request.
    ///
    /// To specify a start or end time, use the equals `=` operator and format in
    /// [RFC-3339](<https://www.rfc-editor.org/rfc/rfc3339>). To filter by both
    /// `start_time` and `end_time`, use the `AND` operator.
    ///
    /// For example, the following queries are valid:
    ///
    /// ```text,
    /// start_time="2023-08-23T19:20:33+00:00" AND
    /// end_time="2023-08-23T19:21:54+00:00"
    /// ```
    ///
    /// ```text,
    /// start_time="2023-08-23T19:20:33+00:00" AND
    /// (event_types:"google.workspace.chat.space.v1.updated" OR
    /// event_types:"google.workspace.chat.message.v1.created")
    /// ```
    ///
    /// The following queries are invalid:
    ///
    /// ```text,
    /// start_time="2023-08-23T19:20:33+00:00" OR
    /// end_time="2023-08-23T19:21:54+00:00"
    /// ```
    ///
    /// ```text,
    /// event_types:"google.workspace.chat.space.v1.updated" AND
    /// event_types:"google.workspace.chat.message.v1.created"
    /// ```
    ///
    /// Invalid queries are rejected by the server with an `INVALID_ARGUMENT`
    /// error.
    #[prost(string, tag = "8")]
    pub filter: ::prost::alloc::string::String,
}
/// Response message for listing space events.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListSpaceEventsResponse {
    /// Results are returned in chronological order (oldest event first).
    /// Note: The `permissionSettings` field is not returned in the Space
    /// object for list requests.
    #[prost(message, repeated, tag = "1")]
    pub space_events: ::prost::alloc::vec::Vec<SpaceEvent>,
    /// Continuation token used to fetch more events.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// The notification setting of a user in a space.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SpaceNotificationSetting {
    /// Identifier. The resource name of the space notification setting.
    /// Format: `users/{user}/spaces/{space}/spaceNotificationSetting`.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The notification setting.
    #[prost(
        enumeration = "space_notification_setting::NotificationSetting",
        optional,
        tag = "2"
    )]
    pub notification_setting: ::core::option::Option<i32>,
    /// The space notification mute setting.
    #[prost(
        enumeration = "space_notification_setting::MuteSetting",
        optional,
        tag = "3"
    )]
    pub mute_setting: ::core::option::Option<i32>,
}
/// Nested message and enum types in `SpaceNotificationSetting`.
pub mod space_notification_setting {
    /// The notification setting types. Other types might be supported in the
    /// future.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum NotificationSetting {
        /// Reserved.
        Unspecified = 0,
        /// Notifications are triggered by @mentions, followed threads, first
        /// message of new threads. All new threads are automatically followed,
        /// unless manually unfollowed by the user.
        All = 1,
        /// The notification is triggered by @mentions, followed threads, first
        /// message of new threads. Not available for 1:1 direct messages.
        MainConversations = 2,
        /// The notification is triggered by @mentions, followed threads. Not
        /// available for 1:1 direct messages.
        ForYou = 3,
        /// Notification is off.
        Off = 4,
    }
    impl NotificationSetting {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "NOTIFICATION_SETTING_UNSPECIFIED",
                Self::All => "ALL",
                Self::MainConversations => "MAIN_CONVERSATIONS",
                Self::ForYou => "FOR_YOU",
                Self::Off => "OFF",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "NOTIFICATION_SETTING_UNSPECIFIED" => Some(Self::Unspecified),
                "ALL" => Some(Self::All),
                "MAIN_CONVERSATIONS" => Some(Self::MainConversations),
                "FOR_YOU" => Some(Self::ForYou),
                "OFF" => Some(Self::Off),
                _ => None,
            }
        }
    }
    /// The space notification mute setting types.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum MuteSetting {
        /// Reserved.
        Unspecified = 0,
        /// The user will receive notifications for the space based on the
        /// notification setting.
        Unmuted = 1,
        /// The user will not receive any notifications for the space, regardless of
        /// the notification setting.
        Muted = 2,
    }
    impl MuteSetting {
        /// String value of the enum field names used in the ProtoBuf definition.
        ///
        /// The values are not transformed in any way and thus are considered stable
        /// (if the ProtoBuf definition does not change) and safe for programmatic use.
        pub fn as_str_name(&self) -> &'static str {
            match self {
                Self::Unspecified => "MUTE_SETTING_UNSPECIFIED",
                Self::Unmuted => "UNMUTED",
                Self::Muted => "MUTED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "MUTE_SETTING_UNSPECIFIED" => Some(Self::Unspecified),
                "UNMUTED" => Some(Self::Unmuted),
                "MUTED" => Some(Self::Muted),
                _ => None,
            }
        }
    }
}
/// Request message to get space notification setting.
/// Only supports getting notification setting for the calling user.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSpaceNotificationSettingRequest {
    /// Required. Format: users/{user}/spaces/{space}/spaceNotificationSetting
    ///
    /// * `users/me/spaces/{space}/spaceNotificationSetting`, OR
    /// * `users/user@example.com/spaces/{space}/spaceNotificationSetting`, OR
    /// * `users/123456789/spaces/{space}/spaceNotificationSetting`.
    ///   Note: Only the caller's user id or email is allowed in the path.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request to update the space notification settings.
/// Only supports updating notification setting for the calling user.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateSpaceNotificationSettingRequest {
    /// Required. The resource name for the space notification settings must be
    /// populated in the form of
    /// `users/{user}/spaces/{space}/spaceNotificationSetting`. Only fields
    /// specified by `update_mask` are updated.
    #[prost(message, optional, tag = "1")]
    pub space_notification_setting: ::core::option::Option<SpaceNotificationSetting>,
    /// Required. Supported field paths:
    ///
    /// * `notification_setting`
    ///
    /// * `mute_setting`
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// A user's read state within a space, used to identify read and unread
/// messages.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SpaceReadState {
    /// Resource name of the space read state.
    ///
    /// Format: `users/{user}/spaces/{space}/spaceReadState`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. The time when the user's space read state was updated. Usually
    /// this corresponds with either the timestamp of the last read message, or a
    /// timestamp specified by the user to mark the last read position in a space.
    #[prost(message, optional, tag = "2")]
    pub last_read_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Request message for GetSpaceReadState API.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetSpaceReadStateRequest {
    /// Required. Resource name of the space read state to retrieve.
    ///
    /// Only supports getting read state for the calling user.
    ///
    /// To refer to the calling user, set one of the following:
    ///
    /// * The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
    ///
    /// * Their Workspace email address. For example,
    ///   `users/user@example.com/spaces/{space}/spaceReadState`.
    ///
    /// * Their user id. For example,
    ///   `users/123456789/spaces/{space}/spaceReadState`.
    ///
    /// Format: users/{user}/spaces/{space}/spaceReadState
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for UpdateSpaceReadState API.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateSpaceReadStateRequest {
    /// Required. The space read state and fields to update.
    ///
    /// Only supports updating read state for the calling user.
    ///
    /// To refer to the calling user, set one of the following:
    ///
    /// * The `me` alias. For example, `users/me/spaces/{space}/spaceReadState`.
    ///
    /// * Their Workspace email address. For example,
    ///   `users/user@example.com/spaces/{space}/spaceReadState`.
    ///
    /// * Their user id. For example,
    ///   `users/123456789/spaces/{space}/spaceReadState`.
    ///
    /// Format: users/{user}/spaces/{space}/spaceReadState
    #[prost(message, optional, tag = "1")]
    pub space_read_state: ::core::option::Option<SpaceReadState>,
    /// Required. The field paths to update. Currently supported field paths:
    ///
    /// * `last_read_time`
    ///
    /// When the `last_read_time` is before the latest message create time, the
    /// space appears as unread in the UI.
    ///
    /// To mark the space as read, set `last_read_time` to any value later (larger)
    /// than the latest message create time. The `last_read_time` is coerced to
    /// match the latest message create time. Note that the space read state only
    /// affects the read state of messages that are visible in the space's
    /// top-level conversation. Replies in threads are unaffected by this
    /// timestamp, and instead rely on the thread read state.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Request to create a space and add specified users to it.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SetUpSpaceRequest {
    /// Required. The `Space.spaceType` field is required.
    ///
    /// To create a space, set `Space.spaceType` to `SPACE` and set
    /// `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when
    /// setting up a space, try a different `displayName`. An existing space
    /// within the Google Workspace organization might already use this display
    /// name.
    ///
    /// To create a group chat, set `Space.spaceType` to
    /// `GROUP_CHAT`. Don't set `Space.displayName`.
    ///
    /// To create a 1:1 conversation between humans,
    /// set `Space.spaceType` to `DIRECT_MESSAGE` and set
    /// `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or
    /// `Space.spaceDetails`.
    ///
    /// To create an 1:1 conversation between a human and the calling Chat app, set
    /// `Space.spaceType` to `DIRECT_MESSAGE` and
    /// `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or
    /// `Space.spaceDetails`.
    ///
    /// If a `DIRECT_MESSAGE` space already exists, that space is returned instead
    /// of creating a new space.
    #[prost(message, optional, tag = "1")]
    pub space: ::core::option::Option<Space>,
    /// Optional. A unique identifier for this request.
    /// A random UUID is recommended.
    /// Specifying an existing request ID returns the space created with that ID
    /// instead of creating a new space.
    /// Specifying an existing request ID from the same Chat app with a different
    /// authenticated user returns an error.
    #[prost(string, tag = "2")]
    pub request_id: ::prost::alloc::string::String,
    /// Optional. The Google Chat users or groups to invite to join the space. Omit
    /// the calling user, as they are added automatically.
    ///
    /// The set currently allows up to 49 memberships (in addition to the caller).
    ///
    /// For human membership, the `Membership.member` field must contain a `user`
    /// with `name` populated (format: `users/{user}`) and `type` set to
    /// `User.Type.HUMAN`. You can only add human users when setting up a space
    /// (adding Chat apps is only supported for direct message setup with the
    /// calling app). You can also add members using the user's email as an alias
    /// for {user}. For example, the `user.name` can be `users/example@gmail.com`.
    /// To invite Gmail users or users from external Google Workspace domains,
    /// user's email must be used for `{user}`.
    ///
    /// For Google group membership, the `Membership.group_member` field must
    /// contain a `group` with `name` populated (format `groups/{group}`). You
    /// can only add Google groups when setting `Space.spaceType` to `SPACE`.
    ///
    /// Optional when setting `Space.spaceType` to `SPACE`.
    ///
    /// Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at
    /// least two memberships.
    ///
    /// Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human
    /// user, along with exactly one membership.
    ///
    /// Must be empty when creating a 1:1 conversation between a human and the
    /// calling Chat app (when setting `Space.spaceType` to
    /// `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`).
    #[prost(message, repeated, tag = "4")]
    pub memberships: ::prost::alloc::vec::Vec<Membership>,
}
/// A user's read state within a thread, used to identify read and unread
/// messages.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ThreadReadState {
    /// Resource name of the thread read state.
    ///
    /// Format: `users/{user}/spaces/{space}/threads/{thread}/threadReadState`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The time when the user's thread read state was updated. Usually this
    /// corresponds with the timestamp of the last read message in a thread.
    #[prost(message, optional, tag = "2")]
    pub last_read_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Request message for GetThreadReadStateRequest API.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetThreadReadStateRequest {
    /// Required. Resource name of the thread read state to retrieve.
    ///
    /// Only supports getting read state for the calling user.
    ///
    /// To refer to the calling user, set one of the following:
    ///
    /// * The `me` alias. For example,
    ///   `users/me/spaces/{space}/threads/{thread}/threadReadState`.
    ///
    /// * Their Workspace email address. For example,
    ///   `users/user@example.com/spaces/{space}/threads/{thread}/threadReadState`.
    ///
    /// * Their user id. For example,
    ///   `users/123456789/spaces/{space}/threads/{thread}/threadReadState`.
    ///
    /// Format: users/{user}/spaces/{space}/threads/{thread}/threadReadState
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Generated client implementations.
pub mod chat_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Enables developers to build Chat apps and
    /// integrations on Google Chat Platform.
    #[derive(Debug, Clone)]
    pub struct ChatServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ChatServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> ChatServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> ChatServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            ChatServiceClient::new(InterceptedService::new(inner, interceptor))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        /// Creates a message in a Google Chat space. For an example, see [Send a
        /// message](https://developers.google.com/workspace/chat/create-messages).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with the authorization scope:
        ///  * `https://www.googleapis.com/auth/chat.bot`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///  * `https://www.googleapis.com/auth/chat.messages.create`
        ///  * `https://www.googleapis.com/auth/chat.messages`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///
        /// Chat attributes the message sender differently depending on the type of
        /// authentication that you use in your request.
        ///
        /// The following image shows how Chat attributes a message when you use app
        /// authentication. Chat displays the Chat app as the message
        /// sender. The content of the message can contain text (`text`), cards
        /// (`cardsV2`), and accessory widgets (`accessoryWidgets`).
        ///
        /// ![Message sent with app
        /// authentication](https://developers.google.com/workspace/chat/images/message-app-auth.svg)
        ///
        /// The following image shows how Chat attributes a message when you use user
        /// authentication. Chat displays the user as the message sender and attributes
        /// the Chat app to the message by displaying its name. The content of message
        /// can only contain text (`text`).
        ///
        /// ![Message sent with user
        /// authentication](https://developers.google.com/workspace/chat/images/message-user-auth.svg)
        ///
        /// The maximum message size, including the message contents, is 32,000 bytes.
        ///
        /// For
        /// [webhook](https://developers.google.com/workspace/chat/quickstart/webhooks)
        /// requests, the response doesn't contain the full message. The response only
        /// populates the `name` and `thread.name` fields in addition to the
        /// information that was in the request.
        pub async fn create_message(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateMessageRequest>,
        ) -> std::result::Result<tonic::Response<super::Message>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/CreateMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "CreateMessage"));
            self.inner.unary(req, path, codec).await
        }
        /// Lists messages in a space that the caller is a member of, including
        /// messages from blocked members and spaces. System messages, like those
        /// announcing new space members, aren't included. If you list messages from a
        /// space with no messages, the response is an empty object. When using a
        /// REST/HTTP interface, the response contains an empty JSON object, `{}`.
        /// For an example, see
        /// [List
        /// messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/list).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator
        ///  approval](https://support.google.com/a?p=chat-app-auth)
        ///  with the authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.messages.readonly`. When
        ///    using this authentication scope, this method only returns public
        ///    messages in a space. It doesn't include private messages.
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.messages.readonly`
        ///  * `https://www.googleapis.com/auth/chat.messages`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        pub async fn list_messages(
            &mut self,
            request: impl tonic::IntoRequest<super::ListMessagesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListMessagesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListMessages",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "ListMessages"));
            self.inner.unary(req, path, codec).await
        }
        /// Lists memberships in a space. For an example, see [List users and Google
        /// Chat apps in a
        /// space](https://developers.google.com/workspace/chat/list-members). Listing
        /// memberships with [app
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        /// lists memberships in spaces that the Chat app has
        /// access to, but excludes Chat app memberships,
        /// including its own. Listing memberships with
        /// [User
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// lists memberships in spaces that the authenticated user has access to.
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`
        ///  * `https://www.googleapis.com/auth/chat.app.memberships` (requires
        ///    [administrator approval](https://support.google.com/a?p=chat-app-auth))
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.memberships.readonly`
        ///  * `https://www.googleapis.com/auth/chat.memberships`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    one of the following authorization scopes is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.memberships.readonly`
        ///    * `https://www.googleapis.com/auth/chat.admin.memberships`
        pub async fn list_memberships(
            &mut self,
            request: impl tonic::IntoRequest<super::ListMembershipsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListMembershipsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListMemberships",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "ListMemberships"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns details about a membership. For an example, see
        /// [Get details about a user's or Google Chat app's
        /// membership](https://developers.google.com/workspace/chat/get-members).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`
        ///  * `https://www.googleapis.com/auth/chat.app.memberships` (requires
        ///    [administrator approval](https://support.google.com/a?p=chat-app-auth))
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.memberships.readonly`
        ///  * `https://www.googleapis.com/auth/chat.memberships`
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    one of the following authorization scopes is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.memberships.readonly`
        ///    * `https://www.googleapis.com/auth/chat.admin.memberships`
        pub async fn get_membership(
            &mut self,
            request: impl tonic::IntoRequest<super::GetMembershipRequest>,
        ) -> std::result::Result<tonic::Response<super::Membership>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetMembership",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "GetMembership"));
            self.inner.unary(req, path, codec).await
        }
        /// Returns details about a message.
        /// For an example, see [Get details about a
        /// message](https://developers.google.com/workspace/chat/get-messages).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`: When using this
        ///    authorization scope, this method returns details about a message the
        ///    Chat app has access to, like direct messages and [slash
        ///    commands](https://developers.google.com/workspace/chat/slash-commands)
        ///    that invoke the Chat app.
        ///  * `https://www.googleapis.com/auth/chat.app.messages.readonly`
        ///    with [administrator
        ///    approval](https://support.google.com/a?p=chat-app-auth).
        ///    When using this authentication scope,
        ///    this method returns details about a public message in a space.
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.messages.readonly`
        ///  * `https://www.googleapis.com/auth/chat.messages`
        ///
        /// Note: Might return a message from a blocked member or space.
        pub async fn get_message(
            &mut self,
            request: impl tonic::IntoRequest<super::GetMessageRequest>,
        ) -> std::result::Result<tonic::Response<super::Message>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "GetMessage"));
            self.inner.unary(req, path, codec).await
        }
        /// Updates a message. There's a difference between the `patch` and `update`
        /// methods. The `patch`
        /// method uses a `patch` request while the `update` method uses a `put`
        /// request. We recommend using the `patch` method. For an example, see
        /// [Update a
        /// message](https://developers.google.com/workspace/chat/update-messages).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with the authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.messages`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///
        /// When using app authentication, requests can only update messages
        /// created by the calling Chat app.
        pub async fn update_message(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateMessageRequest>,
        ) -> std::result::Result<tonic::Response<super::Message>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/UpdateMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "UpdateMessage"));
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a message.
        /// For an example, see [Delete a
        /// message](https://developers.google.com/workspace/chat/delete-messages).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with the authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.messages`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///
        /// When using app authentication, requests can only delete messages
        /// created by the calling Chat app.
        pub async fn delete_message(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteMessageRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/DeleteMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "DeleteMessage"));
            self.inner.unary(req, path, codec).await
        }
        /// Gets the metadata of a message attachment. The attachment data is fetched
        /// using the [media
        /// API](https://developers.google.com/workspace/chat/api/reference/rest/v1/media/download).
        /// For an example, see
        /// [Get metadata about a message
        /// attachment](https://developers.google.com/workspace/chat/get-media-attachments).
        ///
        /// Requires [app
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.bot`
        pub async fn get_attachment(
            &mut self,
            request: impl tonic::IntoRequest<super::GetAttachmentRequest>,
        ) -> std::result::Result<tonic::Response<super::Attachment>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetAttachment",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "GetAttachment"));
            self.inner.unary(req, path, codec).await
        }
        /// Uploads an attachment. For an example, see
        /// [Upload media as a file
        /// attachment](https://developers.google.com/workspace/chat/upload-media-attachments).
        ///
        /// Requires user
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.messages.create`
        /// * `https://www.googleapis.com/auth/chat.messages`
        /// * `https://www.googleapis.com/auth/chat.import` (import mode spaces only)
        ///
        /// You can upload attachments up to 200 MB. Certain file types aren't
        /// supported. For details, see [File types blocked by Google
        /// Chat](https://support.google.com/chat/answer/7651457?&co=GENIE.Platform%3DDesktop#File%20types%20blocked%20in%20Google%20Chat).
        pub async fn upload_attachment(
            &mut self,
            request: impl tonic::IntoRequest<super::UploadAttachmentRequest>,
        ) -> std::result::Result<
            tonic::Response<super::UploadAttachmentResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/UploadAttachment",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "UploadAttachment"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists spaces the caller is a member of. Group chats and DMs aren't listed
        /// until the first message is sent. For an example, see
        /// [List
        /// spaces](https://developers.google.com/workspace/chat/list-spaces).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with the authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.spaces.readonly`
        ///  * `https://www.googleapis.com/auth/chat.spaces`
        ///
        /// To list all named spaces by Google Workspace organization, use the
        /// [`spaces.search()`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces/search)
        /// method using Workspace administrator privileges instead.
        pub async fn list_spaces(
            &mut self,
            request: impl tonic::IntoRequest<super::ListSpacesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListSpacesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListSpaces",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "ListSpaces"));
            self.inner.unary(req, path, codec).await
        }
        /// Returns a list of spaces in a Google Workspace organization based on an
        /// administrator's search. In the request, set `use_admin_access` to `true`.
        /// For an example, see [Search for and manage
        /// spaces](https://developers.google.com/workspace/chat/search-manage-admin).
        ///
        /// Requires [user
        /// authentication with administrator
        /// privileges](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user#admin-privileges)
        /// and one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.admin.spaces.readonly`
        /// * `https://www.googleapis.com/auth/chat.admin.spaces`
        pub async fn search_spaces(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchSpacesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchSpacesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/SearchSpaces",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "SearchSpaces"));
            self.inner.unary(req, path, codec).await
        }
        /// Returns details about a space. For an example, see
        /// [Get details about a
        /// space](https://developers.google.com/workspace/chat/get-spaces).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`
        ///  * `https://www.googleapis.com/auth/chat.app.spaces` with [administrator
        ///    approval](https://support.google.com/a?p=chat-app-auth)
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.spaces.readonly`
        ///  * `https://www.googleapis.com/auth/chat.spaces`
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    one of the following authorization scopes is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.spaces.readonly`
        ///    * `https://www.googleapis.com/auth/chat.admin.spaces`
        ///
        /// App authentication has the following limitations:
        ///
        /// * `space.access_settings` is only populated when using the
        ///  `chat.app.spaces` scope.
        /// * `space.predefind_permission_settings` and `space.permission_settings` are
        ///  only populated when using the `chat.app.spaces` scope, and only for
        ///  spaces the app created.
        pub async fn get_space(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSpaceRequest>,
        ) -> std::result::Result<tonic::Response<super::Space>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetSpace",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "GetSpace"));
            self.inner.unary(req, path, codec).await
        }
        /// Creates a space. Can be used to create a named space, or a
        /// group chat in `Import mode`. For an example, see [Create a
        /// space](https://developers.google.com/workspace/chat/create-spaces).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator approval](https://support.google.com/a?p=chat-app-auth)
        ///  and one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.spaces.create`
        ///  * `https://www.googleapis.com/auth/chat.app.spaces`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.spaces.create`
        ///  * `https://www.googleapis.com/auth/chat.spaces`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///
        /// When authenticating as an app, the `space.customer` field must be set in
        /// the request.
        ///
        /// When authenticating as an app, the Chat app is added as a member of the
        /// space. However, unlike human authentication, the Chat app is not added as a
        /// space manager. By default, the Chat app can be removed from the space by
        /// all space members. To allow only space managers to remove the app from a
        /// space, set `space.permission_settings.manage_apps` to `managers_allowed`.
        ///
        /// Space membership upon creation depends on whether the space is created in
        /// `Import mode`:
        ///
        /// * **Import mode:** No members are created.
        /// * **All other modes:**  The calling user is added as a member. This is:
        ///  * The app itself when using app authentication.
        ///  * The human user when using user authentication.
        ///
        /// If you receive the error message `ALREADY_EXISTS` when creating
        /// a space, try a different `displayName`. An existing space within
        /// the Google Workspace organization might already use this display name.
        pub async fn create_space(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateSpaceRequest>,
        ) -> std::result::Result<tonic::Response<super::Space>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/CreateSpace",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "CreateSpace"));
            self.inner.unary(req, path, codec).await
        }
        /// Creates a space and adds specified users to it. The calling user is
        /// automatically added to the space, and shouldn't be specified as a
        /// membership in the request. For an example, see
        /// [Set up a space with initial
        /// members](https://developers.google.com/workspace/chat/set-up-spaces).
        ///
        /// To specify the human members to add, add memberships with the appropriate
        /// `membership.member.name`. To add a human user, use `users/{user}`, where
        /// `{user}` can be the email address for the user. For users in the same
        /// Workspace organization `{user}` can also be the `id` for the person from
        /// the People API, or the `id` for the user in the Directory API. For example,
        /// if the People API Person profile ID for `user@example.com` is `123456789`,
        /// you can add the user to the space by setting the `membership.member.name`
        /// to `users/user@example.com` or `users/123456789`.
        ///
        /// To specify the Google groups to add, add memberships with the
        /// appropriate `membership.group_member.name`. To add or invite a Google
        /// group, use `groups/{group}`, where `{group}` is the `id` for the group from
        /// the Cloud Identity Groups API. For example, you can use [Cloud Identity
        /// Groups lookup
        /// API](https://cloud.google.com/identity/docs/reference/rest/v1/groups/lookup)
        /// to retrieve the ID `123456789` for group email `group@example.com`, then
        /// you can add the group to the space by setting the
        /// `membership.group_member.name` to `groups/123456789`. Group email is not
        /// supported, and Google groups can only be added as members in named spaces.
        ///
        /// For a named space or group chat, if the caller blocks, or is blocked
        /// by some members, or doesn't have permission to add some members, then
        /// those members aren't added to the created space.
        ///
        /// To create a direct message (DM) between the calling user and another human
        /// user, specify exactly one membership to represent the human user. If
        /// one user blocks the other, the request fails and the DM isn't created.
        ///
        /// To create a DM between the calling user and the calling app, set
        /// `Space.singleUserBotDm` to `true` and don't specify any memberships. You
        /// can only use this method to set up a DM with the calling app. To add the
        /// calling app as a member of a space or an existing DM between two human
        /// users, see
        /// [Invite or add a user or app to a
        /// space](https://developers.google.com/workspace/chat/create-members).
        ///
        /// If a DM already exists between two users, even when one user blocks the
        /// other at the time a request is made, then the existing DM is returned.
        ///
        /// Spaces with threaded replies aren't supported. If you receive the error
        /// message `ALREADY_EXISTS` when setting up a space, try a different
        /// `displayName`. An existing space within the Google Workspace organization
        /// might already use this display name.
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.spaces.create`
        /// * `https://www.googleapis.com/auth/chat.spaces`
        pub async fn set_up_space(
            &mut self,
            request: impl tonic::IntoRequest<super::SetUpSpaceRequest>,
        ) -> std::result::Result<tonic::Response<super::Space>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/SetUpSpace",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "SetUpSpace"));
            self.inner.unary(req, path, codec).await
        }
        /// Updates a space. For an example, see
        /// [Update a
        /// space](https://developers.google.com/workspace/chat/update-spaces).
        ///
        /// If you're updating the `displayName` field and receive the error message
        /// `ALREADY_EXISTS`, try a different display name.. An existing space within
        /// the Google Workspace organization might already use this display name.
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator approval](https://support.google.com/a?p=chat-app-auth)
        ///  and one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.spaces`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.spaces`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    the following authorization scopes is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.spaces`
        ///
        /// App authentication has the following limitations:
        ///
        /// * To update either `space.predefined_permission_settings` or
        ///  `space.permission_settings`, the app must be the space creator.
        /// * Updating the `space.access_settings.audience` is not supported for app
        ///  authentication.
        pub async fn update_space(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateSpaceRequest>,
        ) -> std::result::Result<tonic::Response<super::Space>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/UpdateSpace",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "UpdateSpace"));
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a named space. Always performs a cascading delete, which means
        /// that the space's child resources—like messages posted in the space and
        /// memberships in the space—are also deleted. For an example, see
        /// [Delete a
        /// space](https://developers.google.com/workspace/chat/delete-spaces).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator
        ///  approval](https://support.google.com/a?p=chat-app-auth) and the
        ///  authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.delete` (only in
        ///    spaces the app created)
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.delete`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    the following authorization scope is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.delete`
        pub async fn delete_space(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteSpaceRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/DeleteSpace",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "DeleteSpace"));
            self.inner.unary(req, path, codec).await
        }
        /// Completes the
        /// [import process](https://developers.google.com/workspace/chat/import-data)
        /// for the specified space and makes it visible to users.
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// and domain-wide delegation with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.import`
        ///
        /// For more information, see [Authorize Google
        /// Chat apps to import
        /// data](https://developers.google.com/workspace/chat/authorize-import).
        pub async fn complete_import_space(
            &mut self,
            request: impl tonic::IntoRequest<super::CompleteImportSpaceRequest>,
        ) -> std::result::Result<
            tonic::Response<super::CompleteImportSpaceResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/CompleteImportSpace",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "CompleteImportSpace"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns the existing direct message with the specified user. If no direct
        /// message space is found, returns a `404 NOT_FOUND` error. For an example,
        /// see
        /// [Find a direct message](/chat/api/guides/v1/spaces/find-direct-message).
        ///
        /// With [app
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app),
        /// returns the direct message space between the specified user and the calling
        /// Chat app.
        ///
        /// With [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user),
        /// returns the direct message space between the specified user and the
        /// authenticated user.
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with the authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.bot`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.spaces.readonly`
        ///  * `https://www.googleapis.com/auth/chat.spaces`
        pub async fn find_direct_message(
            &mut self,
            request: impl tonic::IntoRequest<super::FindDirectMessageRequest>,
        ) -> std::result::Result<tonic::Response<super::Space>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/FindDirectMessage",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "FindDirectMessage"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns all spaces with `spaceType == GROUP_CHAT`, whose
        /// human memberships contain exactly the calling user, and the users specified
        /// in `FindGroupChatsRequest.users`. Only members that have joined the
        /// conversation are supported. For an example, see [Find group
        /// chats](https://developers.google.com/workspace/chat/find-group-chats).
        ///
        /// If the calling user blocks, or is blocked by, some users, and no spaces
        /// with the entire specified set of users are found, this method returns
        /// spaces that don't include the blocked or blocking users.
        ///
        /// The specified set of users must contain only human (non-app) memberships.
        /// A request that contains non-human users doesn't return any spaces.
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.memberships.readonly`
        /// * `https://www.googleapis.com/auth/chat.memberships`
        pub async fn find_group_chats(
            &mut self,
            request: impl tonic::IntoRequest<super::FindGroupChatsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::FindGroupChatsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/FindGroupChats",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "FindGroupChats"));
            self.inner.unary(req, path, codec).await
        }
        /// Creates a membership for the calling Chat app, a user, or a Google Group.
        /// Creating memberships for other Chat apps isn't supported.
        /// When creating a membership, if the specified member has their auto-accept
        /// policy turned off, then they're invited, and must accept the space
        /// invitation before joining. Otherwise, creating a membership adds the member
        /// directly to the specified space.
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator approval](https://support.google.com/a?p=chat-app-auth)
        ///  and the authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.memberships`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.memberships`
        ///  * `https://www.googleapis.com/auth/chat.memberships.app` (to add the
        ///    calling app to the space)
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    the following authorization scope is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.memberships`
        ///
        /// App authentication is not supported for the following use cases:
        ///
        /// * Inviting users external to the Workspace organization that owns the
        ///  space.
        /// * Adding a Google Group to a space.
        /// * Adding a Chat app to a space.
        ///
        /// For example usage, see:
        ///
        /// * [Invite or add a user to a
        ///  space](https://developers.google.com/workspace/chat/create-members#create-user-membership).
        /// * [Invite or add a Google Group to a
        ///  space](https://developers.google.com/workspace/chat/create-members#create-group-membership).
        /// * [Add the Chat app to a
        ///  space](https://developers.google.com/workspace/chat/create-members#create-membership-calling-api).
        pub async fn create_membership(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateMembershipRequest>,
        ) -> std::result::Result<tonic::Response<super::Membership>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/CreateMembership",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "CreateMembership"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates a membership. For an example, see [Update a user's membership in
        /// a space](https://developers.google.com/workspace/chat/update-members).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator
        ///  approval](https://support.google.com/a?p=chat-app-auth) and the
        ///  authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.memberships` (only in
        ///    spaces the app created)
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.memberships`
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    the following authorization scope is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.memberships`
        pub async fn update_membership(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateMembershipRequest>,
        ) -> std::result::Result<tonic::Response<super::Membership>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/UpdateMembership",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "UpdateMembership"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a membership. For an example, see
        /// [Remove a user or a Google Chat app from a
        /// space](https://developers.google.com/workspace/chat/delete-members).
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize):
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator approval](https://support.google.com/a?p=chat-app-auth)
        ///  and the authorization scope:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.memberships`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.memberships`
        ///  * `https://www.googleapis.com/auth/chat.memberships.app` (to remove
        ///    the calling app from the space)
        ///  * `https://www.googleapis.com/auth/chat.import` (import mode spaces
        ///    only)
        ///  * User authentication grants administrator privileges when an
        ///    administrator account authenticates, `use_admin_access` is `true`, and
        ///    the following authorization scope is used:
        ///    * `https://www.googleapis.com/auth/chat.admin.memberships`
        ///
        /// App authentication is not supported for the following use cases:
        ///
        /// * Removing a Google Group from a space.
        /// * Removing a Chat app from a space.
        ///
        /// To delete memberships for space managers, the requester
        /// must be a space manager. If you're using [app
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        /// the Chat app must be the space creator.
        pub async fn delete_membership(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteMembershipRequest>,
        ) -> std::result::Result<tonic::Response<super::Membership>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/DeleteMembership",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "DeleteMembership"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a reaction and adds it to a message. For an example, see
        /// [Add a reaction to a
        /// message](https://developers.google.com/workspace/chat/create-reactions).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.messages.reactions.create`
        /// * `https://www.googleapis.com/auth/chat.messages.reactions`
        /// * `https://www.googleapis.com/auth/chat.messages`
        /// * `https://www.googleapis.com/auth/chat.import` (import mode spaces only)
        pub async fn create_reaction(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateReactionRequest>,
        ) -> std::result::Result<tonic::Response<super::Reaction>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/CreateReaction",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "CreateReaction"));
            self.inner.unary(req, path, codec).await
        }
        /// Lists reactions to a message. For an example, see
        /// [List reactions for a
        /// message](https://developers.google.com/workspace/chat/list-reactions).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
        /// * `https://www.googleapis.com/auth/chat.messages.reactions`
        /// * `https://www.googleapis.com/auth/chat.messages.readonly`
        /// * `https://www.googleapis.com/auth/chat.messages`
        pub async fn list_reactions(
            &mut self,
            request: impl tonic::IntoRequest<super::ListReactionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListReactionsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListReactions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "ListReactions"));
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a reaction to a message. For an example, see
        /// [Delete a
        /// reaction](https://developers.google.com/workspace/chat/delete-reactions).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.messages.reactions`
        /// * `https://www.googleapis.com/auth/chat.messages`
        /// * `https://www.googleapis.com/auth/chat.import` (import mode spaces only)
        pub async fn delete_reaction(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteReactionRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/DeleteReaction",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "DeleteReaction"));
            self.inner.unary(req, path, codec).await
        }
        /// Creates a custom emoji.
        ///
        /// Custom emojis are only available for Google Workspace accounts, and the
        /// administrator must turn custom emojis on for the organization. For more
        /// information, see [Learn about custom emojis in Google
        /// Chat](https://support.google.com/chat/answer/12800149) and
        /// [Manage custom emoji
        /// permissions](https://support.google.com/a/answer/12850085).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.customemojis`
        pub async fn create_custom_emoji(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateCustomEmojiRequest>,
        ) -> std::result::Result<tonic::Response<super::CustomEmoji>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/CreateCustomEmoji",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "CreateCustomEmoji"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns details about a custom emoji.
        ///
        /// Custom emojis are only available for Google Workspace accounts, and the
        /// administrator must turn custom emojis on for the organization. For more
        /// information, see [Learn about custom emojis in Google
        /// Chat](https://support.google.com/chat/answer/12800149) and
        /// [Manage custom emoji
        /// permissions](https://support.google.com/a/answer/12850085).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.customemojis.readonly`
        /// * `https://www.googleapis.com/auth/chat.customemojis`
        pub async fn get_custom_emoji(
            &mut self,
            request: impl tonic::IntoRequest<super::GetCustomEmojiRequest>,
        ) -> std::result::Result<tonic::Response<super::CustomEmoji>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetCustomEmoji",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "GetCustomEmoji"));
            self.inner.unary(req, path, codec).await
        }
        /// Lists custom emojis visible to the authenticated user.
        ///
        /// Custom emojis are only available for Google Workspace accounts, and the
        /// administrator must turn custom emojis on for the organization. For more
        /// information, see [Learn about custom emojis in Google
        /// Chat](https://support.google.com/chat/answer/12800149) and
        /// [Manage custom emoji
        /// permissions](https://support.google.com/a/answer/12850085).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.customemojis.readonly`
        /// * `https://www.googleapis.com/auth/chat.customemojis`
        pub async fn list_custom_emojis(
            &mut self,
            request: impl tonic::IntoRequest<super::ListCustomEmojisRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListCustomEmojisResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListCustomEmojis",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "ListCustomEmojis"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a custom emoji. By default, users can only delete custom emoji they
        /// created. [Emoji managers](https://support.google.com/a/answer/12850085)
        /// assigned by the administrator can delete any custom emoji in the
        /// organization. See [Learn about custom emojis in Google
        /// Chat](https://support.google.com/chat/answer/12800149).
        ///
        /// Custom emojis are only available for Google Workspace accounts, and the
        /// administrator must turn custom emojis on for the organization. For more
        /// information, see [Learn about custom emojis in Google
        /// Chat](https://support.google.com/chat/answer/12800149) and
        /// [Manage custom emoji
        /// permissions](https://support.google.com/a/answer/12850085).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.customemojis`
        pub async fn delete_custom_emoji(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteCustomEmojiRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/DeleteCustomEmoji",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "DeleteCustomEmoji"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns details about a user's read state within a space, used to identify
        /// read and unread messages. For an example, see [Get details about a user's
        /// space read
        /// state](https://developers.google.com/workspace/chat/get-space-read-state).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.readstate.readonly`
        /// * `https://www.googleapis.com/auth/chat.users.readstate`
        pub async fn get_space_read_state(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSpaceReadStateRequest>,
        ) -> std::result::Result<tonic::Response<super::SpaceReadState>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetSpaceReadState",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "GetSpaceReadState"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates a user's read state within a space, used to identify read and
        /// unread messages. For an example, see [Update a user's space read
        /// state](https://developers.google.com/workspace/chat/update-space-read-state).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.readstate`
        pub async fn update_space_read_state(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateSpaceReadStateRequest>,
        ) -> std::result::Result<tonic::Response<super::SpaceReadState>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/UpdateSpaceReadState",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "UpdateSpaceReadState"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns details about a user's read state within a thread, used to identify
        /// read and unread messages. For an example, see [Get details about a user's
        /// thread read
        /// state](https://developers.google.com/workspace/chat/get-thread-read-state).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with one of the following [authorization
        /// scopes](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.readstate.readonly`
        /// * `https://www.googleapis.com/auth/chat.users.readstate`
        pub async fn get_thread_read_state(
            &mut self,
            request: impl tonic::IntoRequest<super::GetThreadReadStateRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ThreadReadState>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetThreadReadState",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "GetThreadReadState"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns an event from a Google Chat space. The [event
        /// payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
        /// contains the most recent version of the resource that changed. For example,
        /// if you request an event about a new message but the message was later
        /// updated, the server returns the updated `Message` resource in the event
        /// payload.
        ///
        /// Note: The `permissionSettings` field is not returned in the Space
        /// object of the Space event data for this request.
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize)
        /// with an
        /// [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes)
        /// appropriate for reading the requested data:
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator
        ///  approval](https://support.google.com/a?p=chat-app-auth)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.spaces`
        ///  * `https://www.googleapis.com/auth/chat.app.spaces.readonly`
        ///  * `https://www.googleapis.com/auth/chat.app.messages.readonly`
        ///  * `https://www.googleapis.com/auth/chat.app.memberships`
        ///  * `https://www.googleapis.com/auth/chat.app.memberships.readonly`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.spaces.readonly`
        ///  * `https://www.googleapis.com/auth/chat.spaces`
        ///  * `https://www.googleapis.com/auth/chat.messages.readonly`
        ///  * `https://www.googleapis.com/auth/chat.messages`
        ///  * `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
        ///  * `https://www.googleapis.com/auth/chat.messages.reactions`
        ///  * `https://www.googleapis.com/auth/chat.memberships.readonly`
        ///  * `https://www.googleapis.com/auth/chat.memberships`
        ///
        /// To get an event, the authenticated caller must be a member of the space.
        ///
        /// For an example, see [Get details about an
        /// event from a Google Chat
        /// space](https://developers.google.com/workspace/chat/get-space-event).
        pub async fn get_space_event(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSpaceEventRequest>,
        ) -> std::result::Result<tonic::Response<super::SpaceEvent>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetSpaceEvent",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "GetSpaceEvent"));
            self.inner.unary(req, path, codec).await
        }
        /// Lists events from a Google Chat space. For each event, the
        /// [payload](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.spaceEvents#SpaceEvent.FIELDS.oneof_payload)
        /// contains the most recent version of the Chat resource. For example, if you
        /// list events about new space members, the server returns `Membership`
        /// resources that contain the latest membership details. If new members were
        /// removed during the requested period, the event payload contains an empty
        /// `Membership` resource.
        ///
        /// Supports the following types of
        /// [authentication](https://developers.google.com/workspace/chat/authenticate-authorize)
        /// with an
        /// [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes)
        /// appropriate for reading the requested data:
        ///
        /// * [App
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-app)
        ///  with [administrator
        ///  approval](https://support.google.com/a?p=chat-app-auth)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.app.spaces`
        ///  * `https://www.googleapis.com/auth/chat.app.spaces.readonly`
        ///  * `https://www.googleapis.com/auth/chat.app.messages.readonly`
        ///  * `https://www.googleapis.com/auth/chat.app.memberships`
        ///  * `https://www.googleapis.com/auth/chat.app.memberships.readonly`
        /// * [User
        ///  authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        ///  with one of the following authorization scopes:
        ///
        ///  * `https://www.googleapis.com/auth/chat.spaces.readonly`
        ///  * `https://www.googleapis.com/auth/chat.spaces`
        ///  * `https://www.googleapis.com/auth/chat.messages.readonly`
        ///  * `https://www.googleapis.com/auth/chat.messages`
        ///  * `https://www.googleapis.com/auth/chat.messages.reactions.readonly`
        ///  * `https://www.googleapis.com/auth/chat.messages.reactions`
        ///  * `https://www.googleapis.com/auth/chat.memberships.readonly`
        ///  * `https://www.googleapis.com/auth/chat.memberships`
        ///
        /// To list events, the authenticated caller must be a member of the space.
        ///
        /// For an example, see [List events from a Google Chat
        /// space](https://developers.google.com/workspace/chat/list-space-events).
        pub async fn list_space_events(
            &mut self,
            request: impl tonic::IntoRequest<super::ListSpaceEventsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListSpaceEventsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListSpaceEvents",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "ListSpaceEvents"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the space notification setting. For an example, see [Get the
        /// caller's space notification
        /// setting](https://developers.google.com/workspace/chat/get-space-notification-setting).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.spacesettings`
        pub async fn get_space_notification_setting(
            &mut self,
            request: impl tonic::IntoRequest<super::GetSpaceNotificationSettingRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SpaceNotificationSetting>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/GetSpaceNotificationSetting",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.chat.v1.ChatService",
                        "GetSpaceNotificationSetting",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates the space notification setting. For an example, see [Update
        /// the caller's space notification
        /// setting](https://developers.google.com/workspace/chat/update-space-notification-setting).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.spacesettings`
        pub async fn update_space_notification_setting(
            &mut self,
            request: impl tonic::IntoRequest<
                super::UpdateSpaceNotificationSettingRequest,
            >,
        ) -> std::result::Result<
            tonic::Response<super::SpaceNotificationSetting>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/UpdateSpaceNotificationSetting",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.chat.v1.ChatService",
                        "UpdateSpaceNotificationSetting",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a section in Google Chat. Sections help users group conversations
        /// and customize the list of spaces displayed in Chat navigation panel. Only
        /// sections of type `CUSTOM_SECTION` can be created. For details, see [Create
        /// and organize sections in Google
        /// Chat](https://support.google.com/chat/answer/16059854).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.sections`
        pub async fn create_section(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateSectionRequest>,
        ) -> std::result::Result<tonic::Response<super::Section>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/CreateSection",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "CreateSection"));
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a section of type `CUSTOM_SECTION`.
        ///
        /// If the section contains items, such as spaces, the items are moved to
        /// Google Chat's default sections and are not deleted.
        ///
        /// For details, see [Create and organize sections in Google
        /// Chat](https://support.google.com/chat/answer/16059854).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.sections`
        pub async fn delete_section(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteSectionRequest>,
        ) -> std::result::Result<tonic::Response<()>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/DeleteSection",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "DeleteSection"));
            self.inner.unary(req, path, codec).await
        }
        /// Updates a section. Only sections of type `CUSTOM_SECTION` can be updated.
        /// For details, see [Create and organize sections in Google
        /// Chat](https://support.google.com/chat/answer/16059854).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.sections`
        pub async fn update_section(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateSectionRequest>,
        ) -> std::result::Result<tonic::Response<super::Section>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/UpdateSection",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "UpdateSection"));
            self.inner.unary(req, path, codec).await
        }
        /// Lists sections available to the Chat user. Sections help users group their
        /// conversations and customize the list of spaces displayed in Chat
        /// navigation panel. For details, see [Create and organize sections in Google
        /// Chat](https://support.google.com/chat/answer/16059854).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.sections`
        /// * `https://www.googleapis.com/auth/chat.users.sections.readonly`
        pub async fn list_sections(
            &mut self,
            request: impl tonic::IntoRequest<super::ListSectionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListSectionsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListSections",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(GrpcMethod::new("google.chat.v1.ChatService", "ListSections"));
            self.inner.unary(req, path, codec).await
        }
        /// Changes the sort order of a section. For details, see [Create and organize
        /// sections in Google Chat](https://support.google.com/chat/answer/16059854).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.sections`
        pub async fn position_section(
            &mut self,
            request: impl tonic::IntoRequest<super::PositionSectionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::PositionSectionResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/PositionSection",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "PositionSection"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists items in a section.
        ///
        /// Only spaces can be section items. For details, see [Create and organize
        /// sections in Google Chat](https://support.google.com/chat/answer/16059854).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.sections`
        /// * `https://www.googleapis.com/auth/chat.users.sections.readonly`
        pub async fn list_section_items(
            &mut self,
            request: impl tonic::IntoRequest<super::ListSectionItemsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListSectionItemsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/ListSectionItems",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "ListSectionItems"),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Moves an item from one section to another. For example, if a section
        /// contains spaces, this method can be used to move a space to a different
        /// section. For details, see [Create and organize sections in Google
        /// Chat](https://support.google.com/chat/answer/16059854).
        ///
        /// Requires [user
        /// authentication](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user)
        /// with the [authorization
        /// scope](https://developers.google.com/workspace/chat/authenticate-authorize#chat-api-scopes):
        ///
        /// * `https://www.googleapis.com/auth/chat.users.sections`
        pub async fn move_section_item(
            &mut self,
            request: impl tonic::IntoRequest<super::MoveSectionItemRequest>,
        ) -> std::result::Result<
            tonic::Response<super::MoveSectionItemResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.chat.v1.ChatService/MoveSectionItem",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new("google.chat.v1.ChatService", "MoveSectionItem"),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
