Class: Google::Apis::ChatV1::Message

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/chat_v1/classes.rb,
lib/google/apis/chat_v1/representations.rb,
lib/google/apis/chat_v1/representations.rb

Overview

A message in a Google Chat space.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Message

Returns a new instance of Message.



5206
5207
5208
# File 'lib/google/apis/chat_v1/classes.rb', line 5206

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#accessory_widgetsArray<Google::Apis::ChatV1::AccessoryWidget>

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. Creating a message with accessory widgets requires app authentication. Corresponds to the JSON property accessoryWidgets



5003
5004
5005
# File 'lib/google/apis/chat_v1/classes.rb', line 5003

def accessory_widgets
  @accessory_widgets
end

#action_responseGoogle::Apis::ChatV1::ActionResponse

Parameters that a Chat app can use to configure how its response is posted. Corresponds to the JSON property actionResponse



5008
5009
5010
# File 'lib/google/apis/chat_v1/classes.rb', line 5008

def action_response
  @action_response
end

#annotationsArray<Google::Apis::ChatV1::Annotation>

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. Corresponds to the JSON property annotations



5015
5016
5017
# File 'lib/google/apis/chat_v1/classes.rb', line 5015

def annotations
  @annotations
end

#argument_textString

Output only. Plain-text body of the message with all Chat app mentions stripped out. Corresponds to the JSON property argumentText

Returns:

  • (String)


5021
5022
5023
# File 'lib/google/apis/chat_v1/classes.rb', line 5021

def argument_text
  @argument_text
end

#attached_gifsArray<Google::Apis::ChatV1::AttachedGif>

Output only. GIF images that are attached to the message. Corresponds to the JSON property attachedGifs



5026
5027
5028
# File 'lib/google/apis/chat_v1/classes.rb', line 5026

def attached_gifs
  @attached_gifs
end

#attachmentArray<Google::Apis::ChatV1::Attachment>

Optional. User-uploaded attachment. Corresponds to the JSON property attachment



5031
5032
5033
# File 'lib/google/apis/chat_v1/classes.rb', line 5031

def attachment
  @attachment
end

#cardsArray<Google::Apis::ChatV1::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. Corresponds to the JSON property cards

Returns:



5039
5040
5041
# File 'lib/google/apis/chat_v1/classes.rb', line 5039

def cards
  @cards
end

#cards_v2Array<Google::Apis::ChatV1::CardWithId>

Optional. An array of cards. Only Chat apps can create cards. If your Chat app authenticates as a user, the messages can't contain cards. To learn how to create a message that contains cards, see Send a message. Card builder Corresponds to the JSON property cardsV2



5050
5051
5052
# File 'lib/google/apis/chat_v1/classes.rb', line 5050

def cards_v2
  @cards_v2
end

#client_assigned_message_idString

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 field when you create the message. For details, see Name a message. Corresponds to the JSON property clientAssignedMessageId

Returns:

  • (String)


5060
5061
5062
# File 'lib/google/apis/chat_v1/classes.rb', line 5060

def client_assigned_message_id
  @client_assigned_message_id
end

#create_timeString

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. Corresponds to the JSON property createTime

Returns:

  • (String)


5069
5070
5071
# File 'lib/google/apis/chat_v1/classes.rb', line 5069

def create_time
  @create_time
end

#delete_timeString

Output only. The time at which the message was deleted in Google Chat. If the message is never deleted, this field is empty. Corresponds to the JSON property deleteTime

Returns:

  • (String)


5075
5076
5077
# File 'lib/google/apis/chat_v1/classes.rb', line 5075

def delete_time
  @delete_time
end

#deletion_metadataGoogle::Apis::ChatV1::DeletionMetadata

Information about a deleted message. A message is deleted when delete_time is set. Corresponds to the JSON property deletionMetadata



5081
5082
5083
# File 'lib/google/apis/chat_v1/classes.rb', line 5081

def 
  @deletion_metadata
end

#emoji_reaction_summariesArray<Google::Apis::ChatV1::EmojiReactionSummary>

Output only. The list of emoji reaction summaries on the message. Corresponds to the JSON property emojiReactionSummaries



5086
5087
5088
# File 'lib/google/apis/chat_v1/classes.rb', line 5086

def emoji_reaction_summaries
  @emoji_reaction_summaries
end

#fallback_textString

Optional. A plain-text description of the message's cards, used when the actual cards can't be displayed—for example, mobile notifications. Corresponds to the JSON property fallbackText

Returns:

  • (String)


5092
5093
5094
# File 'lib/google/apis/chat_v1/classes.rb', line 5092

def fallback_text
  @fallback_text
end

