xero-ruby 2.0.0 → 2.1.2

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 (201) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +171 -87
  3. data/build_notes.md +39 -4
  4. data/docs/accounting/Account.md +1 -1
  5. data/docs/accounting/AccountsPayable.md +2 -2
  6. data/docs/accounting/AccountsReceivable.md +2 -2
  7. data/docs/accounting/Allocation.md +1 -1
  8. data/docs/accounting/Attachment.md +1 -1
  9. data/docs/accounting/BankTransaction.md +6 -6
  10. data/docs/accounting/BankTransfer.md +3 -3
  11. data/docs/accounting/BatchPayment.md +2 -2
  12. data/docs/accounting/BrandingTheme.md +1 -1
  13. data/docs/accounting/Contact.md +2 -2
  14. data/docs/accounting/CreditNote.md +6 -6
  15. data/docs/accounting/Employee.md +1 -1
  16. data/docs/accounting/ExpenseClaim.md +4 -4
  17. data/docs/accounting/HistoryRecord.md +1 -1
  18. data/docs/accounting/Invoice.md +10 -10
  19. data/docs/accounting/Item.md +3 -3
  20. data/docs/accounting/Journal.md +1 -1
  21. data/docs/accounting/JournalLine.md +3 -3
  22. data/docs/accounting/LineItem.md +6 -6
  23. data/docs/accounting/LinkedTransaction.md +1 -1
  24. data/docs/accounting/ManualJournal.md +1 -1
  25. data/docs/accounting/ManualJournalLine.md +2 -2
  26. data/docs/accounting/Organisation.md +1 -1
  27. data/docs/accounting/Overpayment.md +6 -6
  28. data/docs/accounting/Payment.md +3 -3
  29. data/docs/accounting/Prepayment.md +6 -6
  30. data/docs/accounting/Purchase.md +1 -1
  31. data/docs/accounting/PurchaseOrder.md +6 -6
  32. data/docs/accounting/Quote.md +5 -5
  33. data/docs/accounting/Receipt.md +4 -4
  34. data/docs/accounting/RepeatingInvoice.md +3 -3
  35. data/docs/accounting/Report.md +1 -1
  36. data/docs/accounting/ReportWithRow.md +1 -1
  37. data/docs/accounting/TaxComponent.md +1 -1
  38. data/docs/accounting/TaxRate.md +2 -2
  39. data/docs/accounting/TenNinetyNineContact.md +13 -13
  40. data/docs/accounting/User.md +1 -1
  41. data/docs/assets/Asset.md +3 -3
  42. data/docs/assets/BookDepreciationDetail.md +6 -6
  43. data/docs/assets/BookDepreciationSetting.md +1 -1
  44. data/docs/projects/Amount.md +1 -1
  45. data/docs/projects/ProjectCreateOrUpdate.md +1 -1
  46. data/lib/xero-ruby.rb +1 -1
  47. data/lib/xero-ruby/api/accounting_api.rb +1291 -1
  48. data/lib/xero-ruby/api/asset_api.rb +37 -1
  49. data/lib/xero-ruby/api/project_api.rb +79 -1
  50. data/lib/xero-ruby/api_client.rb +13 -8
  51. data/lib/xero-ruby/api_error.rb +1 -1
  52. data/lib/xero-ruby/configuration.rb +2 -2
  53. data/lib/xero-ruby/models/accounting/account.rb +1 -16
  54. data/lib/xero-ruby/models/accounting/account_type.rb +1 -1
  55. data/lib/xero-ruby/models/accounting/accounts.rb +1 -1
  56. data/lib/xero-ruby/models/accounting/accounts_payable.rb +1 -1
  57. data/lib/xero-ruby/models/accounting/accounts_receivable.rb +1 -1
  58. data/lib/xero-ruby/models/accounting/address.rb +1 -1
  59. data/lib/xero-ruby/models/accounting/allocation.rb +1 -1
  60. data/lib/xero-ruby/models/accounting/allocations.rb +1 -1
  61. data/lib/xero-ruby/models/accounting/attachment.rb +2 -2
  62. data/lib/xero-ruby/models/accounting/attachments.rb +1 -1
  63. data/lib/xero-ruby/models/accounting/balances.rb +1 -1
  64. data/lib/xero-ruby/models/accounting/bank_transaction.rb +1 -6
  65. data/lib/xero-ruby/models/accounting/bank_transactions.rb +1 -1
  66. data/lib/xero-ruby/models/accounting/bank_transfer.rb +1 -1
  67. data/lib/xero-ruby/models/accounting/bank_transfers.rb +1 -1
  68. data/lib/xero-ruby/models/accounting/batch_payment.rb +1 -16
  69. data/lib/xero-ruby/models/accounting/batch_payment_details.rb +1 -1
  70. data/lib/xero-ruby/models/accounting/batch_payments.rb +1 -1
  71. data/lib/xero-ruby/models/accounting/bill.rb +1 -1
  72. data/lib/xero-ruby/models/accounting/branding_theme.rb +1 -1
  73. data/lib/xero-ruby/models/accounting/branding_themes.rb +1 -1
  74. data/lib/xero-ruby/models/accounting/cis_org_setting.rb +1 -1
  75. data/lib/xero-ruby/models/accounting/cis_setting.rb +1 -1
  76. data/lib/xero-ruby/models/accounting/cis_settings.rb +1 -1
  77. data/lib/xero-ruby/models/accounting/contact.rb +1 -1
  78. data/lib/xero-ruby/models/accounting/contact_group.rb +1 -1
  79. data/lib/xero-ruby/models/accounting/contact_groups.rb +1 -1
  80. data/lib/xero-ruby/models/accounting/contact_person.rb +1 -1
  81. data/lib/xero-ruby/models/accounting/contacts.rb +1 -1
  82. data/lib/xero-ruby/models/accounting/country_code.rb +1 -1
  83. data/lib/xero-ruby/models/accounting/credit_note.rb +1 -1
  84. data/lib/xero-ruby/models/accounting/credit_notes.rb +1 -1
  85. data/lib/xero-ruby/models/accounting/currencies.rb +1 -1
  86. data/lib/xero-ruby/models/accounting/currency.rb +1 -1
  87. data/lib/xero-ruby/models/accounting/currency_code.rb +1 -1
  88. data/lib/xero-ruby/models/accounting/element.rb +1 -1
  89. data/lib/xero-ruby/models/accounting/employee.rb +4 -3
  90. data/lib/xero-ruby/models/accounting/employees.rb +1 -1
  91. data/lib/xero-ruby/models/accounting/error.rb +1 -1
  92. data/lib/xero-ruby/models/accounting/expense_claim.rb +1 -1
  93. data/lib/xero-ruby/models/accounting/expense_claims.rb +1 -1
  94. data/lib/xero-ruby/models/accounting/external_link.rb +1 -1
  95. data/lib/xero-ruby/models/accounting/history_record.rb +1 -1
  96. data/lib/xero-ruby/models/accounting/history_records.rb +1 -1
  97. data/lib/xero-ruby/models/accounting/invoice.rb +1 -1
  98. data/lib/xero-ruby/models/accounting/invoice_reminder.rb +1 -1
  99. data/lib/xero-ruby/models/accounting/invoice_reminders.rb +1 -1
  100. data/lib/xero-ruby/models/accounting/invoices.rb +1 -1
  101. data/lib/xero-ruby/models/accounting/item.rb +1 -1
  102. data/lib/xero-ruby/models/accounting/items.rb +1 -1
  103. data/lib/xero-ruby/models/accounting/journal.rb +1 -1
  104. data/lib/xero-ruby/models/accounting/journal_line.rb +1 -1
  105. data/lib/xero-ruby/models/accounting/journals.rb +1 -1
  106. data/lib/xero-ruby/models/accounting/line_amount_types.rb +1 -1
  107. data/lib/xero-ruby/models/accounting/line_item.rb +1 -1
  108. data/lib/xero-ruby/models/accounting/line_item_tracking.rb +1 -1
  109. data/lib/xero-ruby/models/accounting/linked_transaction.rb +1 -1
  110. data/lib/xero-ruby/models/accounting/linked_transactions.rb +1 -1
  111. data/lib/xero-ruby/models/accounting/manual_journal.rb +1 -1
  112. data/lib/xero-ruby/models/accounting/manual_journal_line.rb +1 -1
  113. data/lib/xero-ruby/models/accounting/manual_journals.rb +1 -1
  114. data/lib/xero-ruby/models/accounting/online_invoice.rb +1 -1
  115. data/lib/xero-ruby/models/accounting/online_invoices.rb +1 -1
  116. data/lib/xero-ruby/models/accounting/organisation.rb +1 -1
  117. data/lib/xero-ruby/models/accounting/organisations.rb +1 -1
  118. data/lib/xero-ruby/models/accounting/overpayment.rb +1 -1
  119. data/lib/xero-ruby/models/accounting/overpayments.rb +1 -1
  120. data/lib/xero-ruby/models/accounting/payment.rb +1 -1
  121. data/lib/xero-ruby/models/accounting/payment_delete.rb +1 -1
  122. data/lib/xero-ruby/models/accounting/payment_service.rb +1 -1
  123. data/lib/xero-ruby/models/accounting/payment_services.rb +1 -1
  124. data/lib/xero-ruby/models/accounting/payment_term.rb +1 -1
  125. data/lib/xero-ruby/models/accounting/payment_term_type.rb +1 -1
  126. data/lib/xero-ruby/models/accounting/payments.rb +1 -1
  127. data/lib/xero-ruby/models/accounting/phone.rb +1 -1
  128. data/lib/xero-ruby/models/accounting/prepayment.rb +1 -1
  129. data/lib/xero-ruby/models/accounting/prepayments.rb +1 -1
  130. data/lib/xero-ruby/models/accounting/purchase.rb +1 -1
  131. data/lib/xero-ruby/models/accounting/purchase_order.rb +1 -1
  132. data/lib/xero-ruby/models/accounting/purchase_orders.rb +1 -1
  133. data/lib/xero-ruby/models/accounting/quote.rb +1 -1
  134. data/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +1 -1
  135. data/lib/xero-ruby/models/accounting/quote_status_codes.rb +1 -1
  136. data/lib/xero-ruby/models/accounting/quotes.rb +1 -1
  137. data/lib/xero-ruby/models/accounting/receipt.rb +1 -1
  138. data/lib/xero-ruby/models/accounting/receipts.rb +1 -1
  139. data/lib/xero-ruby/models/accounting/repeating_invoice.rb +1 -1
  140. data/lib/xero-ruby/models/accounting/repeating_invoices.rb +1 -1
  141. data/lib/xero-ruby/models/accounting/report.rb +1 -1
  142. data/lib/xero-ruby/models/accounting/report_attribute.rb +1 -1
  143. data/lib/xero-ruby/models/accounting/report_cell.rb +1 -1
  144. data/lib/xero-ruby/models/accounting/report_fields.rb +1 -1
  145. data/lib/xero-ruby/models/accounting/report_row.rb +1 -1
  146. data/lib/xero-ruby/models/accounting/report_rows.rb +1 -1
  147. data/lib/xero-ruby/models/accounting/report_with_row.rb +1 -1
  148. data/lib/xero-ruby/models/accounting/report_with_rows.rb +1 -1
  149. data/lib/xero-ruby/models/accounting/reports.rb +1 -1
  150. data/lib/xero-ruby/models/accounting/request_empty.rb +1 -1
  151. data/lib/xero-ruby/models/accounting/row_type.rb +1 -1
  152. data/lib/xero-ruby/models/accounting/sales_tracking_category.rb +1 -1
  153. data/lib/xero-ruby/models/accounting/schedule.rb +1 -1
  154. data/lib/xero-ruby/models/accounting/tax_component.rb +1 -1
  155. data/lib/xero-ruby/models/accounting/tax_rate.rb +1 -1
  156. data/lib/xero-ruby/models/accounting/tax_rates.rb +1 -1
  157. data/lib/xero-ruby/models/accounting/tax_type.rb +1 -1
  158. data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +1 -1
  159. data/lib/xero-ruby/models/accounting/time_zone.rb +1 -1
  160. data/lib/xero-ruby/models/accounting/tracking_categories.rb +1 -1
  161. data/lib/xero-ruby/models/accounting/tracking_category.rb +1 -1
  162. data/lib/xero-ruby/models/accounting/tracking_option.rb +1 -1
  163. data/lib/xero-ruby/models/accounting/tracking_options.rb +1 -1
  164. data/lib/xero-ruby/models/accounting/user.rb +1 -1
  165. data/lib/xero-ruby/models/accounting/users.rb +1 -1
  166. data/lib/xero-ruby/models/accounting/validation_error.rb +1 -1
  167. data/lib/xero-ruby/models/assets/asset.rb +1 -1
  168. data/lib/xero-ruby/models/assets/asset_status.rb +1 -1
  169. data/lib/xero-ruby/models/assets/asset_status_query_param.rb +1 -1
  170. data/lib/xero-ruby/models/assets/asset_type.rb +1 -1
  171. data/lib/xero-ruby/models/assets/assets.rb +1 -1
  172. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +1 -1
  173. data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +1 -1
  174. data/lib/xero-ruby/models/assets/error.rb +1 -1
  175. data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +1 -1
  176. data/lib/xero-ruby/models/assets/pagination.rb +1 -1
  177. data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +1 -1
  178. data/lib/xero-ruby/models/assets/setting.rb +1 -1
  179. data/lib/xero-ruby/models/projects/amount.rb +1 -1
  180. data/lib/xero-ruby/models/projects/charge_type.rb +1 -1
  181. data/lib/xero-ruby/models/projects/currency_code.rb +1 -1
  182. data/lib/xero-ruby/models/projects/error.rb +1 -1
  183. data/lib/xero-ruby/models/projects/pagination.rb +1 -1
  184. data/lib/xero-ruby/models/projects/project.rb +1 -1
  185. data/lib/xero-ruby/models/projects/project_create_or_update.rb +1 -1
  186. data/lib/xero-ruby/models/projects/project_patch.rb +1 -1
  187. data/lib/xero-ruby/models/projects/project_status.rb +1 -1
  188. data/lib/xero-ruby/models/projects/project_user.rb +1 -1
  189. data/lib/xero-ruby/models/projects/project_users.rb +1 -1
  190. data/lib/xero-ruby/models/projects/projects.rb +1 -1
  191. data/lib/xero-ruby/models/projects/task.rb +1 -1
  192. data/lib/xero-ruby/models/projects/task_create_or_update.rb +1 -1
  193. data/lib/xero-ruby/models/projects/tasks.rb +1 -1
  194. data/lib/xero-ruby/models/projects/time_entries.rb +1 -1
  195. data/lib/xero-ruby/models/projects/time_entry.rb +1 -1
  196. data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +1 -1
  197. data/lib/xero-ruby/version.rb +2 -2
  198. data/spec/api_client_spec.rb +98 -9
  199. data/xero-ruby.gemspec +2 -2
  200. metadata +3 -4
  201. data/Gemfile.lock +0 -68
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -3,7 +3,7 @@
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.2.11
6
+ The version of the OpenAPI document: 2.3.0
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
9
  OpenAPI Generator version: 4.3.1
