# 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
        # Output only. Annotations associated with the plain-text body of the message.
        # 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:
        # ```
        # Hello @FooBot how are you!"
        # ```
        #
        # The corresponding annotations metadata:
        # ```
        # "annotations":[{
        #   "type":"USER_MENTION",
        #   "startIndex":6,
        #   "length":7,
        #   "userMention": {
        #     "user": {
        #       "name":"users/\\{user}",
        #       "displayName":"FooBot",
        #       "avatarUrl":"https://goo.gl/aeDtrS",
        #       "type":"BOT"
        #     },
        #     "type":"MENTION"
        #    }
        # }]
        # ```
        # @!attribute [rw] type
        #   @return [::Google::Apps::Chat::V1::AnnotationType]
        #     The type of this annotation.
        # @!attribute [rw] start_index
        #   @return [::Integer]
        #     Start index (0-based, inclusive) in the plain-text message body this
        #     annotation corresponds to.
        # @!attribute [rw] length
        #   @return [::Integer]
        #     Length of the substring in the plain-text message body this annotation
        #     corresponds to.
        # @!attribute [rw] user_mention
        #   @return [::Google::Apps::Chat::V1::UserMentionMetadata]
        #     The metadata of user mention.
        # @!attribute [rw] slash_command
        #   @return [::Google::Apps::Chat::V1::SlashCommandMetadata]
        #     The metadata for a slash command.
        # @!attribute [rw] rich_link_metadata
        #   @return [::Google::Apps::Chat::V1::RichLinkMetadata]
        #     The metadata for a rich link.
        class Annotation
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Annotation metadata for user mentions (@).
        # @!attribute [rw] user
        #   @return [::Google::Apps::Chat::V1::User]
        #     The user mentioned.
        # @!attribute [rw] type
        #   @return [::Google::Apps::Chat::V1::UserMentionMetadata::Type]
        #     The type of user mention.
        class UserMentionMetadata
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          module Type
            # Default value for the enum. Don't use.
            TYPE_UNSPECIFIED = 0

            # Add user to space.
            ADD = 1

            # Mention user in space.
            MENTION = 2
          end
        end

        # Annotation metadata for slash commands (/).
        # @!attribute [rw] bot
        #   @return [::Google::Apps::Chat::V1::User]
        #     The Chat app whose command was invoked.
        # @!attribute [rw] type
        #   @return [::Google::Apps::Chat::V1::SlashCommandMetadata::Type]
        #     The type of slash command.
        # @!attribute [rw] command_name
        #   @return [::String]
        #     The name of the invoked slash command.
        # @!attribute [rw] command_id
        #   @return [::Integer]
        #     The command ID of the invoked slash command.
        # @!attribute [rw] triggers_dialog
        #   @return [::Boolean]
        #     Indicates whether the slash command is for a dialog.
        class SlashCommandMetadata
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          module Type
            # Default value for the enum. Don't use.
            TYPE_UNSPECIFIED = 0

            # Add Chat app to space.
            ADD = 1

            # Invoke slash command in space.
            INVOKE = 2
          end
        end

        # A rich link to a resource.
        # @!attribute [rw] uri
        #   @return [::String]
        #     The URI of this link.
        # @!attribute [rw] rich_link_type
        #   @return [::Google::Apps::Chat::V1::RichLinkMetadata::RichLinkType]
        #     The rich link type.
        # @!attribute [rw] drive_link_data
        #   @return [::Google::Apps::Chat::V1::DriveLinkData]
        #     Data for a drive link.
        # @!attribute [rw] chat_space_link_data
        #   @return [::Google::Apps::Chat::V1::ChatSpaceLinkData]
        #     Data for a chat space link.
        class RichLinkMetadata
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # The rich link type. More types might be added in the future.
          module RichLinkType
            # Default value for the enum. Don't use.
            RICH_LINK_TYPE_UNSPECIFIED = 0

            # A Google Drive rich link type.
            DRIVE_FILE = 1

            # A Chat space rich link type. For example, a space smart chip.
            CHAT_SPACE = 2
          end
        end

        # Data for Google Drive links.
        # @!attribute [rw] drive_data_ref
        #   @return [::Google::Apps::Chat::V1::DriveDataRef]
        #     A
        #     [DriveDataRef](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages.attachments#drivedataref)
        #     which references a Google Drive file.
        # @!attribute [rw] mime_type
        #   @return [::String]
        #     The mime type of the linked Google Drive resource.
        class DriveLinkData
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Data for Chat space links.
        # @!attribute [rw] space
        #   @return [::String]
        #     The space of the linked Chat space resource.
        #
        #     Format: `spaces/{space}`
        # @!attribute [rw] thread
        #   @return [::String]
        #     The thread of the linked Chat space resource.
        #
        #     Format: `spaces/{space}/threads/{thread}`
        # @!attribute [rw] message
        #   @return [::String]
        #     The message of the linked Chat space resource.
        #
        #     Format: `spaces/{space}/messages/{message}`
        class ChatSpaceLinkData
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods
        end

        # Type of the annotation.
        module AnnotationType
          # Default value for the enum. Don't use.
          ANNOTATION_TYPE_UNSPECIFIED = 0

          # A user is mentioned.
          USER_MENTION = 1

          # A slash command is invoked.
          SLASH_COMMAND = 2

          # A rich link annotation.
          RICH_LINK = 3
        end
      end
    end
  end
end