xero-ruby 9.3.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xero-ruby/api/accounting_api.rb +178 -319
  3. data/lib/xero-ruby/api/files_api.rb +9 -2
  4. data/lib/xero-ruby/api/finance_api.rb +0 -299
  5. data/lib/xero-ruby/api/payroll_au_v2_api.rb +751 -0
  6. data/lib/xero-ruby/api/payroll_nz_api.rb +0 -86
  7. data/lib/xero-ruby/api/payroll_uk_api.rb +0 -86
  8. data/lib/xero-ruby/models/accounting/bank_transfer.rb +71 -1
  9. data/lib/xero-ruby/models/accounting/bank_transfer_delete.rb +244 -0
  10. data/lib/xero-ruby/models/accounting/bank_transfer_delete_by_url_param.rb +229 -0
  11. data/lib/xero-ruby/models/accounting/bank_transfers_delete.rb +224 -0
  12. data/lib/xero-ruby/models/accounting/contact.rb +27 -1
  13. data/lib/xero-ruby/models/accounting/credit_note.rb +11 -1
  14. data/lib/xero-ruby/models/accounting/invoice.rb +12 -2
  15. data/lib/xero-ruby/models/accounting/organisation.rb +25 -6
  16. data/lib/xero-ruby/models/accounting/overpayment.rb +21 -1
  17. data/lib/xero-ruby/models/accounting/payment.rb +11 -1
  18. data/lib/xero-ruby/models/accounting/prepayment.rb +31 -1
  19. data/lib/xero-ruby/models/accounting/tracking_reference.rb +277 -0
  20. data/lib/xero-ruby/models/accounting/user.rb +3 -2
  21. data/lib/xero-ruby/models/app_store/product.rb +4 -3
  22. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +54 -4
  23. data/lib/xero-ruby/models/files/association.rb +21 -1
  24. data/lib/xero-ruby/models/finance/current_statement_response.rb +1 -1
  25. data/lib/xero-ruby/models/finance/data_source_response.rb +1 -31
  26. data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +16 -1
  27. data/lib/xero-ruby/models/payroll_au/employee.rb +1 -13
  28. data/lib/xero-ruby/models/payroll_au/leave_line.rb +16 -1
  29. data/lib/xero-ruby/models/payroll_au/leave_type.rb +19 -4
  30. data/lib/xero-ruby/models/payroll_au/opening_balance_leave_line.rb +232 -0
  31. data/lib/xero-ruby/models/payroll_au/opening_balances.rb +1 -1
  32. data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +14 -4
  33. data/lib/xero-ruby/models/payroll_au_v2/invalid_field.rb +232 -0
  34. data/lib/xero-ruby/models/payroll_au_v2/pagination.rb +252 -0
  35. data/lib/xero-ruby/models/payroll_au_v2/problem.rb +275 -0
  36. data/lib/xero-ruby/models/payroll_au_v2/timesheet.rb +361 -0
  37. data/lib/xero-ruby/models/payroll_au_v2/timesheet_line.rb +277 -0
  38. data/lib/xero-ruby/models/payroll_au_v2/timesheet_line_object.rb +242 -0
  39. data/lib/xero-ruby/models/payroll_au_v2/timesheet_object.rb +242 -0
  40. data/lib/xero-ruby/models/payroll_au_v2/timesheets.rb +244 -0
  41. data/lib/xero-ruby/models/payroll_nz/employee.rb +20 -0
  42. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +29 -19
  43. data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +31 -11
  44. data/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb +5 -0
  45. data/lib/xero-ruby/models/payroll_nz/employment.rb +15 -0
  46. data/lib/xero-ruby/models/payroll_nz/leave_period.rb +35 -4
  47. data/lib/xero-ruby/models/payroll_nz/leave_type.rb +24 -4
  48. data/lib/xero-ruby/models/payroll_uk/contract_type.rb +38 -0
  49. data/lib/xero-ruby/models/payroll_uk/contracts.rb +297 -0
  50. data/lib/xero-ruby/models/payroll_uk/developmental_role_details.rb +267 -0
  51. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +5 -2
  52. data/lib/xero-ruby/models/payroll_uk/employee.rb +68 -4
  53. data/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb +5 -0
  54. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb +4 -2
  55. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +5 -2
  56. data/lib/xero-ruby/models/payroll_uk/employment.rb +49 -52
  57. data/lib/xero-ruby/models/payroll_uk/employment_status.rb +37 -0
  58. data/lib/xero-ruby/models/payroll_uk/ni_category.rb +318 -0
  59. data/lib/xero-ruby/models/payroll_uk/ni_category_letter.rb +51 -0
  60. data/lib/xero-ruby/models/payroll_uk/ni_category_one_of.rb +264 -0
  61. data/lib/xero-ruby/models/payroll_uk/ni_category_one_of1.rb +257 -0
  62. data/lib/xero-ruby/version.rb +2 -2
  63. data/lib/xero-ruby.rb +22 -10
  64. data/spec/finance/api/finance_api_spec.rb +0 -53
  65. metadata +393 -391
  66. data/spec/finance/models/account_usage_response_spec.rb +0 -58
  67. data/spec/finance/models/account_usage_spec.rb +0 -112
  68. data/spec/finance/models/history_record_response_spec.rb +0 -64
  69. data/spec/finance/models/lock_history_model_spec.rb +0 -52
  70. data/spec/finance/models/lock_history_response_spec.rb +0 -52
  71. data/spec/finance/models/practice_response_spec.rb +0 -64
  72. data/spec/finance/models/report_history_model_spec.rb +0 -52
  73. data/spec/finance/models/report_history_response_spec.rb +0 -52
  74. data/spec/finance/models/user_activities_response_spec.rb +0 -52
  75. data/spec/finance/models/user_response_spec.rb +0 -106
