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.



146
147
148
# File 'lib/models/chat_message.rb', line 146

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)


169
170
171
172
# File 'lib/models/chat_message.rb', line 169

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



86
87
88
# File 'lib/models/chat_message.rb', line 86

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



94
95
96
# File 'lib/models/chat_message.rb', line 94

def attachments=(value)
    @attachments = value
end

#bodyObject

Gets the body property value. The body property

Returns:

  • a item_body



101
102
103
# File 'lib/models/chat_message.rb', line 101

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



109
110
111
# File 'lib/models/chat_message.rb', line 109

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



116
117
118
# File 'lib/models/chat_message.rb', line 116

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 channelIdentity property.

Returns:

  • a void



124
125
126
# File 'lib/models/chat_message.rb', line 124

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



131
132
133
# File 'lib/models/chat_message.rb', line 131

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 chatId property.

Returns:

  • a void



139
140
141
# File 'lib/models/chat_message.rb', line 139

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



153
154
155
# File 'lib/models/chat_message.rb', line 153

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 createdDateTime property.

Returns:

  • a void



161
162
163
# File 'lib/models/chat_message.rb', line 161

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



177
178
179
# File 'lib/models/chat_message.rb', line 177

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 deletedDateTime property.

Returns:

  • a void



185
186
187
# File 'lib/models/chat_message.rb', line 185

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



192
193
194
# File 'lib/models/chat_message.rb', line 192

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



200
201
202
# File 'lib/models/chat_message.rb', line 200

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



207
208
209
# File 'lib/models/chat_message.rb', line 207

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 eventDetail property.

Returns:

  • a void



215
216
217
# File 'lib/models/chat_message.rb', line 215

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



222
223
224
# File 'lib/models/chat_message.rb', line 222

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



230
231
232
# File 'lib/models/chat_message.rb', line 230

def from=(value)
    @from = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



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

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) }) },
        "messageHistory" => lambda {|n| @message_history = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ChatMessageHistoryItem.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



269
270
271
# File 'lib/models/chat_message.rb', line 269

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 hostedContents property.

Returns:

  • a void



277
278
279
# File 'lib/models/chat_message.rb', line 277

def hosted_contents=(value)
    @hosted_contents = value
end

#importanceObject

Gets the importance property value. The importance property

Returns:

  • a chat_message_importance



284
285
286
# File 'lib/models/chat_message.rb', line 284

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



292
293
294
# File 'lib/models/chat_message.rb', line 292

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



299
300
301
# File 'lib/models/chat_message.rb', line 299

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 lastEditedDateTime property.

Returns:

  • a void



307
308
309
# File 'lib/models/chat_message.rb', line 307

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



314
315
316
# File 'lib/models/chat_message.rb', line 314

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 lastModifiedDateTime property.

Returns:

  • a void



322
323
324
# File 'lib/models/chat_message.rb', line 322

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



329
330
331
# File 'lib/models/chat_message.rb', line 329

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



337
338
339
# File 'lib/models/chat_message.rb', line 337

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



344
345
346
# File 'lib/models/chat_message.rb', line 344

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



352
353
354
# File 'lib/models/chat_message.rb', line 352

def mentions=(value)
    @mentions = value
end

#message_historyObject

Gets the messageHistory property value. List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.

Returns:

  • a chat_message_history_item



359
360
361
# File 'lib/models/chat_message.rb', line 359

def message_history
    return @message_history
end

#message_history=(value) ⇒ Object

Sets the messageHistory property value. List of activity history of a message item, including modification time and actions, such as reactionAdded, reactionRemoved, or reaction changes, on the message.

Parameters:

  • value

    Value to set for the messageHistory property.

Returns:

  • a void



367
368
369
# File 'lib/models/chat_message.rb', line 367

def message_history=(value)
    @message_history = value
end

#message_typeObject

Gets the messageType property value. The messageType property

Returns:

  • a chat_message_type



374
375
376
# File 'lib/models/chat_message.rb', line 374

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 messageType property.

Returns:

  • a void



382
383
384
# File 'lib/models/chat_message.rb', line 382

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



389
390
391
# File 'lib/models/chat_message.rb', line 389

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 policyViolation property.

Returns:

  • a void



397
398
399
# File 'lib/models/chat_message.rb', line 397

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



404
405
406
# File 'lib/models/chat_message.rb', line 404

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



412
413
414
# File 'lib/models/chat_message.rb', line 412

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



419
420
421
# File 'lib/models/chat_message.rb', line 419

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



427
428
429
# File 'lib/models/chat_message.rb', line 427

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



434
435
436
# File 'lib/models/chat_message.rb', line 434

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 replyToId property.

Returns:

  • a void



442
443
444
# File 'lib/models/chat_message.rb', line 442

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)


450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
# File 'lib/models/chat_message.rb', line 450

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_collection_of_object_values("messageHistory", @message_history)
    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



482
483
484
# File 'lib/models/chat_message.rb', line 482

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



490
491
492
# File 'lib/models/chat_message.rb', line 490

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



497
498
499
# File 'lib/models/chat_message.rb', line 497

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



505
506
507
# File 'lib/models/chat_message.rb', line 505

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



512
513
514
# File 'lib/models/chat_message.rb', line 512

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 webUrl property.

Returns:

  • a void



520
521
522
# File 'lib/models/chat_message.rb', line 520

def web_url=(value)
    @web_url = value
end