# frozen_string_literal: true # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Auto-generated by gapic-generator-ruby. DO NOT EDIT! module Google module Apps module Chat module V1 # A message in a Google Chat space. # @!attribute [rw] name # @return [::String] # 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). # @!attribute [r] sender # @return [::Google::Apps::Chat::V1::User] # 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`. # @!attribute [rw] create_time # @return [::Google::Protobuf::Timestamp] # 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. # @!attribute [r] last_update_time # @return [::Google::Protobuf::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. # @!attribute [r] delete_time # @return [::Google::Protobuf::Timestamp] # Output only. The time at which the message was deleted in # Google Chat. If the message is never deleted, this field is empty. # @!attribute [rw] text # @return [::String] # 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 text # message](https://developers.google.com/workspace/chat/create-messages#create-text-messages). # @!attribute [r] formatted_text # @return [::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 ``. # # * Custom hyperlinks using the format `<{url}|{rendered_text}>` where the # first string is the URL and the second is the rendered text—for example, # ``. # # * 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. # # 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) # @!attribute [rw] cards # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::Array<::Google::Apps::Chat::V1::ContextualAddOnMarkup::Card>] # 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. # @!attribute [rw] cards_v2 # @return [::Array<::Google::Apps::Chat::V1::CardWithId>] # 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 about cards and how to create them, see [Send card # messages](https://developers.google.com/workspace/chat/create-messages#create). # # [Card builder](https://addons.gsuite.google.com/uikit/builder) # @!attribute [r] annotations # @return [::Array<::Google::Apps::Chat::V1::Annotation>] # Output only. Annotations associated with the `text` in this message. # @!attribute [rw] thread # @return [::Google::Apps::Chat::V1::Thread] # 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). # @!attribute [rw] space # @return [::Google::Apps::Chat::V1::Space] # If your Chat app [authenticates as a # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user), # the output populates the # [space](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces) # `name`. # @!attribute [rw] fallback_text # @return [::String] # A plain-text description of the message's cards, used when the actual cards # can't be displayed—for example, mobile notifications. # @!attribute [rw] action_response # @return [::Google::Apps::Chat::V1::ActionResponse] # Input only. Parameters that a Chat app can use to configure how its # response is posted. # @!attribute [r] argument_text # @return [::String] # Output only. Plain-text body of the message with all Chat app mentions # stripped out. # @!attribute [r] slash_command # @return [::Google::Apps::Chat::V1::SlashCommand] # Output only. Slash command information, if applicable. # @!attribute [rw] attachment # @return [::Array<::Google::Apps::Chat::V1::Attachment>] # User-uploaded attachment. # @!attribute [r] matched_url # @return [::Google::Apps::Chat::V1::MatchedUrl] # 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). # @!attribute [r] thread_reply # @return [::Boolean] # 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`. # @!attribute [rw] client_assigned_message_id # @return [::String] # 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). # @!attribute [r] emoji_reaction_summaries # @return [::Array<::Google::Apps::Chat::V1::EmojiReactionSummary>] # Output only. The list of emoji reaction summaries on the message. # @!attribute [rw] private_message_viewer # @return [::Google::Apps::Chat::V1::User] # 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. Link previews and # attachments aren't supported for private messages. # # Only Chat apps can send private messages. If your Chat app [authenticates # as a # user](https://developers.google.com/workspace/chat/authenticate-authorize-chat-user) # to send a message, the message can't be private and must omit this field. # # For details, see [Send private messages to Google Chat # users](https://developers.google.com/workspace/chat/private-messages). # @!attribute [r] deletion_metadata # @return [::Google::Apps::Chat::V1::DeletionMetadata] # Output only. Information about a deleted message. A message is deleted when # `delete_time` is set. # @!attribute [r] quoted_message_metadata # @return [::Google::Apps::Chat::V1::QuotedMessageMetadata] # Output only. Information about a message that's quoted by a Google Chat # user in a space. Google Chat users can quote a message to reply to it. # @!attribute [r] attached_gifs # @return [::Array<::Google::Apps::Chat::V1::AttachedGif>] # Output only. GIF images that are attached to the message. # @!attribute [rw] accessory_widgets # @return [::Array<::Google::Apps::Chat::V1::AccessoryWidget>] # 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). class Message include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # A GIF image that's specified by a URL. # @!attribute [r] uri # @return [::String] # Output only. The URL that hosts the GIF image. class AttachedGif include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Information about a quoted message. # @!attribute [r] name # @return [::String] # Output only. Resource name of the quoted message. # # Format: `spaces/{space}/messages/{message}` # @!attribute [r] last_update_time # @return [::Google::Protobuf::Timestamp] # Output only. The timestamp when the quoted message was created or when the # quoted message was last updated. class QuotedMessageMetadata include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # 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. # @!attribute [rw] name # @return [::String] # Output only. Resource name of the thread. # # Example: `spaces/{space}/threads/{thread}` # @!attribute [rw] thread_key # @return [::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. class Thread include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Parameters that a Chat app can use to configure how its response is posted. # @!attribute [rw] type # @return [::Google::Apps::Chat::V1::ActionResponse::ResponseType] # Input only. The type of Chat app response. # @!attribute [rw] url # @return [::String] # Input only. URL for users to authenticate or configure. (Only for # `REQUEST_CONFIG` response types.) # @!attribute [rw] dialog_action # @return [::Google::Apps::Chat::V1::DialogAction] # 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`. # @!attribute [rw] updated_widget # @return [::Google::Apps::Chat::V1::ActionResponse::UpdatedWidget] # Input only. The response of the updated widget. class ActionResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # List of widget autocomplete results. # @!attribute [rw] items # @return [::Array<::Google::Apps::Card::V1::SelectionInput::SelectionItem>] # An array of the SelectionItem objects. class SelectionItems include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The response of the updated widget. # Used to provide autocomplete options for a widget. # @!attribute [rw] suggestions # @return [::Google::Apps::Chat::V1::ActionResponse::SelectionItems] # List of widget autocomplete results # @!attribute [rw] widget # @return [::String] # The ID of the updated widget. The ID must match the one for the # widget that triggered the update request. class UpdatedWidget include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # The type of Chat app response. module ResponseType # Default type that's handled as `NEW_MESSAGE`. TYPE_UNSPECIFIED = 0 # Post as a new message in the topic. NEW_MESSAGE = 1 # Update the Chat app's message. This is only permitted on a `CARD_CLICKED` # event where the message sender type is `BOT`. UPDATE_MESSAGE = 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. UPDATE_USER_MESSAGE_CARDS = 6 # Privately ask the user for additional authentication or configuration. REQUEST_CONFIG = 3 # Presents a # [dialog](https://developers.google.com/workspace/chat/dialogs). DIALOG = 4 # Widget text autocomplete options query. UPDATE_WIDGET = 7 end end # 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). # @!attribute [rw] button_list # @return [::Google::Apps::Card::V1::ButtonList] # A list of buttons. class AccessoryWidget include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Request to get a message. # @!attribute [rw] name # @return [::String] # 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). class GetMessageRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Request to delete a message. # @!attribute [rw] name # @return [::String] # 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). # @!attribute [rw] force # @return [::Boolean] # 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). class DeleteMessageRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Request to update a message. # @!attribute [rw] message # @return [::Google::Apps::Chat::V1::Message] # Required. Message with fields updated. # @!attribute [rw] update_mask # @return [::Google::Protobuf::FieldMask] # 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).) # @!attribute [rw] allow_missing # @return [::Boolean] # 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. class UpdateMessageRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Creates a message. # @!attribute [rw] parent # @return [::String] # Required. The resource name of the space in which to create a message. # # Format: `spaces/{space}` # @!attribute [rw] message # @return [::Google::Apps::Chat::V1::Message] # Required. Message body. # @!attribute [rw] thread_key # @deprecated This field is deprecated and may be removed in the next major version update. # @return [::String] # Optional. Deprecated: Use # {::Google::Apps::Chat::V1::Thread#thread_key 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 # {::Google::Apps::Chat::V1::Thread#name thread.name}. For example usage, see [Start or # reply to a message # thread](https://developers.google.com/workspace/chat/create-messages#create-message-thread). # @!attribute [rw] request_id # @return [::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. # @!attribute [rw] message_reply_option # @return [::Google::Apps::Chat::V1::CreateMessageRequest::MessageReplyOption] # Optional. Specifies whether a message starts a thread or replies to one. # Only supported in named spaces. # @!attribute [rw] message_id # @return [::String] # 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). class CreateMessageRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods # Specifies how to reply to a message. # More states might be added in the future. module MessageReplyOption # Default. Starts a new thread. Using this option ignores any [thread # ID][google.chat.v1.Thread.name] or # {::Google::Apps::Chat::V1::Thread#thread_key `thread_key`} that's included. MESSAGE_REPLY_OPTION_UNSPECIFIED = 0 # Creates the message as a reply to the thread specified by [thread # ID][google.chat.v1.Thread.name] or # {::Google::Apps::Chat::V1::Thread#thread_key `thread_key`}. If it fails, the # message starts a new thread instead. REPLY_MESSAGE_FALLBACK_TO_NEW_THREAD = 1 # Creates the message as a reply to the thread specified by [thread # ID][google.chat.v1.Thread.name] or # {::Google::Apps::Chat::V1::Thread#thread_key `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. REPLY_MESSAGE_OR_FAIL = 2 end end # Lists messages in the specified space, that the user is a member of. # @!attribute [rw] parent # @return [::String] # Required. The resource name of the space to list messages from. # # Format: `spaces/{space}` # @!attribute [rw] page_size # @return [::Integer] # 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. # @!attribute [rw] page_token # @return [::String] # Optional, if resuming from a previous query. # # 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. # @!attribute [rw] filter # @return [::String] # 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: # # ``` # 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. # @!attribute [rw] order_by # @return [::String] # Optional, if resuming from a previous query. # # 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`. # @!attribute [rw] show_deleted # @return [::Boolean] # Whether to include deleted messages. Deleted messages include deleted time # and metadata about their deletion, but message content is unavailable. class ListMessagesRequest include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Response message for listing messages. # @!attribute [rw] messages # @return [::Array<::Google::Apps::Chat::V1::Message>] # List of messages. # @!attribute [rw] next_page_token # @return [::String] # You can send a token as `pageToken` to retrieve the next page of # results. If empty, there are no subsequent pages. class ListMessagesResponse include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Contains a # [dialog](https://developers.google.com/workspace/chat/dialogs) and request # status code. # @!attribute [rw] dialog # @return [::Google::Apps::Chat::V1::Dialog] # Input only. # [Dialog](https://developers.google.com/workspace/chat/dialogs) for the # request. # @!attribute [rw] action_status # @return [::Google::Apps::Chat::V1::ActionStatus] # 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. class DialogAction include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # Wrapper around the card body of the dialog. # @!attribute [rw] body # @return [::Google::Apps::Card::V1::Card] # Input only. Body of the dialog, which is rendered in a modal. # Google Chat apps don't support the following card entities: # `DateTimePicker`, `OnChangeAction`. class Dialog include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end # 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) # @!attribute [rw] card_id # @return [::String] # Required if the message contains multiple cards. A unique identifier for # a card in a message. # @!attribute [rw] card # @return [::Google::Apps::Card::V1::Card] # A card. Maximum size is 32 KB. class CardWithId include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end end end end end