xero-ruby 0.1.2 → 0.2.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 (269) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +44 -35
  3. data/docs/Account.md +3 -1
  4. data/docs/AccountingApi.md +2667 -2323
  5. data/docs/Attachment.md +2 -2
  6. data/docs/BankTransaction.md +3 -3
  7. data/docs/BrandingTheme.md +4 -0
  8. data/docs/Contact.md +3 -1
  9. data/docs/CreditNote.md +2 -0
  10. data/docs/Element.md +15 -1
  11. data/docs/Employee.md +5 -1
  12. data/docs/Invoice.md +6 -4
  13. data/docs/Item.md +3 -1
  14. data/docs/LineItem.md +4 -4
  15. data/docs/LineItemTracking.md +3 -1
  16. data/docs/LinkedTransaction.md +2 -2
  17. data/docs/ManualJournal.md +3 -1
  18. data/docs/Prepayment.md +2 -0
  19. data/docs/PurchaseOrder.md +3 -3
  20. data/docs/Quote.md +59 -0
  21. data/docs/QuoteLineAmountTypes.md +16 -0
  22. data/docs/QuoteStatusCodes.md +16 -0
  23. data/docs/Quotes.md +17 -0
  24. data/docs/Receipt.md +6 -4
  25. data/docs/ReportWithRow.md +2 -2
  26. data/docs/TaxRate.md +1 -1
  27. data/git_push.sh +1 -1
  28. data/lib/.DS_Store +0 -0
  29. data/lib/xero-ruby/api/accounting_api.rb +1741 -1334
  30. data/lib/xero-ruby/api_client.rb +2 -2
  31. data/lib/xero-ruby/api_error.rb +2 -2
  32. data/lib/xero-ruby/configuration.rb +3 -7
  33. data/lib/xero-ruby/models/account.rb +15 -5
  34. data/lib/xero-ruby/models/account_type.rb +2 -2
  35. data/lib/xero-ruby/models/accounts.rb +2 -2
  36. data/lib/xero-ruby/models/accounts_payable.rb +2 -2
  37. data/lib/xero-ruby/models/accounts_receivable.rb +2 -2
  38. data/lib/xero-ruby/models/address.rb +2 -2
  39. data/lib/xero-ruby/models/allocation.rb +2 -2
  40. data/lib/xero-ruby/models/allocations.rb +2 -2
  41. data/lib/xero-ruby/models/attachment.rb +2 -2
  42. data/lib/xero-ruby/models/attachments.rb +2 -2
  43. data/lib/xero-ruby/models/balances.rb +2 -2
  44. data/lib/xero-ruby/models/bank_transaction.rb +2 -2
  45. data/lib/xero-ruby/models/bank_transactions.rb +2 -2
  46. data/lib/xero-ruby/models/bank_transfer.rb +2 -2
  47. data/lib/xero-ruby/models/bank_transfers.rb +2 -2
  48. data/lib/xero-ruby/models/batch_payment.rb +48 -2
  49. data/lib/xero-ruby/models/batch_payment_details.rb +2 -2
  50. data/lib/xero-ruby/models/batch_payments.rb +2 -2
  51. data/lib/xero-ruby/models/bill.rb +2 -2
  52. data/lib/xero-ruby/models/branding_theme.rb +57 -3
  53. data/lib/xero-ruby/models/branding_themes.rb +2 -2
  54. data/lib/xero-ruby/models/cis_org_setting.rb +2 -2
  55. data/lib/xero-ruby/models/cis_setting.rb +2 -2
  56. data/lib/xero-ruby/models/cis_settings.rb +2 -2
  57. data/lib/xero-ruby/models/contact.rb +16 -6
  58. data/lib/xero-ruby/models/contact_group.rb +2 -2
  59. data/lib/xero-ruby/models/contact_groups.rb +2 -2
  60. data/lib/xero-ruby/models/contact_person.rb +2 -2
  61. data/lib/xero-ruby/models/contacts.rb +2 -2
  62. data/lib/xero-ruby/models/country_code.rb +2 -2
  63. data/lib/xero-ruby/models/credit_note.rb +13 -3
  64. data/lib/xero-ruby/models/credit_notes.rb +2 -2
  65. data/lib/xero-ruby/models/currencies.rb +2 -2
  66. data/lib/xero-ruby/models/currency.rb +2 -2
  67. data/lib/xero-ruby/models/currency_code.rb +2 -2
  68. data/lib/xero-ruby/models/element.rb +70 -6
  69. data/lib/xero-ruby/models/employee.rb +28 -6
  70. data/lib/xero-ruby/models/employees.rb +2 -2
  71. data/lib/xero-ruby/models/error.rb +2 -2
  72. data/lib/xero-ruby/models/expense_claim.rb +4 -4
  73. data/lib/xero-ruby/models/expense_claims.rb +2 -2
  74. data/lib/xero-ruby/models/external_link.rb +2 -2
  75. data/lib/xero-ruby/models/history_record.rb +2 -2
  76. data/lib/xero-ruby/models/history_records.rb +2 -2
  77. data/lib/xero-ruby/models/invoice.rb +20 -23
  78. data/lib/xero-ruby/models/invoice_reminder.rb +2 -2
  79. data/lib/xero-ruby/models/invoice_reminders.rb +2 -2
  80. data/lib/xero-ruby/models/invoices.rb +2 -2
  81. data/lib/xero-ruby/models/item.rb +13 -8
  82. data/lib/xero-ruby/models/items.rb +2 -2
  83. data/lib/xero-ruby/models/journal.rb +2 -2
  84. data/lib/xero-ruby/models/journal_line.rb +2 -2
  85. data/lib/xero-ruby/models/journals.rb +2 -2
  86. data/lib/xero-ruby/models/line_amount_types.rb +2 -2
  87. data/lib/xero-ruby/models/line_item.rb +4 -4
  88. data/lib/xero-ruby/models/line_item_tracking.rb +13 -3
  89. data/lib/xero-ruby/models/linked_transaction.rb +3 -8
  90. data/lib/xero-ruby/models/linked_transactions.rb +2 -2
  91. data/lib/xero-ruby/models/manual_journal.rb +15 -10
  92. data/lib/xero-ruby/models/manual_journal_line.rb +2 -2
  93. data/lib/xero-ruby/models/manual_journals.rb +2 -2
  94. data/lib/xero-ruby/models/online_invoice.rb +2 -2
  95. data/lib/xero-ruby/models/online_invoices.rb +2 -2
  96. data/lib/xero-ruby/models/organisation.rb +8 -8
  97. data/lib/xero-ruby/models/organisations.rb +2 -2
  98. data/lib/xero-ruby/models/overpayment.rb +2 -2
  99. data/lib/xero-ruby/models/overpayments.rb +2 -2
  100. data/lib/xero-ruby/models/payment.rb +2 -2
  101. data/lib/xero-ruby/models/payment_service.rb +2 -2
  102. data/lib/xero-ruby/models/payment_services.rb +2 -2
  103. data/lib/xero-ruby/models/payment_term.rb +2 -2
  104. data/lib/xero-ruby/models/payment_term_type.rb +2 -2
  105. data/lib/xero-ruby/models/payments.rb +2 -2
  106. data/lib/xero-ruby/models/phone.rb +2 -2
  107. data/lib/xero-ruby/models/prepayment.rb +13 -3
  108. data/lib/xero-ruby/models/prepayments.rb +2 -2
  109. data/lib/xero-ruby/models/purchase.rb +2 -2
  110. data/lib/xero-ruby/models/purchase_order.rb +3 -13
  111. data/lib/xero-ruby/models/purchase_orders.rb +2 -2
  112. data/lib/xero-ruby/models/quote.rb +487 -0
  113. data/lib/xero-ruby/models/quote_line_amount_types.rb +38 -0
  114. data/lib/xero-ruby/models/quote_status_codes.rb +40 -0
  115. data/lib/xero-ruby/models/quotes.rb +205 -0
  116. data/lib/xero-ruby/models/receipt.rb +17 -25
  117. data/lib/xero-ruby/models/receipts.rb +2 -2
  118. data/lib/xero-ruby/models/repeating_invoice.rb +4 -4
  119. data/lib/xero-ruby/models/repeating_invoices.rb +2 -2
  120. data/lib/xero-ruby/models/report.rb +2 -2
  121. data/lib/xero-ruby/models/report_attribute.rb +2 -2
  122. data/lib/xero-ruby/models/report_cell.rb +2 -2
  123. data/lib/xero-ruby/models/report_fields.rb +2 -2
  124. data/lib/xero-ruby/models/report_row.rb +2 -2
  125. data/lib/xero-ruby/models/report_rows.rb +2 -2
  126. data/lib/xero-ruby/models/report_with_row.rb +12 -12
  127. data/lib/xero-ruby/models/report_with_rows.rb +2 -2
  128. data/lib/xero-ruby/models/reports.rb +2 -2
  129. data/lib/xero-ruby/models/request_empty.rb +2 -2
  130. data/lib/xero-ruby/models/row_type.rb +2 -2
  131. data/lib/xero-ruby/models/sales_tracking_category.rb +2 -2
  132. data/lib/xero-ruby/models/schedule.rb +2 -2
  133. data/lib/xero-ruby/models/tax_component.rb +2 -2
  134. data/lib/xero-ruby/models/tax_rate.rb +6 -11
  135. data/lib/xero-ruby/models/tax_rates.rb +2 -2
  136. data/lib/xero-ruby/models/tax_type.rb +5 -2
  137. data/lib/xero-ruby/models/ten_nintey_nine_contact.rb +2 -2
  138. data/lib/xero-ruby/models/time_zone.rb +2 -2
  139. data/lib/xero-ruby/models/tracking_categories.rb +2 -2
  140. data/lib/xero-ruby/models/tracking_category.rb +2 -2
  141. data/lib/xero-ruby/models/tracking_option.rb +2 -2
  142. data/lib/xero-ruby/models/tracking_options.rb +2 -2
  143. data/lib/xero-ruby/models/user.rb +2 -2
  144. data/lib/xero-ruby/models/users.rb +2 -2
  145. data/lib/xero-ruby/models/validation_error.rb +2 -2
  146. data/lib/xero-ruby/version.rb +3 -3
  147. data/lib/xero-ruby.rb +6 -2
  148. data/pkg/xero-ruby-0.2.0.gem +0 -0
  149. data/spec/api/accounting_api_spec.rb +304 -209
  150. data/spec/api_client_spec.rb +2 -2
  151. data/spec/configuration_spec.rb +2 -2
  152. data/spec/models/account_spec.rb +9 -3
  153. data/spec/models/account_type_spec.rb +2 -2
  154. data/spec/models/accounts_payable_spec.rb +2 -2
  155. data/spec/models/accounts_receivable_spec.rb +2 -2
  156. data/spec/models/accounts_spec.rb +2 -2
  157. data/spec/models/address_spec.rb +2 -2
  158. data/spec/models/allocation_spec.rb +2 -2
  159. data/spec/models/allocations_spec.rb +2 -2
  160. data/spec/models/attachment_spec.rb +2 -2
  161. data/spec/models/attachments_spec.rb +2 -2
  162. data/spec/models/balances_spec.rb +2 -2
  163. data/spec/models/bank_transaction_spec.rb +2 -2
  164. data/spec/models/bank_transactions_spec.rb +2 -2
  165. data/spec/models/bank_transfer_spec.rb +2 -2
  166. data/spec/models/bank_transfers_spec.rb +2 -2
  167. data/spec/models/batch_payment_details_spec.rb +2 -2
  168. data/spec/models/batch_payment_spec.rb +10 -2
  169. data/spec/models/batch_payments_spec.rb +2 -2
  170. data/spec/models/bill_spec.rb +2 -2
  171. data/spec/models/branding_theme_spec.rb +18 -2
  172. data/spec/models/branding_themes_spec.rb +2 -2
  173. data/spec/models/cis_org_setting_spec.rb +2 -2
  174. data/spec/models/cis_setting_spec.rb +2 -2
  175. data/spec/models/cis_settings_spec.rb +2 -2
  176. data/spec/models/contact_group_spec.rb +2 -2
  177. data/spec/models/contact_groups_spec.rb +2 -2
  178. data/spec/models/contact_person_spec.rb +2 -2
  179. data/spec/models/contact_spec.rb +8 -2
  180. data/spec/models/contacts_spec.rb +2 -2
  181. data/spec/models/country_code_spec.rb +2 -2
  182. data/spec/models/credit_note_spec.rb +8 -2
  183. data/spec/models/credit_notes_spec.rb +2 -2
  184. data/spec/models/currencies_spec.rb +2 -2
  185. data/spec/models/currency_code_spec.rb +2 -2
  186. data/spec/models/currency_spec.rb +2 -2
  187. data/spec/models/element_spec.rb +44 -2
  188. data/spec/models/employee_spec.rb +14 -2
  189. data/spec/models/employees_spec.rb +2 -2
  190. data/spec/models/error_spec.rb +2 -2
  191. data/spec/models/expense_claim_spec.rb +3 -3
  192. data/spec/models/expense_claims_spec.rb +2 -2
  193. data/spec/models/external_link_spec.rb +2 -2
  194. data/spec/models/history_record_spec.rb +2 -2
  195. data/spec/models/history_records_spec.rb +2 -2
  196. data/spec/models/invoice_reminder_spec.rb +2 -2
  197. data/spec/models/invoice_reminders_spec.rb +2 -2
  198. data/spec/models/invoice_spec.rb +9 -3
  199. data/spec/models/invoices_spec.rb +2 -2
  200. data/spec/models/item_spec.rb +8 -2
  201. data/spec/models/items_spec.rb +2 -2
  202. data/spec/models/journal_line_spec.rb +2 -2
  203. data/spec/models/journal_spec.rb +2 -2
  204. data/spec/models/journals_spec.rb +2 -2
  205. data/spec/models/line_amount_types_spec.rb +2 -2
  206. data/spec/models/line_item_spec.rb +2 -2
  207. data/spec/models/line_item_tracking_spec.rb +8 -2
  208. data/spec/models/linked_transaction_spec.rb +2 -2
  209. data/spec/models/linked_transactions_spec.rb +2 -2
  210. data/spec/models/manual_journal_line_spec.rb +2 -2
  211. data/spec/models/manual_journal_spec.rb +9 -3
  212. data/spec/models/manual_journals_spec.rb +2 -2
  213. data/spec/models/online_invoice_spec.rb +2 -2
  214. data/spec/models/online_invoices_spec.rb +2 -2
  215. data/spec/models/organisation_spec.rb +5 -5
  216. data/spec/models/organisations_spec.rb +2 -2
  217. data/spec/models/overpayment_spec.rb +2 -2
  218. data/spec/models/overpayments_spec.rb +2 -2
  219. data/spec/models/payment_service_spec.rb +2 -2
  220. data/spec/models/payment_services_spec.rb +2 -2
  221. data/spec/models/payment_spec.rb +2 -2
  222. data/spec/models/payment_term_spec.rb +2 -2
  223. data/spec/models/payment_term_type_spec.rb +2 -2
  224. data/spec/models/payments_spec.rb +2 -2
  225. data/spec/models/phone_spec.rb +2 -2
  226. data/spec/models/prepayment_spec.rb +8 -2
  227. data/spec/models/prepayments_spec.rb +2 -2
  228. data/spec/models/purchase_order_spec.rb +2 -2
  229. data/spec/models/purchase_orders_spec.rb +2 -2
  230. data/spec/models/purchase_spec.rb +2 -2
  231. data/spec/models/quote_line_amount_types_spec.rb +35 -0
  232. data/spec/models/quote_spec.rb +167 -0
  233. data/spec/models/quote_status_codes_spec.rb +35 -0
  234. data/spec/models/quotes_spec.rb +41 -0
  235. data/spec/models/receipt_spec.rb +9 -3
  236. data/spec/models/receipts_spec.rb +2 -2
  237. data/spec/models/repeating_invoice_spec.rb +3 -3
  238. data/spec/models/repeating_invoices_spec.rb +2 -2
  239. data/spec/models/report_attribute_spec.rb +2 -2
  240. data/spec/models/report_cell_spec.rb +2 -2
  241. data/spec/models/report_fields_spec.rb +2 -2
  242. data/spec/models/report_row_spec.rb +2 -2
  243. data/spec/models/report_rows_spec.rb +2 -2
  244. data/spec/models/report_spec.rb +2 -2
  245. data/spec/models/report_with_row_spec.rb +4 -4
  246. data/spec/models/report_with_rows_spec.rb +2 -2
  247. data/spec/models/reports_spec.rb +2 -2
  248. data/spec/models/request_empty_spec.rb +2 -2
  249. data/spec/models/row_type_spec.rb +2 -2
  250. data/spec/models/sales_tracking_category_spec.rb +2 -2
  251. data/spec/models/schedule_spec.rb +2 -2
  252. data/spec/models/tax_component_spec.rb +2 -2
  253. data/spec/models/tax_rate_spec.rb +4 -4
  254. data/spec/models/tax_rates_spec.rb +2 -2
  255. data/spec/models/tax_type_spec.rb +2 -2
  256. data/spec/models/ten_nintey_nine_contact_spec.rb +2 -2
  257. data/spec/models/time_zone_spec.rb +2 -2
  258. data/spec/models/tracking_categories_spec.rb +2 -2
  259. data/spec/models/tracking_category_spec.rb +2 -2
  260. data/spec/models/tracking_option_spec.rb +2 -2
  261. data/spec/models/tracking_options_spec.rb +2 -2
  262. data/spec/models/user_spec.rb +2 -2
  263. data/spec/models/users_spec.rb +2 -2
  264. data/spec/models/validation_error_spec.rb +2 -2
  265. data/spec/spec_helper.rb +2 -2
  266. data/xero-ruby.gemspec +3 -3
  267. metadata +21 -5
  268. data/Gemfile.lock +0 -79
  269. data/pkg/xero-ruby-0.1.2.gem +0 -0
