2.0.3
Ruby 2.0.3 release
generated from Xero-OpenAPI version: 2.2.11
BREAKING changes include:
- All monetary fields are now typed as
BigDecimal
across all api sets - examples in readme
changes include:
- re-serialization of params during PUT's and POST's to the XeroAPI to PascalCase from Ruby's preferred snake_case 🐍 related code
SDK does still supports existing functionality of passing camelCase, PascalCase, or some combination.
But now all params can now be snake cased before sent to any SDK method:
invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: contacts[0].contact_id }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: BigDecimal("20.99"), account_code: "600", tax_type: XeroRuby::Accounting::TaxType::NONE }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]}
bug fixes / improvements
- fixing all file download routes based on @wojw5's suggestion in #32
- Download as PDF (#43) also fixed by (https://github.com/XeroAPI/xero-ruby/pull/54/files#diff-c1ed4f733dbf7dd2d5bbba26b23819e5R379)
- Duplicate Constants removed for account.rb & organisation.rb reported in #50
- Upload attachments examples added to readme and sample app
invoice = xero_client.accounting_api.get_invoices(current_user.active_tenant_id).invoices.first
file_name = "an-invoice-filename.png"
opts = {
include_online: true # Boolean | Allows an attachment to be seen by the end customer within their online invoice
}
file = File.read(Rails.root.join('app/assets/images/xero-api.png'))
attachment = xero_client.accounting_api.create_invoice_attachment_by_file_name(current_user.active_tenant_id, invoice.invoice_id, file_name, file, opts)
Readme & related sample app updates
- updates readme with PUT/POST examples
- updates to readme showing how to download a file as PDF
- Related updates to the companion sample app showing more comprehensive xero-ruby SDK usage