Class: MicrosoftGraph::Models::UnifiedRoleDefinition

Inherits:
Entity
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/unified_role_definition.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 unifiedRoleDefinition and sets the default values.



40
41
42
# File 'lib/models/unified_role_definition.rb', line 40

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_definition

Raises:

  • (StandardError)


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

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

Instance Method Details

#descriptionObject

Gets the description property value. The description for the unifiedRoleDefinition. Read-only when isBuiltIn is true.

Returns:

  • a string



56
57
58
# File 'lib/models/unified_role_definition.rb', line 56

def description
    return @description
end

#description=(value) ⇒ Object

Sets the description property value. The description for the unifiedRoleDefinition. Read-only when isBuiltIn is true.

Parameters:

  • value

    Value to set for the description property.

Returns:

  • a void



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

def description=(value)
    @description = value
end

#display_nameObject

Gets the displayName property value. The display name for the unifiedRoleDefinition. Read-only when isBuiltIn is true. Required. Supports $filter (eq, in).

Returns:

  • a string



71
72
73
# File 'lib/models/unified_role_definition.rb', line 71

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. The display name for the unifiedRoleDefinition. Read-only when isBuiltIn is true. Required. Supports $filter (eq, in).

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



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

def display_name=(value)
    @display_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/models/unified_role_definition.rb', line 86

def get_field_deserializers()
    return super.merge({
        "description" => lambda {|n| @description = n.get_string_value() },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "inheritsPermissionsFrom" => lambda {|n| @inherits_permissions_from = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UnifiedRoleDefinition.create_from_discriminator_value(pn) }) },
        "isBuiltIn" => lambda {|n| @is_built_in = n.get_boolean_value() },
        "isEnabled" => lambda {|n| @is_enabled = n.get_boolean_value() },
        "resourceScopes" => lambda {|n| @resource_scopes = n.get_collection_of_primitive_values(String) },
        "rolePermissions" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UnifiedRolePermission.create_from_discriminator_value(pn) }) },
        "templateId" => lambda {|n| @template_id = n.get_string_value() },
        "version" => lambda {|n| @version = n.get_string_value() },
    })
end

#inherits_permissions_fromObject

Gets the inheritsPermissionsFrom property value. Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand.

Returns:

  • a unified_role_definition



103
104
105
# File 'lib/models/unified_role_definition.rb', line 103

def inherits_permissions_from
    return @inherits_permissions_from
end

#inherits_permissions_from=(value) ⇒ Object

Sets the inheritsPermissionsFrom property value. Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in roles (isBuiltIn is true) support this attribute. Supports $expand.

Parameters:

  • value

    Value to set for the inheritsPermissionsFrom property.

Returns:

  • a void



111
112
113
# File 'lib/models/unified_role_definition.rb', line 111

def inherits_permissions_from=(value)
    @inherits_permissions_from = value
end

#is_built_inObject

Gets the isBuiltIn property value. Flag indicating whether the role definition is part of the default set included in Azure Active Directory (Azure AD) or a custom definition. Read-only. Supports $filter (eq, in).

Returns:

  • a boolean



118
119
120
# File 'lib/models/unified_role_definition.rb', line 118

def is_built_in
    return @is_built_in
end

#is_built_in=(value) ⇒ Object

Sets the isBuiltIn property value. Flag indicating whether the role definition is part of the default set included in Azure Active Directory (Azure AD) or a custom definition. Read-only. Supports $filter (eq, in).

Parameters:

  • value

    Value to set for the isBuiltIn property.

Returns:

  • a void



126
127
128
# File 'lib/models/unified_role_definition.rb', line 126

def is_built_in=(value)
    @is_built_in = value
end

#is_enabledObject

Gets the isEnabled property value. Flag indicating whether the role is enabled for assignment. If false the role is not available for assignment. Read-only when isBuiltIn is true.

Returns:

  • a boolean



133
134
135
# File 'lib/models/unified_role_definition.rb', line 133

