Class: MicrosoftGraph::Models::ApprovalSettings

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new approvalSettings and sets the default values.



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

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 approval_settings

Raises:

  • (StandardError)


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

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return ApprovalSettings.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



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

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



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

def additional_data=(value)
    @additional_data = value
end

#approval_modeObject

Gets the approvalMode property value. One of SingleStage, Serial, Parallel, NoApproval (default). NoApproval is used when isApprovalRequired is false.

Returns:

  • a string



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

def approval_mode
    return @approval_mode
end

#approval_mode=(value) ⇒ Object

Sets the approvalMode property value. One of SingleStage, Serial, Parallel, NoApproval (default). NoApproval is used when isApprovalRequired is false.

Parameters:

  • value

    Value to set for the approvalMode property.

Returns:

  • a void



57
58
59
# File 'lib/models/approval_settings.rb', line 57

def approval_mode=(value)
    @approval_mode = value
end

#approval_stagesObject

Gets the approvalStages property value. If approval is required, the one or two elements of this collection define each of the stages of approval. An empty array if no approval is required.

Returns:

  • a unified_approval_stage



64
65
66
# File 'lib/models/approval_settings.rb', line 64

def approval_stages
    return @approval_stages
end

#approval_stages=(value) ⇒ Object

Sets the approvalStages property value. If approval is required, the one or two elements of this collection define each of the stages of approval. An empty array if no approval is required.

Parameters:

  • value

    Value to set for the approvalStages property.

Returns:

  • a void



72
73
74
# File 'lib/models/approval_settings.rb', line 72

def approval_stages=(value)
    @approval_stages = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



95
96
97
98
99
100
101
102
103
104
# File 'lib/models/approval_settings.rb', line 95

def get_field_deserializers()
    return {
        "approvalMode" => lambda {|n| @approval_mode = n.get_string_value() },
        "approvalStages" => lambda {|n| @approval_stages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UnifiedApprovalStage.create_from_discriminator_value(pn) }) },
        "isApprovalRequired" => lambda {|n| @is_approval_required = n.get_boolean_value() },
        "isApprovalRequiredForExtension" => lambda {|n| @is_approval_required_for_extension = n.get_boolean_value() },
        "isRequestorJustificationRequired" => lambda {|n| @is_requestor_justification_required = n.get_boolean_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
    }
end

#is_approval_requiredObject

Gets the isApprovalRequired property value. Indicates whether approval is required for requests in this policy.

Returns:

  • a boolean



109
110
111
# File 'lib/models/approval_settings.rb', line 109

def is_approval_required
    return @is_approval_required
end

#is_approval_required=(value) ⇒ Object

Sets the isApprovalRequired property value. Indicates whether approval is required for requests in this policy.

Parameters:

  • value

    Value to set for the isApprovalRequired property.

Returns:

  • a void



117
118
119
# File 'lib/models/approval_settings.rb', line 117

def is_approval_required=(value)
    @is_approval_required = value
end

#is_approval_required_for_extensionObject

Gets the isApprovalRequiredForExtension property value. Indicates whether approval is required for a user to extend their assignment.

Returns:

  • a boolean



124
125
126
# File 'lib/models/approval_settings.rb', line 124

def is_approval_required_for_extension
    return @is_approval_required_for_extension
end

#is_approval_required_for_extension=(value) ⇒ Object

Sets the isApprovalRequiredForExtension property value. Indicates whether approval is required for a user to extend their assignment.

Parameters:

  • value

    Value to set for the isApprovalRequiredForExtension property.

Returns:

  • a void



132
133
134
# File 'lib/models/approval_settings.rb', line 132

def is_approval_required_for_extension=(value)
    @is_approval_required_for_extension = value
end

#is_requestor_justification_requiredObject

Gets the isRequestorJustificationRequired property value. Indicates whether the requestor is required to supply a justification in their request.

Returns:

  • a boolean



139
140
141
# File 'lib/models/approval_settings.rb', line 139

def is_requestor_justification_required
    return @is_requestor_justification_required
end

#is_requestor_justification_required=(value) ⇒ Object

Sets the isRequestorJustificationRequired property value. Indicates whether the requestor is required to supply a justification in their request.

Parameters:

  • value

    Value to set for the isRequestorJustificationRequired property.

Returns:

  • a void



147
148
149
# File 'lib/models/approval_settings.rb', line 147

def is_requestor_justification_required=(value)
    @is_requestor_justification_required = value
end

#odata_typeObject

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

Returns:

  • a string



154
155
156
# File 'lib/models/approval_settings.rb', line 154

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



162
163
164
# File 'lib/models/approval_settings.rb', line 162

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)


170
171
172
173
174
175
176
177
178
179
# File 'lib/models/approval_settings.rb', line 170

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_string_value("approvalMode", @approval_mode)
    writer.write_collection_of_object_values("approvalStages", @approval_stages)
    writer.write_boolean_value("isApprovalRequired", @is_approval_required)
    writer.write_boolean_value("isApprovalRequiredForExtension", @is_approval_required_for_extension)
    writer.write_boolean_value("isRequestorJustificationRequired", @is_requestor_justification_required)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_additional_data(@additional_data)
end