Class: AdvancedBilling::MultiInvoicePayment
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::MultiInvoicePayment
- Defined in:
- lib/advanced_billing/models/multi_invoice_payment.rb
Overview
MultiInvoicePayment Model.
Instance Attribute Summary collapse
-
#applications ⇒ Array[InvoicePaymentApplication]
The ISO 4217 currency code (3 character string) representing the currency of invoice transaction.
-
#currency_code ⇒ String
The ISO 4217 currency code (3 character string) representing the currency of invoice transaction.
-
#total_amount ⇒ String
Dollar amount of the sum of the paid invoices.
-
#transaction_id ⇒ Integer
The numeric ID of the transaction.
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(transaction_id: SKIP, total_amount: SKIP, currency_code: SKIP, applications: SKIP, additional_properties: {}) ⇒ MultiInvoicePayment
constructor
A new instance of MultiInvoicePayment.
Methods inherited from BaseModel
Constructor Details
#initialize(transaction_id: SKIP, total_amount: SKIP, currency_code: SKIP, applications: SKIP, additional_properties: {}) ⇒ MultiInvoicePayment
Returns a new instance of MultiInvoicePayment.
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 55 def initialize(transaction_id: SKIP, total_amount: SKIP, currency_code: SKIP, applications: SKIP, additional_properties: {}) @transaction_id = transaction_id unless transaction_id == SKIP @total_amount = total_amount unless total_amount == SKIP @currency_code = currency_code unless currency_code == SKIP @applications = applications unless applications == SKIP # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end end |
Instance Attribute Details
#applications ⇒ Array[InvoicePaymentApplication]
The ISO 4217 currency code (3 character string) representing the currency of invoice transaction.
28 29 30 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 28 def applications @applications end |
#currency_code ⇒ String
The ISO 4217 currency code (3 character string) representing the currency of invoice transaction.
23 24 25 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 23 def currency_code @currency_code end |
#total_amount ⇒ String
Dollar amount of the sum of the paid invoices.
18 19 20 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 18 def total_amount @total_amount end |
#transaction_id ⇒ Integer
The numeric ID of the transaction.
14 15 16 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 14 def transaction_id @transaction_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 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/advanced_billing/models/multi_invoice_payment.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. transaction_id = hash.key?('transaction_id') ? hash['transaction_id'] : SKIP total_amount = hash.key?('total_amount') ? hash['total_amount'] : SKIP currency_code = hash.key?('currency_code') ? hash['currency_code'] : SKIP # Parameter is an array, so we need to iterate through it applications = nil unless hash['applications'].nil? applications = [] hash['applications'].each do |structure| applications << (InvoicePaymentApplication.from_hash(structure) if structure) end end applications = SKIP unless hash.key?('applications') # Clean out expected properties from Hash. names.each_value { |k| hash.delete(k) } # Create object from extracted values. MultiInvoicePayment.new(transaction_id: transaction_id, total_amount: total_amount, currency_code: currency_code, applications: applications, additional_properties: hash) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 38 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['transaction_id'] = 'transaction_id' @_hash['total_amount'] = 'total_amount' @_hash['currency_code'] = 'currency_code' @_hash['applications'] = 'applications' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 47 48 |
# File 'lib/advanced_billing/models/multi_invoice_payment.rb', line 41 def self.optionals %w[ transaction_id total_amount currency_code applications ] end |