@@ -11,5 +11,5 @@ OpenAPI Generator version: 4.3.1
11
11
  =end
12
12
 
13
13
  module XeroRuby
14
- VERSION = '2.0.0'
14
+ VERSION = '2.1.2'
15
15
  end
@@ -81,38 +81,127 @@ describe XeroRuby::ApiClient do
81
81
  end
82
82
 
83
83
  describe "#object_to_hash modifies a hash from snake_case to PascalCase" do
84
- it 'Maniuplates a contact object correctly' do
84
+ contact_after = {:Contacts=>[{:Name=>"Bruce Banner", :EmailAddress=>"hulk@avengers.com", :Phones=>[{:PhoneType=>"MOBILE", :PhoneNumber=>"555-1212", :PhoneAreaCode=>"415"}], :PaymentTerms=>{:Bills=>{:Day=>15, :Type=>"OFCURRENTMONTH"}, :Sales=>{:Day=>10, :Type=>"DAYSAFTERBILLMONTH"}}}]}
85
+
86
+ it 'Serializes snake_case object correctly' do
85
87
  contact_before = {:contacts=>[{:name=>"Bruce Banner", :email_address=>"hulk@avengers.com", :phones=>[{:phone_type=>"MOBILE", :phone_number=>"555-1212", :phone_area_code=>"415"}], :payment_terms=>{:bills=>{:day=>15, :type=>"OFCURRENTMONTH"}, :sales=>{:day=>10, :type=>"DAYSAFTERBILLMONTH"}}}]}