#formatted_textString

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 for bold, italic, strikethrough, monospace, monospace block, and bulleted list. * User mentions 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 asU+1F600for 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) Corresponds to the JSON propertyformattedText`

Returns:

  • (String)


5110
5111
5112
# File 'lib/google/apis/chat_v1/classes.rb', line 5110

def formatted_text
  @formatted_text
end

#last_update_timeString

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. Corresponds to the JSON property lastUpdateTime

Returns:

  • (String)


5116
5117
5118
# File 'lib/google/apis/chat_v1/classes.rb', line 5116

def last_update_time
  @last_update_time
end

#matched_urlGoogle::Apis::ChatV1::MatchedUrl

A matched URL in a Chat message. Chat apps can preview matched URLs. For more information, see Preview links. Corresponds to the JSON property matchedUrl



5123
5124
5125
# File 'lib/google/apis/chat_v1/classes.rb', line 5123

def matched_url
  @matched_url
end

#nameString

Identifier. Resource name of the message. Format: spaces/space/messages/ messageWherespaceis the ID of the space where the message is posted andmessageis 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 replacingmessage`with the value from theclientAssignedMessageIdfield. 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). Corresponds to the JSON propertyname`

Returns:

  • (String)


5136
5137
5138
# File 'lib/google/apis/chat_v1/classes.rb', line 5136

def name
  @name
end

#private_message_viewerGoogle::Apis::ChatV1::User

A user in Google Chat. When returned as an output from a request, if your Chat app authenticates as a user, the output for a User resource only populates the user's name and type. Corresponds to the JSON property privateMessageViewer



5144
5145
5146
# File 'lib/google/apis/chat_v1/classes.rb', line 5144

def private_message_viewer
  @private_message_viewer
end

#quoted_message_metadataGoogle::Apis::ChatV1::QuotedMessageMetadata

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. Corresponds to the JSON property quotedMessageMetadata



5155
5156
5157
# File 'lib/google/apis/chat_v1/classes.rb', line 5155

def 
  @quoted_message_metadata
end

#senderGoogle::Apis::ChatV1::User

A user in Google Chat. When returned as an output from a request, if your Chat app authenticates as a user, the output for a User resource only populates the user's name and type. Corresponds to the JSON property sender



5163
5164
5165
# File 'lib/google/apis/chat_v1/classes.rb', line 5163

def sender
  @sender
end

#slash_commandGoogle::Apis::ChatV1::SlashCommand

Metadata about a slash command in Google Chat. Corresponds to the JSON property slashCommand



5169
5170
5171
# File 'lib/google/apis/chat_v1/classes.rb', line 5169

def slash_command
  @slash_command
end

#spaceGoogle::Apis::ChatV1::Space

A space in Google Chat. Spaces are conversations between two or more users or 1:1 messages between a user and a Chat app. Corresponds to the JSON property space



5175
5176
5177
# File 'lib/google/apis/chat_v1/classes.rb', line 5175

def space
  @space
end

#textString

Optional. Plain-text body of the message. The first link to an image, video, or web page generates a preview chip. You can also @mention a Google Chat user, or everyone in the space. To learn about creating text messages, see Send a message. Corresponds to the JSON property text

Returns:

  • (String)


5185
5186
5187
# File 'lib/google/apis/chat_v1/classes.rb', line 5185

def text
  @text
end

#threadGoogle::Apis::ChatV1::Thread

A thread in a Google Chat space. For example usage, see Start or reply to a message thread. If you specify a thread when creating a message, you can set the messageReplyOption field to determine what happens if no matching thread is found. Corresponds to the JSON property thread



5195
5196
5197
# File 'lib/google/apis/chat_v1/classes.rb', line 5195

def thread
  @thread
end

#thread_replyBoolean Also known as: thread_reply?

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. Corresponds to the JSON property threadReply

Returns:

  • (Boolean)


5203
5204
5205
# File 'lib/google/apis/chat_v1/classes.rb', line 5203

def thread_reply
  @thread_reply
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
# File 'lib/google/apis/chat_v1/classes.rb', line 5211

def update!(**args)
  @accessory_widgets = args[:accessory_widgets] if args.key?(:accessory_widgets)
  @action_response = args[:action_response] if args.key?(:action_response)
  @annotations = args[:annotations] if args.key?(:annotations)
  @argument_text = args[:argument_text] if args.key?(:argument_text)
  @attached_gifs = args[:attached_gifs] if args.key?(:attached_gifs)
  @attachment = args[:attachment] if args.key?(:attachment)
  @cards = args[:cards] if args.key?(:cards)
  @cards_v2 = args[:cards_v2] if args.key?(:cards_v2)
  @client_assigned_message_id = args[:client_assigned_message_id] if args.key?(:client_assigned_message_id)
  @create_time = args[:create_time] if args.key?(:create_time)
  @delete_time = args[:delete_time] if args.key?(:delete_time)
  @deletion_metadata = args[:deletion_metadata] if args.key?(:deletion_metadata)
  @emoji_reaction_summaries = args[:emoji_reaction_summaries] if args.key?(:emoji_reaction_summaries)
  @fallback_text = args[:fallback_text] if args.key?(:fallback_text)
  @formatted_text = args[:formatted_text] if args.key?(:formatted_text)
  @last_update_time = args[:last_update_time] if args.key?(:last_update_time)
  @matched_url = args[:matched_url] if args.key?(:matched_url)
  @name = args[:name] if args.key?(:name)
  @private_message_viewer = args[:private_message_viewer] if args.key?(:private_message_viewer)
  @quoted_message_metadata = args[:quoted_message_metadata] if args.key?(:quoted_message_metadata)
  @sender = args[:sender] if args.key?(:sender)
  @slash_command = args[:slash_command] if args.key?(:slash_command)
  @space = args[:space] if args.key?(:space)
  @text = args[:text] if args.key?(:text)
  @thread = args[:thread] if args.key?(:thread)
  @thread_reply = args[:thread_reply] if args.key?(:thread_reply)
end