Class: MicrosoftGraph::Models::ChatMessage

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/chat_message.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new chatMessage and sets the default values.



143
144
145
# File 'lib/models/chat_message.rb', line 143

def initialize()
    super
end

Class Method Details

.create_from_discriminator_value(parse_node) ⇒ Object

Creates a new instance of the appropriate class based on discriminator value

Parameters:

  • parse_node

    The parse node to use to read the discriminator value and create the object

Returns:

  • a chat_message

Raises:

  • (StandardError)


166
167
168
169
# File 'lib/models/chat_message.rb', line 166

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return ChatMessage.new
end

Instance Method Details

#attachmentsObject

Gets the attachments property value. References to attached objects like files, tabs, meetings etc.

Returns:

  • a chat_message_attachment



83
84
85
# File 'lib/models/chat_message.rb', line 83

def attachments
    return @attachments
end

#attachments=(value) ⇒ Object

Sets the attachments property value. References to attached objects like files, tabs, meetings etc.

Parameters:

  • value

    Value to set for the attachments property.

Returns:

  • a void



91
92
93
# File 'lib/models/chat_message.rb', line 91

def attachments=(value)
    @attachments = value
end

#bodyObject

Gets the body property value. The body property

Returns:

  • a item_body



98
99
100
# File 'lib/models/chat_message.rb', line 98

def body
    return @body
end

#body=(value) ⇒ Object

Sets the body property value. The body property

Parameters:

  • value

    Value to set for the body property.

Returns:

  • a void



106
107
108
# File 'lib/models/chat_message.rb', line 106

def body=(value)
    @body = value
end

#channel_identityObject

Gets the channelIdentity property value. If the message was sent in a channel, represents identity of the channel.

Returns:

  • a channel_identity



113
114
115
# File 'lib/models/chat_message.rb', line 113

def channel_identity
    return @channel_identity
end

#channel_identity=(value) ⇒ Object

Sets the channelIdentity property value. If the message was sent in a channel, represents identity of the channel.

Parameters:

  • value

    Value to set for the channel_identity property.

Returns:

  • a void



121
122
123
# File 'lib/models/chat_message.rb', line 121

def channel_identity=(value)
    @channel_identity = value
end

#chat_idObject

Gets the chatId property value. If the message was sent in a chat, represents the identity of the chat.

Returns:

  • a string



128
129
130
# File 'lib/models/chat_message.rb', line 128

def chat_id
    return @chat_id
end

#chat_id=(value) ⇒ Object

Sets the chatId property value. If the message was sent in a chat, represents the identity of the chat.

Parameters:

  • value

    Value to set for the chat_id property.

Returns:

  • a void



136
137
138
# File 'lib/models/chat_message.rb', line 136

def chat_id=(value)
    @chat_id = value
end

#created_date_timeObject

Gets the createdDateTime property value. Timestamp of when the chat message was created.

Returns:

  • a date_time



150
151
152
# File 'lib/models/chat_message.rb', line 150

def created_date_time
    return @created_date_time
end

#created_date_time=(value) ⇒ Object

Sets the createdDateTime property value. Timestamp of when the chat message was created.

Parameters:

  • value

    Value to set for the created_date_time property.

Returns:

  • a void



158
159
160
# File 'lib/models/chat_message.rb', line 158

def created_date_time=(value)
    @created_date_time = value
end

#deleted_date_timeObject

Gets the deletedDateTime property value. Read only. Timestamp at which the chat message was deleted, or null if not deleted.

Returns:

  • a date_time



174
175
176
# File 'lib/models/chat_message.rb', line 174

def deleted_date_time
    return @deleted_date_time
end

#deleted_date_time=(value) ⇒ Object

Sets the deletedDateTime property value. Read only. Timestamp at which the chat message was deleted, or null if not deleted.

Parameters:

  • value

    Value to set for the deleted_date_time property.

Returns:

  • a void



182
183
184
# File 'lib/models/chat_message.rb', line 182

def deleted_date_time=(value)
    @deleted_date_time = value
end

#etagObject

Gets the etag property value. Read-only. Version number of the chat message.

Returns:

  • a string



189
190
191
# File 'lib/models/chat_message.rb', line 189

def etag
    return @etag
end

#etag=(value) ⇒ Object

Sets the etag property value. Read-only. Version number of the chat message.

Parameters:

  • value

    Value to set for the etag property.

Returns:

  • a void



