Class: MicrosoftGraph::Models::FileAttachment

Inherits:
Attachment show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/file_attachment.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Attachment

#content_type, #content_type=, #is_inline, #is_inline=, #last_modified_date_time, #last_modified_date_time=, #name, #name=, #size, #size=

Methods inherited from Entity

#additional_data, #additional_data=, #id, #id=, #odata_type, #odata_type=

Constructor Details

#initializeObject

Instantiates a new fileAttachment and sets the default values.



22
23
24
25
# File 'lib/models/file_attachment.rb', line 22

def initialize()
    super
    @odata_type = "#microsoft.graph.fileAttachment"
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 file_attachment

Raises:

  • (StandardError)


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

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

Instance Method Details

#content_bytesObject

Gets the contentBytes property value. The base64-encoded contents of the file.

Returns:

  • a base64url



30
31
32
# File 'lib/models/file_attachment.rb', line 30

def content_bytes
    return @content_bytes
end

#content_bytes=(value) ⇒ Object

Sets the contentBytes property value. The base64-encoded contents of the file.

Parameters:

  • value

    Value to set for the contentBytes property.

Returns:

  • a void



38
39
40
# File 'lib/models/file_attachment.rb', line 38

def content_bytes=(value)
    @content_bytes = value
end

#content_idObject

Gets the contentId property value. The ID of the attachment in the Exchange store.

Returns:

  • a string



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

def content_id
    return @content_id
end

#content_id=(value) ⇒ Object

Sets the contentId property value. The ID of the attachment in the Exchange store.

Parameters:

  • value

    Value to set for the contentId property.

Returns:

  • a void



53
54
55
# File 'lib/models/file_attachment.rb', line 53

def content_id=(value)
    @content_id = value
end

#content_locationObject

Gets the contentLocation property value. Do not use this property as it is not supported.

Returns:

  • a string



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

def content_location
    return @content_location
end

#content_location=(value) ⇒ Object

Sets the contentLocation property value. Do not use this property as it is not supported.

Parameters:

  • value

    Value to set for the contentLocation property.

Returns:

  • a void



68
69
70
# File 'lib/models/file_attachment.rb', line 68

def content_location=(value)
    @content_location = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



84
85
86
87
88
89
90
# File 'lib/models/file_attachment.rb', line 84

def get_field_deserializers()
    return super.merge({
        "contentBytes" => lambda {|n| @content_bytes = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },
        "contentId" => lambda {|n| @content_id = n.get_string_value() },
        "contentLocation" => lambda {|n| @content_location = n.get_string_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)


96
97
98
99
100
101
102
# File 'lib/models/file_attachment.rb', line 96

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("contentBytes", @content_bytes)
    writer.write_string_value("contentId", @content_id)
    writer.write_string_value("contentLocation", @content_location)
end