Class: MicrosoftGraph::Models::ShiftItem

Inherits:
ScheduleEntity show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/shift_item.rb

Direct Known Subclasses

OpenShiftItem

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ScheduleEntity

#additional_data, #additional_data=, #end_date_time, #end_date_time=, #odata_type, #odata_type=, #start_date_time, #start_date_time=, #theme, #theme=

Constructor Details

#initializeObject

Instantiates a new shiftItem and sets the default values.



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

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 shift_item

Raises:

  • (StandardError)


45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/models/shift_item.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.openShiftItem"
                return OpenShiftItem.new
        end
    end
    return ShiftItem.new
end

Instance Method Details

#activitiesObject

Gets the activities property value. An incremental part of a shift which can cover details of when and where an employee is during their shift. For example, an assignment or a scheduled break or lunch. Required.

Returns:

  • a shift_activity



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

def activities
    return @activities
end

#activities=(value) ⇒ Object

Sets the activities property value. An incremental part of a shift which can cover details of when and where an employee is during their shift. For example, an assignment or a scheduled break or lunch. Required.

Parameters:

  • value

    Value to set for the activities property.

Returns:

  • a void



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

def activities=(value)
    @activities = value
end

#display_nameObject

Gets the displayName property value. The shift label of the shiftItem.

Returns:

  • a string



61
62
63
# File 'lib/models/shift_item.rb', line 61

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. The shift label of the shiftItem.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



69
70
71
# File 'lib/models/shift_item.rb', line 69

def display_name=(value)
    @display_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



76
77
78
79
80
81
82
# File 'lib/models/shift_item.rb', line 76

def get_field_deserializers()
    return super.merge({
        "activities" => lambda {|n| @activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ShiftActivity.create_from_discriminator_value(pn) }) },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "notes" => lambda {|n| @notes = n.get_string_value() },
    })
end

#notesObject

Gets the notes property value. The shift notes for the shiftItem.

Returns:

  • a string



87
88
89
# File 'lib/models/shift_item.rb', line 87

def notes
    return @notes
end

#notes=(value) ⇒ Object

Sets the notes property value. The shift notes for the shiftItem.

Parameters:

  • value

    Value to set for the notes property.

Returns:

  • a void



95
96
97
# File 'lib/models/shift_item.rb', line 95

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


103
104
105
106
107
108
109
# File 'lib/models/shift_item.rb', line 103

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_collection_of_object_values("activities", @activities)
    writer.write_string_value("displayName", @display_name)
    writer.write_string_value("notes", @notes)
end