Class: MicrosoftGraph::Models::PolicyBase

Inherits:
DirectoryObject show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/policy_base.rb

Class Method Summary collapse

Instance Method Summary collapse

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 policyBase and sets the default values.



19
20
21
22
# File 'lib/models/policy_base.rb', line 19

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

Raises:

  • (StandardError)


28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/models/policy_base.rb', line 28

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.appManagementPolicy"
                return AppManagementPolicy.new
            when "#microsoft.graph.authorizationPolicy"
                return AuthorizationPolicy.new
            when "#microsoft.graph.claimsMappingPolicy"
                return ClaimsMappingPolicy.new
            when "#microsoft.graph.crossTenantAccessPolicy"
                return CrossTenantAccessPolicy.new
            when "#microsoft.graph.homeRealmDiscoveryPolicy"
                return HomeRealmDiscoveryPolicy.new
            when "#microsoft.graph.identitySecurityDefaultsEnforcementPolicy"
                return IdentitySecurityDefaultsEnforcementPolicy.new
            when "#microsoft.graph.permissionGrantPolicy"
                return PermissionGrantPolicy.new
            when "#microsoft.graph.stsPolicy"
                return StsPolicy.new
            when "#microsoft.graph.tenantAppManagementPolicy"
                return TenantAppManagementPolicy.new
            when "#microsoft.graph.tokenIssuancePolicy"
                return TokenIssuancePolicy.new
            when "#microsoft.graph.tokenLifetimePolicy"
                return TokenLifetimePolicy.new
        end
    end
    return PolicyBase.new
end

Instance Method Details

#descriptionObject

Gets the description property value. Description for this policy. Required.

Returns:

  • a string



66
67
68
# File 'lib/models/policy_base.rb', line 66

def description
    return @description
end

#description=(value) ⇒ Object

Sets the description property value. Description for this policy. Required.

Parameters:

  • value

    Value to set for the description property.

Returns:

  • a void



74
75
76
# File 'lib/models/policy_base.rb', line 74

def description=(value)
    @description = value
end

#display_nameObject

Gets the displayName property value. Display name for this policy. Required.

Returns:

  • a string



81
82
83
# File 'lib/models/policy_base.rb', line 81

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. Display name for this policy. Required.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



89
90
91
# File 'lib/models/policy_base.rb', line 89

def display_name=(value)
    @display_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



96
97
98
99
100
101
# File 'lib/models/policy_base.rb', line 96

def get_field_deserializers()
    return super.merge({
        "description" => lambda {|n| @description = n.get_string_value() },
        "displayName" => lambda {|n| @display_name = n.get_string_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)


107
108
109
110
111
112
# File 'lib/models/policy_base.rb', line 107

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