Class: MicrosoftGraph::Models::TimeZoneBase

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

Direct Known Subclasses

CustomTimeZone

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new timeZoneBase and sets the default values.



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

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 time_zone_base

Raises:

  • (StandardError)


45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/models/time_zone_base.rb', line 45

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.customTimeZone"
                return CustomTimeZone.new
        end
    end
    return TimeZoneBase.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



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

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



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

def additional_data=(value)
    @additional_data = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



61
62
63
64
65
66
# File 'lib/models/time_zone_base.rb', line 61

def get_field_deserializers()
    return {
        "name" => lambda {|n| @name = n.get_string_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
    }
end

#nameObject

Gets the name property value. The name of a time zone. It can be a standard time zone name such as ‘Hawaii-Aleutian Standard Time’, or ‘Customized Time Zone’ for a custom time zone.

Returns:

  • a string



71
72
73
# File 'lib/models/time_zone_base.rb', line 71

def name
    return @name
end

#name=(value) ⇒ Object

Sets the name property value. The name of a time zone. It can be a standard time zone name such as ‘Hawaii-Aleutian Standard Time’, or ‘Customized Time Zone’ for a custom time zone.

Parameters:

  • value

    Value to set for the name property.

Returns:

  • a void



79
80
81
# File 'lib/models/time_zone_base.rb', line 79

def name=(value)
    @name = value
end

#odata_typeObject

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

Returns:

  • a string



86
87
88
# File 'lib/models/time_zone_base.rb', line 86

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



94
95
96
# File 'lib/models/time_zone_base.rb', line 94

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)


102
103
104
105
106
107
# File 'lib/models/time_zone_base.rb', line 102

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_string_value("name", @name)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_additional_data(@additional_data)
end