Class: MicrosoftGraph::Models::ChatMessageAttachment

Inherits:
Object
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/chat_message_attachment.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new chatMessageAttachment and sets the default values.



55
56
57
# File 'lib/models/chat_message_attachment.rb', line 55

def initialize()
    @additional_data = Hash.new
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_attachment

Raises:

  • (StandardError)


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

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

Instance Method Details

#additional_dataObject

Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Returns:

  • a i_dictionary



40
41
42
# File 'lib/models/chat_message_attachment.rb', line 40

def additional_data
    return @additional_data
end

#additional_data=(value) ⇒ Object

Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Parameters:

  • value

    Value to set for the additionalData property.

Returns:

  • a void



48
49
50
# File 'lib/models/chat_message_attachment.rb', line 48

def additional_data=(value)
    @additional_data = value
end

#contentObject

Gets the content property value. The content of the attachment. If the attachment is a rich card, set the property to the rich card object. This property and contentUrl are mutually exclusive.

Returns:

  • a string



62
63
64
# File 'lib/models/chat_message_attachment.rb', line 62

def content
    return @content
end

#content=(value) ⇒ Object

Sets the content property value. The content of the attachment. If the attachment is a rich card, set the property to the rich card object. This property and contentUrl are mutually exclusive.

Parameters:

  • value

    Value to set for the content property.

Returns:

  • a void



70
71
72
# File 'lib/models/chat_message_attachment.rb', line 70

def content=(value)
    @content = value
end

#content_typeObject

Gets the contentType property value. The media type of the content attachment. It can have the following values: reference: Attachment is a link to another file. Populate the contentURL with the link to the object.Any contentTypes supported by the Bot Framework’s Attachment objectapplication/vnd.microsoft.card.codesnippet: A code snippet. application/vnd.microsoft.card.announcement: An announcement header.

Returns:

  • a string



77
78
79
# File 'lib/models/chat_message_attachment.rb', line 77

def content_type
    return @content_type
end

#content_type=(value) ⇒ Object

Sets the contentType property value. The media type of the content attachment. It can have the following values: reference: Attachment is a link to another file. Populate the contentURL with the link to the object.Any contentTypes supported by the Bot Framework’s Attachment objectapplication/vnd.microsoft.card.codesnippet: A code snippet. application/vnd.microsoft.card.announcement: An announcement header.

Parameters:

  • value

    Value to set for the contentType property.

Returns:

  • a void



85
86
87
# File 'lib/models/chat_message_attachment.rb', line 85

def content_type=(value)
    @content_type = value
end

#content_urlObject

Gets the contentUrl property value. URL for the content of the attachment. Supported protocols: http, https, file and data.

Returns:

  • a string



92
93
94
# File 'lib/models/chat_message_attachment.rb', line 92

def content_url
    return @content_url
end

#content_url=(value) ⇒ Object

Sets the contentUrl property value. URL for the content of the attachment. Supported protocols: http, https, file and data.

Parameters:

  • value

    Value to set for the contentUrl property.

Returns:

  • a void



100
101
102
# File 'lib/models/chat_message_attachment.rb', line 100

def content_url=(value)
    @content_url = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/models/chat_message_attachment.rb', line 116

def get_field_deserializers()
    return {
        "content" => lambda {|n| @content = n.get_string_value() },
        "contentType" => lambda {|n| @content_type = n.get_string_value() },
        "contentUrl" => lambda {|n| @content_url = n.get_string_value() },
        "id" => lambda {|n| @id = n.get_string_value() },
        "name" => lambda {|n| @name = n.get_string_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "teamsAppId" => lambda {|n| @teams_app_id = n.get_string_value() },
        "thumbnailUrl" => lambda {|n| @thumbnail_url = n.get_string_value() },
    }
end

#idObject

Gets the id property value. Read-only. Unique id of the attachment.

Returns:

  • a string



132
133
134
# File 'lib/models/chat_message_attachment.rb', line 132

def id
    return @id
end

#id=(value) ⇒ Object

Sets the id property value. Read-only. Unique id of the attachment.

Parameters:

  • value

    Value to set for the id property.

Returns:

  • a void



140
141
142
# File 'lib/models/chat_message_attachment.rb', line 140

def id=(value)
    @id = value
end

#nameObject

Gets the name property value. Name of the attachment.

Returns:

  • a string



147
148
149
# File 'lib/models/chat_message_attachment.rb', line 147

def name
    return @name
end

#name=(value) ⇒ Object

Sets the name property value. Name of the attachment.

Parameters:

  • value

    Value to set for the name property.

Returns:

  • a void



155
156
157
# File 'lib/models/chat_message_attachment.rb', line 155

def name=(value)
    @name = value
end

#odata_typeObject

Gets the @odata.type property value. The OdataType property

Returns:

  • a string



162
163
164
# File 'lib/models/chat_message_attachment.rb', line 162

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

Sets the @odata.type property value. The OdataType property

Parameters:

  • value

    Value to set for the @odata.type property.

Returns:

  • a void



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

def odata_type=(value)
    @odata_type = 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)


178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/models/chat_message_attachment.rb', line 178

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_string_value("content", @content)
    writer.write_string_value("contentType", @content_type)
    writer.write_string_value("contentUrl", @content_url)
    writer.write_string_value("id", @id)
    writer.write_string_value("name", @name)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_string_value("teamsAppId", @teams_app_id)
    writer.write_string_value("thumbnailUrl", @thumbnail_url)
    writer.write_additional_data(@additional_data)
end

#teams_app_idObject

Gets the teamsAppId property value. The ID of the Teams app that is associated with the attachment. The property is specifically used to attribute a Teams message card to the specified app.

Returns:

  • a string



194
195
196
# File 'lib/models/chat_message_attachment.rb', line 194

def teams_app_id
    return @teams_app_id
end

#teams_app_id=(value) ⇒ Object

Sets the teamsAppId property value. The ID of the Teams app that is associated with the attachment. The property is specifically used to attribute a Teams message card to the specified app.

Parameters:

  • value

    Value to set for the teamsAppId property.

Returns:

  • a void



202
203
204
# File 'lib/models/chat_message_attachment.rb', line 202

def teams_app_id=(value)
    @teams_app_id = value
end

#thumbnail_urlObject

Gets the thumbnailUrl property value. URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content or contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the Word document, you might include a thumbnail image that represents the document. The channel could display the thumbnail image instead of the document. When the user clicks the image, the channel would open the document.

Returns:

  • a string



209
210
211
# File 'lib/models/chat_message_attachment.rb', line 209

def thumbnail_url
    return @thumbnail_url
end

#thumbnail_url=(value) ⇒ Object

Sets the thumbnailUrl property value. URL to a thumbnail image that the channel can use if it supports using an alternative, smaller form of content or contentUrl. For example, if you set contentType to application/word and set contentUrl to the location of the Word document, you might include a thumbnail image that represents the document. The channel could display the thumbnail image instead of the document. When the user clicks the image, the channel would open the document.

Parameters:

  • value

    Value to set for the thumbnailUrl property.

Returns:

  • a void



217
218
219
# File 'lib/models/chat_message_attachment.rb', line 217

def thumbnail_url=(value)
    @thumbnail_url = value
end