Class: Unit::AuthorizationRequest::ApproveRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/authorization_request/approve_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization_request_id, amount = nil, funding_account = nil, tags = nil) ⇒ ApproveRequest

Returns a new instance of ApproveRequest.

Parameters:

  • authorization_request_id (String)
  • amount (Integer) (defaults to: nil)
    • optional

  • funding_account (String) (defaults to: nil)
    • optional

  • tags (Hash) (defaults to: nil)
    • optional



14
15
16
17
18
19
# File 'lib/unit/models/authorization_request/approve_request.rb', line 14

def initialize(authorization_request_id, amount = nil,  = nil, tags = nil)
  @authorization_request_id = authorization_request_id
  @amount = amount
  @funding_account = 
  @tags = tags
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



8
9
10
# File 'lib/unit/models/authorization_request/approve_request.rb', line 8

def amount
  @amount
end

#authorization_request_idObject (readonly)

Returns the value of attribute authorization_request_id.



8
9
10
# File 'lib/unit/models/authorization_request/approve_request.rb', line 8

def authorization_request_id
  @authorization_request_id
end

#funding_accountObject (readonly)

Returns the value of attribute funding_account.



8
9
10
# File 'lib/unit/models/authorization_request/approve_request.rb', line 8

def 
  @funding_account
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/authorization_request/approve_request.rb', line 8

def tags
  @tags
end

Instance Method Details

#to_json_apiObject



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/unit/models/authorization_request/approve_request.rb', line 21

def to_json_api
  payload = {
    data: {
      type: "approveAuthorizationRequest",
      attributes: {
        amount: amount,
        fundingAccount: ,
        tags: tags
      }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end