86
- contact_after = {:Contacts=>[{:Name=>"Bruce Banner", :EmailAddress=>"hulk@avengers.com", :Phones=>[{:PhoneType=>"MOBILE", :PhoneNumber=>"555-1212", :PhoneAreaCode=>"415"}], :PaymentTerms=>{:Bills=>{:Day=>15, :Type=>"OFCURRENTMONTH"}, :Sales=>{:Day=>10, :Type=>"DAYSAFTERBILLMONTH"}}}]}
87
88
  api_client = XeroRuby::ApiClient.new
88
89
  expect(api_client.object_to_hash(contact_before)).to eq(contact_after)
89
90
  end
90
91
 
91
- # todo - insert every model PascalCase conversion as they are added as sample app examples
92
+ it 'Serializes camelCase object correctly' do
93
+ json_before = {
94
+ type: "ACCREC",
95
+ invoiceNumber: "INV-01",
96
+ dueDate: "2020-01-01",
97
+ lineItems: [
98
+ { quantity: 1.0, unitAmount: 20 }
99
+ ]
100
+ }
101
+ json_after = {
102
+ Type: "ACCREC",
103
+ InvoiceNumber: "INV-01",
104
+ DueDate: "2020-01-01",
105
+ LineItems: [
106
+ { Quantity: 1.0, UnitAmount: 20 }
107
+ ]
108
+ }
109
+ api_client = XeroRuby::ApiClient.new
110
+ expect(api_client.object_to_hash(json_before)).to eq(json_after)
111
+ end
112
+
113
+ it 'Serializes json with multiple nested objects correctly' do
114
+ json_before = {
115
+ "line_Items":[
116
+ {
117
+ "quantity":1.0,
118
+ "unit_amount":20,
119
+ "sub_Items":[
120
+ {
121
+ "quantity":1.0,
122
+ "unit_amount":20
123
+ },
124
+ {
125
+ "quantity":1.0,
126
+ "Unit_amount":20,
127
+ "Deep_Items":[
128
+ {
129
+ "quantity":1.0,
130
+ "unit_amount":20
131
+ },
132
+ {
133
+ "quantity":1.0,
134
+ "unit_Amount":20
135
+ }
136
+ ]
137
+ }
138
+ ]
139
+ }
140
+ ]
141
+ }
142
+
143
+ json_after = {
144
+ "LineItems":[
145
+ {
146
+ "UnitAmount":20,
147
+ "Quantity":1.0,
148
+ "SubItems":[
149
+ {
150
+ "UnitAmount":20,
151
+ "Quantity":1.0
152
+ },
153
+ {
154
+ "UnitAmount":20,
155
+ "Quantity":1.0,
156
+ "DeepItems":[
157
+ {
158
+ "UnitAmount":20,
159
+ "Quantity":1.0
160
+ },
161
+ {
162
+ "UnitAmount":20,
163
+ "Quantity":1.0
164
+ }
165
+ ]
166
+ }
167
+ ]
168
+ }
169
+ ]
170
+ }
171
+ api_client = XeroRuby::ApiClient.new
172
+ expect(api_client.object_to_hash(json_before)).to eq(json_after)
173
+ end
174
+
175
+ it 'Serializes mixed cased keys correctly' do
176
+ contact_after = { :Contacts=>[{:Name=>"Bruce Banner", :EmailAddress=>"hulk@avengers.com", :Phones=>[{:PhoneType=>"MOBILE", :PhoneNumber=>"555-1212", :PhoneAreaCode=>"415"}], :PaymentTerms=>{:Bills=>{:Day=>15, :Type=>"OFCURRENTMONTH"}, :Sales=>{:Day=>10, :Type=>"DAYSAFTERBILLMONTH"}}}]}
177
+ contact_before = {:contacts=>[{:name=>"Bruce Banner", :emailAddress=>"hulk@avengers.com", :phones=>[{:phoneType=>"MOBILE", :phone_number=>"555-1212", :phone_areaCode=>"415"}], :Payment_terms=>{:bills=>{:day=>15, :type=>"OFCURRENTMONTH"}, :sales=>{:day=>10, :type=>"DAYSAFTERBILLMONTH"}}}]}
178
+ api_client = XeroRuby::ApiClient.new
179
+ expect(api_client.object_to_hash(contact_before)).to eq(contact_after)
180
+ end
92
181
  end
