Class: MicrosoftGraph::Models::AppManagementPolicy

Inherits:
PolicyBase show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/app_management_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 appManagementPolicy and sets the default values.



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

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

Raises:

  • (StandardError)


46
47
48
49
# File 'lib/models/app_management_policy.rb', line 46

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

Instance Method Details

#applies_toObject

Gets the appliesTo property value. Collection of applications and service principals to which the policy is applied.

Returns:

  • a directory_object



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

def applies_to
    return @applies_to
end

#applies_to=(value) ⇒ Object

Sets the appliesTo property value. Collection of applications and service principals to which the policy is applied.

Parameters:

  • value

    Value to set for the appliesTo property.

Returns:

  • a void



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

def applies_to=(value)
    @applies_to = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



54
55
56
57
58
59
60
# File 'lib/models/app_management_policy.rb', line 54

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) }) },
        "isEnabled" => lambda {|n| @is_enabled = n.get_boolean_value() },
        "restrictions" => lambda {|n| @restrictions = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AppManagementConfiguration.create_from_discriminator_value(pn) }) },
    })
end

#is_enabledObject

Gets the isEnabled property value. Denotes whether the policy is enabled.

Returns:

  • a boolean



65
66
67
# File 'lib/models/app_management_policy.rb', line 65

def is_enabled
    return @is_enabled
end

#is_enabled=(value) ⇒ Object

Sets the isEnabled property value. Denotes whether the policy is enabled.

Parameters:

  • value

    Value to set for the isEnabled property.

Returns:

  • a void



73
74
75
# File 'lib/models/app_management_policy.rb', line 73

def is_enabled=(value)
    @is_enabled = value
end

#restrictionsObject

Gets the restrictions property value. Restrictions that apply to an application or service principal object.

Returns:

  • a app_management_configuration



80
81
82
# File 'lib/models/app_management_policy.rb', line 80

def restrictions
    return @restrictions
end

#restrictions=(value) ⇒ Object

Sets the restrictions property value. Restrictions that apply to an application or service principal object.

Parameters:

  • value

    Value to set for the restrictions property.

Returns:

  • a void



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

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


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

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_collection_of_object_values("appliesTo", @applies_to)
    writer.write_boolean_value("isEnabled", @is_enabled)
    writer.write_object_value("restrictions", @restrictions)
end