Class: ModernTreasury::PaymentFlowCreateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::PaymentFlowCreateRequest
- Defined in:
- lib/modern_treasury/models/payment_flow_create_request.rb
Overview
PaymentFlowCreateRequest Model.
Instance Attribute Summary collapse
-
#amount ⇒ Integer
Required.
-
#counterparty_id ⇒ UUID | String
Required.
-
#currency ⇒ String
Required.
-
#direction ⇒ Direction10
Required.
-
#originating_account_id ⇒ UUID | String
Required.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(amount:, currency:, direction:, counterparty_id:, originating_account_id:, additional_properties: nil) ⇒ PaymentFlowCreateRequest
constructor
A new instance of PaymentFlowCreateRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(amount:, currency:, direction:, counterparty_id:, originating_account_id:, additional_properties: nil) ⇒ PaymentFlowCreateRequest
Returns a new instance of PaymentFlowCreateRequest.
58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 58 def initialize(amount:, currency:, direction:, counterparty_id:, originating_account_id:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @amount = amount @currency = currency @direction = direction @counterparty_id = counterparty_id @originating_account_id = originating_account_id @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ Integer
Required. Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000. Can be any integer up to 36 digits.
15 16 17 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 15 def amount @amount end |
#counterparty_id ⇒ UUID | String
Required. The ID of a counterparty associated with the payment. As part of the payment workflow an external account will be associated with this model.
31 32 33 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 31 def counterparty_id @counterparty_id end |
#currency ⇒ String
Required. The currency of the payment.
19 20 21 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 19 def currency @currency end |
#direction ⇒ Direction10
Required. Describes the direction money is flowing in the transaction. Can only be ‘debit`. A `debit` pulls money from someone else’s account to your own.
25 26 27 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 25 def direction @direction end |
#originating_account_id ⇒ UUID | String
Required. The ID of one of your organization’s internal accounts.
35 36 37 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 35 def originating_account_id @originating_account_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 72 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash.key?('amount') ? hash['amount'] : nil currency = hash.key?('currency') ? hash['currency'] : nil direction = hash.key?('direction') ? hash['direction'] : nil counterparty_id = hash.key?('counterparty_id') ? hash['counterparty_id'] : nil originating_account_id = hash.key?('originating_account_id') ? hash['originating_account_id'] : nil # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. PaymentFlowCreateRequest.new(amount: amount, currency: currency, direction: direction, counterparty_id: counterparty_id, originating_account_id: originating_account_id, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['currency'] = 'currency' @_hash['direction'] = 'direction' @_hash['counterparty_id'] = 'counterparty_id' @_hash['originating_account_id'] = 'originating_account_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
49 50 51 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 49 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
109 110 111 112 113 114 115 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 109 def inspect class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount.inspect}, currency: #{@currency.inspect}, direction:"\ " #{@direction.inspect}, counterparty_id: #{@counterparty_id.inspect},"\ " originating_account_id: #{@originating_account_id.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
101 102 103 104 105 106 |
# File 'lib/modern_treasury/models/payment_flow_create_request.rb', line 101 def to_s class_name = self.class.name.split('::').last "<#{class_name} amount: #{@amount}, currency: #{@currency}, direction: #{@direction},"\ " counterparty_id: #{@counterparty_id}, originating_account_id: #{@originating_account_id},"\ " additional_properties: #{@additional_properties}>" end |