197
198
199
# File 'lib/models/chat_message.rb', line 197

def etag=(value)
    @etag = value
end

#event_detailObject

Gets the eventDetail property value. Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, adding new members. For event messages, the messageType property will be set to systemEventMessage.

Returns:

  • a event_message_detail



204
205
206
# File 'lib/models/chat_message.rb', line 204

def event_detail
    return @event_detail
end

#event_detail=(value) ⇒ Object

Sets the eventDetail property value. Read-only. If present, represents details of an event that happened in a chat, a channel, or a team, for example, adding new members. For event messages, the messageType property will be set to systemEventMessage.

Parameters:

  • value

    Value to set for the event_detail property.

Returns:

  • a void



212
213
214
# File 'lib/models/chat_message.rb', line 212

def event_detail=(value)
    @event_detail = value
end

#fromObject

Gets the from property value. Details of the sender of the chat message. Can only be set during migration.

Returns:

  • a chat_message_from_identity_set



219
220
221
# File 'lib/models/chat_message.rb', line 219

def from
    return @from
end

#from=(value) ⇒ Object

Sets the from property value. Details of the sender of the chat message. Can only be set during migration.

Parameters:

  • value

    Value to set for the from property.

Returns:

  • a void



227
228
229
# File 'lib/models/chat_message.rb', line 227

def from=(value)
    @from = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/models/chat_message.rb', line 234

def get_field_deserializers()
    return super.merge({
        "attachments" => lambda {|n| @attachments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessageAttachment.create_from_discriminator_value(pn) }) },
        "body" => lambda {|n| @body = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },
        "channelIdentity" => lambda {|n| @channel_identity = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChannelIdentity.create_from_discriminator_value(pn) }) },
        "chatId" => lambda {|n| @chat_id = n.get_string_value() },
        "createdDateTime" => lambda {|n| @created_date_time = n.get_date_time_value() },
        "deletedDateTime" => lambda {|n| @deleted_date_time = n.get_date_time_value() },
        "etag" => lambda {|n| @etag = n.get_string_value() },
        "eventDetail" => lambda {|n| @event_detail = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EventMessageDetail.create_from_discriminator_value(pn) }) },
        "from" => lambda {|n| @from = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatMessageFromIdentitySet.create_from_discriminator_value(pn) }) },
        "hostedContents" => lambda {|n| @hosted_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessageHostedContent.create_from_discriminator_value(pn) }) },
        "importance" => lambda {|n| @importance = n.get_enum_value(MicrosoftGraph::Models::ChatMessageImportance) },
        "lastEditedDateTime" => lambda {|n| @last_edited_date_time = n.get_date_time_value() },
        "lastModifiedDateTime" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },
        "locale" => lambda {|n| @locale = n.get_string_value() },
        "mentions" => lambda {|n| @mentions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessageMention.create_from_discriminator_value(pn) }) },
        "messageType" => lambda {|n| @message_type = n.get_enum_value(MicrosoftGraph::Models::ChatMessageType) },
        "policyViolation" => lambda {|n| @policy_violation = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatMessagePolicyViolation.create_from_discriminator_value(pn) }) },
        "reactions" => lambda {|n| @reactions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessageReaction.create_from_discriminator_value(pn) }) },
        "replies" => lambda {|n| @replies = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessage.create_from_discriminator_value(pn) }) },
        "replyToId" => lambda {|n| @reply_to_id = n.get_string_value() },
        "subject" => lambda {|n| @subject = n.get_string_value() },
        "summary" => lambda {|n| @summary = n.get_string_value() },
        "webUrl" => lambda {|n| @web_url = n.get_string_value() },
    })
end

#hosted_contentsObject

Gets the hostedContents property value. Content in a message hosted by Microsoft Teams - for example, images or code snippets.

Returns:

  • a chat_message_hosted_content



265
266
267
# File 'lib/models/chat_message.rb', line 265

def hosted_contents
    return @hosted_contents
end

#hosted_contents=(value) ⇒ Object

Sets the hostedContents property value. Content in a message hosted by Microsoft Teams - for example, images or code snippets.

Parameters:

  • value

    Value to set for the hosted_contents property.

Returns:

  • a void



273
274
275
# File 'lib/models/chat_message.rb', line 273

def hosted_contents=(value)
    @hosted_contents = value
end

#importanceObject

Gets the importance property value. The importance property

Returns:

  • a chat_message_importance



