Class: MicrosoftGraph::Models::AppRole

Inherits:
Object
  • Object
show all
Includes:
MicrosoftKiotaAbstractions::AdditionalDataHolder, MicrosoftKiotaAbstractions::Parsable
Defined in:
lib/models/app_role.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new appRole and sets the default values.



70
71
72
# File 'lib/models/app_role.rb', line 70

def initialize()
    @additional_data = Hash.new
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

Raises:

  • (StandardError)


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

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

Instance Method Details

#additional_dataObject

Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Returns:

  • a i_dictionary



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

def additional_data
    return @additional_data
end

#additional_data=(value) ⇒ Object

Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.

Parameters:

  • value

    Value to set for the additionalData property.

Returns:

  • a void



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

def additional_data=(value)
    @additional_data = value
end

#allowed_member_typesObject

Gets the allowedMemberTypes property value. Specifies whether this app role can be assigned to users and groups (by setting to [‘User’]), to other application’s (by setting to [‘Application’], or both (by setting to [‘User’, ‘Application’]). App roles supporting assignment to other applications’ service principals are also known as application permissions. The ‘Application’ value is only supported for app roles defined on application entities.

Returns:

  • a string



55
56
57
# File 'lib/models/app_role.rb', line 55

def allowed_member_types
    return @allowed_member_types
end

#allowed_member_types=(value) ⇒ Object

Sets the allowedMemberTypes property value. Specifies whether this app role can be assigned to users and groups (by setting to [‘User’]), to other application’s (by setting to [‘Application’], or both (by setting to [‘User’, ‘Application’]). App roles supporting assignment to other applications’ service principals are also known as application permissions. The ‘Application’ value is only supported for app roles defined on application entities.

Parameters:

  • value

    Value to set for the allowedMemberTypes property.

Returns:

  • a void



63
64
65
# File 'lib/models/app_role.rb', line 63

def allowed_member_types=(value)
    @allowed_member_types = value
end

#descriptionObject

Gets the description property value. The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences.

Returns:

  • a string



86
87
88
# File 'lib/models/app_role.rb', line 86

def description
    return @description
end

#description=(value) ⇒ Object

Sets the description property value. The description for the app role. This is displayed when the app role is being assigned and, if the app role functions as an application permission, during consent experiences.

Parameters:

  • value

    Value to set for the description property.

Returns:

  • a void



94
95
96
# File 'lib/models/app_role.rb', line 94

def description=(value)
    @description = value
end

#display_nameObject

Gets the displayName property value. Display name for the permission that appears in the app role assignment and consent experiences.

Returns:

  • a string



101
102
103
# File 'lib/models/app_role.rb', line 101

def display_name
    return @display_name
end

#display_name=(value) ⇒ Object

Sets the displayName property value. Display name for the permission that appears in the app role assignment and consent experiences.

Parameters:

  • value

    Value to set for the displayName property.

Returns:

  • a void



109
110
111
# File 'lib/models/app_role.rb', line 109

def display_name=(value)
    @display_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/models/app_role.rb', line 116

def get_field_deserializers()
    return {
        "allowedMemberTypes" => lambda {|n| @allowed_member_types = n.get_collection_of_primitive_values(String) },
        "description" => lambda {|n| @description = n.get_string_value() },
        "displayName" => lambda {|n| @display_name = n.get_string_value() },
        "id" => lambda {|n| @id = n.get_guid_value() },
        "isEnabled" => lambda {|n| @is_enabled = n.get_boolean_value() },
        "@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
        "origin" => lambda {|n| @origin = n.get_string_value() },
        "value" => lambda {|n| @value = n.get_string_value() },
    }
end

#idObject

Gets the id property value. Unique role identifier inside the appRoles collection. When creating a new app role, a new GUID identifier must be provided.

Returns:

  • a guid



132
133
134
# File 'lib/models/app_role.rb', line 132

def id
    return @id
end

#id=(value) ⇒ Object

Sets the id property value. Unique role identifier inside the appRoles collection. When creating a new app role, a new GUID identifier must be provided.

Parameters:

  • value

    Value to set for the id property.

Returns:

  • a void



140
141
142
# File 'lib/models/app_role.rb', line 140

def id=(value)
    @id = value
end

#is_enabledObject

Gets the isEnabled property value. When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed.

Returns:

  • a boolean



147
148
149
# File 'lib/models/app_role.rb', line 147

def is_enabled
    return @is_enabled
end

#is_enabled=(value) ⇒ Object

Sets the isEnabled property value. When creating or updating an app role, this must be set to true (which is the default). To delete a role, this must first be set to false. At that point, in a subsequent call, this role may be removed.

Parameters:

  • value

    Value to set for the isEnabled property.

Returns:

  • a void



155
156
157
# File 'lib/models/app_role.rb', line 155

def is_enabled=(value)
    @is_enabled = value
end

#odata_typeObject

Gets the @odata.type property value. The OdataType property

Returns:

  • a string



162
163
164
# File 'lib/models/app_role.rb', line 162

def odata_type
    return @odata_type
end

#odata_type=(value) ⇒ Object

Sets the @odata.type property value. The OdataType property

Parameters:

  • value

    Value to set for the @odata.type property.

Returns:

  • a void



170
171
172
# File 'lib/models/app_role.rb', line 170

def odata_type=(value)
    @odata_type = value
end

#originObject

Gets the origin property value. Specifies if the app role is defined on the application object or on the servicePrincipal entity. Must not be included in any POST or PATCH requests. Read-only.

Returns:

  • a string



177
178
179
# File 'lib/models/app_role.rb', line 177

def origin
    return @origin
end

#origin=(value) ⇒ Object

Sets the origin property value. Specifies if the app role is defined on the application object or on the servicePrincipal entity. Must not be included in any POST or PATCH requests. Read-only.

Parameters:

  • value

    Value to set for the origin property.

Returns:

  • a void



185
186
187
# File 'lib/models/app_role.rb', line 185

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


193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/models/app_role.rb', line 193

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_collection_of_primitive_values("allowedMemberTypes", @allowed_member_types)
    writer.write_string_value("description", @description)
    writer.write_string_value("displayName", @display_name)
    writer.write_guid_value("id", @id)
    writer.write_boolean_value("isEnabled", @is_enabled)
    writer.write_string_value("@odata.type", @odata_type)
    writer.write_string_value("origin", @origin)
    writer.write_string_value("value", @value)
    writer.write_additional_data(@additional_data)
end

#valueObject

Gets the value property value. Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ‘ ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with ..

Returns:

  • a string



209
210
211
# File 'lib/models/app_role.rb', line 209

def value
    return @value
end

#value=(value) ⇒ Object

Sets the value property value. Specifies the value to include in the roles claim in ID tokens and access tokens authenticating an assigned user or service principal. Must not exceed 120 characters in length. Allowed characters are : ! # $ % & ‘ ( ) * + , - . / : ; = ? @ [ ] ^ + _ { } ~, as well as characters in the ranges 0-9, A-Z and a-z. Any other character, including the space character, are not allowed. May not begin with ..

Parameters:

  • value

    Value to set for the value property.

Returns:

  • a void



217
218
219
# File 'lib/models/app_role.rb', line 217

def value=(value)
    @value = value
end