Class: MicrosoftGraph::Models::TeamworkHostedContent

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

Direct Known Subclasses

ChatMessageHostedContent

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



19
20
21
# File 'lib/models/teamwork_hosted_content.rb', line 19

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 teamwork_hosted_content

Raises:

  • (StandardError)


57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/models/teamwork_hosted_content.rb', line 57

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.chatMessageHostedContent"
                return ChatMessageHostedContent.new
        end
    end
    return TeamworkHostedContent.new
end

Instance Method Details

#content_bytesObject

Gets the contentBytes property value. Write only. Bytes for the hosted content (such as images).

Returns:

  • a base64url



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

def content_bytes
    return @content_bytes
end

#content_bytes=(value) ⇒ Object

Sets the contentBytes property value. Write only. Bytes for the hosted content (such as images).

Parameters:

  • value

    Value to set for the contentBytes property.

Returns:

  • a void



34
35
36
# File 'lib/models/teamwork_hosted_content.rb', line 34

def content_bytes=(value)
    @content_bytes = value
end

#content_typeObject

Gets the contentType property value. Write only. Content type. sicj as image/png, image/jpg.

Returns:

  • a string



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

def content_type
    return @content_type
end

#content_type=(value) ⇒ Object

Sets the contentType property value. Write only. Content type. sicj as image/png, image/jpg.

Parameters:

  • value

    Value to set for the contentType property.

Returns:

  • a void



49
50
51
# File 'lib/models/teamwork_hosted_content.rb', line 49

def content_type=(value)
    @content_type = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



73
74
75
76
77
78
# File 'lib/models/teamwork_hosted_content.rb', line 73

def get_field_deserializers()
    return super.merge({
        "contentBytes" => lambda {|n| @content_bytes = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },
        "contentType" => lambda {|n| @content_type = 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)


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

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