280
281
282
# File 'lib/models/chat_message.rb', line 280

def importance
    return @importance
end

#importance=(value) ⇒ Object

Sets the importance property value. The importance property

Parameters:

  • value

    Value to set for the importance property.

Returns:

  • a void



288
289
290
# File 'lib/models/chat_message.rb', line 288

def importance=(value)
    @importance = value
end

#last_edited_date_timeObject

Gets the lastEditedDateTime property value. Read only. Timestamp when edits to the chat message were made. Triggers an ‘Edited’ flag in the Teams UI. If no edits are made the value is null.

Returns:

  • a date_time



295
296
297
# File 'lib/models/chat_message.rb', line 295

def last_edited_date_time
    return @last_edited_date_time
end

#last_edited_date_time=(value) ⇒ Object

Sets the lastEditedDateTime property value. Read only. Timestamp when edits to the chat message were made. Triggers an ‘Edited’ flag in the Teams UI. If no edits are made the value is null.

Parameters:

  • value

    Value to set for the last_edited_date_time property.

Returns:

  • a void



303
304
305
# File 'lib/models/chat_message.rb', line 303

def last_edited_date_time=(value)
    @last_edited_date_time = value
end

#last_modified_date_timeObject

Gets the lastModifiedDateTime property value. Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.

Returns:

  • a date_time



310
311
312
# File 'lib/models/chat_message.rb', line 310

def last_modified_date_time
    return @last_modified_date_time
end

#last_modified_date_time=(value) ⇒ Object

Sets the lastModifiedDateTime property value. Read only. Timestamp when the chat message is created (initial setting) or modified, including when a reaction is added or removed.

Parameters:

  • value

    Value to set for the last_modified_date_time property.

Returns:

  • a void



318
319
320
# File 'lib/models/chat_message.rb', line 318

def last_modified_date_time=(value)
    @last_modified_date_time = value
end

#localeObject

Gets the locale property value. Locale of the chat message set by the client. Always set to en-us.

Returns:

  • a string



325
326
327
# File 'lib/models/chat_message.rb', line 325

def locale
    return @locale
end

#locale=(value) ⇒ Object

Sets the locale property value. Locale of the chat message set by the client. Always set to en-us.

Parameters:

  • value

    Value to set for the locale property.

Returns:

  • a void



333
334
335
# File 'lib/models/chat_message.rb', line 333

def locale=(value)
    @locale = value
end

#mentionsObject

Gets the mentions property value. List of entities mentioned in the chat message. Supported entities are: user, bot, team, and channel.

Returns:

  • a chat_message_mention



340
341
342
# File 'lib/models/chat_message.rb', line 340

def mentions
    return @mentions
end

#mentions=(value) ⇒ Object

Sets the mentions property value. List of entities mentioned in the chat message. Supported entities are: user, bot, team, and channel.

Parameters:

  • value

    Value to set for the mentions property.

Returns:

  • a void



348
349
350
# File 'lib/models/chat_message.rb', line 348

def mentions=(value)
    @mentions = value
end

#message_typeObject

Gets the messageType property value. The messageType property

Returns:

  • a chat_message_type



355
356
357
# File 'lib/models/chat_message.rb', line 355

def message_type
    return @message_type
end

#message_type=(value) ⇒ Object

Sets the messageType property value. The messageType property

Parameters:

  • value

    Value to set for the message_type property.

Returns:

  • a void



363
364
365
# File 'lib/models/chat_message.rb', line 363

def message_type=(value)
    @message_type = value
end

#policy_violationObject

Gets the policyViolation property value. Defines the properties of a policy violation set by a data loss prevention (DLP) application.

Returns:

  • a chat_message_policy_violation



370
371
372
# File 'lib/models/chat_message.rb', line 370

def policy_violation
    return @policy_violation
end

#policy_violation=(value) ⇒ Object

Sets the policyViolation property value. Defines the properties of a policy violation set by a data loss prevention (DLP) application.

Parameters:

  • value

    Value to set for the policy_violation property.

Returns:

  • a void



378
379
380
# File 'lib/models/chat_message.rb', line 378

def policy_violation=(value)
    @policy_violation = value
end

#reactionsObject

Gets the reactions property value. Reactions for this chat message (for example, Like).

Returns:

  • a chat_message_reaction



385
386
387
# File 'lib/models/chat_message.rb', line 385

def reactions
    return @reactions
end

#reactions=(value) ⇒ Object

