Class: Merge::Accounting::RemoteFieldApiResponse
- Inherits:
-
Object
- Object
- Merge::Accounting::RemoteFieldApiResponse
- Defined in:
- lib/merge_ruby_client/accounting/types/remote_field_api_response.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
- #account ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #accounting_attachment ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #accounting_period ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #balance_sheet ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #bank_feed_account ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #cash_flow_statement ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #company_info ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #contact ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #credit_note ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #employee ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #expense ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #general_ledger_transaction ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #income_statement ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #invoice ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #item ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #journal_entry ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #payment ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #payment_method ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #payment_term ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #project ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #purchase_order ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #tax_rate ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #tracking_category ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #transaction ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
- #vendor_credit ⇒ Array<Merge::Accounting::RemoteFieldApi> readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Accounting::RemoteFieldApiResponse
Deserialize a JSON object to an instance of RemoteFieldApiResponse.
-
.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, accounting_period: OMIT, general_ledger_transaction: OMIT, bank_feed_account: OMIT, employee: OMIT, payment_method: OMIT, project: OMIT, payment_term: OMIT, additional_properties: nil) ⇒ Merge::Accounting::RemoteFieldApiResponse constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of RemoteFieldApiResponse 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, accounting_period: OMIT, general_ledger_transaction: OMIT, bank_feed_account: OMIT, employee: OMIT, payment_method: OMIT, project: OMIT, payment_term: OMIT, additional_properties: nil) ⇒ Merge::Accounting::RemoteFieldApiResponse
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 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 95 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, accounting_period: OMIT, general_ledger_transaction: OMIT, bank_feed_account: OMIT, employee: OMIT, payment_method: OMIT, project: OMIT, payment_term: 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 @accounting_period = accounting_period if accounting_period != OMIT @general_ledger_transaction = general_ledger_transaction if general_ledger_transaction != OMIT @bank_feed_account = bank_feed_account if bank_feed_account != OMIT @employee = employee if employee != OMIT @payment_method = payment_method if payment_method != OMIT @project = project if project != OMIT @payment_term = payment_term if payment_term != 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, "AccountingPeriod": accounting_period, "GeneralLedgerTransaction": general_ledger_transaction, "BankFeedAccount": bank_feed_account, "Employee": employee, "PaymentMethod": payment_method, "Project": project, "PaymentTerm": payment_term }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#account ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
11 12 13 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 11 def account @account end |
#accounting_attachment ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
13 14 15 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 13 def @accounting_attachment end |
#accounting_period ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
47 48 49 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 47 def accounting_period @accounting_period end |
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
61 62 63 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 61 def additional_properties @additional_properties end |
#balance_sheet ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
15 16 17 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 15 def balance_sheet @balance_sheet end |
#bank_feed_account ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
51 52 53 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 51 def bank_feed_account @bank_feed_account end |
#cash_flow_statement ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
17 18 19 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 17 def cash_flow_statement @cash_flow_statement end |
#company_info ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
19 20 21 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 19 def company_info @company_info end |
#contact ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 21 def contact @contact end |
#credit_note ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
25 26 27 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 25 def credit_note @credit_note end |
#employee ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
53 54 55 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 53 def employee @employee end |
#expense ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
41 42 43 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 41 def expense @expense end |
#general_ledger_transaction ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
49 50 51 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 49 def general_ledger_transaction @general_ledger_transaction end |
#income_statement ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
23 24 25 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 23 def income_statement @income_statement end |
#invoice ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
37 38 39 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 37 def invoice @invoice end |
#item ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
27 28 29 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 27 def item @item end |
#journal_entry ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
33 34 35 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 33 def journal_entry @journal_entry end |
#payment ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
39 40 41 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 39 def payment @payment end |
#payment_method ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
55 56 57 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 55 def payment_method @payment_method end |
#payment_term ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
59 60 61 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 59 def payment_term @payment_term end |
#project ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
57 58 59 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 57 def project @project end |
#purchase_order ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
29 30 31 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 29 def purchase_order @purchase_order end |
#tax_rate ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
35 36 37 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 35 def tax_rate @tax_rate end |
#tracking_category ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
31 32 33 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 31 def tracking_category @tracking_category end |
#transaction ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
45 46 47 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 45 def transaction @transaction end |
#vendor_credit ⇒ Array<Merge::Accounting::RemoteFieldApi> (readonly)
43 44 45 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 43 def vendor_credit @vendor_credit end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Accounting::RemoteFieldApiResponse
Deserialize a JSON object to an instance of RemoteFieldApiResponse
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 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 158 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::RemoteFieldApi.from_json(json_object: item) end = parsed_json["AccountingAttachment"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end balance_sheet = parsed_json["BalanceSheet"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end cash_flow_statement = parsed_json["CashFlowStatement"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end company_info = parsed_json["CompanyInfo"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end contact = parsed_json["Contact"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end income_statement = parsed_json["IncomeStatement"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end credit_note = parsed_json["CreditNote"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end item = parsed_json["Item"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end purchase_order = parsed_json["PurchaseOrder"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end tracking_category = parsed_json["TrackingCategory"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end journal_entry = parsed_json["JournalEntry"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end tax_rate = parsed_json["TaxRate"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end invoice = parsed_json["Invoice"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end payment = parsed_json["Payment"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end expense = parsed_json["Expense"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end vendor_credit = parsed_json["VendorCredit"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end transaction = parsed_json["Transaction"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end accounting_period = parsed_json["AccountingPeriod"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end general_ledger_transaction = parsed_json["GeneralLedgerTransaction"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end bank_feed_account = parsed_json["BankFeedAccount"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end employee = parsed_json["Employee"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end payment_method = parsed_json["PaymentMethod"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end project = parsed_json["Project"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.from_json(json_object: item) end payment_term = parsed_json["PaymentTerm"]&.map do |item| item = item.to_json Merge::Accounting::RemoteFieldApi.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, accounting_period: accounting_period, general_ledger_transaction: general_ledger_transaction, bank_feed_account: bank_feed_account, employee: employee, payment_method: payment_method, project: project, payment_term: payment_term, 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.
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 304 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.accounting_period&.is_a?(Array) != false || raise("Passed value for field obj.accounting_period 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.") obj.bank_feed_account&.is_a?(Array) != false || raise("Passed value for field obj.bank_feed_account is not the expected type, validation failed.") obj.employee&.is_a?(Array) != false || raise("Passed value for field obj.employee is not the expected type, validation failed.") obj.payment_method&.is_a?(Array) != false || raise("Passed value for field obj.payment_method is not the expected type, validation failed.") obj.project&.is_a?(Array) != false || raise("Passed value for field obj.project is not the expected type, validation failed.") obj.payment_term&.is_a?(Array) != false || raise("Passed value for field obj.payment_term is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of RemoteFieldApiResponse to a JSON object
294 295 296 |
# File 'lib/merge_ruby_client/accounting/types/remote_field_api_response.rb', line 294 def to_json(*_args) @_field_set&.to_json end |