@@ -59,6 +59,14 @@ module XeroRuby::Accounting
59
59
  SOLE_TRADER ||= "SOLE_TRADER".freeze
60
60
  SUPERANNUATION_FUND ||= "SUPERANNUATION_FUND".freeze
61
61
  TRUST ||= "TRUST".freeze
62
+ PERSONAL ||= "PERSONAL".freeze
63
+ SINGLEMEMBERLLC ||= "SINGLEMEMBERLLC".freeze
64
+ CCORPORATIONLLC ||= "CCORPORATIONLLC".freeze
65
+ PARTNERSHIPLLC ||= "PARTNERSHIPLLC".freeze
66
+ SCORPORATIONLLC ||= "SCORPORATIONLLC".freeze
67
+ LLC ||= "LLC".freeze
68
+ NOTLLC ||= "NOTLLC".freeze
69
+ UNSPECIFIED ||= "UNSPECIFIED".freeze
62
70
 
63
71
 
64
72
  attr_accessor :base_currency
@@ -149,6 +157,14 @@ module XeroRuby::Accounting
149
157
  SOLE_TRADER ||= "SOLE_TRADER".freeze
150
158
  SUPERANNUATION_FUND ||= "SUPERANNUATION_FUND".freeze
151
159
  TRUST ||= "TRUST".freeze
160
+ PERSONAL ||= "PERSONAL".freeze
161
+ SINGLEMEMBERLLC ||= "SINGLEMEMBERLLC".freeze
162
+ CCORPORATIONLLC ||= "CCORPORATIONLLC".freeze
163
+ PARTNERSHIPLLC ||= "PARTNERSHIPLLC".freeze
164
+ SCORPORATIONLLC ||= "SCORPORATIONLLC".freeze
165
+ LLC ||= "LLC".freeze
166
+ NOTLLC ||= "NOTLLC".freeze
167
+ UNSPECIFIED ||= "UNSPECIFIED".freeze
152
168
 
153
169
  # A unique identifier for the organisation. Potential uses.
154
170
  attr_accessor :short_code
