Class: MicrosoftGraph::Models::Attachment
- Includes:
- MicrosoftKiotaAbstractions::Parsable
- Defined in:
- lib/models/attachment.rb
Direct Known Subclasses
Class Method Summary collapse
-
.create_from_discriminator_value(parse_node) ⇒ Object
Creates a new instance of the appropriate class based on discriminator value.
Instance Method Summary collapse
-
#content_type ⇒ Object
Gets the contentType property value.
-
#content_type=(value) ⇒ Object
Sets the contentType property value.
-
#get_field_deserializers ⇒ Object
The deserialization information for the current model.
-
#initialize ⇒ Object
constructor
Instantiates a new attachment and sets the default values.
-
#is_inline ⇒ Object
Gets the isInline property value.
-
#is_inline=(value) ⇒ Object
Sets the isInline property value.
-
#last_modified_date_time ⇒ Object
Gets the lastModifiedDateTime property value.
-
#last_modified_date_time=(value) ⇒ Object
Sets the lastModifiedDateTime property value.
-
#name ⇒ Object
Gets the name property value.
-
#name=(value) ⇒ Object
Sets the name property value.
-
#serialize(writer) ⇒ Object
Serializes information the current object.
-
#size ⇒ Object
Gets the size property value.
-
#size=(value) ⇒ Object
Sets the size property value.
Methods inherited from Entity
#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=
Constructor Details
#initialize ⇒ Object
Instantiates a new attachment and sets the default values.
29 30 31 |
# File 'lib/models/attachment.rb', line 29 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
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/models/attachment.rb', line 52 def self.create_from_discriminator_value(parse_node) raise StandardError, 'parse_node cannot be null' if parse_node.nil? mapping_value_node = parse_node.get_child_node("@odata.type") unless mapping_value_node.nil? then mapping_value = mapping_value_node.get_string_value case mapping_value when "#microsoft.graph.fileAttachment" return FileAttachment.new when "#microsoft.graph.itemAttachment" return ItemAttachment.new when "#microsoft.graph.referenceAttachment" return ReferenceAttachment.new end end return Attachment.new end |
Instance Method Details
#content_type ⇒ Object
Gets the contentType property value. The MIME type.
36 37 38 |
# File 'lib/models/attachment.rb', line 36 def content_type return @content_type end |
#content_type=(value) ⇒ Object
Sets the contentType property value. The MIME type.
44 45 46 |
# File 'lib/models/attachment.rb', line 44 def content_type=(value) @content_type = value end |
#get_field_deserializers ⇒ Object
The deserialization information for the current model
72 73 74 75 76 77 78 79 80 |
# File 'lib/models/attachment.rb', line 72 def get_field_deserializers() return super.merge({ "contentType" => lambda {|n| @content_type = n.get_string_value() }, "isInline" => lambda {|n| @is_inline = n.get_boolean_value() }, "lastModifiedDateTime" => lambda {|n| @last_modified_date_time = n.get_date_time_value() }, "name" => lambda {|n| @name = n.get_string_value() }, "size" => lambda {|n| @size = n.get_number_value() }, }) end |
#is_inline ⇒ Object
Gets the isInline property value. true if the attachment is an inline attachment; otherwise, false.
85 86 87 |
# File 'lib/models/attachment.rb', line 85 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.
93 94 95 |
# File 'lib/models/attachment.rb', line 93 def is_inline=(value) @is_inline = value end |
#last_modified_date_time ⇒ Object
Gets the lastModifiedDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z
100 101 102 |
# File 'lib/models/attachment.rb', line 100 def last_modified_date_time return @last_modified_date_time end |
#last_modified_date_time=(value) ⇒ Object
Sets the lastModifiedDateTime property value. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z
108 109 110 |
# File 'lib/models/attachment.rb', line 108 def last_modified_date_time=(value) @last_modified_date_time = value end |
#name ⇒ Object
Gets the name property value. The attachment’s file name.
115 116 117 |
# File 'lib/models/attachment.rb', line 115 def name return @name end |
#name=(value) ⇒ Object
Sets the name property value. The attachment’s file name.
123 124 125 |
# File 'lib/models/attachment.rb', line 123 def name=(value) @name = value end |
#serialize(writer) ⇒ Object
Serializes information the current object
131 132 133 134 135 136 137 138 139 |
# File 'lib/models/attachment.rb', line 131 def serialize(writer) raise StandardError, 'writer cannot be null' if writer.nil? super writer.write_string_value("contentType", @content_type) writer.write_boolean_value("isInline", @is_inline) writer.write_date_time_value("lastModifiedDateTime", @last_modified_date_time) writer.write_string_value("name", @name) writer.write_number_value("size", @size) end |
#size ⇒ Object
Gets the size property value. The length of the attachment in bytes.
144 145 146 |
# File 'lib/models/attachment.rb', line 144 def size return @size end |
#size=(value) ⇒ Object
Sets the size property value. The length of the attachment in bytes.
152 153 154 |
# File 'lib/models/attachment.rb', line 152 def size=(value) @size = value end |