Class: ShellDataReportingApIs::StatementOfAccountResp
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::StatementOfAccountResp
- Defined in:
- lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb
Overview
StatementOfAccountResp Model.
Instance Attribute Summary collapse
-
#invoices_summaries ⇒ Array[InvoicesSummaries]
TODO: Write general description for this method.
-
#last_statement_of_account ⇒ LastStatementOfAccount2
TODO: Write general description for this method.
-
#monthly_invoice_trend ⇒ Array[MonthlyInvoiceTrend]
TODO: Write general description for this method.
-
#past_statement_of_accounts ⇒ Array[PastStatementOfAccounts]
TODO: Write general description for this method.
-
#payments_since_last_soa ⇒ Array[PaymentsSinceLastSOA]
TODO: Write general description for this method.
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(last_statement_of_account = SKIP, monthly_invoice_trend = SKIP, past_statement_of_accounts = SKIP, payments_since_last_soa = SKIP, invoices_summaries = SKIP) ⇒ StatementOfAccountResp
constructor
A new instance of StatementOfAccountResp.
Methods inherited from BaseModel
Constructor Details
#initialize(last_statement_of_account = SKIP, monthly_invoice_trend = SKIP, past_statement_of_accounts = SKIP, payments_since_last_soa = SKIP, invoices_summaries = SKIP) ⇒ StatementOfAccountResp
Returns a new instance of StatementOfAccountResp.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 63 def initialize(last_statement_of_account = SKIP, monthly_invoice_trend = SKIP, past_statement_of_accounts = SKIP, payments_since_last_soa = SKIP, invoices_summaries = SKIP) unless last_statement_of_account == SKIP @last_statement_of_account = last_statement_of_account end @monthly_invoice_trend = monthly_invoice_trend unless monthly_invoice_trend == SKIP unless past_statement_of_accounts == SKIP @past_statement_of_accounts = past_statement_of_accounts end @payments_since_last_soa = payments_since_last_soa unless payments_since_last_soa == SKIP @invoices_summaries = invoices_summaries unless invoices_summaries == SKIP end |
Instance Attribute Details
#invoices_summaries ⇒ Array[InvoicesSummaries]
TODO: Write general description for this method
30 31 32 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 30 def invoices_summaries @invoices_summaries end |
#last_statement_of_account ⇒ LastStatementOfAccount2
TODO: Write general description for this method
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 14 def last_statement_of_account @last_statement_of_account end |
#monthly_invoice_trend ⇒ Array[MonthlyInvoiceTrend]
TODO: Write general description for this method
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 18 def monthly_invoice_trend @monthly_invoice_trend end |
#past_statement_of_accounts ⇒ Array[PastStatementOfAccounts]
TODO: Write general description for this method
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 22 def past_statement_of_accounts @past_statement_of_accounts end |
#payments_since_last_soa ⇒ Array[PaymentsSinceLastSOA]
TODO: Write general description for this method
26 27 28 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 26 def payments_since_last_soa @payments_since_last_soa end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 81 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. if hash['LastStatementOfAccount'] last_statement_of_account = LastStatementOfAccount2.from_hash(hash['LastStatementOfAccount']) end # Parameter is an array, so we need to iterate through it monthly_invoice_trend = nil unless hash['MonthlyInvoiceTrend'].nil? monthly_invoice_trend = [] hash['MonthlyInvoiceTrend'].each do |structure| monthly_invoice_trend << (MonthlyInvoiceTrend.from_hash(structure) if structure) end end monthly_invoice_trend = SKIP unless hash.key?('MonthlyInvoiceTrend') # Parameter is an array, so we need to iterate through it past_statement_of_accounts = nil unless hash['PastStatementOfAccounts'].nil? past_statement_of_accounts = [] hash['PastStatementOfAccounts'].each do |structure| past_statement_of_accounts << (PastStatementOfAccounts.from_hash(structure) if structure) end end past_statement_of_accounts = SKIP unless hash.key?('PastStatementOfAccounts') # Parameter is an array, so we need to iterate through it payments_since_last_soa = nil unless hash['PaymentsSinceLastSOA'].nil? payments_since_last_soa = [] hash['PaymentsSinceLastSOA'].each do |structure| payments_since_last_soa << (PaymentsSinceLastSOA.from_hash(structure) if structure) end end payments_since_last_soa = SKIP unless hash.key?('PaymentsSinceLastSOA') # Parameter is an array, so we need to iterate through it invoices_summaries = nil unless hash['InvoicesSummaries'].nil? invoices_summaries = [] hash['InvoicesSummaries'].each do |structure| invoices_summaries << (InvoicesSummaries.from_hash(structure) if structure) end end invoices_summaries = SKIP unless hash.key?('InvoicesSummaries') # Create object from extracted values. StatementOfAccountResp.new(last_statement_of_account, monthly_invoice_trend, past_statement_of_accounts, payments_since_last_soa, invoices_summaries) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['last_statement_of_account'] = 'LastStatementOfAccount' @_hash['monthly_invoice_trend'] = 'MonthlyInvoiceTrend' @_hash['past_statement_of_accounts'] = 'PastStatementOfAccounts' @_hash['payments_since_last_soa'] = 'PaymentsSinceLastSOA' @_hash['invoices_summaries'] = 'InvoicesSummaries' @_hash end |
.nullables ⇒ Object
An array for nullable fields
55 56 57 58 59 60 61 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 55 def self.nullables %w[ monthly_invoice_trend payments_since_last_soa invoices_summaries ] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 52 |
# File 'lib/shell_data_reporting_ap_is/models/statement_of_account_resp.rb', line 44 def self.optionals %w[ last_statement_of_account monthly_invoice_trend past_statement_of_accounts payments_since_last_soa invoices_summaries ] end |