Class: Unit::Fee::CreateFeeRequest
- Inherits:
-
Object
- Object
- Unit::Fee::CreateFeeRequest
- Defined in:
- lib/unit/models/fee/create_fee_request.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#idempotency_key ⇒ Object
readonly
Returns the value of attribute idempotency_key.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(account_id, amount, description, tags = nil, idempotency_key = nil) ⇒ CreateFeeRequest
constructor
A new instance of CreateFeeRequest.
- #to_json_api ⇒ Object
Constructor Details
#initialize(account_id, amount, description, tags = nil, idempotency_key = nil) ⇒ CreateFeeRequest
Returns a new instance of CreateFeeRequest.
15 16 17 18 19 20 21 |
# File 'lib/unit/models/fee/create_fee_request.rb', line 15 def initialize(account_id, amount, description, = nil, idempotency_key = nil) @account_id = account_id @amount = amount @description = description @tags = @idempotency_key = idempotency_key end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
8 9 10 |
# File 'lib/unit/models/fee/create_fee_request.rb', line 8 def account_id @account_id end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
8 9 10 |
# File 'lib/unit/models/fee/create_fee_request.rb', line 8 def amount @amount end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
8 9 10 |
# File 'lib/unit/models/fee/create_fee_request.rb', line 8 def description @description end |
#idempotency_key ⇒ Object (readonly)
Returns the value of attribute idempotency_key.
8 9 10 |
# File 'lib/unit/models/fee/create_fee_request.rb', line 8 def idempotency_key @idempotency_key end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
8 9 10 |
# File 'lib/unit/models/fee/create_fee_request.rb', line 8 def @tags end |
Instance Method Details
#to_json_api ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/unit/models/fee/create_fee_request.rb', line 23 def to_json_api payload = { "data": { "type": "fee", "attributes": { "amount": amount, "description": description, "tags": , "idempotencyKey": idempotency_key }, "relationships": { "account": Unit::Types::Relationship.new("depositAccount", account_id).to_hash } } } payload[:data][:attributes].compact! payload.to_json end |