Class: MicrosoftGraph::Models::Shift

Inherits:
ChangeTrackedEntity show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/shift.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ChangeTrackedEntity

#created_date_time, #created_date_time=, #last_modified_by, #last_modified_by=, #last_modified_date_time, #last_modified_date_time=

Methods inherited from Entity

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

Constructor Details

#initializeObject

Instantiates a new shift and sets the default values.



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

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

Raises:

  • (StandardError)


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

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

Instance Method Details

#draft_shiftObject

Gets the draftShift property value. The draft version of this shift that is viewable by managers. Required.

Returns:

  • a shift_item



42
43
44
# File 'lib/models/shift.rb', line 42

def draft_shift
    return @draft_shift
end

#draft_shift=(value) ⇒ Object

Sets the draftShift property value. The draft version of this shift that is viewable by managers. Required.

Parameters:

  • value

    Value to set for the draftShift property.

Returns:

  • a void



50
51
52
# File 'lib/models/shift.rb', line 50

def draft_shift=(value)
    @draft_shift = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



57
58
59
60
61
62
63
64
# File 'lib/models/shift.rb', line 57

def get_field_deserializers()
    return super.merge({
        "draftShift" => lambda {|n| @draft_shift = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ShiftItem.create_from_discriminator_value(pn) }) },
        "schedulingGroupId" => lambda {|n| @scheduling_group_id = n.get_string_value() },
        "sharedShift" => lambda {|n| @shared_shift = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ShiftItem.create_from_discriminator_value(pn) }) },
        "userId" => lambda {|n| @user_id = n.get_string_value() },
    })
end

#scheduling_group_idObject

Gets the schedulingGroupId property value. ID of the scheduling group the shift is part of. Required.

Returns:

  • a string



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

def scheduling_group_id
    return @scheduling_group_id
end

#scheduling_group_id=(value) ⇒ Object

Sets the schedulingGroupId property value. ID of the scheduling group the shift is part of. Required.

Parameters:

  • value

    Value to set for the schedulingGroupId property.

Returns:

  • a void



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

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


85
86
87
88
89
90
91
92
# File 'lib/models/shift.rb', line 85

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("draftShift", @draft_shift)
    writer.write_string_value("schedulingGroupId", @scheduling_group_id)
    writer.write_object_value("sharedShift", @shared_shift)
    writer.write_string_value("userId", @user_id)
end

#shared_shiftObject

Gets the sharedShift property value. The shared version of this shift that is viewable by both employees and managers. Required.

Returns:

  • a shift_item



97
98
99
# File 'lib/models/shift.rb', line 97

def shared_shift
    return @shared_shift
end

#shared_shift=(value) ⇒ Object

Sets the sharedShift property value. The shared version of this shift that is viewable by both employees and managers. Required.

Parameters:

  • value

    Value to set for the sharedShift property.

Returns:

  • a void



105
106
107
# File 'lib/models/shift.rb', line 105

def shared_shift=(value)
    @shared_shift = value
end

#user_idObject

Gets the userId property value. ID of the user assigned to the shift. Required.

Returns:

  • a string



112
113
114
# File 'lib/models/shift.rb', line 112

def user_id
    return @user_id
end

#user_id=(value) ⇒ Object

Sets the userId property value. ID of the user assigned to the shift. Required.

Parameters:

  • value

    Value to set for the userId property.

Returns:

  • a void



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

def user_id=(value)
    @user_id = value
end