Class: FdxV660Api::PaymentForUpdateEntity2
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- FdxV660Api::PaymentForUpdateEntity2
- Defined in:
- lib/fdx_v660_api/models/payment_for_update_entity2.rb
Overview
The data of the Payment to be updated
Instance Attribute Summary collapse
-
#amount ⇒ Float
Amount for the payment.
-
#description ⇒ String
The purpose of the payment as provided by consumer or payment-requesting app.
-
#due_date ⇒ Date
Date that the funds are scheduled to be delivered.
-
#from_account_id ⇒ String
ID of the account used to source funds for payment.
-
#merchant_account_id ⇒ String
User's account identifier with the merchant.
-
#to_payee_id ⇒ String
ID of the payee to receive funds for the payment.
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(from_account_id:, to_payee_id:, amount:, due_date:, description: SKIP, merchant_account_id: SKIP, additional_properties: nil) ⇒ PaymentForUpdateEntity2
constructor
A new instance of PaymentForUpdateEntity2.
-
#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(from_account_id:, to_payee_id:, amount:, due_date:, description: SKIP, merchant_account_id: SKIP, additional_properties: nil) ⇒ PaymentForUpdateEntity2
Returns a new instance of PaymentForUpdateEntity2.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 62 def initialize(from_account_id:, to_payee_id:, amount:, due_date:, description: SKIP, merchant_account_id: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @from_account_id = from_account_id @to_payee_id = to_payee_id @description = description unless description == SKIP @amount = amount @merchant_account_id = merchant_account_id unless merchant_account_id == SKIP @due_date = due_date @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ Float
Amount for the payment. Must be positive
27 28 29 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 27 def amount @amount end |
#description ⇒ String
The purpose of the payment as provided by consumer or payment-requesting app
23 24 25 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 23 def description @description end |
#due_date ⇒ Date
Date that the funds are scheduled to be delivered
35 36 37 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 35 def due_date @due_date end |
#from_account_id ⇒ String
ID of the account used to source funds for payment
14 15 16 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 14 def from_account_id @from_account_id end |
#merchant_account_id ⇒ String
User's account identifier with the merchant
31 32 33 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 31 def merchant_account_id @merchant_account_id end |
#to_payee_id ⇒ String
ID of the payee to receive funds for the payment
18 19 20 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 18 def to_payee_id @to_payee_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 78 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. from_account_id = hash.key?('fromAccountId') ? hash['fromAccountId'] : nil to_payee_id = hash.key?('toPayeeId') ? hash['toPayeeId'] : nil amount = hash.key?('amount') ? hash['amount'] : nil due_date = hash.key?('dueDate') ? hash['dueDate'] : nil description = hash.key?('description') ? hash['description'] : SKIP merchant_account_id = hash.key?('merchantAccountId') ? hash['merchantAccountId'] : SKIP # 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. PaymentForUpdateEntity2.new(from_account_id: from_account_id, to_payee_id: to_payee_id, amount: amount, due_date: due_date, description: description, merchant_account_id: merchant_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 47 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['from_account_id'] = 'fromAccountId' @_hash['to_payee_id'] = 'toPayeeId' @_hash['description'] = 'description' @_hash['amount'] = 'amount' @_hash['merchant_account_id'] = 'merchantAccountId' @_hash['due_date'] = 'dueDate' @_hash end |
.nullables ⇒ Object
An array for nullable fields
58 59 60 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 58 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
50 51 52 53 54 55 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 50 def self.optionals %w[ description merchant_account_id ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
117 118 119 120 121 122 123 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 117 def inspect class_name = self.class.name.split('::').last "<#{class_name} from_account_id: #{@from_account_id.inspect}, to_payee_id:"\ " #{@to_payee_id.inspect}, description: #{@description.inspect}, amount: #{@amount.inspect},"\ " merchant_account_id: #{@merchant_account_id.inspect}, due_date: #{@due_date.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
108 109 110 111 112 113 114 |
# File 'lib/fdx_v660_api/models/payment_for_update_entity2.rb', line 108 def to_s class_name = self.class.name.split('::').last "<#{class_name} from_account_id: #{@from_account_id}, to_payee_id: #{@to_payee_id},"\ " description: #{@description}, amount: #{@amount}, merchant_account_id:"\ " #{@merchant_account_id}, due_date: #{@due_date}, additional_properties:"\ " #{@additional_properties}>" end |