Class: Unit::Counterparty::CreateCounterpartyRequest
- Inherits:
-
Object
- Object
- Unit::Counterparty::CreateCounterpartyRequest
- Defined in:
- lib/unit/models/counterparty/create_counterparty_request.rb
Instance Attribute Summary collapse
-
#account_number ⇒ Object
readonly
Returns the value of attribute account_number.
-
#account_type ⇒ Object
readonly
Returns the value of attribute account_type.
-
#customer_id ⇒ Object
readonly
Returns the value of attribute customer_id.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#permissions ⇒ Object
readonly
Returns the value of attribute permissions.
-
#routing_number ⇒ Object
readonly
Returns the value of attribute routing_number.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(customer_id, name, routing_number, account_number, account_type, type, tags = nil, permissions = nil, idempotency_key = nil) ⇒ CreateCounterpartyRequest
constructor
A new instance of CreateCounterpartyRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(customer_id, name, routing_number, account_number, account_type, type, tags = nil, permissions = nil, idempotency_key = nil) ⇒ CreateCounterpartyRequest
Returns a new instance of CreateCounterpartyRequest.
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 20 def initialize(customer_id, name, routing_number, account_number, account_type, type, = nil, = nil, idempotency_key = nil) @customer_id = customer_id @name = name @routing_number = routing_number @account_number = account_number @account_type = account_type @type = type @tags = @permissions = @idempotency_key = idempotency_key end |
Instance Attribute Details
#account_number ⇒ Object (readonly)
Returns the value of attribute account_number.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def account_number @account_number end |
#account_type ⇒ Object (readonly)
Returns the value of attribute account_type.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def account_type @account_type end |
#customer_id ⇒ Object (readonly)
Returns the value of attribute customer_id.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def customer_id @customer_id end |
#idempotency_key ⇒ Object (readonly)
Returns the value of attribute idempotency_key.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def idempotency_key @idempotency_key end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def name @name end |
#permissions ⇒ Object (readonly)
Returns the value of attribute permissions.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def @permissions end |
#routing_number ⇒ Object (readonly)
Returns the value of attribute routing_number.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def routing_number @routing_number end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def @tags end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 8 def type @type end |
Instance Method Details
#to_json_api ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/unit/models/counterparty/create_counterparty_request.rb', line 32 def to_json_api payload = { "data": { "type": "achCounterparty", "attributes": { name: name, routingNumber: routing_number, accountNumber: account_number, accountType: account_type, type: type, tags: , permissions: , idempotencyKey: idempotency_key }, "relationships": { customer: Unit::Types::Relationship.new("customer", customer_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |