Class: ModernTreasury::IncomingPaymentDetailCreateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::IncomingPaymentDetailCreateRequest
- Defined in:
- lib/modern_treasury/models/incoming_payment_detail_create_request.rb
Overview
IncomingPaymentDetailCreateRequest Model.
Instance Attribute Summary collapse
-
#amount ⇒ Integer
Value in specified currency’s smallest unit.
-
#as_of_date ⇒ Date
Defaults to today.
-
#currency ⇒ CurrencyEnum
Three-letter ISO currency code.
-
#description ⇒ String
Defaults to a random description.
-
#direction ⇒ Direction14Enum
One of ‘credit`, `debit`.
-
#internal_account_id ⇒ UUID | String
The ID of one of your internal accounts.
-
#type ⇒ Type10Enum
One of ‘ach`, `wire`, `check`.
-
#virtual_account_id ⇒ UUID | String
An optional parameter to associate the incoming payment detail to a virtual account.
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(type = SKIP, direction = SKIP, amount = SKIP, currency = SKIP, internal_account_id = SKIP, virtual_account_id = SKIP, as_of_date = SKIP, description = SKIP) ⇒ IncomingPaymentDetailCreateRequest
constructor
A new instance of IncomingPaymentDetailCreateRequest.
-
#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(type = SKIP, direction = SKIP, amount = SKIP, currency = SKIP, internal_account_id = SKIP, virtual_account_id = SKIP, as_of_date = SKIP, description = SKIP) ⇒ IncomingPaymentDetailCreateRequest
Returns a new instance of IncomingPaymentDetailCreateRequest.
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 83 def initialize(type = SKIP, direction = SKIP, amount = SKIP, currency = SKIP, internal_account_id = SKIP, virtual_account_id = SKIP, as_of_date = SKIP, description = SKIP) @type = type unless type == SKIP @direction = direction unless direction == SKIP @amount = amount unless amount == SKIP @currency = currency unless currency == SKIP @internal_account_id = internal_account_id unless internal_account_id == SKIP @virtual_account_id = virtual_account_id unless virtual_account_id == SKIP @as_of_date = as_of_date unless as_of_date == SKIP @description = description unless description == SKIP end |
Instance Attribute Details
#amount ⇒ Integer
Value in specified currency’s smallest unit. e.g. $10 would be represented as 1000.
23 24 25 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 23 def amount @amount end |
#as_of_date ⇒ Date
Defaults to today.
40 41 42 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 40 def as_of_date @as_of_date end |
#currency ⇒ CurrencyEnum
Three-letter ISO currency code.
27 28 29 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 27 def currency @currency end |
#description ⇒ String
Defaults to a random description.
44 45 46 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 44 def description @description end |
#direction ⇒ Direction14Enum
One of ‘credit`, `debit`.
18 19 20 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 18 def direction @direction end |
#internal_account_id ⇒ UUID | String
The ID of one of your internal accounts.
31 32 33 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 31 def internal_account_id @internal_account_id end |
#type ⇒ Type10Enum
One of ‘ach`, `wire`, `check`.
14 15 16 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 14 def type @type end |
#virtual_account_id ⇒ UUID | String
An optional parameter to associate the incoming payment detail to a virtual account.
36 37 38 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 36 def virtual_account_id @virtual_account_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 98 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash.key?('type') ? hash['type'] : SKIP direction = hash.key?('direction') ? hash['direction'] : SKIP amount = hash.key?('amount') ? hash['amount'] : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP internal_account_id = hash.key?('internal_account_id') ? hash['internal_account_id'] : SKIP virtual_account_id = hash.key?('virtual_account_id') ? hash['virtual_account_id'] : SKIP as_of_date = hash.key?('as_of_date') ? hash['as_of_date'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP # Create object from extracted values. IncomingPaymentDetailCreateRequest.new(type, direction, amount, currency, internal_account_id, virtual_account_id, as_of_date, description) end |
.names ⇒ Object
A mapping from model property names to API property names.
47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 47 def self.names @_hash = {} if @_hash.nil? @_hash['type'] = 'type' @_hash['direction'] = 'direction' @_hash['amount'] = 'amount' @_hash['currency'] = 'currency' @_hash['internal_account_id'] = 'internal_account_id' @_hash['virtual_account_id'] = 'virtual_account_id' @_hash['as_of_date'] = 'as_of_date' @_hash['description'] = 'description' @_hash end |
.nullables ⇒ Object
An array for nullable fields
75 76 77 78 79 80 81 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 75 def self.nullables %w[ virtual_account_id as_of_date description ] end |
.optionals ⇒ Object
An array for optional fields
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 61 def self.optionals %w[ type direction amount currency internal_account_id virtual_account_id as_of_date description ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
133 134 135 136 137 138 139 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 133 def inspect class_name = self.class.name.split('::').last "<#{class_name} type: #{@type.inspect}, direction: #{@direction.inspect}, amount:"\ " #{@amount.inspect}, currency: #{@currency.inspect}, internal_account_id:"\ " #{@internal_account_id.inspect}, virtual_account_id: #{@virtual_account_id.inspect},"\ " as_of_date: #{@as_of_date.inspect}, description: #{@description.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
125 126 127 128 129 130 |
# File 'lib/modern_treasury/models/incoming_payment_detail_create_request.rb', line 125 def to_s class_name = self.class.name.split('::').last "<#{class_name} type: #{@type}, direction: #{@direction}, amount: #{@amount}, currency:"\ " #{@currency}, internal_account_id: #{@internal_account_id}, virtual_account_id:"\ " #{@virtual_account_id}, as_of_date: #{@as_of_date}, description: #{@description}>" end |