Class: MicrosoftGraph::Models::AttachmentItem

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new attachmentItem and sets the default values.



67
68
69
# File 'lib/models/attachment_item.rb', line 67

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 attachment_item

Raises:

  • (StandardError)


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

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return AttachmentItem.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



37
38
39
# File 'lib/models/attachment_item.rb', line 37

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



45
46
47
# File 'lib/models/attachment_item.rb', line 45

def additional_data=(value)
    @additional_data = value
end

#attachment_typeObject

Gets the attachmentType property value. The type of attachment. Possible values are: file, item, reference. Required.

Returns:

  • a attachment_type



52
53
54
# File 'lib/models/attachment_item.rb', line 52

def attachment_type
    return @attachment_type
end

#attachment_type=(value) ⇒ Object

Sets the attachmentType property value. The type of attachment. Possible values are: file, item, reference. Required.

Parameters:

  • value

    Value to set for the attachmentType property.

Returns:

  • a void



60
61
62
# File 'lib/models/attachment_item.rb', line 60

def attachment_type=(value)
    @attachment_type = value
end

#content_idObject

Gets the contentId property value. The CID or Content-Id of the attachment for referencing in case of in-line attachments using <img src=‘cid:contentId’> tag in HTML messages. Optional.

Returns:

  • a string



74
75
76
# File 'lib/models/attachment_item.rb', line 74

def content_id
    return @content_id
end

#content_id=(value) ⇒ Object

Sets the contentId property value. The CID or Content-Id of the attachment for referencing in case of in-line attachments using <img src=‘cid:contentId’> tag in HTML messages. Optional.

Parameters:

  • value

    Value to set for the contentId property.

Returns:

  • a void



82
83
84
# File 'lib/models/attachment_item.rb', line 82

def content_id=(value)
    @content_id = value
end

#content_typeObject

Gets the contentType property value. The nature of the data in the attachment. Optional.

Returns:

  • a string



89
90
91
# File 'lib/models/attachment_item.rb', line 89

def content_type
    return @content_type
end

#content_type=(value) ⇒ Object

Sets the contentType property value. The nature of the data in the attachment. Optional.

Parameters:

  • value

    Value to set for the contentType property.

Returns:

  • a void



97
98
99
# File 'lib/models/attachment_item.rb', line 97

def content_type=(value)
    @content_type = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/models/attachment_item.rb', line 113

def get_field_deserializers()
    return {
        "attachmentType" => lambda {|n| @attachment_type = n.get_enum_value(MicrosoftGraph::Models::AttachmentType) },
        "contentId" => lambda {|n| @content_id = n.get_string_value() },
        "contentType" => lambda {|n| @content_type = n.get_string_value() },
        "isInline" => lambda {|n| @is_inline = n.get_boolean_value() },
        "name" => lambda {|n| @name = n.get_string_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "size" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },
    }
end

#is_inlineObject

Gets the isInline property value. true if the attachment is an inline attachment; otherwise, false. Optional.

Returns:

  • a boolean



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

def is_inline
    return @is_inline
end

#is_inline=(value) ⇒ Object

Sets the isInline property value. true if the attachment is an inline attachment; otherwise, false. Optional.

Parameters:

  • value

    Value to set for the isInline property.

Returns:

  • a void



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

def is_inline=(value)
    @is_inline = value
end

#nameObject

Gets the name property value. The display name of the attachment. This can be a descriptive string and does not have to be the actual file name. Required.

Returns:

  • a string



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

def name
    return @name
end

#name=(value) ⇒ Object

Sets the name property value. The display name of the attachment. This can be a descriptive string and does not have to be the actual file name. Required.

Parameters:

  • value

    Value to set for the name property.

Returns:

  • a void



151
152
153
# File 'lib/models/attachment_item.rb', line 151

def name=(value)
    @name = value
end

#odata_typeObject

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

Returns:

  • a string



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

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



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

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)


174
175
176
177
178
179
180
181
182
183
184
# File 'lib/models/attachment_item.rb', line 174

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_enum_value("attachmentType", @attachment_type)
    writer.write_string_value("contentId", @content_id)
    writer.write_string_value("contentType", @content_type)
    writer.write_boolean_value("isInline", @is_inline)
    writer.write_string_value("name", @name)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_object_value("size", @size)
    writer.write_additional_data(@additional_data)
end

#sizeObject

Gets the size property value. The length of the attachment in bytes. Required.

Returns:

  • a int64



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

def size
    return @size
end

#size=(value) ⇒ Object

Sets the size property value. The length of the attachment in bytes. Required.

Parameters:

  • value

    Value to set for the size property.

Returns:

  • a void



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

def size=(value)
    @size = value
end