93
182
 
94
183
  describe '#build_collection_param' do
95
- let(:param) { ['aa', 'bb', 'cc'] }
184
+ let(:param) { ['contact_ids', 'order', 'where'] }
96
185
  let(:api_client) { XeroRuby::ApiClient.new }
97
186
 
98
187
  it 'works for csv' do
99
- expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
188
+ expect(api_client.build_collection_param(param, :csv)).to eq('contact_ids,order,where')
100
189
  end
101
190
 
102
191
  it 'works for ssv' do
103
- expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
192
+ expect(api_client.build_collection_param(param, :ssv)).to eq('contact_ids order where')
104
193
  end
105
194
 
106
195
  it 'works for tsv' do
107
- expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
196
+ expect(api_client.build_collection_param(param, :tsv)).to eq("contact_ids\torder\twhere")
108
197
  end
109
198
 
110
199
  it 'works for pipes' do
111
- expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
200
+ expect(api_client.build_collection_param(param, :pipes)).to eq('contact_ids|order|where')
112
201
  end
113
202
 
114
203
  it 'works for multi' do
115
- expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
204
+ expect(api_client.build_collection_param(param, :multi)).to eq(['contact_ids', 'order', 'where'])
116
205
  end
117
206
 
118
207
  it 'fails for invalid collection format' do