def is_enabled
    return @is_enabled
end

#is_enabled=(value) ⇒ Object

Sets the isEnabled property value. Flag indicating whether the role is enabled for assignment. If false the role is not available for assignment. Read-only when isBuiltIn is true.

Parameters:

  • value

    Value to set for the isEnabled property.

Returns:

  • a void



141
142
143
# File 'lib/models/unified_role_definition.rb', line 141

def is_enabled=(value)
    @is_enabled = value
end

#resource_scopesObject

Gets the resourceScopes property value. List of the scopes or permissions the role definition applies to. Currently only / is supported. Read-only when isBuiltIn is true. DO NOT USE. This will be deprecated soon. Attach scope to role assignment.

Returns:

  • a string



148
149
150
# File 'lib/models/unified_role_definition.rb', line 148

def resource_scopes
    return @resource_scopes
end

#resource_scopes=(value) ⇒ Object

Sets the resourceScopes property value. List of the scopes or permissions the role definition applies to. Currently only / is supported. Read-only when isBuiltIn is true. DO NOT USE. This will be deprecated soon. Attach scope to role assignment.

Parameters:

  • value

    Value to set for the resourceScopes property.

Returns:

  • a void



156
157
158
# File 'lib/models/unified_role_definition.rb', line 156

def resource_scopes=(value)
    @resource_scopes = value
end

#role_permissionsObject

Gets the rolePermissions property value. List of permissions included in the role. Read-only when isBuiltIn is true. Required.

Returns:

  • a unified_role_permission



163
164
165
# File 'lib/models/unified_role_definition.rb', line 163

def role_permissions
    return @role_permissions
end

#role_permissions=(value) ⇒ Object

Sets the rolePermissions property value. List of permissions included in the role. Read-only when isBuiltIn is true. Required.

Parameters:

  • value

    Value to set for the rolePermissions property.

Returns:

  • a void



171
172
173
# File 'lib/models/unified_role_definition.rb', line 171

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


179
180
181
182
183
184
185
186
187
188
189
190
191
# File 'lib/models/unified_role_definition.rb', line 179

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)
    writer.write_collection_of_object_values("inheritsPermissionsFrom", @inherits_permissions_from)
    writer.write_boolean_value("isBuiltIn", @is_built_in)
    writer.write_boolean_value("isEnabled", @is_enabled)
    writer.write_collection_of_primitive_values("resourceScopes", @resource_scopes)
    writer.write_collection_of_object_values("rolePermissions", @role_permissions)
    writer.write_string_value("templateId", @template_id)
    writer.write_string_value("version", @version)
end

#template_idObject

Gets the templateId property value. Custom template identifier that can be set when isBuiltIn is false but is read-only when isBuiltIn is true. This identifier is typically used if one needs an identifier to be the same across different directories.

Returns:

  • a string



196
197
198
# File 'lib/models/unified_role_definition.rb', line 196

def template_id
    return @template_id
end

#template_id=(value) ⇒ Object

Sets the templateId property value. Custom template identifier that can be set when isBuiltIn is false but is read-only when isBuiltIn is true. This identifier is typically used if one needs an identifier to be the same across different directories.

Parameters:

  • value

    Value to set for the templateId property.

Returns:

  • a void



204
205
206
# File 'lib/models/unified_role_definition.rb', line 204

def template_id=(value)
    @template_id = value
end

#versionObject

Gets the version property value. Indicates version of the role definition. Read-only when isBuiltIn is true.

Returns:

  • a string



211
212
213
# File 'lib/models/unified_role_definition.rb', line 211

def version
    return @version
end

#version=(value) ⇒ Object

Sets the version property value. Indicates version of the role definition. Read-only when isBuiltIn is true.

Parameters:

  • value

    Value to set for the version property.

Returns:

  • a void



219
220
221
# File 'lib/models/unified_role_definition.rb', line 219

def version=(value)
    @version = value
end