@@ -175,6 +191,9 @@ module XeroRuby::Accounting
175
191
  IGNITE ||= "IGNITE".freeze
176
192
  GROW ||= "GROW".freeze
177
193
  COMPREHENSIVE ||= "COMPREHENSIVE".freeze
194
+ SIMPLE ||= "SIMPLE".freeze
195
+ BASICLITE ||= "BASICLITE".freeze
196
+ ULTRA ||= "ULTRA".freeze
178
197
 
179
198
  # BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing)
180
199
  attr_accessor :edition
@@ -462,15 +481,15 @@ module XeroRuby::Accounting
462
481
  def valid?
463
482
  version_validator = EnumAttributeValidator.new('String', ["AU", "NZ", "GLOBAL", "UK", "US", "AUONRAMP", "NZONRAMP", "GLOBALONRAMP", "UKONRAMP", "USONRAMP"])
464
483
  return false unless version_validator.valid?(@version)
465
- organisation_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
484
+ organisation_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
466
485
  return false unless organisation_type_validator.valid?(@organisation_type)
467
486
  sales_tax_basis_validator = EnumAttributeValidator.new('String', ["PAYMENTS", "INVOICE", "NONE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS"])
468
487
  return false unless sales_tax_basis_validator.valid?(@sales_tax_basis)
469
488
  sales_tax_period_validator = EnumAttributeValidator.new('String', ["MONTHLY", "QUARTERLY1", "QUARTERLY2", "QUARTERLY3", "ANNUALLY", "ONEMONTHS", "TWOMONTHS", "SIXMONTHS", "1MONTHLY", "2MONTHLY", "3MONTHLY", "6MONTHLY", "QUARTERLY", "YEARLY", "NONE"])
470
489
  return false unless sales_tax_period_validator.valid?(@sales_tax_period)
471
- organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
490
+ organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
472
491
  return false unless organisation_entity_type_validator.valid?(@organisation_entity_type)
473
- _class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE"])
492
+ _class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE", "ULTRA"])
474
493
  return false unless _class_validator.valid?(@_class)
475
494
  edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"])
476
495
  return false unless edition_validator.valid?(@edition)
@@ -490,7 +509,7 @@ module XeroRuby::Accounting
490
509
  # Custom attribute writer method checking allowed values (enum).
491
510
  # @param [Object] organisation_type Object to be assigned
492
511
  def organisation_type=(organisation_type)
493
- validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
512
+ validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
494
513
  unless validator.valid?(organisation_type)
495
514
  fail ArgumentError, "invalid value for \"organisation_type\", must be one of #{validator.allowable_values}."
496
515
  end
@@ -520,7 +539,7 @@ module XeroRuby::Accounting
520
539
  # Custom attribute writer method checking allowed values (enum).
521
540
  # @param [Object] organisation_entity_type Object to be assigned
522
541
  def organisation_entity_type=(organisation_entity_type)
523
- validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
542
+ validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
524
543
  unless validator.valid?(organisation_entity_type)
525
544
  fail ArgumentError, "invalid value for \"organisation_entity_type\", must be one of #{validator.allowable_values}."
526
545
  end
@@ -530,7 +549,7 @@ module XeroRuby::Accounting
530
549
  # Custom attribute writer method checking allowed values (enum).
531
550
  # @param [Object] _class Object to be assigned
532
551
  def _class=(_class)
533
- validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE"])
552
+ validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE", "ULTRA"])
534
553
  unless validator.valid?(_class)
535
554
  fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
536
555
  end
@@ -52,6 +52,9 @@ module XeroRuby::Accounting
52
52
  # UTC timestamp of last update to the overpayment
53
53
  attr_accessor :updated_date_utc
54
54
 
55
+ # UTC ISO-8601 formatted timestamp of last update to the overpayment
56
+ attr_accessor :updated_date_utc_string
57
+
55
58
 
56
59
  attr_accessor :currency_code
57
60
 