@@ -5,7 +5,7 @@
5
5
 
6
6
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
8
- The version of the OpenAPI document: 2.2.11
8
+ The version of the OpenAPI document: 2.3.0
9
9
  Contact: api@xero.com
10
10
  Generated by: https://openapi-generator.tech
11
11
  OpenAPI Generator version: 4.3.1
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
25
25
  s.summary = "Accounting API Ruby Gem"
26
26
  s.description = "Xero API OAuth2.0 SDK - Ruby Gem"
27
27
  s.license = "Unlicense"
28
- s.required_ruby_version = ">= 1.9"
28
+ s.required_ruby_version = ">= 2.3"
29
29
 
30
30
  s.add_runtime_dependency 'faraday', '~> 1.0.1', '>= 1.0.1'
31
31
  s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xero-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xero API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-05 00:00:00.000000000 Z
11
+ date: 2020-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -80,7 +80,6 @@ files:
80
80
  - CODE_OF_CONDUCT.md
81
81
  - CONTRIBUTING.md
82
82
  - Gemfile
83
- - Gemfile.lock
84
83
  - LICENSE
85
84
  - README.md
86
85
  - Rakefile
@@ -548,7 +547,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
548
547
  requirements:
549
548
  - - ">="
550
549
  - !ruby/object:Gem::Version
