Class: MicrosoftGraph::Models::UnifiedRoleManagementPolicyRule

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/unified_role_management_policy_rule.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

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

Constructor Details

#initializeObject

Instantiates a new unifiedRoleManagementPolicyRule and sets the default values.



16
17
18
# File 'lib/models/unified_role_management_policy_rule.rb', line 16

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 unified_role_management_policy_rule

Raises:

  • (StandardError)


24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/models/unified_role_management_policy_rule.rb', line 24

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.unifiedRoleManagementPolicyApprovalRule"
                return UnifiedRoleManagementPolicyApprovalRule.new
            when "#microsoft.graph.unifiedRoleManagementPolicyAuthenticationContextRule"
                return UnifiedRoleManagementPolicyAuthenticationContextRule.new
            when "#microsoft.graph.unifiedRoleManagementPolicyEnablementRule"
                return UnifiedRoleManagementPolicyEnablementRule.new
            when "#microsoft.graph.unifiedRoleManagementPolicyExpirationRule"
                return UnifiedRoleManagementPolicyExpirationRule.new
            when "#microsoft.graph.unifiedRoleManagementPolicyNotificationRule"
                return UnifiedRoleManagementPolicyNotificationRule.new
        end
    end
    return UnifiedRoleManagementPolicyRule.new
end

Instance Method Details

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



48
49
50
51
52
# File 'lib/models/unified_role_management_policy_rule.rb', line 48

def get_field_deserializers()
    return super.merge({
        "target" => lambda {|n| @target = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UnifiedRoleManagementPolicyRuleTarget.create_from_discriminator_value(pn) }) },
    })
end

#serialize(writer) ⇒ Object

Serializes information the current object

Parameters:

  • writer

    Serialization writer to use to serialize this model

Returns:

  • a void

Raises:

  • (StandardError)


58
59
60
61
62
# File 'lib/models/unified_role_management_policy_rule.rb', line 58

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_object_value("target", @target)
end

#targetObject

Gets the target property value. Defines details of scope that’s targeted by role management policy rule. The details can include the principal type, the role assignment type, and actions affecting a role. Supports $filter (eq, ne).

Returns:

  • a unified_role_management_policy_rule_target



67
68
69
# File 'lib/models/unified_role_management_policy_rule.rb', line 67

def target
    return @target
end

#target=(value) ⇒ Object

Sets the target property value. Defines details of scope that’s targeted by role management policy rule. The details can include the principal type, the role assignment type, and actions affecting a role. Supports $filter (eq, ne).

Parameters:

  • value

    Value to set for the target property.

Returns:

  • a void



75
76
77
# File 'lib/models/unified_role_management_policy_rule.rb', line 75

def target=(value)
    @target = value
end