Class: Levelup::Requests::RequestPermissions

Inherits:
Base show all
Includes:
Templates::AppAuthenticated
Defined in:
lib/levelup/requests/request_permissions.rb

Overview

Represents a request to request a set of permissions from a specified account (merchant or user).

Constant Summary

Constants inherited from Base

Base::ALLOWED_REQUEST_METHODS

Instance Attribute Summary collapse

Attributes included from Templates::AppAuthenticated

#app_access_token

Instance Method Summary collapse

Methods included from Templates::AppAuthenticated

#auth_type

Methods inherited from Base

#auth_type, #headers, instance_variables_excluded_from_hash, #send_to_api

Methods inherited from Templates::DataParcel

excluded?, #initialize, instance_variables_excluded_from_hash

Constructor Details

This class inherits a constructor from Levelup::Templates::DataParcel

Instance Attribute Details

#emailObject

The email address of the requested user or merchant.


8
9
10
# File 'lib/levelup/requests/request_permissions.rb', line 8

def email
  @email
end

#permission_keynamesObject

An array of strings representing desired permissions from the user or merchant. Common permissions include 'create_orders' and 'manage_merchant_orders'


12
13
14
# File 'lib/levelup/requests/request_permissions.rb', line 12

def permission_keynames
  @permission_keynames
end

Instance Method Details

#bodyObject


14
15
16
# File 'lib/levelup/requests/request_permissions.rb', line 14

def body
  { permissions_request: to_hash }
end

#response_from_hash(hash) ⇒ Object


18
19
20
# File 'lib/levelup/requests/request_permissions.rb', line 18

def response_from_hash(hash)
  Responses::Success.new(hash['permissions_request'])
end