Class: MicrosoftGraph::Models::AttachmentBase

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

Direct Known Subclasses

TaskFileAttachment

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 attachmentBase and sets the default values.



26
27
28
# File 'lib/models/attachment_base.rb', line 26

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 attachment_base

Raises:

  • (StandardError)


49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/models/attachment_base.rb', line 49

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.taskFileAttachment"
                return TaskFileAttachment.new
        end
    end
    return AttachmentBase.new
end

Instance Method Details

#content_typeObject

Gets the contentType property value. The MIME type.

Returns:

  • a string



33
34
35
# File 'lib/models/attachment_base.rb', line 33

def content_type
    return @content_type
end

#content_type=(value) ⇒ Object

Sets the contentType property value. The MIME type.

Parameters:

  • value

    Value to set for the contentType property.

Returns:

  • a void



41
42
43
# File 'lib/models/attachment_base.rb', line 41

def content_type=(value)
    @content_type = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



65
66
67
68
69
70
71
72
# File 'lib/models/attachment_base.rb', line 65

def get_field_deserializers()
    return super.merge({
        "contentType" => lambda {|n| @content_type = n.get_string_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

#last_modified_date_timeObject

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.

Returns:

  • a date_time



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

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.

Parameters:

  • value

    Value to set for the lastModifiedDateTime property.

Returns:

  • a void



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

def last_modified_date_time=(value)
    @last_modified_date_time = value
end

#nameObject

Gets the name property value. The display name of the attachment. This does not need to be the actual file name.

Returns:

  • a string



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

def name
    return @name
end

#name=(value) ⇒ Object

Sets the name property value. The display name of the attachment. This does not need to be the actual file name.

Parameters:

  • value

    Value to set for the name property.

Returns:

  • a void



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

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


108
109
110
111
112
113
114
115
# File 'lib/models/attachment_base.rb', line 108

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_string_value("contentType", @content_type)
    writer.write_date_time_value("lastModifiedDateTime", @last_modified_date_time)
    writer.write_string_value("name", @name)
    writer.write_number_value("size", @size)
end

#sizeObject

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

Returns:

  • a integer



120
121
122
# File 'lib/models/attachment_base.rb', line 120

def size
    return @size
end

#size=(value) ⇒ Object

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

Parameters:

  • value

    Value to set for the size property.

Returns:

  • a void



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

def size=(value)
    @size = value
end