@@ -76,6 +79,9 @@ module XeroRuby::Accounting
76
79
  # boolean to indicate if a overpayment has an attachment
77
80
  attr_accessor :has_attachments
78
81
 
82
+ # An optional description for Overpayment
83
+ attr_accessor :reference
84
+
79
85
  # See Attachments
80
86
  attr_accessor :attachments
81
87
 
@@ -114,6 +120,7 @@ module XeroRuby::Accounting
114
120
  :'total_tax' => :'TotalTax',
115
121
  :'total' => :'Total',
116
122
  :'updated_date_utc' => :'UpdatedDateUTC',
123
+ :'updated_date_utc_string' => :'UpdatedDateUTCString',
117
124
  :'currency_code' => :'CurrencyCode',
118
125
  :'overpayment_id' => :'OverpaymentID',
119
126
  :'currency_rate' => :'CurrencyRate',
@@ -122,6 +129,7 @@ module XeroRuby::Accounting
122
129
  :'applied_amount' => :'AppliedAmount',
123
130
  :'payments' => :'Payments',
124
131
  :'has_attachments' => :'HasAttachments',
132
+ :'reference' => :'Reference',
125
133
  :'attachments' => :'Attachments'
126
134
  }
127
135
  end
@@ -139,6 +147,7 @@ module XeroRuby::Accounting
139
147
  :'total_tax' => :'BigDecimal',
140
148
  :'total' => :'BigDecimal',
141
149
  :'updated_date_utc' => :'DateTime',
150
+ :'updated_date_utc_string' => :'String',
142
151
  :'currency_code' => :'CurrencyCode',
143
152
  :'overpayment_id' => :'String',
144
153
  :'currency_rate' => :'BigDecimal',
@@ -147,6 +156,7 @@ module XeroRuby::Accounting
147
156
  :'applied_amount' => :'Float',
148
157
  :'payments' => :'Array<Payment>',
149
158
  :'has_attachments' => :'Boolean',
159
+ :'reference' => :'String',
150
160
  :'attachments' => :'Array<Attachment>'
151
161
  }
152
162
  end
@@ -208,6 +218,10 @@ module XeroRuby::Accounting
208
218
  self.updated_date_utc = attributes[:'updated_date_utc']
209
219
  end
210
220
 
221
+ if attributes.key?(:'updated_date_utc_string')
222
+ self.updated_date_utc_string = attributes[:'updated_date_utc_string']
223
+ end
224
+
211
225
  if attributes.key?(:'currency_code')
212
226
  self.currency_code = attributes[:'currency_code']
213
227
  end
@@ -246,6 +260,10 @@ module XeroRuby::Accounting
246
260
  self.has_attachments = false
247
261
  end
248
262
 
263
+ if attributes.key?(:'reference')
264
+ self.reference = attributes[:'reference']
265
+ end
266
+
249
267
  if attributes.key?(:'attachments')
250
268
  if (value = attributes[:'attachments']).is_a?(Array)
251
269
  self.attachments = value
@@ -305,6 +323,7 @@ module XeroRuby::Accounting
305
323
  total_tax == o.total_tax &&
306
324
  total == o.total &&
307
325
  updated_date_utc == o.updated_date_utc &&
326
+ updated_date_utc_string == o.updated_date_utc_string &&
308
327
  currency_code == o.currency_code &&
309
328
  overpayment_id == o.overpayment_id &&
310
329
  currency_rate == o.currency_rate &&
@@ -313,6 +332,7 @@ module XeroRuby::Accounting
313
332
  applied_amount == o.applied_amount &&
314
333
  payments == o.payments &&
315
334
  has_attachments == o.has_attachments &&
335
+ reference == o.reference &&
316
336
  attachments == o.attachments
317
337
  end
318
338
 
@@ -325,7 +345,7 @@ module XeroRuby::Accounting
325
345
  # Calculates hash code according to all attributes.
326
346
  # @return [Integer] Hash code
327
347
  def hash
