Class: MicrosoftGraph::Models::PermissionScope

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObject

Instantiates a new permissionScope and sets the default values.



91
92
93
# File 'lib/models/permission_scope.rb', line 91

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 permission_scope

Raises:

  • (StandardError)


99
100
101
102
# File 'lib/models/permission_scope.rb', line 99

def self.create_from_discriminator_value(parse_node)
    raise StandardError, 'parse_node cannot be null' if parse_node.nil?
    return PermissionScope.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



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

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



54
55
56
# File 'lib/models/permission_scope.rb', line 54

def additional_data=(value)
    @additional_data = value
end

Gets the adminConsentDescription property value. A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences.

Returns:

  • a string



61
62
63
# File 'lib/models/permission_scope.rb', line 61

def admin_consent_description
    return @admin_consent_description
end

Sets the adminConsentDescription property value. A description of the delegated permissions, intended to be read by an administrator granting the permission on behalf of all users. This text appears in tenant-wide admin consent experiences.

Parameters:

  • value

    Value to set for the adminConsentDescription property.

Returns:

  • a void



69
70
71
# File 'lib/models/permission_scope.rb', line 69

def admin_consent_description=(value)
    @admin_consent_description = value
end

Gets the adminConsentDisplayName property value. The permission’s title, intended to be read by an administrator granting the permission on behalf of all users.

Returns:

  • a string



76
77
78
# File 'lib/models/permission_scope.rb', line 76

def admin_consent_display_name
    return @admin_consent_display_name
end

Sets the adminConsentDisplayName property value. The permission’s title, intended to be read by an administrator granting the permission on behalf of all users.

Parameters:

  • value

    Value to set for the adminConsentDisplayName property.

Returns:

  • a void



84
85
86
# File 'lib/models/permission_scope.rb', line 84

def admin_consent_display_name=(value)
    @admin_consent_display_name = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/models/permission_scope.rb', line 107

def get_field_deserializers()
    return {
        "adminConsentDescription" => lambda {|n| @admin_consent_description = n.get_string_value() },
        "adminConsentDisplayName" => lambda {|n| @admin_consent_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() },
        "type" => lambda {|n| @type = n.get_string_value() },
        "userConsentDescription" => lambda {|n| @user_consent_description = n.get_string_value() },
        "userConsentDisplayName" => lambda {|n| @user_consent_display_name = n.get_string_value() },
        "value" => lambda {|n| @value = n.get_string_value() },
    }
end

#idObject

Gets the id property value. Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application.

Returns:

  • a guid



125
126
127
# File 'lib/models/permission_scope.rb', line 125

def id
    return @id
end

#id=(value) ⇒ Object

Sets the id property value. Unique delegated permission identifier inside the collection of delegated permissions defined for a resource application.

Parameters:

  • value

    Value to set for the id property.

Returns:

  • a void



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

def id=(value)
    @id = value
end

#is_enabledObject

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

Returns:

  • a boolean



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

def is_enabled
    return @is_enabled
end

#is_enabled=(value) ⇒ Object

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

Parameters:

  • value

    Value to set for the isEnabled property.

Returns:

  • a void



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

def is_enabled=(value)
    @is_enabled = value
end

#odata_typeObject

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

Returns:

  • a string



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

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



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

def odata_type=(value)
    @odata_type = value
end

#originObject

Gets the origin property value. The origin property

Returns:

  • a string



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

def origin
    return @origin
end

#origin=(value) ⇒ Object

Sets the origin property value. The origin property

Parameters:

  • value

    Value to set for the origin property.

Returns:

  • a void



178
179
180
# File 'lib/models/permission_scope.rb', line 178

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)


186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/models/permission_scope.rb', line 186

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    writer.write_string_value("adminConsentDescription", @admin_consent_description)
    writer.write_string_value("adminConsentDisplayName", @admin_consent_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("type", @type)
    writer.write_string_value("userConsentDescription", @user_consent_description)
    writer.write_string_value("userConsentDisplayName", @user_consent_display_name)
    writer.write_string_value("value", @value)
    writer.write_additional_data(@additional_data)
end

#typeObject

Gets the type property value. The possible values are: User and Admin. Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf of themselves, or whether an administrator consent should always be required. While Microsoft Graph defines the default consent requirement for each permission, the tenant administrator may override the behavior in their organization (by allowing, restricting, or limiting user consent to this delegated permission). For more information, see Configure how users consent to applications.

Returns:

  • a string



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

def type
    return @type
end

#type=(value) ⇒ Object

Sets the type property value. The possible values are: User and Admin. Specifies whether this delegated permission should be considered safe for non-admin users to consent to on behalf of themselves, or whether an administrator consent should always be required. While Microsoft Graph defines the default consent requirement for each permission, the tenant administrator may override the behavior in their organization (by allowing, restricting, or limiting user consent to this delegated permission). For more information, see Configure how users consent to applications.

Parameters:

  • value

    Value to set for the type property.

Returns:

  • a void



212
213
214
# File 'lib/models/permission_scope.rb', line 212

def type=(value)
    @type = value
end

Gets the userConsentDescription property value. A description of the delegated permissions, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves.

Returns:

  • a string



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

def user_consent_description
    return @user_consent_description
end

Sets the userConsentDescription property value. A description of the delegated permissions, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves.

Parameters:

  • value

    Value to set for the userConsentDescription property.

Returns:

  • a void



227
228
229
# File 'lib/models/permission_scope.rb', line 227

def user_consent_description=(value)
    @user_consent_description = value
end

Gets the userConsentDisplayName property value. A title for the permission, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves.

Returns:

  • a string



234
235
236
# File 'lib/models/permission_scope.rb', line 234

def user_consent_display_name
    return @user_consent_display_name
end

Sets the userConsentDisplayName property value. A title for the permission, intended to be read by a user granting the permission on their own behalf. This text appears in consent experiences where the user is consenting only on behalf of themselves.

Parameters:

  • value

    Value to set for the userConsentDisplayName property.

Returns:

  • a void



242
243
244
# File 'lib/models/permission_scope.rb', line 242

def user_consent_display_name=(value)
    @user_consent_display_name = value
end

#valueObject

Gets the value property value. Specifies the value to include in the scp (scope) claim in access tokens. 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



249
250
251
# File 'lib/models/permission_scope.rb', line 249

def value
    return @value
end

#value=(value) ⇒ Object

Sets the value property value. Specifies the value to include in the scp (scope) claim in access tokens. 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



257
258
259
# File 'lib/models/permission_scope.rb', line 257

def value=(value)
    @value = value
end