Class: MicrosoftGraph::Models::StsPolicy

Inherits:
PolicyBase show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/sts_policy.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from PolicyBase

#description, #description=, #display_name, #display_name=

Methods inherited from DirectoryObject

#deleted_date_time, #deleted_date_time=

Methods inherited from Entity

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

Constructor Details

#initializeObject

Instantiates a new stsPolicy and sets the default values.



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

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

Raises:

  • (StandardError)


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/models/sts_policy.rb', line 46

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.activityBasedTimeoutPolicy"
                return ActivityBasedTimeoutPolicy.new
            when "#microsoft.graph.claimsMappingPolicy"
                return ClaimsMappingPolicy.new
            when "#microsoft.graph.homeRealmDiscoveryPolicy"
                return HomeRealmDiscoveryPolicy.new
            when "#microsoft.graph.tokenIssuancePolicy"
                return TokenIssuancePolicy.new
            when "#microsoft.graph.tokenLifetimePolicy"
                return TokenLifetimePolicy.new
        end
    end
    return StsPolicy.new
end

Instance Method Details

#applies_toObject

Gets the appliesTo property value. The appliesTo property

Returns:

  • a directory_object



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

def applies_to
    return @applies_to
end

#applies_to=(value) ⇒ Object

Sets the appliesTo property value. The appliesTo property

Parameters:

  • value

    Value to set for the appliesTo property.

Returns:

  • a void



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

def applies_to=(value)
    @applies_to = value
end

#definitionObject

Gets the definition property value. A string collection containing a JSON string that defines the rules and settings for a policy. The syntax for the definition differs for each derived policy type. Required.

Returns:

  • a string



70
71
72
# File 'lib/models/sts_policy.rb', line 70

def definition
    return @definition
end

#definition=(value) ⇒ Object

Sets the definition property value. A string collection containing a JSON string that defines the rules and settings for a policy. The syntax for the definition differs for each derived policy type. Required.

Parameters:

  • value

    Value to set for the definition property.

Returns:

  • a void



78
79
80
# File 'lib/models/sts_policy.rb', line 78

def definition=(value)
    @definition = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



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

def get_field_deserializers()
    return super.merge({
        "appliesTo" => lambda {|n| @applies_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },
        "definition" => lambda {|n| @definition = n.get_collection_of_primitive_values(String) },
        "isOrganizationDefault" => lambda {|n| @is_organization_default = n.get_boolean_value() },
    })
end

#is_organization_defaultObject

Gets the isOrganizationDefault property value. If set to true, activates this policy. There can be many policies for the same policy type, but only one can be activated as the organization default. Optional, default value is false.

Returns:

  • a boolean



96
97
98
# File 'lib/models/sts_policy.rb', line 96

def is_organization_default
    return @is_organization_default
end

#is_organization_default=(value) ⇒ Object

Sets the isOrganizationDefault property value. If set to true, activates this policy. There can be many policies for the same policy type, but only one can be activated as the organization default. Optional, default value is false.

Parameters:

  • value

    Value to set for the isOrganizationDefault property.

Returns:

  • a void



104
105
106
# File 'lib/models/sts_policy.rb', line 104

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


112
113
114
115
116
117
118
# File 'lib/models/sts_policy.rb', line 112

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_collection_of_object_values("appliesTo", @applies_to)
    writer.write_collection_of_primitive_values("definition", @definition)
    writer.write_boolean_value("isOrganizationDefault", @is_organization_default)
end