328
- [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, currency_code, overpayment_id, currency_rate, remaining_credit, allocations, applied_amount, payments, has_attachments, attachments].hash
348
+ [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, updated_date_utc_string, currency_code, overpayment_id, currency_rate, remaining_credit, allocations, applied_amount, payments, has_attachments, reference, attachments].hash
329
349
  end
330
350
 
331
351
  # Builds the object from hash
@@ -80,6 +80,9 @@ module XeroRuby::Accounting
80
80
  # UTC timestamp of last update to the payment
81
81
  attr_accessor :updated_date_utc
82
82
 
83
+ # UTC ISO-8601 formatted timestamp of last update to the payment
84
+ attr_accessor :updated_date_utc_string
85
+
83
86
  # The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
84
87
  attr_accessor :payment_id
85
88
 
@@ -153,6 +156,7 @@ module XeroRuby::Accounting
153
156
  :'status' => :'Status',
154
157
  :'payment_type' => :'PaymentType',
155
158
  :'updated_date_utc' => :'UpdatedDateUTC',
159
+ :'updated_date_utc_string' => :'UpdatedDateUTCString',
156
160
  :'payment_id' => :'PaymentID',
157
161
  :'batch_payment_id' => :'BatchPaymentID',
158
162
  :'bank_account_number' => :'BankAccountNumber',
@@ -187,6 +191,7 @@ module XeroRuby::Accounting
187
191
  :'status' => :'String',
188
192
  :'payment_type' => :'String',
189
193
  :'updated_date_utc' => :'DateTime',
194
+ :'updated_date_utc_string' => :'String',
190
195
  :'payment_id' => :'String',
191
196
  :'batch_payment_id' => :'String',
192
197
  :'bank_account_number' => :'String',
@@ -287,6 +292,10 @@ module XeroRuby::Accounting
287
292
  self.updated_date_utc = attributes[:'updated_date_utc']
288
293
  end
289
294
 
295
+ if attributes.key?(:'updated_date_utc_string')
296
+ self.updated_date_utc_string = attributes[:'updated_date_utc_string']
297
+ end
298
+
290
299
  if attributes.key?(:'payment_id')
291
300
  self.payment_id = attributes[:'payment_id']
292
301
  end
@@ -396,6 +405,7 @@ module XeroRuby::Accounting
396
405
  status == o.status &&
397
406
  payment_type == o.payment_type &&
398
407
  updated_date_utc == o.updated_date_utc &&
408
+ updated_date_utc_string == o.updated_date_utc_string &&
399
409
  payment_id == o.payment_id &&
400
410
  batch_payment_id == o.batch_payment_id &&
401
411
  bank_account_number == o.bank_account_number &&
@@ -417,7 +427,7 @@ module XeroRuby::Accounting
417
427
  # Calculates hash code according to all attributes.
418
428
  # @return [Integer] Hash code
419
429
  def hash
420
- [invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, batch_payment, account, code, date, currency_rate, amount, bank_amount, reference, is_reconciled, status, payment_type, updated_date_utc, payment_id, batch_payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors, warnings].hash
430
+ [invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, batch_payment, account, code, date, currency_rate, amount, bank_amount, reference, is_reconciled, status, payment_type, updated_date_utc, updated_date_utc_string, payment_id, batch_payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors, warnings].hash
421
431
  end
422
432
 
423
433
  # Builds the object from hash
@@ -53,15 +53,24 @@ module XeroRuby::Accounting
53
53
  # Returns Invoice number field. Reference field isn't available.
54
54
  attr_accessor :reference
55
55
 
56
+ # Returns Invoice number for prepayment receive document only.
57
+ attr_accessor :invoice_number
58
+
56
59
  # UTC timestamp of last update to the prepayment
57
60
  attr_accessor :updated_date_utc
58
61
 
62
+ # UTC ISO-8601 formatted timestamp of last update to the prepayment
63
+ attr_accessor :updated_date_utc_string
64
+
59
65
 
60
66
  attr_accessor :currency_code
