Class: Merge::Accounting::ExternalTargetFieldApiResponse
- Inherits:
-
Object
- Object
- Merge::Accounting::ExternalTargetFieldApiResponse
- Defined in:
- lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #account ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #accounting_attachment ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #balance_sheet ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #cash_flow_statement ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #company_info ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #contact ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #credit_note ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #expense ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #general_ledger_transaction ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #income_statement ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #invoice ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #item ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #journal_entry ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #payment ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #purchase_order ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #tax_rate ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #tracking_category ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #transaction ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
- #vendor_credit ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Accounting::ExternalTargetFieldApiResponse
Deserialize a JSON object to an instance of ExternalTargetFieldApiResponse.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(account: OMIT, accounting_attachment: OMIT, balance_sheet: OMIT, cash_flow_statement: OMIT, company_info: OMIT, contact: OMIT, income_statement: OMIT, credit_note: OMIT, item: OMIT, purchase_order: OMIT, tracking_category: OMIT, journal_entry: OMIT, tax_rate: OMIT, invoice: OMIT, payment: OMIT, expense: OMIT, vendor_credit: OMIT, transaction: OMIT, general_ledger_transaction: OMIT, additional_properties: nil) ⇒ Merge::Accounting::ExternalTargetFieldApiResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ExternalTargetFieldApiResponse to a JSON object.
Constructor Details
#initialize(account: OMIT, accounting_attachment: OMIT, balance_sheet: OMIT, cash_flow_statement: OMIT, company_info: OMIT, contact: OMIT, income_statement: OMIT, credit_note: OMIT, item: OMIT, purchase_order: OMIT, tracking_category: OMIT, journal_entry: OMIT, tax_rate: OMIT, invoice: OMIT, payment: OMIT, expense: OMIT, vendor_credit: OMIT, transaction: OMIT, general_ledger_transaction: OMIT, additional_properties: nil) ⇒ Merge::Accounting::ExternalTargetFieldApiResponse
77 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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 77 def initialize(account: OMIT, accounting_attachment: OMIT, balance_sheet: OMIT, cash_flow_statement: OMIT, company_info: OMIT, contact: OMIT, income_statement: OMIT, credit_note: OMIT, item: OMIT, purchase_order: OMIT, tracking_category: OMIT, journal_entry: OMIT, tax_rate: OMIT, invoice: OMIT, payment: OMIT, expense: OMIT, vendor_credit: OMIT, transaction: OMIT, general_ledger_transaction: OMIT, additional_properties: nil) @account = account if account != OMIT @accounting_attachment = if != OMIT @balance_sheet = balance_sheet if balance_sheet != OMIT @cash_flow_statement = cash_flow_statement if cash_flow_statement != OMIT @company_info = company_info if company_info != OMIT @contact = contact if contact != OMIT @income_statement = income_statement if income_statement != OMIT @credit_note = credit_note if credit_note != OMIT @item = item if item != OMIT @purchase_order = purchase_order if purchase_order != OMIT @tracking_category = tracking_category if tracking_category != OMIT @journal_entry = journal_entry if journal_entry != OMIT @tax_rate = tax_rate if tax_rate != OMIT @invoice = invoice if invoice != OMIT @payment = payment if payment != OMIT @expense = expense if expense != OMIT @vendor_credit = vendor_credit if vendor_credit != OMIT @transaction = transaction if transaction != OMIT @general_ledger_transaction = general_ledger_transaction if general_ledger_transaction != OMIT @additional_properties = additional_properties @_field_set = { "Account": account, "AccountingAttachment": , "BalanceSheet": balance_sheet, "CashFlowStatement": cash_flow_statement, "CompanyInfo": company_info, "Contact": contact, "IncomeStatement": income_statement, "CreditNote": credit_note, "Item": item, "PurchaseOrder": purchase_order, "TrackingCategory": tracking_category, "JournalEntry": journal_entry, "TaxRate": tax_rate, "Invoice": invoice, "Payment": payment, "Expense": expense, "VendorCredit": vendor_credit, "Transaction": transaction, "GeneralLedgerTransaction": general_ledger_transaction }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
11 12 13 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 11 def account @account end |
#accounting_attachment ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
13 14 15 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 13 def @accounting_attachment end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
49 50 51 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 49 def additional_properties @additional_properties end |
#balance_sheet ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
15 16 17 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 15 def balance_sheet @balance_sheet end |
#cash_flow_statement ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
17 18 19 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 17 def cash_flow_statement @cash_flow_statement end |
#company_info ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
19 20 21 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 19 def company_info @company_info end |
#contact ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 21 def contact @contact end |
#credit_note ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
25 26 27 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 25 def credit_note @credit_note end |
#expense ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
41 42 43 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 41 def expense @expense end |
#general_ledger_transaction ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
47 48 49 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 47 def general_ledger_transaction @general_ledger_transaction end |
#income_statement ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
23 24 25 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 23 def income_statement @income_statement end |
#invoice ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
37 38 39 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 37 def invoice @invoice end |
#item ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
27 28 29 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 27 def item @item end |
#journal_entry ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
33 34 35 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 33 def journal_entry @journal_entry end |
#payment ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
39 40 41 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 39 def payment @payment end |
#purchase_order ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
29 30 31 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 29 def purchase_order @purchase_order end |
#tax_rate ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
35 36 37 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 35 def tax_rate @tax_rate end |
#tracking_category ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
31 32 33 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 31 def tracking_category @tracking_category end |
#transaction ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
45 46 47 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 45 def transaction @transaction end |
#vendor_credit ⇒ Array<Merge::Accounting::ExternalTargetFieldApi> (readonly)
43 44 45 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 43 def vendor_credit @vendor_credit end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Accounting::ExternalTargetFieldApiResponse
Deserialize a JSON object to an instance of ExternalTargetFieldApiResponse
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 128 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) account = parsed_json["Account"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end = parsed_json["AccountingAttachment"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end balance_sheet = parsed_json["BalanceSheet"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end cash_flow_statement = parsed_json["CashFlowStatement"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end company_info = parsed_json["CompanyInfo"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end contact = parsed_json["Contact"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end income_statement = parsed_json["IncomeStatement"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end credit_note = parsed_json["CreditNote"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end item = parsed_json["Item"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end purchase_order = parsed_json["PurchaseOrder"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end tracking_category = parsed_json["TrackingCategory"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end journal_entry = parsed_json["JournalEntry"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end tax_rate = parsed_json["TaxRate"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end invoice = parsed_json["Invoice"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end payment = parsed_json["Payment"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end expense = parsed_json["Expense"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end vendor_credit = parsed_json["VendorCredit"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end transaction = parsed_json["Transaction"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end general_ledger_transaction = parsed_json["GeneralLedgerTransaction"]&.map do |item| item = item.to_json Merge::Accounting::ExternalTargetFieldApi.from_json(json_object: item) end new( account: account, accounting_attachment: , balance_sheet: balance_sheet, cash_flow_statement: cash_flow_statement, company_info: company_info, contact: contact, income_statement: income_statement, credit_note: credit_note, item: item, purchase_order: purchase_order, tracking_category: tracking_category, journal_entry: journal_entry, tax_rate: tax_rate, invoice: invoice, payment: payment, expense: expense, vendor_credit: vendor_credit, transaction: transaction, general_ledger_transaction: general_ledger_transaction, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 244 def self.validate_raw(obj:) obj.account&.is_a?(Array) != false || raise("Passed value for field obj.account is not the expected type, validation failed.") obj.&.is_a?(Array) != false || raise("Passed value for field obj.accounting_attachment is not the expected type, validation failed.") obj.balance_sheet&.is_a?(Array) != false || raise("Passed value for field obj.balance_sheet is not the expected type, validation failed.") obj.cash_flow_statement&.is_a?(Array) != false || raise("Passed value for field obj.cash_flow_statement is not the expected type, validation failed.") obj.company_info&.is_a?(Array) != false || raise("Passed value for field obj.company_info is not the expected type, validation failed.") obj.contact&.is_a?(Array) != false || raise("Passed value for field obj.contact is not the expected type, validation failed.") obj.income_statement&.is_a?(Array) != false || raise("Passed value for field obj.income_statement is not the expected type, validation failed.") obj.credit_note&.is_a?(Array) != false || raise("Passed value for field obj.credit_note is not the expected type, validation failed.") obj.item&.is_a?(Array) != false || raise("Passed value for field obj.item is not the expected type, validation failed.") obj.purchase_order&.is_a?(Array) != false || raise("Passed value for field obj.purchase_order is not the expected type, validation failed.") obj.tracking_category&.is_a?(Array) != false || raise("Passed value for field obj.tracking_category is not the expected type, validation failed.") obj.journal_entry&.is_a?(Array) != false || raise("Passed value for field obj.journal_entry is not the expected type, validation failed.") obj.tax_rate&.is_a?(Array) != false || raise("Passed value for field obj.tax_rate is not the expected type, validation failed.") obj.invoice&.is_a?(Array) != false || raise("Passed value for field obj.invoice is not the expected type, validation failed.") obj.payment&.is_a?(Array) != false || raise("Passed value for field obj.payment is not the expected type, validation failed.") obj.expense&.is_a?(Array) != false || raise("Passed value for field obj.expense is not the expected type, validation failed.") obj.vendor_credit&.is_a?(Array) != false || raise("Passed value for field obj.vendor_credit is not the expected type, validation failed.") obj.transaction&.is_a?(Array) != false || raise("Passed value for field obj.transaction is not the expected type, validation failed.") obj.general_ledger_transaction&.is_a?(Array) != false || raise("Passed value for field obj.general_ledger_transaction is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of ExternalTargetFieldApiResponse to a JSON object
234 235 236 |
# File 'lib/merge_ruby_client/accounting/types/external_target_field_api_response.rb', line 234 def to_json(*_args) @_field_set&.to_json end |