@@ -0,0 +1,205 @@
1
+ =begin
2
+ #Accounting API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 2.0.1
7
+ Contact: api@xero.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.2.0
10
+
11
+ =end
12
+
13
+ require 'time'
14
+ require 'date'
15
+
16
+ module XeroRuby
17
+ class Quotes
18
+ attr_accessor :quotes
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'quotes' => :'Quotes'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.openapi_types
29
+ {
30
+ :'quotes' => :'Array<Quote>'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ if (!attributes.is_a?(Hash))
38
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Quotes` initialize method"
39
+ end
40
+
41
+ # check to see if the attribute exists and convert string to symbol for hash key
42
+ attributes = attributes.each_with_object({}) { |(k, v), h|
43
+ if (!self.class.attribute_map.key?(k.to_sym))
44
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Quotes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
45
+ end
46
+ h[k.to_sym] = v
47
+ }
48
+
49
+ if attributes.key?(:'quotes')
50
+ if (value = attributes[:'quotes']).is_a?(Array)
51
+ self.quotes = value
52
+ end
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ invalid_properties
61
+ end
62
+
63
+ # Check to see if the all the properties in the model are valid
64
+ # @return true if the model is valid
65
+ def valid?
66
+ true
67
+ end
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] Object to be compared
71
+ def ==(o)
72
+ return true if self.equal?(o)
73
+ self.class == o.class &&
74
+ quotes == o.quotes
75
+ end
76
+
77
+ # @see the `==` method
78
+ # @param [Object] Object to be compared
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculates hash code according to all attributes.
84
+ # @return [Integer] Hash code
85
+ def hash
86
+ [quotes].hash
87
+ end
88
+
89
+ # Builds the object from hash
90
+ # @param [Hash] attributes Model attributes in the form of hash
91
+ # @return [Object] Returns the model itself
92
+ def self.build_from_hash(attributes)
93
+ new.build_from_hash(attributes)
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+ self.class.openapi_types.each_pair do |key, type|
102
+ if type =~ /\AArray<(.*)>/i
103
+ # check to ensure the input is an array given that the attribute
104
+ # is documented as an array but the input is not
105
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
106
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
107
+ end
108
+ elsif !attributes[self.class.attribute_map[key]].nil?
109
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
110
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
111
+ end
112
+
113
+ self
114
+ end
115
+
116
+ # Deserializes the data based on type
117
+ # @param string type Data type
118
+ # @param string value Value to be deserialized
119
+ # @return [Object] Deserialized data
120
+ def _deserialize(type, value)
121
+ case type.to_sym
122
+ when :DateTime
123
+ DateTime.parse(parse_date(value))
124
+ when :Date
125
+ Date.parse(parse_date(value))
126
+ when :String
127
+ value.to_s
128
+ when :Integer
129
+ value.to_i
130
+ when :Float
131
+ value.to_f
132
+ when :Boolean
133
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
134
+ true
135
+ else
136
+ false
137
+ end
138
+ when :Object
139
+ # generic object (usually a Hash), return directly
140
+ value
141
+ when /\AArray<(?<inner_type>.+)>\z/
142
+ inner_type = Regexp.last_match[:inner_type]
143
+ value.map { |v| _deserialize(inner_type, v) }
144
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
145
+ k_type = Regexp.last_match[:k_type]
146
+ v_type = Regexp.last_match[:v_type]
147
+ {}.tap do |hash|
148
+ value.each do |k, v|
149
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
150
+ end
151
+ end
152
+ else # model
153
+ XeroRuby.const_get(type).build_from_hash(value)
154
+ end
155
+ end
156
+
157
+ # Returns the string representation of the object
158
+ # @return [String] String presentation of the object
159
+ def to_s
160
+ to_hash.to_s
161
+ end
162
+
163
+ # to_body is an alias to to_hash (backward compatibility)
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_body
166
+ to_hash
167
+ end
168
+
169
+ # Returns the object in the form of hash
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_hash
172
+ hash = {}
173
+ self.class.attribute_map.each_pair do |attr, param|
174
+ value = self.send(attr)
175
+ next if value.nil?
176
+ hash[param] = _to_hash(value)
177
+ end
178
+ hash
179
+ end
180
+
181
+ # Outputs non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
183
+ # @param [Object] value Any valid value
184
+ # @return [Hash] Returns the value in the form of hash
185
+ def _to_hash(value)
186
+ if value.is_a?(Array)
187
+ value.compact.map { |v| _to_hash(v) }
188
+ elsif value.is_a?(Hash)
189
+ {}.tap do |hash|
190
+ value.each { |k, v| hash[k] = _to_hash(v) }
191
+ end
192
+ elsif value.respond_to? :to_hash
193
+ value.to_hash
194
+ else
195
+ value
196
+ end
197
+ end
198
+
199
+ # customized data_parser
200
+ def parse_date(datestring)
201
+ seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0
202
+ return Time.at(seconds_since_epoch).to_s
203
+ end
204
+ end
205
+ end
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -59,6 +59,9 @@ module XeroRuby
59
59
  # Displays array of validation error messages from the API
60
60
  attr_accessor :validation_errors
61
61
 
62
+ # Displays array of warning messages from the API
63
+ attr_accessor :warnings
64
+
62
65
  # Displays array of attachments from the API
63
66
  attr_accessor :attachments
64
67
 
@@ -103,6 +106,7 @@ module XeroRuby
103
106
  :'has_attachments' => :'HasAttachments',
104
107
  :'url' => :'Url',
105
108
  :'validation_errors' => :'ValidationErrors',
109
+ :'warnings' => :'Warnings',
106
110
  :'attachments' => :'Attachments'
107
111
  }
108
112
  end
@@ -126,6 +130,7 @@ module XeroRuby
126
130
  :'has_attachments' => :'Boolean',
127
131
  :'url' => :'String',
128
132
  :'validation_errors' => :'Array<ValidationError>',
133
+ :'warnings' => :'Array<ValidationError>',
129
134
  :'attachments' => :'Array<Attachment>'
130
135
  }
131
136
  end
@@ -213,6 +218,12 @@ module XeroRuby
213
218
  end
214
219
  end
215
220
 
221
+ if attributes.key?(:'warnings')
222
+ if (value = attributes[:'warnings']).is_a?(Array)
223
+ self.warnings = value
224
+ end
225
+ end
226
+
216
227
  if attributes.key?(:'attachments')
217
228
  if (value = attributes[:'attachments']).is_a?(Array)
218
229
  self.attachments = value
@@ -224,33 +235,13 @@ module XeroRuby
224
235
  # @return Array for valid properties with the reasons
225
236
  def list_invalid_properties
226
237
  invalid_properties = Array.new
227
- if @date.nil?
228
- invalid_properties.push('invalid value for "date", date cannot be nil.')
229
- end
230
-
231
- if @contact.nil?
232
- invalid_properties.push('invalid value for "contact", contact cannot be nil.')
233
- end
234
-
235
- if @line_items.nil?
236
- invalid_properties.push('invalid value for "line_items", line_items cannot be nil.')
237
- end
238
-
239
- if @user.nil?
240
- invalid_properties.push('invalid value for "user", user cannot be nil.')
241
- end
242
-
243
238
  invalid_properties
244
239
  end
245
240
 
246
241
  # Check to see if the all the properties in the model are valid
247
242
  # @return true if the model is valid
248
243
  def valid?
249
- return false if @date.nil?
250
- return false if @contact.nil?
251
- return false if @line_items.nil?
252
- return false if @user.nil?
253
- status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED"])
244
+ status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED", "VOIDED"])
254
245
  return false unless status_validator.valid?(@status)
255
246
  true
256
247
  end
@@ -258,7 +249,7 @@ module XeroRuby
258
249
  # Custom attribute writer method checking allowed values (enum).
259
250
  # @param [Object] status Object to be assigned
260
251
  def status=(status)
261
- validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED"])
252
+ validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED", "VOIDED"])
262
253
  unless validator.valid?(status)
263
254
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
264
255
  end
@@ -286,6 +277,7 @@ module XeroRuby
286
277
  has_attachments == o.has_attachments &&
287
278
  url == o.url &&
288
279
  validation_errors == o.validation_errors &&
280
+ warnings == o.warnings &&
289
281
  attachments == o.attachments
290
282
  end
291
283
 
@@ -298,7 +290,7 @@ module XeroRuby
298
290
  # Calculates hash code according to all attributes.
299
291
  # @return [Integer] Hash code
300
292
  def hash
301
- [date, contact, line_items, user, reference, line_amount_types, sub_total, total_tax, total, receipt_id, status, receipt_number, updated_date_utc, has_attachments, url, validation_errors, attachments].hash
293
+ [date, contact, line_items, user, reference, line_amount_types, sub_total, total_tax, total, receipt_id, status, receipt_number, updated_date_utc, has_attachments, url, validation_errors, warnings, attachments].hash
302
294
  end
303
295
 
304
296
  # Builds the object from hash
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -221,7 +221,7 @@ module XeroRuby
221
221
  def valid?
222
222
  type_validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCREC"])
223
223
  return false unless type_validator.valid?(@type)
224
- status_validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED"])
224
+ status_validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED", "DELETED"])
225
225
  return false unless status_validator.valid?(@status)
226
226
  true
227
227
  end
@@ -239,7 +239,7 @@ module XeroRuby
239
239
  # Custom attribute writer method checking allowed values (enum).
240
240
  # @param [Object] status Object to be assigned
241
241
  def status=(status)
242
- validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED"])
242
+ validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED", "DELETED"])
243
243
  unless validator.valid?(status)
244
244
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
245
245
  end
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -33,11 +33,11 @@ module XeroRuby
33
33
  # Date of report
34
34
  attr_accessor :report_date
35
35
 
36
+ attr_accessor :rows
37
+
36
38
  # Updated Date
37
39
  attr_accessor :updated_date_utc
38
40
 
39
- attr_accessor :rows
40
-
41
41
  attr_accessor :fields
42
42
 
43
43
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -49,8 +49,8 @@ module XeroRuby
49
49
  :'report_type' => :'ReportType',
50
50
  :'report_titles' => :'ReportTitles',
51
51
  :'report_date' => :'ReportDate',
52
- :'updated_date_utc' => :'UpdatedDateUTC',
53
52
  :'rows' => :'Rows',
53
+ :'updated_date_utc' => :'UpdatedDateUTC',
54
54
  :'fields' => :'Fields'
55
55
  }
56
56
  end
@@ -64,8 +64,8 @@ module XeroRuby
64
64
  :'report_type' => :'String',
65
65
  :'report_titles' => :'Array<String>',
66
66
  :'report_date' => :'String',
67
- :'updated_date_utc' => :'DateTime',
68
67
  :'rows' => :'Array<ReportRows>',
68
+ :'updated_date_utc' => :'DateTime',
69
69
  :'fields' => :'Array<ReportFields>'
70
70
  }
71
71
  end
@@ -111,16 +111,16 @@ module XeroRuby
111
111
  self.report_date = attributes[:'report_date']
112
112
  end
113
113
 
114
- if attributes.key?(:'updated_date_utc')
115
- self.updated_date_utc = attributes[:'updated_date_utc']
116
- end
117
-
118
114
  if attributes.key?(:'rows')
119
115
  if (value = attributes[:'rows']).is_a?(Array)
120
116
  self.rows = value
121
117
  end
122
118
  end
123
119
 
120
+ if attributes.key?(:'updated_date_utc')
121
+ self.updated_date_utc = attributes[:'updated_date_utc']
122
+ end
123
+
124
124
  if attributes.key?(:'fields')
125
125
  if (value = attributes[:'fields']).is_a?(Array)
126
126
  self.fields = value
@@ -152,8 +152,8 @@ module XeroRuby
152
152
  report_type == o.report_type &&
153
153
  report_titles == o.report_titles &&
154
154
  report_date == o.report_date &&
155
- updated_date_utc == o.updated_date_utc &&
156
155
  rows == o.rows &&
156
+ updated_date_utc == o.updated_date_utc &&
157
157
  fields == o.fields
158
158
  end
159
159
 
@@ -166,7 +166,7 @@ module XeroRuby
166
166
  # Calculates hash code according to all attributes.
167
167
  # @return [Integer] Hash code
168
168
  def hash
169
- [report_id, report_name, report_title, report_type, report_titles, report_date, updated_date_utc, rows, fields].hash
169
+ [report_id, report_name, report_title, report_type, report_titles, report_date, rows, updated_date_utc, fields].hash
170
170
  end
171
171
 
172
172
  # Builds the object from hash
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12
 
@@ -3,10 +3,10 @@
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.0.0
6
+ The version of the OpenAPI document: 2.0.1
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.0.3
9
+ OpenAPI Generator version: 4.2.0
10
10
 
11
11
  =end
12
12