61
67
 
62
68
  # Xero generated unique identifier
63
69
  attr_accessor :prepayment_id
64
70
 
71
+ # The unique identifier of the branding template applied to a receive prepayment
72
+ attr_accessor :branding_theme_id
73
+
65
74
  # The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used
66
75
  attr_accessor :currency_rate
67
76
 
@@ -118,9 +127,12 @@ module XeroRuby::Accounting
118
127
  :'total_tax' => :'TotalTax',
119
128
  :'total' => :'Total',
120
129
  :'reference' => :'Reference',
130
+ :'invoice_number' => :'InvoiceNumber',
121
131
  :'updated_date_utc' => :'UpdatedDateUTC',
132
+ :'updated_date_utc_string' => :'UpdatedDateUTCString',
122
133
  :'currency_code' => :'CurrencyCode',
123
134
  :'prepayment_id' => :'PrepaymentID',
135
+ :'branding_theme_id' => :'BrandingThemeID',
124
136
  :'currency_rate' => :'CurrencyRate',
125
137
  :'remaining_credit' => :'RemainingCredit',
126
138
  :'allocations' => :'Allocations',
@@ -144,9 +156,12 @@ module XeroRuby::Accounting
144
156
  :'total_tax' => :'BigDecimal',
145
157
  :'total' => :'BigDecimal',
146
158
  :'reference' => :'String',
159
+ :'invoice_number' => :'String',
147
160
  :'updated_date_utc' => :'DateTime',
161
+ :'updated_date_utc_string' => :'String',
148
162
  :'currency_code' => :'CurrencyCode',
149
163
  :'prepayment_id' => :'String',
164
+ :'branding_theme_id' => :'String',
150
165
  :'currency_rate' => :'BigDecimal',
151
166
  :'remaining_credit' => :'BigDecimal',
152
167
  :'allocations' => :'Array<Allocation>',
@@ -214,10 +229,18 @@ module XeroRuby::Accounting
214
229
  self.reference = attributes[:'reference']
215
230
  end
216
231
 
232
+ if attributes.key?(:'invoice_number')
233
+ self.invoice_number = attributes[:'invoice_number']
234
+ end
235
+
217
236
  if attributes.key?(:'updated_date_utc')
218
237
  self.updated_date_utc = attributes[:'updated_date_utc']
219
238
  end
220
239
 
240
+ if attributes.key?(:'updated_date_utc_string')
241
+ self.updated_date_utc_string = attributes[:'updated_date_utc_string']
242
+ end
243
+
221
244
  if attributes.key?(:'currency_code')
222
245
  self.currency_code = attributes[:'currency_code']
223
246
  end
@@ -226,6 +249,10 @@ module XeroRuby::Accounting
226
249
  self.prepayment_id = attributes[:'prepayment_id']
227
250
  end
228
251
 
252
+ if attributes.key?(:'branding_theme_id')
253
+ self.branding_theme_id = attributes[:'branding_theme_id']
254
+ end
255
+
229
256
  if attributes.key?(:'currency_rate')
230
257
  self.currency_rate = attributes[:'currency_rate']
231
258
  end
@@ -315,9 +342,12 @@ module XeroRuby::Accounting
315
342
  total_tax == o.total_tax &&
316
343
  total == o.total &&
317
344
  reference == o.reference &&
345
+ invoice_number == o.invoice_number &&
318
346
  updated_date_utc == o.updated_date_utc &&
347
+ updated_date_utc_string == o.updated_date_utc_string &&
319
348
  currency_code == o.currency_code &&
320
349
  prepayment_id == o.prepayment_id &&
350
+ branding_theme_id == o.branding_theme_id &&
321
351
  currency_rate == o.currency_rate &&
322
352
  remaining_credit == o.remaining_credit &&
323
353
  allocations == o.allocations &&
@@ -336,7 +366,7 @@ module XeroRuby::Accounting
336
366
  # Calculates hash code according to all attributes.
337
367
  # @return [Integer] Hash code
