Class: Unit::Counterparty::UpdateCounterpartyRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/models/counterparty/update_counterparty_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(counterparty_id, plaid_processor_token, verify_name = nil, permissions = nil, tags = nil) ⇒ UpdateCounterpartyRequest

Returns a new instance of UpdateCounterpartyRequest.

Parameters:

  • counterparty_id (String)
  • plaid_processor_token (String)
  • verify_name (Boolean) (defaults to: nil)
    • optional

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

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



15
16
17
18
19
20
21
# File 'lib/unit/models/counterparty/update_counterparty_request.rb', line 15

def initialize(counterparty_id, plaid_processor_token, verify_name = nil, permissions = nil, tags = nil)
  @counterparty_id = counterparty_id
  @plaid_processor_token = plaid_processor_token
  @verify_name = verify_name
  @permissions = permissions
  @tags = tags
end

Instance Attribute Details

#counterparty_idObject (readonly)

Returns the value of attribute counterparty_id.



8
9
10
# File 'lib/unit/models/counterparty/update_counterparty_request.rb', line 8

def counterparty_id
  @counterparty_id
end

#permissionsObject (readonly)

Returns the value of attribute permissions.



8
9
10
# File 'lib/unit/models/counterparty/update_counterparty_request.rb', line 8

def permissions
  @permissions
end

#plaid_processor_tokenObject (readonly)

Returns the value of attribute plaid_processor_token.



8
9
10
# File 'lib/unit/models/counterparty/update_counterparty_request.rb', line 8

def plaid_processor_token
  @plaid_processor_token
end

#tagsObject (readonly)

Returns the value of attribute tags.



8
9
10
# File 'lib/unit/models/counterparty/update_counterparty_request.rb', line 8

def tags
  @tags
end

#verify_nameObject (readonly)

Returns the value of attribute verify_name.



8
9
10
# File 'lib/unit/models/counterparty/update_counterparty_request.rb', line 8

def verify_name
  @verify_name
end

Instance Method Details

#to_json_apiObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/unit/models/counterparty/update_counterparty_request.rb', line 23

def to_json_api
  payload = {
    "data": {
      "type": "counterparty",
      attributes: {
        plaidProcessorToken: plaid_processor_token,
        verifyName: verify_name,
        permissions: permissions,
        tags: tags
      }
    }
  }
  payload[:data][:attributes].compact!
  payload.to_json
end