Sets the reactions property value. Reactions for this chat message (for example, Like).

Parameters:

  • value

    Value to set for the reactions property.

Returns:

  • a void



393
394
395
# File 'lib/models/chat_message.rb', line 393

def reactions=(value)
    @reactions = value
end

#repliesObject

Gets the replies property value. Replies for a specified message. Supports $expand for channel messages.

Returns:

  • a chat_message



400
401
402
# File 'lib/models/chat_message.rb', line 400

def replies
    return @replies
end

#replies=(value) ⇒ Object

Sets the replies property value. Replies for a specified message. Supports $expand for channel messages.

Parameters:

  • value

    Value to set for the replies property.

Returns:

  • a void



408
409
410
# File 'lib/models/chat_message.rb', line 408

def replies=(value)
    @replies = value
end

#reply_to_idObject

Gets the replyToId property value. Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)

Returns:

  • a string



415
416
417
# File 'lib/models/chat_message.rb', line 415

def reply_to_id
    return @reply_to_id
end

#reply_to_id=(value) ⇒ Object

Sets the replyToId property value. Read-only. ID of the parent chat message or root chat message of the thread. (Only applies to chat messages in channels, not chats.)

Parameters:

  • value

    Value to set for the reply_to_id property.

Returns:

  • a void



423
424
425
# File 'lib/models/chat_message.rb', line 423

def reply_to_id=(value)
    @reply_to_id = value
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
# File 'lib/models/chat_message.rb', line 431

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_collection_of_object_values("attachments", @attachments)
    writer.write_object_value("body", @body)
    writer.write_object_value("channelIdentity", @channel_identity)
    writer.write_string_value("chatId", @chat_id)
    writer.write_date_time_value("createdDateTime", @created_date_time)
    writer.write_date_time_value("deletedDateTime", @deleted_date_time)
    writer.write_string_value("etag", @etag)
    writer.write_object_value("eventDetail", @event_detail)
    writer.write_object_value("from", @from)
    writer.write_collection_of_object_values("hostedContents", @hosted_contents)
    writer.write_enum_value("importance", @importance)
    writer.write_date_time_value("lastEditedDateTime", @last_edited_date_time)
    writer.write_date_time_value("lastModifiedDateTime", @last_modified_date_time)
    writer.write_string_value("locale", @locale)
    writer.write_collection_of_object_values("mentions", @mentions)
    writer.write_enum_value("messageType", @message_type)
    writer.write_object_value("policyViolation", @policy_violation)
    writer.write_collection_of_object_values("reactions", @reactions)
    writer.write_collection_of_object_values("replies", @replies)
    writer.write_string_value("replyToId", @reply_to_id)
    writer.write_string_value("subject", @subject)
    writer.write_string_value("summary", @summary)
    writer.write_string_value("webUrl", @web_url)
end

#subjectObject

Gets the subject property value. The subject of the chat message, in plaintext.

Returns:

  • a string



462
463
464
# File 'lib/models/chat_message.rb', line 462

def subject
    return @subject
end

#subject=(value) ⇒ Object

Sets the subject property value. The subject of the chat message, in plaintext.

Parameters:

  • value

    Value to set for the subject property.

Returns:

  • a void



470
471
472
# File 'lib/models/chat_message.rb', line 470

def subject=(value)
    @subject = value
end

#summaryObject

Gets the summary property value. Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.

Returns:

  • a string



477
478
479
# File 'lib/models/chat_message.rb', line 477

def summary
    return @summary
end

#summary=(value) ⇒ Object

Sets the summary property value. Summary text of the chat message that could be used for push notifications and summary views or fall back views. Only applies to channel chat messages, not chat messages in a chat.

Parameters:

  • value

    Value to set for the summary property.

Returns:

  • a void



485
486
487
# File 'lib/models/chat_message.rb', line 485

def summary=(value)
    @summary = value
end

#web_urlObject

Gets the webUrl property value. Read-only. Link to the message in Microsoft Teams.

Returns:

  • a string



492
493
494
# File 'lib/models/chat_message.rb', line 492

def web_url
    return @web_url
end

#web_url=(value) ⇒ Object

Sets the webUrl property value. Read-only. Link to the message in Microsoft Teams.

Parameters:

  • value

    Value to set for the web_url property.

Returns:

  • a void



500
501
502
# File 'lib/models/chat_message.rb', line 500

def web_url=(value)
    @web_url = value
end