Class: MicrosoftGraph::Models::AppRoleAssignment

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



50
51
52
53
# File 'lib/models/app_role_assignment.rb', line 50

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

Raises:

  • (StandardError)


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

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

Instance Method Details

#app_role_idObject

Gets the appRoleId property value. The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application’s service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create.

Returns:

  • a guid



35
36
37
# File 'lib/models/app_role_assignment.rb', line 35

def app_role_id
    return @app_role_id
end

#app_role_id=(value) ⇒ Object

Sets the appRoleId property value. The identifier (id) for the app role which is assigned to the principal. This app role must be exposed in the appRoles property on the resource application’s service principal (resourceId). If the resource application has not declared any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal that the principal is assigned to the resource app without any specific app roles. Required on create.

Parameters:

  • value

    Value to set for the appRoleId property.

Returns:

  • a void



43
44
45
# File 'lib/models/app_role_assignment.rb', line 43

def app_role_id=(value)
    @app_role_id = value
end

#created_date_timeObject

Gets the createdDateTime property value. The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.

Returns:

  • a date_time



58
59
60
# File 'lib/models/app_role_assignment.rb', line 58

def created_date_time
    return @created_date_time
end

#created_date_time=(value) ⇒ Object

Sets the createdDateTime property value. The time when the app role assignment was created. The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z. Read-only.

Parameters:

  • value

    Value to set for the createdDateTime property.

Returns:

  • a void



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

def created_date_time=(value)
    @created_date_time = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



82
83
84
85
86
87
88
89
90
91
92
# File 'lib/models/app_role_assignment.rb', line 82

def get_field_deserializers()
    return super.merge({
        "appRoleId" => lambda {|n| @app_role_id = n.get_guid_value() },
        "createdDateTime" => lambda {|n| @created_date_time = n.get_date_time_value() },
        "principalDisplayName" => lambda {|n| @principal_display_name = n.get_string_value() },
        "principalId" => lambda {|n| @principal_id = n.get_guid_value() },
        "principalType" => lambda {|n| @principal_type = n.get_string_value() },
        "resourceDisplayName" => lambda {|n| @resource_display_name = n.get_string_value() },
        "resourceId" => lambda {|n| @resource_id = n.get_guid_value() },
    })
end

#principal_display_nameObject

Gets the principalDisplayName property value. The display name of the user, group, or service principal that was granted the app role assignment. Read-only. Supports $filter (eq and startswith).

Returns:

  • a string



97
98
99
# File 'lib/models/app_role_assignment.rb', line 97

def principal_display_name
    return @principal_display_name
end

#principal_display_name=(value) ⇒ Object

Sets the principalDisplayName property value. The display name of the user, group, or service principal that was granted the app role assignment. Read-only. Supports $filter (eq and startswith).

Parameters:

  • value

    Value to set for the principalDisplayName property.

Returns:

  • a void



105
106
107
# File 'lib/models/app_role_assignment.rb', line 105

def principal_display_name=(value)
    @principal_display_name = value
end

#principal_idObject

Gets the principalId property value. The unique identifier (id) for the user, security group, or service principal being granted the app role. Security groups with dynamic memberships are supported. Required on create.

Returns:

  • a guid



112
113
114
# File 'lib/models/app_role_assignment.rb', line 112

def principal_id
    return @principal_id
end

#principal_id=(value) ⇒ Object

Sets the principalId property value. The unique identifier (id) for the user, security group, or service principal being granted the app role. Security groups with dynamic memberships are supported. Required on create.

Parameters:

  • value

    Value to set for the principalId property.

Returns:

  • a void



120
121
122
# File 'lib/models/app_role_assignment.rb', line 120

def principal_id=(value)
    @principal_id = value
end

#principal_typeObject

Gets the principalType property value. The type of the assigned principal. This can either be User, Group, or ServicePrincipal. Read-only.

Returns:

  • a string



127
128
129
# File 'lib/models/app_role_assignment.rb', line 127

def principal_type
    return @principal_type
end

#principal_type=(value) ⇒ Object

Sets the principalType property value. The type of the assigned principal. This can either be User, Group, or ServicePrincipal. Read-only.

Parameters:

  • value

    Value to set for the principalType property.

Returns:

  • a void



135
136
137
# File 'lib/models/app_role_assignment.rb', line 135

def principal_type=(value)
    @principal_type = value
end

#resource_display_nameObject

Gets the resourceDisplayName property value. The display name of the resource app’s service principal to which the assignment is made.

Returns:

  • a string



142
143
144
# File 'lib/models/app_role_assignment.rb', line 142

def resource_display_name
    return @resource_display_name
end

#resource_display_name=(value) ⇒ Object

Sets the resourceDisplayName property value. The display name of the resource app’s service principal to which the assignment is made.

Parameters:

  • value

    Value to set for the resourceDisplayName property.

Returns:

  • a void



150
151
152
# File 'lib/models/app_role_assignment.rb', line 150

def resource_display_name=(value)
    @resource_display_name = value
end

#resource_idObject

Gets the resourceId property value. The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only).

Returns:

  • a guid



157
158
159
# File 'lib/models/app_role_assignment.rb', line 157

def resource_id
    return @resource_id
end

#resource_id=(value) ⇒ Object

Sets the resourceId property value. The unique identifier (id) for the resource service principal for which the assignment is made. Required on create. Supports $filter (eq only).

Parameters:

  • value

    Value to set for the resourceId property.

Returns:

  • a void



165
166
167
# File 'lib/models/app_role_assignment.rb', line 165

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


173
174
175
176
177
178
179
180
181
182
183
# File 'lib/models/app_role_assignment.rb', line 173

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_guid_value("appRoleId", @app_role_id)
    writer.write_date_time_value("createdDateTime", @created_date_time)
    writer.write_string_value("principalDisplayName", @principal_display_name)
    writer.write_guid_value("principalId", @principal_id)
    writer.write_string_value("principalType", @principal_type)
    writer.write_string_value("resourceDisplayName", @resource_display_name)
    writer.write_guid_value("resourceId", @resource_id)
end