551
- version: '1.9'
550
+ version: '2.3'
552
551
  required_rubygems_version: !ruby/object:Gem::Requirement
553
552
  requirements:
554
553
  - - ">="
@@ -1,68 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- xero-ruby (0.4.1)
5
- faraday (~> 0.14, >= 0.14.0)
6
- json (~> 2.1, >= 2.1.0)
7
-
8
- GEM
9
- remote: https://rubygems.org/
10
- specs:
11
- ast (2.4.1)
12
- byebug (11.1.3)
13
- coderay (1.1.3)
14
- diff-lcs (1.3)
15
- faraday (0.17.3)
16
- multipart-post (>= 1.2, < 3)
17
- jaro_winkler (1.5.4)
18
- json (2.3.0)
19
- method_source (1.0.0)
20
- multipart-post (2.1.1)
21
- parallel (1.19.1)
22
- parser (2.7.1.3)
23
- ast (~> 2.4.0)
24
- pry (0.13.1)
25
- coderay (~> 1.1)
26
- method_source (~> 1.0)
27
- pry-byebug (3.9.0)
28
- byebug (~> 11.0)
29
- pry (~> 0.13.0)
30
- psych (3.1.0)
31
- rainbow (3.0.0)
32
- rake (12.3.3)
33
- rspec (3.9.0)
34
- rspec-core (~> 3.9.0)
35
- rspec-expectations (~> 3.9.0)
36
- rspec-mocks (~> 3.9.0)
37
- rspec-core (3.9.2)
38
- rspec-support (~> 3.9.3)
39
- rspec-expectations (3.9.2)
40
- diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.9.0)
42
- rspec-mocks (3.9.1)
43
- diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.9.0)
45
- rspec-support (3.9.3)
46
- rubocop (0.66.0)
47
- jaro_winkler (~> 1.5.1)
48
- parallel (~> 1.10)
49
- parser (>= 2.5, != 2.5.1.1)
50
- psych (>= 3.1.0)
51
- rainbow (>= 2.2.2, < 4.0)
52
- ruby-progressbar (~> 1.7)
53
- unicode-display_width (>= 1.4.0, < 1.6)
54
- ruby-progressbar (1.10.1)
55
- unicode-display_width (1.5.0)
56
-
57
- PLATFORMS
58
- ruby
59
-
60
- DEPENDENCIES
61
- pry-byebug
62
- rake (~> 12.3.3)
63
- rspec
64
- rubocop (~> 0.66.0)
65
- xero-ruby!
66
-
67
- BUNDLED WITH
68
- 2.1.2