Class: MicrosoftGraph::Models::OAuth2PermissionGrant

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



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

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 o_auth2_permission_grant

Raises:

  • (StandardError)


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

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

Instance Method Details

#client_idObject

Gets the clientId property value. The object id (not appId) of the client service principal for the application which is authorized to act on behalf of a signed-in user when accessing an API. Required. Supports $filter (eq only).

Returns:

  • a string



28
29
30
# File 'lib/models/o_auth2_permission_grant.rb', line 28

def client_id
    return @client_id
end

#client_id=(value) ⇒ Object

Sets the clientId property value. The object id (not appId) of the client service principal for the application which is authorized to act on behalf of a signed-in user when accessing an API. Required. Supports $filter (eq only).

Parameters:

  • value

    Value to set for the clientId property.

Returns:

  • a void



36
37
38
# File 'lib/models/o_auth2_permission_grant.rb', line 36

def client_id=(value)
    @client_id = value
end

Gets the consentType property value. Indicates if authorization is granted for the client application to impersonate all users or only a specific user. AllPrincipals indicates authorization to impersonate all users. Principal indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an administrator. Non-admin users may be authorized to consent on behalf of themselves in some cases, for some delegated permissions. Required. Supports $filter (eq only).

Returns:

  • a string



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

def consent_type
    return @consent_type
end

Sets the consentType property value. Indicates if authorization is granted for the client application to impersonate all users or only a specific user. AllPrincipals indicates authorization to impersonate all users. Principal indicates authorization to impersonate a specific user. Consent on behalf of all users can be granted by an administrator. Non-admin users may be authorized to consent on behalf of themselves in some cases, for some delegated permissions. Required. Supports $filter (eq only).

Parameters:

  • value

    Value to set for the consentType property.

Returns:

  • a void



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

def consent_type=(value)
    @consent_type = value
end

#get_field_deserializersObject

The deserialization information for the current model

Returns:

  • a i_dictionary



74
75
76
77
78
79
80
81
82
# File 'lib/models/o_auth2_permission_grant.rb', line 74

def get_field_deserializers()
    return super.merge({
        "clientId" => lambda {|n| @client_id = n.get_string_value() },
        "consentType" => lambda {|n| @consent_type = n.get_string_value() },
        "principalId" => lambda {|n| @principal_id = n.get_string_value() },
        "resourceId" => lambda {|n| @resource_id = n.get_string_value() },
        "scope" => lambda {|n| @scope = n.get_string_value() },
    })
end

#principal_idObject

Gets the principalId property value. The id of the user on behalf of whom the client is authorized to access the resource, when consentType is Principal. If consentType is AllPrincipals this value is null. Required when consentType is Principal. Supports $filter (eq only).

Returns:

  • a string



87
88
89
# File 'lib/models/o_auth2_permission_grant.rb', line 87

def principal_id
    return @principal_id
end

#principal_id=(value) ⇒ Object

Sets the principalId property value. The id of the user on behalf of whom the client is authorized to access the resource, when consentType is Principal. If consentType is AllPrincipals this value is null. Required when consentType is Principal. Supports $filter (eq only).

Parameters:

  • value

    Value to set for the principalId property.

Returns:

  • a void



95
96
97
# File 'lib/models/o_auth2_permission_grant.rb', line 95

def principal_id=(value)
    @principal_id = value
end

#resource_idObject

Gets the resourceId property value. The id of the resource service principal to which access is authorized. This identifies the API which the client is authorized to attempt to call on behalf of a signed-in user. Supports $filter (eq only).

Returns:

  • a string



102
103
104
# File 'lib/models/o_auth2_permission_grant.rb', line 102

def resource_id
    return @resource_id
end

#resource_id=(value) ⇒ Object

Sets the resourceId property value. The id of the resource service principal to which access is authorized. This identifies the API which the client is authorized to attempt to call on behalf of a signed-in user. Supports $filter (eq only).

Parameters:

  • value

    Value to set for the resourceId property.

Returns:

  • a void



110
111
112
# File 'lib/models/o_auth2_permission_grant.rb', line 110

def resource_id=(value)
    @resource_id = value
end

#scopeObject

Gets the scope property value. A space-separated list of the claim values for delegated permissions which should be included in access tokens for the resource application (the API). For example, openid User.Read GroupMember.Read.All. Each claim value should match the value field of one of the delegated permissions defined by the API, listed in the oauth2PermissionScopes property of the resource service principal. Must not exceed 3850 characters in length.

Returns:

  • a string



117
118
119
# File 'lib/models/o_auth2_permission_grant.rb', line 117

def scope
    return @scope
end

#scope=(value) ⇒ Object

Sets the scope property value. A space-separated list of the claim values for delegated permissions which should be included in access tokens for the resource application (the API). For example, openid User.Read GroupMember.Read.All. Each claim value should match the value field of one of the delegated permissions defined by the API, listed in the oauth2PermissionScopes property of the resource service principal. Must not exceed 3850 characters in length.

Parameters:

  • value

    Value to set for the scope property.

Returns:

  • a void



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

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


133
134
135
136
137
138
139
140
141
# File 'lib/models/o_auth2_permission_grant.rb', line 133

def serialize(writer)
    raise StandardError, 'writer cannot be null' if writer.nil?
    super
    writer.write_string_value("clientId", @client_id)
    writer.write_string_value("consentType", @consent_type)
    writer.write_string_value("principalId", @principal_id)
    writer.write_string_value("resourceId", @resource_id)
    writer.write_string_value("scope", @scope)
end