338
368
  def hash
339
- [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, updated_date_utc, currency_code, prepayment_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
369
+ [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, invoice_number, updated_date_utc, updated_date_utc_string, currency_code, prepayment_id, branding_theme_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
340
370
  end
341
371
 
342
372
  # Builds the object from hash
@@ -0,0 +1,277 @@
1
+ =begin
2
+ #Xero Accounting API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ Contact: api@xero.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 4.3.1
9
+
10
+ =end
11
+
12
+ require 'time'
13
+ require 'date'
14
+
15
+ module XeroRuby::Accounting
16
+ require 'bigdecimal'
17
+
18
+ class TrackingReference
19
+ # The Xero identifier for a tracking category
20
+ attr_accessor :tracking_category_id
21
+
22
+ # The Xero identifier for a tracking category option
23
+ attr_accessor :tracking_option_id
24
+
25
+ # The name of the tracking category
26
+ attr_accessor :name
27
+
28
+ # See Tracking Options
29
+ attr_accessor :option
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'tracking_category_id' => :'TrackingCategoryID',
35
+ :'tracking_option_id' => :'TrackingOptionID',
36
+ :'name' => :'Name',
37
+ :'option' => :'Option'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'tracking_category_id' => :'String',
45
+ :'tracking_option_id' => :'String',
46
+ :'name' => :'String',
47
+ :'option' => :'String'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingReference` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingReference`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'tracking_category_id')
67
+ self.tracking_category_id = attributes[:'tracking_category_id']
68
+ end
69
+
70
+ if attributes.key?(:'tracking_option_id')
71
+ self.tracking_option_id = attributes[:'tracking_option_id']
72
+ end
73
+
74
+ if attributes.key?(:'name')
75
+ self.name = attributes[:'name']
76
+ end
77
+
78
+ if attributes.key?(:'option')
79
+ self.option = attributes[:'option']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @tracking_category_id.nil?
88
+ invalid_properties.push('invalid value for "tracking_category_id", tracking_category_id cannot be nil.')
89
+ end
90
+
91
+ if @tracking_option_id.nil?
92
+ invalid_properties.push('invalid value for "tracking_option_id", tracking_option_id cannot be nil.')
93
+ end
94
+
95
+ if !@name.nil? && @name.to_s.length > 100
96
+ invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @tracking_category_id.nil?
106
+ return false if @tracking_option_id.nil?
107
+ return false if !@name.nil? && @name.to_s.length > 100
108
+ true
109
+ end
110
+
111
+ # Custom attribute writer method with validation
112
+ # @param [Object] name Value to be assigned
113
+ def name=(name)
114
+ if !name.nil? && name.to_s.length > 100
115
+ fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.'
116
+ end
117
+
118
+ @name = name
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ tracking_category_id == o.tracking_category_id &&
127
+ tracking_option_id == o.tracking_option_id &&
128
+ name == o.name &&
129
+ option == o.option
130
+ end
131
+
132
+ # @see the `==` method
133
+ # @param [Object] Object to be compared
134
+ def eql?(o)
135
+ self == o
136
+ end
137
+
138
+ # Calculates hash code according to all attributes.
139
+ # @return [Integer] Hash code
140
+ def hash
141
+ [tracking_category_id, tracking_option_id, name, option].hash
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def self.build_from_hash(attributes)
148
+ new.build_from_hash(attributes)
149
+ end
150
+
151
+ # Builds the object from hash
152
+ # @param [Hash] attributes Model attributes in the form of hash
153
+ # @return [Object] Returns the model itself
154
+ def build_from_hash(attributes)
155
+ return nil unless attributes.is_a?(Hash)
156
+ self.class.openapi_types.each_pair do |key, type|
157
+ if type =~ /\AArray<(.*)>/i
158
+ # check to ensure the input is an array given that the attribute
159
+ # is documented as an array but the input is not
160
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
161
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
162
+ end
163
+ elsif !attributes[self.class.attribute_map[key]].nil?
164
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
165
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
166
+ end
167
+
168
+ self
169
+ end
170
+
171
+ # Deserializes the data based on type
172
+ # @param string type Data type
173
+ # @param string value Value to be deserialized
174
+ # @return [Object] Deserialized data
175
+ def _deserialize(type, value)
176
+ case type.to_sym
177
+ when :DateTime
178
+ DateTime.parse(parse_date(value))
179
+ when :Date
180
+ Date.parse(parse_date(value))
181
+ when :String
182
+ value.to_s
183
+ when :Integer
184
+ value.to_i
185
+ when :Float
186
+ value.to_f
187
+ when :BigDecimal
188
+ BigDecimal(value.to_s)
189
+ when :Boolean
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ XeroRuby::Accounting.const_get(type).build_from_hash(value)
211
+ end
212
+ end
213
+
214
+ # Returns the string representation of the object
215
+ # @return [String] String presentation of the object
216
+ def to_s
217
+ to_hash.to_s
218
+ end
219
+
220
+ # to_body is an alias to to_hash (backward compatibility)
221
+ # @return [Hash] Returns the object in the form of hash
222
+ def to_body
223
+ to_hash
224
+ end
225
+
226
+ # Returns the object in the form of hash
227
+ # @return [Hash] Returns the object in the form of hash
228
+ def to_hash(downcase: false)
229
+ hash = {}
230
+ self.class.attribute_map.each_pair do |attr, param|
231
+ value = self.send(attr)
232
+ next if value.nil?
233
+ key = downcase ? attr : param
234
+ hash[key] = _to_hash(value, downcase: downcase)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Returns the object in the form of hash with snake_case
240
+ def to_attributes
241
+ to_hash(downcase: true)
242
+ end
243
+
244
+ # Outputs non-array value in the form of hash
245
+ # For object, use to_hash. Otherwise, just return the value
246
+ # @param [Object] value Any valid value
247
+ # @return [Hash] Returns the value in the form of hash
248
+ def _to_hash(value, downcase: false)
249
+ if value.is_a?(Array)
250
+ value.map do |v|
251
+ v.to_hash(downcase: downcase)
252
+ end
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash(downcase: downcase)
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ def parse_date(datestring)
265
+ if datestring.include?('Date')
266
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
267
+ original, date, timezone = *date_pattern.match(datestring)
268
+ date = (date.to_i / 1000)
269
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
270
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
271
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
272
+ else # handle date 'types' for small subset of payroll API's
273
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
274
+ end
275
+ end
276
+ end
277
+ end
@@ -43,6 +43,7 @@ module XeroRuby::Accounting
43
43
  MANAGEDCLIENT ||= "MANAGEDCLIENT".freeze
44
44
  CASHBOOKCLIENT ||= "CASHBOOKCLIENT".freeze
45
45
  UNKNOWN ||= "UNKNOWN".freeze
46
+ REMOVED ||= "REMOVED".freeze
46
47
 
47
48
  class EnumAttributeValidator
48
49
  attr_reader :datatype
@@ -146,7 +147,7 @@ module XeroRuby::Accounting
146
147
  # Check to see if the all the properties in the model are valid
147
148
  # @return true if the model is valid
148
149
  def valid?
149
- organisation_role_validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN"])
150
+ organisation_role_validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN", "REMOVED"])
150
151
  return false unless organisation_role_validator.valid?(@organisation_role)
151
152
  true
152
153
  end
@@ -154,7 +155,7 @@ module XeroRuby::Accounting
154
155
  # Custom attribute writer method checking allowed values (enum).
155
156
  # @param [Object] organisation_role Object to be assigned
156
157
  def organisation_role=(organisation_role)
157
- validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN"])
158
+ validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN", "REMOVED"])
158
159
  unless validator.valid?(organisation_role)
159
160
  fail ArgumentError, "invalid value for \"organisation_role\", must be one of #{validator.allowable_values}."
160
161
  end