From 2ce0482ef33c3d67c2121e2b13bef174960e4792 Mon Sep 17 00:00:00 2001 From: serknight Date: Tue, 16 Jun 2020 15:25:22 -0600 Subject: [PATCH 01/21] rspec spec/ 1117 green --- Gemfile | 1 + Gemfile.lock | 68 ++++++++++++++++++++++ README.md | 7 +++ lib/xero-ruby/api/accounting_api.rb | 2 +- lib/xero-ruby/api/asset_api.rb | 2 +- spec/accounting/api/accounting_api_spec.rb | 6 +- spec/api_client_spec.rb | 46 +++++++-------- spec/assets/api/asset_api_spec.rb | 6 +- spec/configuration_spec.rb | 4 +- 9 files changed, 109 insertions(+), 33 deletions(-) create mode 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile index 577f058f..3f0115d2 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source 'https://rubygems.org' gemspec group :development, :test do + gem 'rspec' gem 'rake', '~> 12.3.3' gem 'pry-byebug' gem 'rubocop', '~> 0.66.0' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..eb1ab3c5 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,68 @@ +PATH + remote: . + specs: + xero-ruby (0.4.1) + faraday (~> 0.14, >= 0.14.0) + json (~> 2.1, >= 2.1.0) + +GEM + remote: https://rubygems.org/ + specs: + ast (2.4.1) + byebug (11.1.3) + coderay (1.1.3) + diff-lcs (1.3) + faraday (0.17.3) + multipart-post (>= 1.2, < 3) + jaro_winkler (1.5.4) + json (2.3.0) + method_source (1.0.0) + multipart-post (2.1.1) + parallel (1.19.1) + parser (2.7.1.3) + ast (~> 2.4.0) + pry (0.13.1) + coderay (~> 1.1) + method_source (~> 1.0) + pry-byebug (3.9.0) + byebug (~> 11.0) + pry (~> 0.13.0) + psych (3.1.0) + rainbow (3.0.0) + rake (12.3.3) + rspec (3.9.0) + rspec-core (~> 3.9.0) + rspec-expectations (~> 3.9.0) + rspec-mocks (~> 3.9.0) + rspec-core (3.9.2) + rspec-support (~> 3.9.3) + rspec-expectations (3.9.2) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-mocks (3.9.1) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.9.0) + rspec-support (3.9.3) + rubocop (0.66.0) + jaro_winkler (~> 1.5.1) + parallel (~> 1.10) + parser (>= 2.5, != 2.5.1.1) + psych (>= 3.1.0) + rainbow (>= 2.2.2, < 4.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 1.6) + ruby-progressbar (1.10.1) + unicode-display_width (1.5.0) + +PLATFORMS + ruby + +DEPENDENCIES + pry-byebug + rake (~> 12.3.3) + rspec + rubocop (~> 0.66.0) + xero-ruby! + +BUNDLED WITH + 2.1.2 diff --git a/README.md b/README.md index f9463c32..b8e9f84e 100644 --- a/README.md +++ b/README.md @@ -162,3 +162,10 @@ The best resource to understanding how to best leverage this SDK is to clone dow ## Models * [Accounting Models Docs](/docs/accounting/) * [Asset Models Docs](/docs/assets/) + + +## Testing + +* clone repo +* cd lib +* `bundle exec rspec spec/` \ No newline at end of file diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 37ef9b66..5305e20f 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -16,7 +16,7 @@ module XeroRuby class AccountingApi attr_accessor :api_client - def initialize(api_client = ApiClient.default) + def initialize(api_client = XeroRuby::Configuration.default) @api_client = api_client end # Allows you to create a new chart of accounts diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index 1932e176..1b7955c2 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -16,7 +16,7 @@ module XeroRuby class AssetApi attr_accessor :api_client - def initialize(api_client = ApiClient.default) + def initialize(api_client = XeroRuby::Configuration.default) @api_client = api_client end # adds a fixed asset diff --git a/spec/accounting/api/accounting_api_spec.rb b/spec/accounting/api/accounting_api_spec.rb index 42360ae0..905ff121 100644 --- a/spec/accounting/api/accounting_api_spec.rb +++ b/spec/accounting/api/accounting_api_spec.rb @@ -13,13 +13,13 @@ require 'spec_helper' require 'json' -# Unit tests for XeroRuby::Accounting::AccountingApi +# Unit tests for XeroRuby::AccountingApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'AccountingApi' do before do # run before each test - @api_instance = XeroRuby::Accounting::AccountingApi.new + @api_instance = XeroRuby::AccountingApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of AccountingApi' do it 'should create an instance of AccountingApi' do - expect(@api_instance).to be_instance_of(XeroRuby::Accounting::AccountingApi) + expect(@api_instance).to be_instance_of(XeroRuby::AccountingApi) end end diff --git a/spec/api_client_spec.rb b/spec/api_client_spec.rb index 3793d524..4fb6d555 100644 --- a/spec/api_client_spec.rb +++ b/spec/api_client_spec.rb @@ -10,42 +10,42 @@ =end -require 'spec_helper' +require './spec_helper' -describe XeroRuby::Accounting::ApiClient do +describe XeroRuby::ApiClient do context 'initialization' do context 'URL stuff' do context 'host' do it 'removes http from host' do - XeroRuby::Accounting.configure { |c| c.host = 'http://example.com' } - expect(XeroRuby::Accounting::Configuration.default.host).to eq('example.com') + XeroRuby.configure { |c| c.host = 'http://example.com' } + expect(XeroRuby::Configuration.default.host).to eq('example.com') end it 'removes https from host' do - XeroRuby::Accounting.configure { |c| c.host = 'https://wookiee.com' } - expect(XeroRuby::Accounting::ApiClient.default.config.host).to eq('wookiee.com') + XeroRuby.configure { |c| c.host = 'https://wookiee.com' } + expect(XeroRuby::Configuration.default.host).to eq('wookiee.com') end it 'removes trailing path from host' do - XeroRuby::Accounting.configure { |c| c.host = 'hobo.com/v4' } - expect(XeroRuby::Accounting::Configuration.default.host).to eq('hobo.com') + XeroRuby.configure { |c| c.host = 'hobo.com/v4' } + expect(XeroRuby::Configuration.default.host).to eq('hobo.com') end end context 'base_path' do it "prepends a slash to base_path" do - XeroRuby::Accounting.configure { |c| c.base_path = 'v4/dog' } - expect(XeroRuby::Accounting::Configuration.default.base_path).to eq('/v4/dog') + XeroRuby.configure { |c| c.base_path = 'v4/dog' } + expect(XeroRuby::Configuration.default.base_path).to eq('/v4/dog') end it "doesn't prepend a slash if one is already there" do - XeroRuby::Accounting.configure { |c| c.base_path = '/v4/dog' } - expect(XeroRuby::Accounting::Configuration.default.base_path).to eq('/v4/dog') + XeroRuby.configure { |c| c.base_path = '/v4/dog' } + expect(XeroRuby::Configuration.default.base_path).to eq('/v4/dog') end it "ends up as a blank string if nil" do - XeroRuby::Accounting.configure { |c| c.base_path = nil } - expect(XeroRuby::Accounting::Configuration.default.base_path).to eq('') + XeroRuby.configure { |c| c.base_path = nil } + expect(XeroRuby::Configuration.default.base_path).to eq('') end end end @@ -53,7 +53,7 @@ describe '#deserialize' do it "handles Array" do - api_client = XeroRuby::Accounting::ApiClient.new + api_client = XeroRuby::ApiClient.new headers = { 'Content-Type' => 'application/json' } response = double('response', headers: headers, body: '[12, 34]') data = api_client.deserialize(response, 'Array') @@ -62,7 +62,7 @@ end it 'handles Array>' do - api_client = XeroRuby::Accounting::ApiClient.new + api_client = XeroRuby::ApiClient.new headers = { 'Content-Type' => 'application/json' } response = double('response', headers: headers, body: '[[12, 34], [56]]') data = api_client.deserialize(response, 'Array>') @@ -71,7 +71,7 @@ end it 'handles Hash' do - api_client = XeroRuby::Accounting::ApiClient.new + api_client = XeroRuby::ApiClient.new headers = { 'Content-Type' => 'application/json' } response = double('response', headers: headers, body: '{"message": "Hello"}') data = api_client.deserialize(response, 'Hash') @@ -83,7 +83,7 @@ describe "#object_to_hash" do it 'ignores nils and includes empty arrays' do # uncomment below to test object_to_hash for model - # api_client = XeroRuby::Accounting::ApiClient.new + # api_client = XeroRuby::ApiClient.new # _model = XeroRuby::Accounting::ModelName.new # update the model attribute below # _model.id = 1 @@ -95,7 +95,7 @@ describe '#build_collection_param' do let(:param) { ['aa', 'bb', 'cc'] } - let(:api_client) { XeroRuby::Accounting::ApiClient.new } + let(:api_client) { XeroRuby::ApiClient.new } it 'works for csv' do expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc') @@ -123,7 +123,7 @@ end describe '#json_mime?' do - let(:api_client) { XeroRuby::Accounting::ApiClient.new } + let(:api_client) { XeroRuby::ApiClient.new } it 'works' do expect(api_client.json_mime?(nil)).to eq false @@ -140,7 +140,7 @@ end describe '#select_header_accept' do - let(:api_client) { XeroRuby::Accounting::ApiClient.new } + let(:api_client) { XeroRuby::ApiClient.new } it 'works' do expect(api_client.select_header_accept(nil)).to be_nil @@ -156,7 +156,7 @@ end describe '#select_header_content_type' do - let(:api_client) { XeroRuby::Accounting::ApiClient.new } + let(:api_client) { XeroRuby::ApiClient.new } it 'works' do expect(api_client.select_header_content_type(nil)).to eq('application/json') @@ -171,7 +171,7 @@ end describe '#sanitize_filename' do - let(:api_client) { XeroRuby::Accounting::ApiClient.new } + let(:api_client) { XeroRuby::ApiClient.new } it 'works' do expect(api_client.sanitize_filename('sun')).to eq('sun') diff --git a/spec/assets/api/asset_api_spec.rb b/spec/assets/api/asset_api_spec.rb index a474b1e7..0dd6082e 100644 --- a/spec/assets/api/asset_api_spec.rb +++ b/spec/assets/api/asset_api_spec.rb @@ -13,13 +13,13 @@ require 'spec_helper' require 'json' -# Unit tests for XeroRuby::Assets::AssetApi +# Unit tests for XeroRuby::AssetApi # Automatically generated by openapi-generator (https://openapi-generator.tech) # Please update as you see appropriate describe 'AssetApi' do before do # run before each test - @api_instance = XeroRuby::Assets::AssetApi.new + @api_instance = XeroRuby::AssetApi.new end after do @@ -28,7 +28,7 @@ describe 'test an instance of AssetApi' do it 'should create an instance of AssetApi' do - expect(@api_instance).to be_instance_of(XeroRuby::Assets::AssetApi) + expect(@api_instance).to be_instance_of(XeroRuby::AssetApi) end end diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index a201299c..6ed6bd2d 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -12,8 +12,8 @@ require 'spec_helper' -describe XeroRuby::Accounting::Configuration do - let(:config) { XeroRuby::Accounting::Configuration.default } +describe XeroRuby::Configuration do + let(:config) { XeroRuby::Configuration.default } before(:each) do # uncomment below to setup host and base_path From 17926bd43172db4239a0e5cabb21f1faa9f161ab Mon Sep 17 00:00:00 2001 From: serknight Date: Tue, 16 Jun 2020 15:42:00 -0600 Subject: [PATCH 02/21] add base urls default spec --- spec/configuration_spec.rb | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/spec/configuration_spec.rb b/spec/configuration_spec.rb index 6ed6bd2d..edca8adc 100644 --- a/spec/configuration_spec.rb +++ b/spec/configuration_spec.rb @@ -15,28 +15,12 @@ describe XeroRuby::Configuration do let(:config) { XeroRuby::Configuration.default } - before(:each) do - # uncomment below to setup host and base_path - # require 'URI' - # uri = URI.parse("https://api.xero.com/api.xro/2.0") - # XeroRuby::Accounting.configure do |c| - # c.host = uri.host - # c.base_path = uri.path - # end - end - - describe '#base_url' do + describe 'urls' do it 'should have the default value' do - # uncomment below to test default value of the base path - # expect(config.base_url).to eq("https://api.xero.com/api.xro/2.0") - end - - it 'should remove trailing slashes' do - [nil, '', '/', '//'].each do |base_path| - config.base_path = base_path - # uncomment below to test trailing slashes - # expect(config.base_url).to eq("https://api.xero.com/api.xro/2.0") - end + expect(config.login_url).to eq("https://login.xero.com/identity/connect/authorize") + expect(config.token_url).to eq("https://identity.xero.com/connect/token") + expect(config.accounting_url).to eq("https://api.xero.com/api.xro/2.0") + expect(config.asset_url).to eq("https://api.xero.com/assets.xro/1.0") end end end From 1037d0e439d3a2ad5e8c474f1db729bd7802d730 Mon Sep 17 00:00:00 2001 From: serknight Date: Tue, 16 Jun 2020 15:58:30 -0600 Subject: [PATCH 03/21] tests readme --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index b8e9f84e..cc04618c 100644 --- a/README.md +++ b/README.md @@ -165,7 +165,4 @@ The best resource to understanding how to best leverage this SDK is to clone dow ## Testing - -* clone repo -* cd lib -* `bundle exec rspec spec/` \ No newline at end of file +* `rspec spec/` \ No newline at end of file From 4a80ecc78cf0c638d61c312f6ed553c80430d32b Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 13:29:31 -0600 Subject: [PATCH 04/21] github action --- .github/workflows/test.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..61357ff1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,18 @@ +name: test-hook + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - name: Setup Ruby + uses: actions/setup-ruby@v1 + with: + ruby-version: 2.7.x + - name: Build and run tests + run: | + gem install bundler + bundle install + bundle exec rspec spec/ \ No newline at end of file From 25c470e938923c2025d03a58169da4c5c11b7b49 Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 13:59:40 -0600 Subject: [PATCH 05/21] do on push --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 61357ff1..329d0057 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,6 @@ name: test-hook -on: [push, pull_request] +on: [push] jobs: build: @@ -15,4 +15,4 @@ jobs: run: | gem install bundler bundle install - bundle exec rspec spec/ \ No newline at end of file + rspec spec/ \ No newline at end of file From cf71754b60552c22892b6ed22efe7ff6828503d5 Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 14:05:02 -0600 Subject: [PATCH 06/21] specs good, audited changes from commits. Need to test gem build and local usage --- .github/workflows/test.yml | 2 +- lib/xero-ruby/api/accounting_api.rb | 2 +- lib/xero-ruby/api/asset_api.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 329d0057..6754108c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,4 +15,4 @@ jobs: run: | gem install bundler bundle install - rspec spec/ \ No newline at end of file + rspec spec/ diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 5305e20f..a2941bfd 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -16,7 +16,7 @@ module XeroRuby class AccountingApi attr_accessor :api_client - def initialize(api_client = XeroRuby::Configuration.default) + def initialize(api_client = ApiClient.new) @api_client = api_client end # Allows you to create a new chart of accounts diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index 1b7955c2..a7e51994 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -16,7 +16,7 @@ module XeroRuby class AssetApi attr_accessor :api_client - def initialize(api_client = XeroRuby::Configuration.default) + def initialize(api_client = ApiClient.new) @api_client = api_client end # adds a fixed asset From 20172d2ac8e04f0530ebec7f88c3ab784ec6332b Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 14:27:35 -0600 Subject: [PATCH 07/21] bump version, will likely include a new api set with this pr --- lib/xero-ruby/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb index 08cc1ee3..25d3a942 100644 --- a/lib/xero-ruby/version.rb +++ b/lib/xero-ruby/version.rb @@ -11,5 +11,5 @@ =end module XeroRuby - VERSION = '0.4.1' + VERSION = '0.5.0' end From 1a32e9a5657188493546a5d4ed4e7bc71f500c51 Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 15:28:05 -0600 Subject: [PATCH 08/21] test diff --- docs/accounting/Account.md | 55 - docs/accounting/AccountType.md | 16 - docs/accounting/AccountingApi.md | 14424 -------------- docs/accounting/Accounts.md | 17 - docs/accounting/AccountsPayable.md | 19 - docs/accounting/AccountsReceivable.md | 19 - docs/accounting/Address.md | 35 - docs/accounting/Allocation.md | 21 - docs/accounting/Allocations.md | 17 - docs/accounting/Attachment.md | 27 - docs/accounting/Attachments.md | 17 - docs/accounting/Balances.md | 19 - docs/accounting/BankTransaction.md | 59 - docs/accounting/BankTransactions.md | 17 - docs/accounting/BankTransfer.md | 37 - docs/accounting/BankTransfers.md | 17 - docs/accounting/BatchPayment.md | 47 - docs/accounting/BatchPaymentDetails.md | 25 - docs/accounting/BatchPayments.md | 17 - docs/accounting/Bill.md | 19 - docs/accounting/BrandingTheme.md | 27 - docs/accounting/BrandingThemes.md | 17 - docs/accounting/CISOrgSetting.md | 21 - docs/accounting/CISSetting.md | 19 - docs/accounting/CISSettings.md | 17 - docs/accounting/Contact.md | 93 - docs/accounting/ContactGroup.md | 23 - docs/accounting/ContactGroups.md | 17 - docs/accounting/ContactPerson.md | 23 - docs/accounting/Contacts.md | 17 - docs/accounting/CountryCode.md | 16 - docs/accounting/CreditNote.md | 67 - docs/accounting/CreditNotes.md | 17 - docs/accounting/Currencies.md | 17 - docs/accounting/Currency.md | 19 - docs/accounting/CurrencyCode.md | 16 - docs/accounting/Element.md | 31 - docs/accounting/Employee.md | 31 - docs/accounting/Employees.md | 17 - docs/accounting/Error.md | 23 - docs/accounting/ExpenseClaim.md | 39 - docs/accounting/ExpenseClaims.md | 17 - docs/accounting/ExternalLink.md | 21 - docs/accounting/HistoryRecord.md | 23 - docs/accounting/HistoryRecords.md | 17 - docs/accounting/Invoice.md | 91 - docs/accounting/InvoiceReminder.md | 17 - docs/accounting/InvoiceReminders.md | 17 - docs/accounting/Invoices.md | 17 - docs/accounting/Item.md | 47 - docs/accounting/Items.md | 17 - docs/accounting/Journal.md | 31 - docs/accounting/JournalLine.md | 39 - docs/accounting/Journals.md | 17 - docs/accounting/LineAmountTypes.md | 16 - docs/accounting/LineItem.md | 41 - docs/accounting/LineItemTracking.md | 23 - docs/accounting/LinkedTransaction.md | 37 - docs/accounting/LinkedTransactions.md | 17 - docs/accounting/ManualJournal.md | 43 - docs/accounting/ManualJournalLine.md | 29 - docs/accounting/ManualJournals.md | 17 - docs/accounting/OnlineInvoice.md | 17 - docs/accounting/OnlineInvoices.md | 17 - docs/accounting/Organisation.md | 79 - docs/accounting/Organisations.md | 17 - docs/accounting/Overpayment.md | 53 - docs/accounting/Overpayments.md | 17 - docs/accounting/Payment.md | 63 - docs/accounting/PaymentDelete.md | 17 - docs/accounting/PaymentService.md | 27 - docs/accounting/PaymentServices.md | 17 - docs/accounting/PaymentTerm.md | 19 - docs/accounting/PaymentTermType.md | 16 - docs/accounting/Payments.md | 17 - docs/accounting/Phone.md | 23 - docs/accounting/Prepayment.md | 53 - docs/accounting/Prepayments.md | 17 - docs/accounting/Purchase.md | 23 - docs/accounting/PurchaseOrder.md | 71 - docs/accounting/PurchaseOrders.md | 17 - docs/accounting/Quote.md | 59 - docs/accounting/QuoteLineAmountTypes.md | 16 - docs/accounting/QuoteStatusCodes.md | 16 - docs/accounting/Quotes.md | 17 - docs/accounting/Receipt.md | 51 - docs/accounting/Receipts.md | 17 - docs/accounting/RepeatingInvoice.md | 47 - docs/accounting/RepeatingInvoices.md | 17 - docs/accounting/Report.md | 29 - docs/accounting/ReportAttribute.md | 19 - docs/accounting/ReportCell.md | 19 - docs/accounting/ReportFields.md | 21 - docs/accounting/ReportRow.md | 21 - docs/accounting/ReportRows.md | 23 - docs/accounting/ReportWithRow.md | 33 - docs/accounting/ReportWithRows.md | 17 - docs/accounting/Reports.md | 17 - docs/accounting/RequestEmpty.md | 17 - docs/accounting/RowType.md | 16 - docs/accounting/SalesTrackingCategory.md | 19 - docs/accounting/Schedule.md | 29 - docs/accounting/TaxComponent.md | 23 - docs/accounting/TaxRate.md | 39 - docs/accounting/TaxRates.md | 17 - docs/accounting/TaxType.md | 16 - docs/accounting/TenNinteyNineContact.md | 59 - docs/accounting/TimeZone.md | 16 - docs/accounting/TrackingCategories.md | 17 - docs/accounting/TrackingCategory.md | 27 - docs/accounting/TrackingOption.md | 23 - docs/accounting/TrackingOptions.md | 17 - docs/accounting/User.md | 29 - docs/accounting/Users.md | 17 - docs/accounting/ValidationError.md | 17 - docs/assets/Asset.md | 45 - docs/assets/AssetApi.md | 414 - docs/assets/AssetStatus.md | 16 - docs/assets/AssetStatusQueryParam.md | 16 - docs/assets/AssetType.md | 29 - docs/assets/Assets.md | 19 - docs/assets/BookDepreciationDetail.md | 29 - docs/assets/BookDepreciationSetting.md | 31 - docs/assets/Error.md | 25 - docs/assets/FieldValidationErrorsElement.md | 27 - docs/assets/Pagination.md | 23 - .../assets/ResourceValidationErrorsElement.md | 25 - docs/assets/Setting.md | 31 - lib/xero-ruby.rb | 161 - lib/xero-ruby/api/accounting_api.rb | 15672 ---------------- lib/xero-ruby/api/asset_api.rb | 452 - lib/xero-ruby/api_client.rb | 488 - lib/xero-ruby/api_error.rb | 57 - lib/xero-ruby/configuration.rb | 259 - lib/xero-ruby/models/accounting/account.rb | 496 - .../models/accounting/account_type.rb | 57 - lib/xero-ruby/models/accounting/accounts.rb | 205 - .../models/accounting/accounts_payable.rb | 212 - .../models/accounting/accounts_receivable.rb | 212 - lib/xero-ruby/models/accounting/address.rb | 463 - lib/xero-ruby/models/accounting/allocation.rb | 238 - .../models/accounting/allocations.rb | 205 - lib/xero-ruby/models/accounting/attachment.rb | 254 - .../models/accounting/attachments.rb | 205 - lib/xero-ruby/models/accounting/balances.rb | 213 - .../models/accounting/bank_transaction.rb | 482 - .../models/accounting/bank_transactions.rb | 205 - .../models/accounting/bank_transfer.rb | 321 - .../models/accounting/bank_transfers.rb | 205 - .../models/accounting/batch_payment.rb | 475 - .../accounting/batch_payment_details.rb | 290 - .../models/accounting/batch_payments.rb | 205 - lib/xero-ruby/models/accounting/bill.rb | 213 - .../models/accounting/branding_theme.rb | 288 - .../models/accounting/branding_themes.rb | 205 - .../models/accounting/cis_org_setting.rb | 224 - .../models/accounting/cis_setting.rb | 214 - .../models/accounting/cis_settings.rb | 205 - lib/xero-ruby/models/accounting/contact.rb | 736 - .../models/accounting/contact_group.rb | 270 - .../models/accounting/contact_groups.rb | 205 - .../models/accounting/contact_person.rb | 234 - lib/xero-ruby/models/accounting/contacts.rb | 205 - .../models/accounting/country_code.rb | 275 - .../models/accounting/credit_note.rb | 507 - .../models/accounting/credit_notes.rb | 205 - lib/xero-ruby/models/accounting/currencies.rb | 205 - lib/xero-ruby/models/accounting/currency.rb | 213 - .../models/accounting/currency_code.rb | 199 - lib/xero-ruby/models/accounting/element.rb | 270 - lib/xero-ruby/models/accounting/employee.rb | 338 - lib/xero-ruby/models/accounting/employees.rb | 205 - lib/xero-ruby/models/accounting/error.rb | 236 - .../models/accounting/expense_claim.rb | 350 - .../models/accounting/expense_claims.rb | 205 - .../models/accounting/external_link.rb | 257 - .../models/accounting/history_record.rb | 234 - .../models/accounting/history_records.rb | 205 - lib/xero-ruby/models/accounting/invoice.rb | 665 - .../models/accounting/invoice_reminder.rb | 204 - .../models/accounting/invoice_reminders.rb | 205 - lib/xero-ruby/models/accounting/invoices.rb | 205 - lib/xero-ruby/models/accounting/item.rb | 423 - lib/xero-ruby/models/accounting/items.rb | 205 - lib/xero-ruby/models/accounting/journal.rb | 310 - .../models/accounting/journal_line.rb | 315 - lib/xero-ruby/models/accounting/journals.rb | 205 - .../models/accounting/line_amount_types.rb | 38 - lib/xero-ruby/models/accounting/line_item.rb | 326 - .../models/accounting/line_item_tracking.rb | 249 - .../models/accounting/linked_transaction.rb | 364 - .../models/accounting/linked_transactions.rb | 205 - .../models/accounting/manual_journal.rb | 382 - .../models/accounting/manual_journal_line.rb | 266 - .../models/accounting/manual_journals.rb | 205 - .../models/accounting/online_invoice.rb | 204 - .../models/accounting/online_invoices.rb | 205 - .../models/accounting/organisation.rb | 622 - .../models/accounting/organisations.rb | 205 - .../models/accounting/overpayment.rb | 437 - .../models/accounting/overpayments.rb | 205 - lib/xero-ruby/models/accounting/payment.rb | 477 - .../models/accounting/payment_delete.rb | 211 - .../models/accounting/payment_service.rb | 256 - .../models/accounting/payment_services.rb | 205 - .../models/accounting/payment_term.rb | 212 - .../models/accounting/payment_term_type.rb | 39 - lib/xero-ruby/models/accounting/payments.rb | 205 - lib/xero-ruby/models/accounting/phone.rb | 312 - lib/xero-ruby/models/accounting/prepayment.rb | 435 - .../models/accounting/prepayments.rb | 205 - lib/xero-ruby/models/accounting/purchase.rb | 234 - .../models/accounting/purchase_order.rb | 515 - .../models/accounting/purchase_orders.rb | 205 - lib/xero-ruby/models/accounting/quote.rb | 487 - .../accounting/quote_line_amount_types.rb | 38 - .../models/accounting/quote_status_codes.rb | 40 - lib/xero-ruby/models/accounting/quotes.rb | 205 - lib/xero-ruby/models/accounting/receipt.rb | 414 - lib/xero-ruby/models/accounting/receipts.rb | 205 - .../models/accounting/repeating_invoice.rb | 402 - .../models/accounting/repeating_invoices.rb | 205 - lib/xero-ruby/models/accounting/report.rb | 299 - .../models/accounting/report_attribute.rb | 212 - .../models/accounting/report_cell.rb | 214 - .../models/accounting/report_fields.rb | 221 - lib/xero-ruby/models/accounting/report_row.rb | 223 - .../models/accounting/report_rows.rb | 234 - .../models/accounting/report_with_row.rb | 288 - .../models/accounting/report_with_rows.rb | 205 - lib/xero-ruby/models/accounting/reports.rb | 205 - .../models/accounting/request_empty.rb | 204 - lib/xero-ruby/models/accounting/row_type.rb | 39 - .../accounting/sales_tracking_category.rb | 214 - lib/xero-ruby/models/accounting/schedule.rb | 310 - .../models/accounting/tax_component.rb | 234 - lib/xero-ruby/models/accounting/tax_rate.rb | 362 - lib/xero-ruby/models/accounting/tax_rates.rb | 205 - lib/xero-ruby/models/accounting/tax_type.rb | 94 - .../accounting/ten_nintey_nine_contact.rb | 414 - lib/xero-ruby/models/accounting/time_zone.rb | 142 - .../models/accounting/tracking_categories.rb | 205 - .../models/accounting/tracking_category.rb | 320 - .../models/accounting/tracking_option.rb | 283 - .../models/accounting/tracking_options.rb | 205 - lib/xero-ruby/models/accounting/user.rb | 298 - lib/xero-ruby/models/accounting/users.rb | 205 - .../models/accounting/validation_error.rb | 204 - lib/xero-ruby/models/assets/asset.rb | 346 - lib/xero-ruby/models/assets/asset_status.rb | 38 - .../models/assets/asset_status_query_param.rb | 38 - lib/xero-ruby/models/assets/asset_type.rb | 278 - lib/xero-ruby/models/assets/assets.rb | 214 - .../models/assets/book_depreciation_detail.rb | 264 - .../assets/book_depreciation_setting.rb | 332 - lib/xero-ruby/models/assets/error.rb | 248 - .../assets/field_validation_errors_element.rb | 254 - lib/xero-ruby/models/assets/pagination.rb | 230 - .../resource_validation_errors_element.rb | 244 - lib/xero-ruby/models/assets/setting.rb | 274 - lib/xero-ruby/version.rb | 15 - 261 files changed, 68138 deletions(-) delete mode 100644 docs/accounting/Account.md delete mode 100644 docs/accounting/AccountType.md delete mode 100644 docs/accounting/AccountingApi.md delete mode 100644 docs/accounting/Accounts.md delete mode 100644 docs/accounting/AccountsPayable.md delete mode 100644 docs/accounting/AccountsReceivable.md delete mode 100644 docs/accounting/Address.md delete mode 100644 docs/accounting/Allocation.md delete mode 100644 docs/accounting/Allocations.md delete mode 100644 docs/accounting/Attachment.md delete mode 100644 docs/accounting/Attachments.md delete mode 100644 docs/accounting/Balances.md delete mode 100644 docs/accounting/BankTransaction.md delete mode 100644 docs/accounting/BankTransactions.md delete mode 100644 docs/accounting/BankTransfer.md delete mode 100644 docs/accounting/BankTransfers.md delete mode 100644 docs/accounting/BatchPayment.md delete mode 100644 docs/accounting/BatchPaymentDetails.md delete mode 100644 docs/accounting/BatchPayments.md delete mode 100644 docs/accounting/Bill.md delete mode 100644 docs/accounting/BrandingTheme.md delete mode 100644 docs/accounting/BrandingThemes.md delete mode 100644 docs/accounting/CISOrgSetting.md delete mode 100644 docs/accounting/CISSetting.md delete mode 100644 docs/accounting/CISSettings.md delete mode 100644 docs/accounting/Contact.md delete mode 100644 docs/accounting/ContactGroup.md delete mode 100644 docs/accounting/ContactGroups.md delete mode 100644 docs/accounting/ContactPerson.md delete mode 100644 docs/accounting/Contacts.md delete mode 100644 docs/accounting/CountryCode.md delete mode 100644 docs/accounting/CreditNote.md delete mode 100644 docs/accounting/CreditNotes.md delete mode 100644 docs/accounting/Currencies.md delete mode 100644 docs/accounting/Currency.md delete mode 100644 docs/accounting/CurrencyCode.md delete mode 100644 docs/accounting/Element.md delete mode 100644 docs/accounting/Employee.md delete mode 100644 docs/accounting/Employees.md delete mode 100644 docs/accounting/Error.md delete mode 100644 docs/accounting/ExpenseClaim.md delete mode 100644 docs/accounting/ExpenseClaims.md delete mode 100644 docs/accounting/ExternalLink.md delete mode 100644 docs/accounting/HistoryRecord.md delete mode 100644 docs/accounting/HistoryRecords.md delete mode 100644 docs/accounting/Invoice.md delete mode 100644 docs/accounting/InvoiceReminder.md delete mode 100644 docs/accounting/InvoiceReminders.md delete mode 100644 docs/accounting/Invoices.md delete mode 100644 docs/accounting/Item.md delete mode 100644 docs/accounting/Items.md delete mode 100644 docs/accounting/Journal.md delete mode 100644 docs/accounting/JournalLine.md delete mode 100644 docs/accounting/Journals.md delete mode 100644 docs/accounting/LineAmountTypes.md delete mode 100644 docs/accounting/LineItem.md delete mode 100644 docs/accounting/LineItemTracking.md delete mode 100644 docs/accounting/LinkedTransaction.md delete mode 100644 docs/accounting/LinkedTransactions.md delete mode 100644 docs/accounting/ManualJournal.md delete mode 100644 docs/accounting/ManualJournalLine.md delete mode 100644 docs/accounting/ManualJournals.md delete mode 100644 docs/accounting/OnlineInvoice.md delete mode 100644 docs/accounting/OnlineInvoices.md delete mode 100644 docs/accounting/Organisation.md delete mode 100644 docs/accounting/Organisations.md delete mode 100644 docs/accounting/Overpayment.md delete mode 100644 docs/accounting/Overpayments.md delete mode 100644 docs/accounting/Payment.md delete mode 100644 docs/accounting/PaymentDelete.md delete mode 100644 docs/accounting/PaymentService.md delete mode 100644 docs/accounting/PaymentServices.md delete mode 100644 docs/accounting/PaymentTerm.md delete mode 100644 docs/accounting/PaymentTermType.md delete mode 100644 docs/accounting/Payments.md delete mode 100644 docs/accounting/Phone.md delete mode 100644 docs/accounting/Prepayment.md delete mode 100644 docs/accounting/Prepayments.md delete mode 100644 docs/accounting/Purchase.md delete mode 100644 docs/accounting/PurchaseOrder.md delete mode 100644 docs/accounting/PurchaseOrders.md delete mode 100644 docs/accounting/Quote.md delete mode 100644 docs/accounting/QuoteLineAmountTypes.md delete mode 100644 docs/accounting/QuoteStatusCodes.md delete mode 100644 docs/accounting/Quotes.md delete mode 100644 docs/accounting/Receipt.md delete mode 100644 docs/accounting/Receipts.md delete mode 100644 docs/accounting/RepeatingInvoice.md delete mode 100644 docs/accounting/RepeatingInvoices.md delete mode 100644 docs/accounting/Report.md delete mode 100644 docs/accounting/ReportAttribute.md delete mode 100644 docs/accounting/ReportCell.md delete mode 100644 docs/accounting/ReportFields.md delete mode 100644 docs/accounting/ReportRow.md delete mode 100644 docs/accounting/ReportRows.md delete mode 100644 docs/accounting/ReportWithRow.md delete mode 100644 docs/accounting/ReportWithRows.md delete mode 100644 docs/accounting/Reports.md delete mode 100644 docs/accounting/RequestEmpty.md delete mode 100644 docs/accounting/RowType.md delete mode 100644 docs/accounting/SalesTrackingCategory.md delete mode 100644 docs/accounting/Schedule.md delete mode 100644 docs/accounting/TaxComponent.md delete mode 100644 docs/accounting/TaxRate.md delete mode 100644 docs/accounting/TaxRates.md delete mode 100644 docs/accounting/TaxType.md delete mode 100644 docs/accounting/TenNinteyNineContact.md delete mode 100644 docs/accounting/TimeZone.md delete mode 100644 docs/accounting/TrackingCategories.md delete mode 100644 docs/accounting/TrackingCategory.md delete mode 100644 docs/accounting/TrackingOption.md delete mode 100644 docs/accounting/TrackingOptions.md delete mode 100644 docs/accounting/User.md delete mode 100644 docs/accounting/Users.md delete mode 100644 docs/accounting/ValidationError.md delete mode 100644 docs/assets/Asset.md delete mode 100644 docs/assets/AssetApi.md delete mode 100644 docs/assets/AssetStatus.md delete mode 100644 docs/assets/AssetStatusQueryParam.md delete mode 100644 docs/assets/AssetType.md delete mode 100644 docs/assets/Assets.md delete mode 100644 docs/assets/BookDepreciationDetail.md delete mode 100644 docs/assets/BookDepreciationSetting.md delete mode 100644 docs/assets/Error.md delete mode 100644 docs/assets/FieldValidationErrorsElement.md delete mode 100644 docs/assets/Pagination.md delete mode 100644 docs/assets/ResourceValidationErrorsElement.md delete mode 100644 docs/assets/Setting.md delete mode 100644 lib/xero-ruby.rb delete mode 100644 lib/xero-ruby/api/accounting_api.rb delete mode 100644 lib/xero-ruby/api/asset_api.rb delete mode 100644 lib/xero-ruby/api_client.rb delete mode 100644 lib/xero-ruby/api_error.rb delete mode 100644 lib/xero-ruby/configuration.rb delete mode 100644 lib/xero-ruby/models/accounting/account.rb delete mode 100644 lib/xero-ruby/models/accounting/account_type.rb delete mode 100644 lib/xero-ruby/models/accounting/accounts.rb delete mode 100644 lib/xero-ruby/models/accounting/accounts_payable.rb delete mode 100644 lib/xero-ruby/models/accounting/accounts_receivable.rb delete mode 100644 lib/xero-ruby/models/accounting/address.rb delete mode 100644 lib/xero-ruby/models/accounting/allocation.rb delete mode 100644 lib/xero-ruby/models/accounting/allocations.rb delete mode 100644 lib/xero-ruby/models/accounting/attachment.rb delete mode 100644 lib/xero-ruby/models/accounting/attachments.rb delete mode 100644 lib/xero-ruby/models/accounting/balances.rb delete mode 100644 lib/xero-ruby/models/accounting/bank_transaction.rb delete mode 100644 lib/xero-ruby/models/accounting/bank_transactions.rb delete mode 100644 lib/xero-ruby/models/accounting/bank_transfer.rb delete mode 100644 lib/xero-ruby/models/accounting/bank_transfers.rb delete mode 100644 lib/xero-ruby/models/accounting/batch_payment.rb delete mode 100644 lib/xero-ruby/models/accounting/batch_payment_details.rb delete mode 100644 lib/xero-ruby/models/accounting/batch_payments.rb delete mode 100644 lib/xero-ruby/models/accounting/bill.rb delete mode 100644 lib/xero-ruby/models/accounting/branding_theme.rb delete mode 100644 lib/xero-ruby/models/accounting/branding_themes.rb delete mode 100644 lib/xero-ruby/models/accounting/cis_org_setting.rb delete mode 100644 lib/xero-ruby/models/accounting/cis_setting.rb delete mode 100644 lib/xero-ruby/models/accounting/cis_settings.rb delete mode 100644 lib/xero-ruby/models/accounting/contact.rb delete mode 100644 lib/xero-ruby/models/accounting/contact_group.rb delete mode 100644 lib/xero-ruby/models/accounting/contact_groups.rb delete mode 100644 lib/xero-ruby/models/accounting/contact_person.rb delete mode 100644 lib/xero-ruby/models/accounting/contacts.rb delete mode 100644 lib/xero-ruby/models/accounting/country_code.rb delete mode 100644 lib/xero-ruby/models/accounting/credit_note.rb delete mode 100644 lib/xero-ruby/models/accounting/credit_notes.rb delete mode 100644 lib/xero-ruby/models/accounting/currencies.rb delete mode 100644 lib/xero-ruby/models/accounting/currency.rb delete mode 100644 lib/xero-ruby/models/accounting/currency_code.rb delete mode 100644 lib/xero-ruby/models/accounting/element.rb delete mode 100644 lib/xero-ruby/models/accounting/employee.rb delete mode 100644 lib/xero-ruby/models/accounting/employees.rb delete mode 100644 lib/xero-ruby/models/accounting/error.rb delete mode 100644 lib/xero-ruby/models/accounting/expense_claim.rb delete mode 100644 lib/xero-ruby/models/accounting/expense_claims.rb delete mode 100644 lib/xero-ruby/models/accounting/external_link.rb delete mode 100644 lib/xero-ruby/models/accounting/history_record.rb delete mode 100644 lib/xero-ruby/models/accounting/history_records.rb delete mode 100644 lib/xero-ruby/models/accounting/invoice.rb delete mode 100644 lib/xero-ruby/models/accounting/invoice_reminder.rb delete mode 100644 lib/xero-ruby/models/accounting/invoice_reminders.rb delete mode 100644 lib/xero-ruby/models/accounting/invoices.rb delete mode 100644 lib/xero-ruby/models/accounting/item.rb delete mode 100644 lib/xero-ruby/models/accounting/items.rb delete mode 100644 lib/xero-ruby/models/accounting/journal.rb delete mode 100644 lib/xero-ruby/models/accounting/journal_line.rb delete mode 100644 lib/xero-ruby/models/accounting/journals.rb delete mode 100644 lib/xero-ruby/models/accounting/line_amount_types.rb delete mode 100644 lib/xero-ruby/models/accounting/line_item.rb delete mode 100644 lib/xero-ruby/models/accounting/line_item_tracking.rb delete mode 100644 lib/xero-ruby/models/accounting/linked_transaction.rb delete mode 100644 lib/xero-ruby/models/accounting/linked_transactions.rb delete mode 100644 lib/xero-ruby/models/accounting/manual_journal.rb delete mode 100644 lib/xero-ruby/models/accounting/manual_journal_line.rb delete mode 100644 lib/xero-ruby/models/accounting/manual_journals.rb delete mode 100644 lib/xero-ruby/models/accounting/online_invoice.rb delete mode 100644 lib/xero-ruby/models/accounting/online_invoices.rb delete mode 100644 lib/xero-ruby/models/accounting/organisation.rb delete mode 100644 lib/xero-ruby/models/accounting/organisations.rb delete mode 100644 lib/xero-ruby/models/accounting/overpayment.rb delete mode 100644 lib/xero-ruby/models/accounting/overpayments.rb delete mode 100644 lib/xero-ruby/models/accounting/payment.rb delete mode 100644 lib/xero-ruby/models/accounting/payment_delete.rb delete mode 100644 lib/xero-ruby/models/accounting/payment_service.rb delete mode 100644 lib/xero-ruby/models/accounting/payment_services.rb delete mode 100644 lib/xero-ruby/models/accounting/payment_term.rb delete mode 100644 lib/xero-ruby/models/accounting/payment_term_type.rb delete mode 100644 lib/xero-ruby/models/accounting/payments.rb delete mode 100644 lib/xero-ruby/models/accounting/phone.rb delete mode 100644 lib/xero-ruby/models/accounting/prepayment.rb delete mode 100644 lib/xero-ruby/models/accounting/prepayments.rb delete mode 100644 lib/xero-ruby/models/accounting/purchase.rb delete mode 100644 lib/xero-ruby/models/accounting/purchase_order.rb delete mode 100644 lib/xero-ruby/models/accounting/purchase_orders.rb delete mode 100644 lib/xero-ruby/models/accounting/quote.rb delete mode 100644 lib/xero-ruby/models/accounting/quote_line_amount_types.rb delete mode 100644 lib/xero-ruby/models/accounting/quote_status_codes.rb delete mode 100644 lib/xero-ruby/models/accounting/quotes.rb delete mode 100644 lib/xero-ruby/models/accounting/receipt.rb delete mode 100644 lib/xero-ruby/models/accounting/receipts.rb delete mode 100644 lib/xero-ruby/models/accounting/repeating_invoice.rb delete mode 100644 lib/xero-ruby/models/accounting/repeating_invoices.rb delete mode 100644 lib/xero-ruby/models/accounting/report.rb delete mode 100644 lib/xero-ruby/models/accounting/report_attribute.rb delete mode 100644 lib/xero-ruby/models/accounting/report_cell.rb delete mode 100644 lib/xero-ruby/models/accounting/report_fields.rb delete mode 100644 lib/xero-ruby/models/accounting/report_row.rb delete mode 100644 lib/xero-ruby/models/accounting/report_rows.rb delete mode 100644 lib/xero-ruby/models/accounting/report_with_row.rb delete mode 100644 lib/xero-ruby/models/accounting/report_with_rows.rb delete mode 100644 lib/xero-ruby/models/accounting/reports.rb delete mode 100644 lib/xero-ruby/models/accounting/request_empty.rb delete mode 100644 lib/xero-ruby/models/accounting/row_type.rb delete mode 100644 lib/xero-ruby/models/accounting/sales_tracking_category.rb delete mode 100644 lib/xero-ruby/models/accounting/schedule.rb delete mode 100644 lib/xero-ruby/models/accounting/tax_component.rb delete mode 100644 lib/xero-ruby/models/accounting/tax_rate.rb delete mode 100644 lib/xero-ruby/models/accounting/tax_rates.rb delete mode 100644 lib/xero-ruby/models/accounting/tax_type.rb delete mode 100644 lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb delete mode 100644 lib/xero-ruby/models/accounting/time_zone.rb delete mode 100644 lib/xero-ruby/models/accounting/tracking_categories.rb delete mode 100644 lib/xero-ruby/models/accounting/tracking_category.rb delete mode 100644 lib/xero-ruby/models/accounting/tracking_option.rb delete mode 100644 lib/xero-ruby/models/accounting/tracking_options.rb delete mode 100644 lib/xero-ruby/models/accounting/user.rb delete mode 100644 lib/xero-ruby/models/accounting/users.rb delete mode 100644 lib/xero-ruby/models/accounting/validation_error.rb delete mode 100644 lib/xero-ruby/models/assets/asset.rb delete mode 100644 lib/xero-ruby/models/assets/asset_status.rb delete mode 100644 lib/xero-ruby/models/assets/asset_status_query_param.rb delete mode 100644 lib/xero-ruby/models/assets/asset_type.rb delete mode 100644 lib/xero-ruby/models/assets/assets.rb delete mode 100644 lib/xero-ruby/models/assets/book_depreciation_detail.rb delete mode 100644 lib/xero-ruby/models/assets/book_depreciation_setting.rb delete mode 100644 lib/xero-ruby/models/assets/error.rb delete mode 100644 lib/xero-ruby/models/assets/field_validation_errors_element.rb delete mode 100644 lib/xero-ruby/models/assets/pagination.rb delete mode 100644 lib/xero-ruby/models/assets/resource_validation_errors_element.rb delete mode 100644 lib/xero-ruby/models/assets/setting.rb delete mode 100644 lib/xero-ruby/version.rb diff --git a/docs/accounting/Account.md b/docs/accounting/Account.md deleted file mode 100644 index 2acad17d..00000000 --- a/docs/accounting/Account.md +++ /dev/null @@ -1,55 +0,0 @@ -# XeroRuby::Accounting::Account - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **String** | Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) | [optional] -**name** | **String** | Name of account (max length = 150) | [optional] -**account_id** | **String** | The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] -**type** | [**AccountType**](AccountType.md) | | [optional] -**bank_account_number** | **String** | For bank accounts only (Account Type BANK) | [optional] -**status** | **String** | Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes | [optional] -**description** | **String** | Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) | [optional] -**bank_account_type** | **String** | For bank accounts only. See Bank Account types | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**tax_type** | **String** | The tax type from TaxRates | [optional] -**enable_payments_to_account** | **Boolean** | Boolean – describes whether account can have payments applied to it | [optional] -**show_in_expense_claims** | **Boolean** | Boolean – describes whether account code is available for use with expense claims | [optional] -**_class** | **String** | See Account Class Types | [optional] -**system_account** | **String** | If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. | [optional] -**reporting_code** | **String** | Shown if set | [optional] -**reporting_code_name** | **String** | Shown if set | [optional] -**has_attachments** | **Boolean** | boolean to indicate if an account has an attachment (read only) | [optional] [default to false] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**add_to_watchlist** | **Boolean** | Boolean – describes whether the account is shown in the watchlist widget on the dashboard | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Account.new(code: 4400, - name: Food Sales, - account_id: 00000000-0000-0000-0000-000000000000, - type: null, - bank_account_number: null, - status: null, - description: null, - bank_account_type: null, - currency_code: null, - tax_type: null, - enable_payments_to_account: null, - show_in_expense_claims: null, - _class: null, - system_account: null, - reporting_code: null, - reporting_code_name: null, - has_attachments: false, - updated_date_utc: null, - add_to_watchlist: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/AccountType.md b/docs/accounting/AccountType.md deleted file mode 100644 index 2bfebddc..00000000 --- a/docs/accounting/AccountType.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::AccountType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::AccountType.new() -``` - - diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md deleted file mode 100644 index 8b412696..00000000 --- a/docs/accounting/AccountingApi.md +++ /dev/null @@ -1,14424 +0,0 @@ -# XeroRuby::Accounting::AccountingApi - -All URIs are relative to *https://api.xero.com/api.xro/2.0* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_account**](AccountingApi.md#create_account) | **PUT** /Accounts | Allows you to create a new chart of accounts -[**create_account_attachment_by_file_name**](AccountingApi.md#create_account_attachment_by_file_name) | **PUT** /Accounts/{AccountID}/Attachments/{FileName} | Allows you to create Attachment on Account -[**create_bank_transaction_attachment_by_file_name**](AccountingApi.md#create_bank_transaction_attachment_by_file_name) | **PUT** /BankTransactions/{BankTransactionID}/Attachments/{FileName} | Allows you to createa an Attachment on BankTransaction by Filename -[**create_bank_transaction_history_record**](AccountingApi.md#create_bank_transaction_history_record) | **PUT** /BankTransactions/{BankTransactionID}/History | Allows you to create history record for a bank transactions -[**create_bank_transactions**](AccountingApi.md#create_bank_transactions) | **PUT** /BankTransactions | Allows you to create one or more spend or receive money transaction -[**create_bank_transfer**](AccountingApi.md#create_bank_transfer) | **PUT** /BankTransfers | Allows you to create a bank transfers -[**create_bank_transfer_attachment_by_file_name**](AccountingApi.md#create_bank_transfer_attachment_by_file_name) | **PUT** /BankTransfers/{BankTransferID}/Attachments/{FileName} | -[**create_bank_transfer_history_record**](AccountingApi.md#create_bank_transfer_history_record) | **PUT** /BankTransfers/{BankTransferID}/History | -[**create_batch_payment**](AccountingApi.md#create_batch_payment) | **PUT** /BatchPayments | Create one or many BatchPayments for invoices -[**create_batch_payment_history_record**](AccountingApi.md#create_batch_payment_history_record) | **PUT** /BatchPayments/{BatchPaymentID}/History | Allows you to create a history record for a Batch Payment -[**create_branding_theme_payment_services**](AccountingApi.md#create_branding_theme_payment_services) | **POST** /BrandingThemes/{BrandingThemeID}/PaymentServices | Allow for the creation of new custom payment service for specified Branding Theme -[**create_contact_attachment_by_file_name**](AccountingApi.md#create_contact_attachment_by_file_name) | **PUT** /Contacts/{ContactID}/Attachments/{FileName} | -[**create_contact_group**](AccountingApi.md#create_contact_group) | **PUT** /ContactGroups | Allows you to create a contact group -[**create_contact_group_contacts**](AccountingApi.md#create_contact_group_contacts) | **PUT** /ContactGroups/{ContactGroupID}/Contacts | Allows you to add Contacts to a Contact Group -[**create_contact_history**](AccountingApi.md#create_contact_history) | **PUT** /Contacts/{ContactID}/History | Allows you to retrieve a history records of an Contact -[**create_contacts**](AccountingApi.md#create_contacts) | **PUT** /Contacts | Allows you to create a multiple contacts (bulk) in a Xero organisation -[**create_credit_note_allocation**](AccountingApi.md#create_credit_note_allocation) | **PUT** /CreditNotes/{CreditNoteID}/Allocations | Allows you to create Allocation on CreditNote -[**create_credit_note_attachment_by_file_name**](AccountingApi.md#create_credit_note_attachment_by_file_name) | **PUT** /CreditNotes/{CreditNoteID}/Attachments/{FileName} | Allows you to create Attachments on CreditNote by file name -[**create_credit_note_history**](AccountingApi.md#create_credit_note_history) | **PUT** /CreditNotes/{CreditNoteID}/History | Allows you to retrieve a history records of an CreditNote -[**create_credit_notes**](AccountingApi.md#create_credit_notes) | **PUT** /CreditNotes | Allows you to create a credit note -[**create_currency**](AccountingApi.md#create_currency) | **PUT** /Currencies | -[**create_employees**](AccountingApi.md#create_employees) | **PUT** /Employees | Allows you to create new employees used in Xero payrun -[**create_expense_claim_history**](AccountingApi.md#create_expense_claim_history) | **PUT** /ExpenseClaims/{ExpenseClaimID}/History | Allows you to create a history records of an ExpenseClaim -[**create_expense_claims**](AccountingApi.md#create_expense_claims) | **PUT** /ExpenseClaims | Allows you to retrieve expense claims -[**create_invoice_attachment_by_file_name**](AccountingApi.md#create_invoice_attachment_by_file_name) | **PUT** /Invoices/{InvoiceID}/Attachments/{FileName} | Allows you to create an Attachment on invoices or purchase bills by it's filename -[**create_invoice_history**](AccountingApi.md#create_invoice_history) | **PUT** /Invoices/{InvoiceID}/History | Allows you to retrieve a history records of an invoice -[**create_invoices**](AccountingApi.md#create_invoices) | **PUT** /Invoices | Allows you to create one or more sales invoices or purchase bills -[**create_item_history**](AccountingApi.md#create_item_history) | **PUT** /Items/{ItemID}/History | Allows you to create a history record for items -[**create_items**](AccountingApi.md#create_items) | **PUT** /Items | Allows you to create one or more items -[**create_linked_transaction**](AccountingApi.md#create_linked_transaction) | **PUT** /LinkedTransactions | Allows you to create linked transactions (billable expenses) -[**create_manual_journal_attachment_by_file_name**](AccountingApi.md#create_manual_journal_attachment_by_file_name) | **PUT** /ManualJournals/{ManualJournalID}/Attachments/{FileName} | Allows you to create a specified Attachment on ManualJournal by file name -[**create_manual_journals**](AccountingApi.md#create_manual_journals) | **PUT** /ManualJournals | Allows you to create one or more manual journals -[**create_overpayment_allocations**](AccountingApi.md#create_overpayment_allocations) | **PUT** /Overpayments/{OverpaymentID}/Allocations | Allows you to create a single allocation for an overpayment -[**create_overpayment_history**](AccountingApi.md#create_overpayment_history) | **PUT** /Overpayments/{OverpaymentID}/History | Allows you to create history records of an Overpayment -[**create_payment**](AccountingApi.md#create_payment) | **POST** /Payments | Allows you to create a single payment for invoices or credit notes -[**create_payment_history**](AccountingApi.md#create_payment_history) | **PUT** /Payments/{PaymentID}/History | Allows you to create a history record for a payment -[**create_payment_service**](AccountingApi.md#create_payment_service) | **PUT** /PaymentServices | Allows you to create payment services -[**create_payments**](AccountingApi.md#create_payments) | **PUT** /Payments | Allows you to create multiple payments for invoices or credit notes -[**create_prepayment_allocations**](AccountingApi.md#create_prepayment_allocations) | **PUT** /Prepayments/{PrepaymentID}/Allocations | Allows you to create an Allocation for prepayments -[**create_prepayment_history**](AccountingApi.md#create_prepayment_history) | **PUT** /Prepayments/{PrepaymentID}/History | Allows you to create a history record for an Prepayment -[**create_purchase_order_history**](AccountingApi.md#create_purchase_order_history) | **PUT** /PurchaseOrders/{PurchaseOrderID}/History | Allows you to create HistoryRecord for purchase orders -[**create_purchase_orders**](AccountingApi.md#create_purchase_orders) | **PUT** /PurchaseOrders | Allows you to create one or more purchase orders -[**create_quote_attachment_by_file_name**](AccountingApi.md#create_quote_attachment_by_file_name) | **PUT** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to create Attachment on Quote -[**create_quote_history**](AccountingApi.md#create_quote_history) | **PUT** /Quotes/{QuoteID}/History | Allows you to retrieve a history records of an quote -[**create_quotes**](AccountingApi.md#create_quotes) | **PUT** /Quotes | Allows you to create one or more quotes -[**create_receipt**](AccountingApi.md#create_receipt) | **PUT** /Receipts | Allows you to create draft expense claim receipts for any user -[**create_receipt_attachment_by_file_name**](AccountingApi.md#create_receipt_attachment_by_file_name) | **PUT** /Receipts/{ReceiptID}/Attachments/{FileName} | Allows you to create Attachment on expense claim receipts by file name -[**create_receipt_history**](AccountingApi.md#create_receipt_history) | **PUT** /Receipts/{ReceiptID}/History | Allows you to retrieve a history records of an Receipt -[**create_repeating_invoice_attachment_by_file_name**](AccountingApi.md#create_repeating_invoice_attachment_by_file_name) | **PUT** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} | Allows you to create attachment on repeating invoices by file name -[**create_repeating_invoice_history**](AccountingApi.md#create_repeating_invoice_history) | **PUT** /RepeatingInvoices/{RepeatingInvoiceID}/History | Allows you to create history for a repeating invoice -[**create_tax_rates**](AccountingApi.md#create_tax_rates) | **PUT** /TaxRates | Allows you to create one or more Tax Rates -[**create_tracking_category**](AccountingApi.md#create_tracking_category) | **PUT** /TrackingCategories | Allows you to create tracking categories -[**create_tracking_options**](AccountingApi.md#create_tracking_options) | **PUT** /TrackingCategories/{TrackingCategoryID}/Options | Allows you to create options for a specified tracking category -[**delete_account**](AccountingApi.md#delete_account) | **DELETE** /Accounts/{AccountID} | Allows you to delete a chart of accounts -[**delete_contact_group_contact**](AccountingApi.md#delete_contact_group_contact) | **DELETE** /ContactGroups/{ContactGroupID}/Contacts/{ContactID} | Allows you to delete a specific Contact from a Contact Group -[**delete_contact_group_contacts**](AccountingApi.md#delete_contact_group_contacts) | **DELETE** /ContactGroups/{ContactGroupID}/Contacts | Allows you to delete all Contacts from a Contact Group -[**delete_item**](AccountingApi.md#delete_item) | **DELETE** /Items/{ItemID} | Allows you to delete a specified item -[**delete_linked_transaction**](AccountingApi.md#delete_linked_transaction) | **DELETE** /LinkedTransactions/{LinkedTransactionID} | Allows you to delete a specified linked transactions (billable expenses) -[**delete_payment**](AccountingApi.md#delete_payment) | **POST** /Payments/{PaymentID} | Allows you to update a specified payment for invoices and credit notes -[**delete_tracking_category**](AccountingApi.md#delete_tracking_category) | **DELETE** /TrackingCategories/{TrackingCategoryID} | Allows you to delete tracking categories -[**delete_tracking_options**](AccountingApi.md#delete_tracking_options) | **DELETE** /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} | Allows you to delete a specified option for a specified tracking category -[**email_invoice**](AccountingApi.md#email_invoice) | **POST** /Invoices/{InvoiceID}/Email | Allows you to email a copy of invoice to related Contact -[**get_account**](AccountingApi.md#get_account) | **GET** /Accounts/{AccountID} | Allows you to retrieve a single chart of accounts -[**get_account_attachment_by_file_name**](AccountingApi.md#get_account_attachment_by_file_name) | **GET** /Accounts/{AccountID}/Attachments/{FileName} | Allows you to retrieve Attachment on Account by Filename -[**get_account_attachment_by_id**](AccountingApi.md#get_account_attachment_by_id) | **GET** /Accounts/{AccountID}/Attachments/{AttachmentID} | Allows you to retrieve specific Attachment on Account -[**get_account_attachments**](AccountingApi.md#get_account_attachments) | **GET** /Accounts/{AccountID}/Attachments | Allows you to retrieve Attachments for accounts -[**get_accounts**](AccountingApi.md#get_accounts) | **GET** /Accounts | Allows you to retrieve the full chart of accounts -[**get_bank_transaction**](AccountingApi.md#get_bank_transaction) | **GET** /BankTransactions/{BankTransactionID} | Allows you to retrieve a single spend or receive money transaction -[**get_bank_transaction_attachment_by_file_name**](AccountingApi.md#get_bank_transaction_attachment_by_file_name) | **GET** /BankTransactions/{BankTransactionID}/Attachments/{FileName} | Allows you to retrieve Attachments on BankTransaction by Filename -[**get_bank_transaction_attachment_by_id**](AccountingApi.md#get_bank_transaction_attachment_by_id) | **GET** /BankTransactions/{BankTransactionID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on a specific BankTransaction -[**get_bank_transaction_attachments**](AccountingApi.md#get_bank_transaction_attachments) | **GET** /BankTransactions/{BankTransactionID}/Attachments | Allows you to retrieve any attachments to bank transactions -[**get_bank_transactions**](AccountingApi.md#get_bank_transactions) | **GET** /BankTransactions | Allows you to retrieve any spend or receive money transactions -[**get_bank_transactions_history**](AccountingApi.md#get_bank_transactions_history) | **GET** /BankTransactions/{BankTransactionID}/History | Allows you to retrieve history from a bank transactions -[**get_bank_transfer**](AccountingApi.md#get_bank_transfer) | **GET** /BankTransfers/{BankTransferID} | Allows you to retrieve any bank transfers -[**get_bank_transfer_attachment_by_file_name**](AccountingApi.md#get_bank_transfer_attachment_by_file_name) | **GET** /BankTransfers/{BankTransferID}/Attachments/{FileName} | Allows you to retrieve Attachments on BankTransfer by file name -[**get_bank_transfer_attachment_by_id**](AccountingApi.md#get_bank_transfer_attachment_by_id) | **GET** /BankTransfers/{BankTransferID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on BankTransfer -[**get_bank_transfer_attachments**](AccountingApi.md#get_bank_transfer_attachments) | **GET** /BankTransfers/{BankTransferID}/Attachments | Allows you to retrieve Attachments from bank transfers -[**get_bank_transfer_history**](AccountingApi.md#get_bank_transfer_history) | **GET** /BankTransfers/{BankTransferID}/History | Allows you to retrieve history from a bank transfers -[**get_bank_transfers**](AccountingApi.md#get_bank_transfers) | **GET** /BankTransfers | Allows you to retrieve all bank transfers -[**get_batch_payment_history**](AccountingApi.md#get_batch_payment_history) | **GET** /BatchPayments/{BatchPaymentID}/History | Allows you to retrieve history from a Batch Payment -[**get_batch_payments**](AccountingApi.md#get_batch_payments) | **GET** /BatchPayments | Retrieve either one or many BatchPayments for invoices -[**get_branding_theme**](AccountingApi.md#get_branding_theme) | **GET** /BrandingThemes/{BrandingThemeID} | Allows you to retrieve a specific BrandingThemes -[**get_branding_theme_payment_services**](AccountingApi.md#get_branding_theme_payment_services) | **GET** /BrandingThemes/{BrandingThemeID}/PaymentServices | Allows you to retrieve the Payment services for a Branding Theme -[**get_branding_themes**](AccountingApi.md#get_branding_themes) | **GET** /BrandingThemes | Allows you to retrieve all the BrandingThemes -[**get_contact**](AccountingApi.md#get_contact) | **GET** /Contacts/{ContactID} | Allows you to retrieve a single contacts in a Xero organisation -[**get_contact_attachment_by_file_name**](AccountingApi.md#get_contact_attachment_by_file_name) | **GET** /Contacts/{ContactID}/Attachments/{FileName} | Allows you to retrieve Attachments on Contacts by file name -[**get_contact_attachment_by_id**](AccountingApi.md#get_contact_attachment_by_id) | **GET** /Contacts/{ContactID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on Contacts -[**get_contact_attachments**](AccountingApi.md#get_contact_attachments) | **GET** /Contacts/{ContactID}/Attachments | Allows you to retrieve, add and update contacts in a Xero organisation -[**get_contact_cis_settings**](AccountingApi.md#get_contact_cis_settings) | **GET** /Contacts/{ContactID}/CISSettings | Allows you to retrieve CISSettings for a contact in a Xero organisation -[**get_contact_group**](AccountingApi.md#get_contact_group) | **GET** /ContactGroups/{ContactGroupID} | Allows you to retrieve a unique Contact Group by ID -[**get_contact_groups**](AccountingApi.md#get_contact_groups) | **GET** /ContactGroups | Allows you to retrieve the ContactID and Name of all the contacts in a contact group -[**get_contact_history**](AccountingApi.md#get_contact_history) | **GET** /Contacts/{ContactID}/History | Allows you to retrieve a history records of an Contact -[**get_contacts**](AccountingApi.md#get_contacts) | **GET** /Contacts | Allows you to retrieve all contacts in a Xero organisation -[**get_credit_note**](AccountingApi.md#get_credit_note) | **GET** /CreditNotes/{CreditNoteID} | Allows you to retrieve a specific credit note -[**get_credit_note_as_pdf**](AccountingApi.md#get_credit_note_as_pdf) | **GET** /CreditNotes/{CreditNoteID}/pdf | Allows you to retrieve Credit Note as PDF files -[**get_credit_note_attachment_by_file_name**](AccountingApi.md#get_credit_note_attachment_by_file_name) | **GET** /CreditNotes/{CreditNoteID}/Attachments/{FileName} | Allows you to retrieve Attachments on CreditNote by file name -[**get_credit_note_attachment_by_id**](AccountingApi.md#get_credit_note_attachment_by_id) | **GET** /CreditNotes/{CreditNoteID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on CreditNote -[**get_credit_note_attachments**](AccountingApi.md#get_credit_note_attachments) | **GET** /CreditNotes/{CreditNoteID}/Attachments | Allows you to retrieve Attachments for credit notes -[**get_credit_note_history**](AccountingApi.md#get_credit_note_history) | **GET** /CreditNotes/{CreditNoteID}/History | Allows you to retrieve a history records of an CreditNote -[**get_credit_notes**](AccountingApi.md#get_credit_notes) | **GET** /CreditNotes | Allows you to retrieve any credit notes -[**get_currencies**](AccountingApi.md#get_currencies) | **GET** /Currencies | Allows you to retrieve currencies for your organisation -[**get_employee**](AccountingApi.md#get_employee) | **GET** /Employees/{EmployeeID} | Allows you to retrieve a specific employee used in Xero payrun -[**get_employees**](AccountingApi.md#get_employees) | **GET** /Employees | Allows you to retrieve employees used in Xero payrun -[**get_expense_claim**](AccountingApi.md#get_expense_claim) | **GET** /ExpenseClaims/{ExpenseClaimID} | Allows you to retrieve a specified expense claim -[**get_expense_claim_history**](AccountingApi.md#get_expense_claim_history) | **GET** /ExpenseClaims/{ExpenseClaimID}/History | Allows you to retrieve a history records of an ExpenseClaim -[**get_expense_claims**](AccountingApi.md#get_expense_claims) | **GET** /ExpenseClaims | Allows you to retrieve expense claims -[**get_invoice**](AccountingApi.md#get_invoice) | **GET** /Invoices/{InvoiceID} | Allows you to retrieve a specified sales invoice or purchase bill -[**get_invoice_as_pdf**](AccountingApi.md#get_invoice_as_pdf) | **GET** /Invoices/{InvoiceID}/pdf | Allows you to retrieve invoices or purchase bills as PDF files -[**get_invoice_attachment_by_file_name**](AccountingApi.md#get_invoice_attachment_by_file_name) | **GET** /Invoices/{InvoiceID}/Attachments/{FileName} | Allows you to retrieve Attachment on invoices or purchase bills by it's filename -[**get_invoice_attachment_by_id**](AccountingApi.md#get_invoice_attachment_by_id) | **GET** /Invoices/{InvoiceID}/Attachments/{AttachmentID} | Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID -[**get_invoice_attachments**](AccountingApi.md#get_invoice_attachments) | **GET** /Invoices/{InvoiceID}/Attachments | Allows you to retrieve Attachments on invoices or purchase bills -[**get_invoice_history**](AccountingApi.md#get_invoice_history) | **GET** /Invoices/{InvoiceID}/History | Allows you to retrieve a history records of an invoice -[**get_invoice_reminders**](AccountingApi.md#get_invoice_reminders) | **GET** /InvoiceReminders/Settings | Allows you to retrieve invoice reminder settings -[**get_invoices**](AccountingApi.md#get_invoices) | **GET** /Invoices | Allows you to retrieve any sales invoices or purchase bills -[**get_item**](AccountingApi.md#get_item) | **GET** /Items/{ItemID} | Allows you to retrieve a specified item -[**get_item_history**](AccountingApi.md#get_item_history) | **GET** /Items/{ItemID}/History | Allows you to retrieve history for items -[**get_items**](AccountingApi.md#get_items) | **GET** /Items | Allows you to retrieve any items -[**get_journal**](AccountingApi.md#get_journal) | **GET** /Journals/{JournalID} | Allows you to retrieve a specified journals. -[**get_journals**](AccountingApi.md#get_journals) | **GET** /Journals | Allows you to retrieve any journals. -[**get_linked_transaction**](AccountingApi.md#get_linked_transaction) | **GET** /LinkedTransactions/{LinkedTransactionID} | Allows you to retrieve a specified linked transactions (billable expenses) -[**get_linked_transactions**](AccountingApi.md#get_linked_transactions) | **GET** /LinkedTransactions | Retrieve linked transactions (billable expenses) -[**get_manual_journal**](AccountingApi.md#get_manual_journal) | **GET** /ManualJournals/{ManualJournalID} | Allows you to retrieve a specified manual journals -[**get_manual_journal_attachment_by_file_name**](AccountingApi.md#get_manual_journal_attachment_by_file_name) | **GET** /ManualJournals/{ManualJournalID}/Attachments/{FileName} | Allows you to retrieve specified Attachment on ManualJournal by file name -[**get_manual_journal_attachment_by_id**](AccountingApi.md#get_manual_journal_attachment_by_id) | **GET** /ManualJournals/{ManualJournalID}/Attachments/{AttachmentID} | Allows you to retrieve specified Attachment on ManualJournals -[**get_manual_journal_attachments**](AccountingApi.md#get_manual_journal_attachments) | **GET** /ManualJournals/{ManualJournalID}/Attachments | Allows you to retrieve Attachment for manual journals -[**get_manual_journals**](AccountingApi.md#get_manual_journals) | **GET** /ManualJournals | Allows you to retrieve any manual journals -[**get_online_invoice**](AccountingApi.md#get_online_invoice) | **GET** /Invoices/{InvoiceID}/OnlineInvoice | Allows you to retrieve a URL to an online invoice -[**get_organisation_cis_settings**](AccountingApi.md#get_organisation_cis_settings) | **GET** /Organisation/{OrganisationID}/CISSettings | Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. -[**get_organisations**](AccountingApi.md#get_organisations) | **GET** /Organisation | Allows you to retrieve Organisation details -[**get_overpayment**](AccountingApi.md#get_overpayment) | **GET** /Overpayments/{OverpaymentID} | Allows you to retrieve a specified overpayments -[**get_overpayment_history**](AccountingApi.md#get_overpayment_history) | **GET** /Overpayments/{OverpaymentID}/History | Allows you to retrieve a history records of an Overpayment -[**get_overpayments**](AccountingApi.md#get_overpayments) | **GET** /Overpayments | Allows you to retrieve overpayments -[**get_payment**](AccountingApi.md#get_payment) | **GET** /Payments/{PaymentID} | Allows you to retrieve a specified payment for invoices and credit notes -[**get_payment_history**](AccountingApi.md#get_payment_history) | **GET** /Payments/{PaymentID}/History | Allows you to retrieve history records of a payment -[**get_payment_services**](AccountingApi.md#get_payment_services) | **GET** /PaymentServices | Allows you to retrieve payment services -[**get_payments**](AccountingApi.md#get_payments) | **GET** /Payments | Allows you to retrieve payments for invoices and credit notes -[**get_prepayment**](AccountingApi.md#get_prepayment) | **GET** /Prepayments/{PrepaymentID} | Allows you to retrieve a specified prepayments -[**get_prepayment_as_pdf**](AccountingApi.md#get_prepayment_as_pdf) | **GET** /Prepayments/{PrepaymentID}/pdf | Allows you to retrieve prepayments as PDF files -[**get_prepayment_history**](AccountingApi.md#get_prepayment_history) | **GET** /Prepayments/{PrepaymentID}/History | Allows you to retrieve a history records of an Prepayment -[**get_prepayments**](AccountingApi.md#get_prepayments) | **GET** /Prepayments | Allows you to retrieve prepayments -[**get_purchase_order**](AccountingApi.md#get_purchase_order) | **GET** /PurchaseOrders/{PurchaseOrderID} | Allows you to retrieve a specified purchase orders -[**get_purchase_order_as_pdf**](AccountingApi.md#get_purchase_order_as_pdf) | **GET** /PurchaseOrders/{PurchaseOrderID}/pdf | Allows you to retrieve purchase orders as PDF files -[**get_purchase_order_by_number**](AccountingApi.md#get_purchase_order_by_number) | **GET** /PurchaseOrders/{PurchaseOrderNumber} | Allows you to retrieve a specified purchase orders -[**get_purchase_order_history**](AccountingApi.md#get_purchase_order_history) | **GET** /PurchaseOrders/{PurchaseOrderID}/History | Allows you to retrieve history for PurchaseOrder -[**get_purchase_orders**](AccountingApi.md#get_purchase_orders) | **GET** /PurchaseOrders | Allows you to retrieve purchase orders -[**get_quote**](AccountingApi.md#get_quote) | **GET** /Quotes/{QuoteID} | Allows you to retrieve a specified quote -[**get_quote_as_pdf**](AccountingApi.md#get_quote_as_pdf) | **GET** /Quotes/{QuotesID}/pdf | Allows you to retrieve quotes as PDF files -[**get_quote_attachment_by_file_name**](AccountingApi.md#get_quote_attachment_by_file_name) | **GET** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to retrieve Attachment on Quote by Filename -[**get_quote_attachment_by_id**](AccountingApi.md#get_quote_attachment_by_id) | **GET** /Quotes/{QuoteID}/Attachments/{AttachmentID} | Allows you to retrieve specific Attachment on Quote -[**get_quote_attachments**](AccountingApi.md#get_quote_attachments) | **GET** /Quotes/{QuoteID}/Attachments | Allows you to retrieve Attachments for Quotes -[**get_quote_history**](AccountingApi.md#get_quote_history) | **GET** /Quotes/{QuoteID}/History | Allows you to retrieve a history records of an quote -[**get_quotes**](AccountingApi.md#get_quotes) | **GET** /Quotes | Allows you to retrieve any sales quotes -[**get_receipt**](AccountingApi.md#get_receipt) | **GET** /Receipts/{ReceiptID} | Allows you to retrieve a specified draft expense claim receipts -[**get_receipt_attachment_by_file_name**](AccountingApi.md#get_receipt_attachment_by_file_name) | **GET** /Receipts/{ReceiptID}/Attachments/{FileName} | Allows you to retrieve Attachments on expense claim receipts by file name -[**get_receipt_attachment_by_id**](AccountingApi.md#get_receipt_attachment_by_id) | **GET** /Receipts/{ReceiptID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on expense claim receipts by ID -[**get_receipt_attachments**](AccountingApi.md#get_receipt_attachments) | **GET** /Receipts/{ReceiptID}/Attachments | Allows you to retrieve Attachments for expense claim receipts -[**get_receipt_history**](AccountingApi.md#get_receipt_history) | **GET** /Receipts/{ReceiptID}/History | Allows you to retrieve a history records of an Receipt -[**get_receipts**](AccountingApi.md#get_receipts) | **GET** /Receipts | Allows you to retrieve draft expense claim receipts for any user -[**get_repeating_invoice**](AccountingApi.md#get_repeating_invoice) | **GET** /RepeatingInvoices/{RepeatingInvoiceID} | Allows you to retrieve a specified repeating invoice -[**get_repeating_invoice_attachment_by_file_name**](AccountingApi.md#get_repeating_invoice_attachment_by_file_name) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} | Allows you to retrieve specified attachment on repeating invoices by file name -[**get_repeating_invoice_attachment_by_id**](AccountingApi.md#get_repeating_invoice_attachment_by_id) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID} | Allows you to retrieve a specified Attachments on repeating invoices -[**get_repeating_invoice_attachments**](AccountingApi.md#get_repeating_invoice_attachments) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments | Allows you to retrieve Attachments on repeating invoice -[**get_repeating_invoice_history**](AccountingApi.md#get_repeating_invoice_history) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/History | Allows you to retrieve history for a repeating invoice -[**get_repeating_invoices**](AccountingApi.md#get_repeating_invoices) | **GET** /RepeatingInvoices | Allows you to retrieve any repeating invoices -[**get_report_aged_payables_by_contact**](AccountingApi.md#get_report_aged_payables_by_contact) | **GET** /Reports/AgedPayablesByContact | Allows you to retrieve report for AgedPayablesByContact -[**get_report_aged_receivables_by_contact**](AccountingApi.md#get_report_aged_receivables_by_contact) | **GET** /Reports/AgedReceivablesByContact | Allows you to retrieve report for AgedReceivablesByContact -[**get_report_ba_sor_gst**](AccountingApi.md#get_report_ba_sor_gst) | **GET** /Reports/{ReportID} | Allows you to retrieve report for BAS only valid for AU orgs -[**get_report_ba_sor_gst_list**](AccountingApi.md#get_report_ba_sor_gst_list) | **GET** /Reports | Allows you to retrieve report for BAS only valid for AU orgs -[**get_report_balance_sheet**](AccountingApi.md#get_report_balance_sheet) | **GET** /Reports/BalanceSheet | Allows you to retrieve report for BalanceSheet -[**get_report_bank_summary**](AccountingApi.md#get_report_bank_summary) | **GET** /Reports/BankSummary | Allows you to retrieve report for BankSummary -[**get_report_budget_summary**](AccountingApi.md#get_report_budget_summary) | **GET** /Reports/BudgetSummary | Allows you to retrieve report for Budget Summary -[**get_report_executive_summary**](AccountingApi.md#get_report_executive_summary) | **GET** /Reports/ExecutiveSummary | Allows you to retrieve report for ExecutiveSummary -[**get_report_profit_and_loss**](AccountingApi.md#get_report_profit_and_loss) | **GET** /Reports/ProfitAndLoss | Allows you to retrieve report for ProfitAndLoss -[**get_report_ten_ninety_nine**](AccountingApi.md#get_report_ten_ninety_nine) | **GET** /Reports/TenNinetyNine | Allows you to retrieve report for TenNinetyNine -[**get_report_trial_balance**](AccountingApi.md#get_report_trial_balance) | **GET** /Reports/TrialBalance | Allows you to retrieve report for TrialBalance -[**get_tax_rates**](AccountingApi.md#get_tax_rates) | **GET** /TaxRates | Allows you to retrieve Tax Rates -[**get_tracking_categories**](AccountingApi.md#get_tracking_categories) | **GET** /TrackingCategories | Allows you to retrieve tracking categories and options -[**get_tracking_category**](AccountingApi.md#get_tracking_category) | **GET** /TrackingCategories/{TrackingCategoryID} | Allows you to retrieve tracking categories and options for specified category -[**get_user**](AccountingApi.md#get_user) | **GET** /Users/{UserID} | Allows you to retrieve a specified user -[**get_users**](AccountingApi.md#get_users) | **GET** /Users | Allows you to retrieve users -[**update_account**](AccountingApi.md#update_account) | **POST** /Accounts/{AccountID} | Allows you to update a chart of accounts -[**update_account_attachment_by_file_name**](AccountingApi.md#update_account_attachment_by_file_name) | **POST** /Accounts/{AccountID}/Attachments/{FileName} | Allows you to update Attachment on Account by Filename -[**update_bank_transaction**](AccountingApi.md#update_bank_transaction) | **POST** /BankTransactions/{BankTransactionID} | Allows you to update a single spend or receive money transaction -[**update_bank_transaction_attachment_by_file_name**](AccountingApi.md#update_bank_transaction_attachment_by_file_name) | **POST** /BankTransactions/{BankTransactionID}/Attachments/{FileName} | Allows you to update an Attachment on BankTransaction by Filename -[**update_bank_transfer_attachment_by_file_name**](AccountingApi.md#update_bank_transfer_attachment_by_file_name) | **POST** /BankTransfers/{BankTransferID}/Attachments/{FileName} | -[**update_contact**](AccountingApi.md#update_contact) | **POST** /Contacts/{ContactID} | -[**update_contact_attachment_by_file_name**](AccountingApi.md#update_contact_attachment_by_file_name) | **POST** /Contacts/{ContactID}/Attachments/{FileName} | -[**update_contact_group**](AccountingApi.md#update_contact_group) | **POST** /ContactGroups/{ContactGroupID} | Allows you to update a Contact Group -[**update_credit_note**](AccountingApi.md#update_credit_note) | **POST** /CreditNotes/{CreditNoteID} | Allows you to update a specific credit note -[**update_credit_note_attachment_by_file_name**](AccountingApi.md#update_credit_note_attachment_by_file_name) | **POST** /CreditNotes/{CreditNoteID}/Attachments/{FileName} | Allows you to update Attachments on CreditNote by file name -[**update_expense_claim**](AccountingApi.md#update_expense_claim) | **POST** /ExpenseClaims/{ExpenseClaimID} | Allows you to update specified expense claims -[**update_invoice**](AccountingApi.md#update_invoice) | **POST** /Invoices/{InvoiceID} | Allows you to update a specified sales invoices or purchase bills -[**update_invoice_attachment_by_file_name**](AccountingApi.md#update_invoice_attachment_by_file_name) | **POST** /Invoices/{InvoiceID}/Attachments/{FileName} | Allows you to update Attachment on invoices or purchase bills by it's filename -[**update_item**](AccountingApi.md#update_item) | **POST** /Items/{ItemID} | Allows you to update a specified item -[**update_linked_transaction**](AccountingApi.md#update_linked_transaction) | **POST** /LinkedTransactions/{LinkedTransactionID} | Allows you to update a specified linked transactions (billable expenses) -[**update_manual_journal**](AccountingApi.md#update_manual_journal) | **POST** /ManualJournals/{ManualJournalID} | Allows you to update a specified manual journal -[**update_manual_journal_attachment_by_file_name**](AccountingApi.md#update_manual_journal_attachment_by_file_name) | **POST** /ManualJournals/{ManualJournalID}/Attachments/{FileName} | Allows you to update a specified Attachment on ManualJournal by file name -[**update_or_create_bank_transactions**](AccountingApi.md#update_or_create_bank_transactions) | **POST** /BankTransactions | Allows you to update or create one or more spend or receive money transaction -[**update_or_create_contacts**](AccountingApi.md#update_or_create_contacts) | **POST** /Contacts | Allows you to update OR create one or more contacts in a Xero organisation -[**update_or_create_credit_notes**](AccountingApi.md#update_or_create_credit_notes) | **POST** /CreditNotes | Allows you to update OR create one or more credit notes -[**update_or_create_employees**](AccountingApi.md#update_or_create_employees) | **POST** /Employees | Allows you to create a single new employees used in Xero payrun -[**update_or_create_invoices**](AccountingApi.md#update_or_create_invoices) | **POST** /Invoices | Allows you to update OR create one or more sales invoices or purchase bills -[**update_or_create_items**](AccountingApi.md#update_or_create_items) | **POST** /Items | Allows you to update or create one or more items -[**update_or_create_manual_journals**](AccountingApi.md#update_or_create_manual_journals) | **POST** /ManualJournals | Allows you to create a single manual journal -[**update_or_create_purchase_orders**](AccountingApi.md#update_or_create_purchase_orders) | **POST** /PurchaseOrders | Allows you to update or create one or more purchase orders -[**update_or_create_quotes**](AccountingApi.md#update_or_create_quotes) | **POST** /Quotes | Allows you to update OR create one or more quotes -[**update_purchase_order**](AccountingApi.md#update_purchase_order) | **POST** /PurchaseOrders/{PurchaseOrderID} | Allows you to update a specified purchase order -[**update_quote**](AccountingApi.md#update_quote) | **POST** /Quotes/{QuoteID} | Allows you to update a specified quote -[**update_quote_attachment_by_file_name**](AccountingApi.md#update_quote_attachment_by_file_name) | **POST** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to update Attachment on Quote by Filename -[**update_receipt**](AccountingApi.md#update_receipt) | **POST** /Receipts/{ReceiptID} | Allows you to retrieve a specified draft expense claim receipts -[**update_receipt_attachment_by_file_name**](AccountingApi.md#update_receipt_attachment_by_file_name) | **POST** /Receipts/{ReceiptID}/Attachments/{FileName} | Allows you to update Attachment on expense claim receipts by file name -[**update_repeating_invoice_attachment_by_file_name**](AccountingApi.md#update_repeating_invoice_attachment_by_file_name) | **POST** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} | Allows you to update specified attachment on repeating invoices by file name -[**update_tax_rate**](AccountingApi.md#update_tax_rate) | **POST** /TaxRates | Allows you to update Tax Rates -[**update_tracking_category**](AccountingApi.md#update_tracking_category) | **POST** /TrackingCategories/{TrackingCategoryID} | Allows you to update tracking categories -[**update_tracking_options**](AccountingApi.md#update_tracking_options) | **POST** /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} | Allows you to update options for a specified tracking category - - - -## create_account - -> Accounts create_account(xero_tenant_id, account) - -Allows you to create a new chart of accounts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" } # Account | Account object in body of request - -begin - #Allows you to create a new chart of accounts - result = api_instance.create_account(xero_tenant_id, account) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_account: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account** | [**Account**](Account.md)| Account object in body of request | - -### Return type - -[**Accounts**](Accounts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_account_attachment_by_file_name - -> Attachments create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) - -Allows you to create Attachment on Account - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object -file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create Attachment on Account - result = api_instance.create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_account_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for Account object | - **file_name** | **String**| Name of the attachment | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_bank_transaction_attachment_by_file_name - -> Attachments create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) - -Allows you to createa an Attachment on BankTransaction by Filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -file_name = 'xero-dev.jpg' # String | The name of the file being attached -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to createa an Attachment on BankTransaction by Filename - result = api_instance.create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_bank_transaction_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - **file_name** | **String**| The name of the file being attached | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_bank_transaction_history_record - -> HistoryRecords create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) - -Allows you to create history record for a bank transactions - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create history record for a bank transactions - result = api_instance.create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_bank_transaction_history_record: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_bank_transactions - -> BankTransactions create_bank_transactions(xero_tenant_id, bank_transactions, opts) - -Allows you to create one or more spend or receive money transaction - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | BankTransactions with an array of BankTransaction objects in body of request -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to create one or more spend or receive money transaction - result = api_instance.create_bank_transactions(xero_tenant_id, bank_transactions, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_bank_transactions: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transactions** | [**BankTransactions**](BankTransactions.md)| BankTransactions with an array of BankTransaction objects in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**BankTransactions**](BankTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_bank_transfer - -> BankTransfers create_bank_transfer(xero_tenant_id, bank_transfers) - -Allows you to create a bank transfers - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] } # BankTransfers | BankTransfers with array of BankTransfer objects in request body - -begin - #Allows you to create a bank transfers - result = api_instance.create_bank_transfer(xero_tenant_id, bank_transfers) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_bank_transfer: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfers** | [**BankTransfers**](BankTransfers.md)| BankTransfers with array of BankTransfer objects in request body | - -### Return type - -[**BankTransfers**](BankTransfers.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_bank_transfer_attachment_by_file_name - -> Attachments create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) - - - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -body = 'body_example' # String | Byte array of file in body of request - -begin - result = api_instance.create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_bank_transfer_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - **file_name** | **String**| The name of the file being attached to a Bank Transfer | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_bank_transfer_history_record - -> HistoryRecords create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) - - - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - result = api_instance.create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_bank_transfer_history_record: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_batch_payment - -> BatchPayments create_batch_payment(xero_tenant_id, batch_payments, opts) - -Create one or many BatchPayments for invoices - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -batch_payments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] } # BatchPayments | BatchPayments with an array of Payments in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Create one or many BatchPayments for invoices - result = api_instance.create_batch_payment(xero_tenant_id, batch_payments, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_batch_payment: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **batch_payments** | [**BatchPayments**](BatchPayments.md)| BatchPayments with an array of Payments in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**BatchPayments**](BatchPayments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_batch_payment_history_record - -> HistoryRecords create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) - -Allows you to create a history record for a Batch Payment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for a Batch Payment - result = api_instance.create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_batch_payment_history_record: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **batch_payment_id** | [**String**](.md)| Unique identifier for BatchPayment | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_branding_theme_payment_services - -> PaymentServices create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) - -Allow for the creation of new custom payment service for specified Branding Theme - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme -payment_service = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" } # PaymentService | PaymentService object in body of request - -begin - #Allow for the creation of new custom payment service for specified Branding Theme - result = api_instance.create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_branding_theme_payment_services: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **branding_theme_id** | [**String**](.md)| Unique identifier for a Branding Theme | - **payment_service** | [**PaymentService**](PaymentService.md)| PaymentService object in body of request | - -### Return type - -[**PaymentServices**](PaymentServices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_contact_attachment_by_file_name - -> Attachments create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) - - - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -body = 'body_example' # String | Byte array of file in body of request - -begin - result = api_instance.create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_contact_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **file_name** | **String**| Name for the file you are attaching | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_contact_group - -> ContactGroups create_contact_group(xero_tenant_id, contact_groups) - -Allows you to create a contact group - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_groups = { contactGroups:[ { name:"VIPs" } ] } # ContactGroups | ContactGroups with an array of names in request body - -begin - #Allows you to create a contact group - result = api_instance.create_contact_group(xero_tenant_id, contact_groups) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_contact_group: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_groups** | [**ContactGroups**](ContactGroups.md)| ContactGroups with an array of names in request body | - -### Return type - -[**ContactGroups**](ContactGroups.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_contact_group_contacts - -> Contacts create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts) - -Allows you to add Contacts to a Contact Group - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group -contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] } # Contacts | Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request - -begin - #Allows you to add Contacts to a Contact Group - result = api_instance.create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_contact_group_contacts: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | - **contacts** | [**Contacts**](Contacts.md)| Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request | - -### Return type - -[**Contacts**](Contacts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_contact_history - -> HistoryRecords create_contact_history(xero_tenant_id, contact_id, history_records) - -Allows you to retrieve a history records of an Contact - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an Contact - result = api_instance.create_contact_history(xero_tenant_id, contact_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_contact_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_contacts - -> Contacts create_contacts(xero_tenant_id, contacts, opts) - -Allows you to create a multiple contacts (bulk) in a Xero organisation - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | Contacts with an array of Contact objects to create in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create a multiple contacts (bulk) in a Xero organisation - result = api_instance.create_contacts(xero_tenant_id, contacts, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_contacts: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contacts** | [**Contacts**](Contacts.md)| Contacts with an array of Contact objects to create in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Contacts**](Contacts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_credit_note_allocation - -> Allocations create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations) - -Allows you to create Allocation on CreditNote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] } # Allocations | Allocations with array of Allocation object in body of request. - -begin - #Allows you to create Allocation on CreditNote - result = api_instance.create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_credit_note_allocation: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **allocations** | [**Allocations**](Allocations.md)| Allocations with array of Allocation object in body of request. | - -### Return type - -[**Allocations**](Allocations.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_credit_note_attachment_by_file_name - -> Attachments create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts) - -Allows you to create Attachments on CreditNote by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note -body = 'body_example' # String | Byte array of file in body of request -opts = { - include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice -} - -begin - #Allows you to create Attachments on CreditNote by file name - result = api_instance.create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_credit_note_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **file_name** | **String**| Name of the file you are attaching to Credit Note | - **body** | **String**| Byte array of file in body of request | - **include_online** | **Boolean**| Allows an attachment to be seen by the end customer within their online invoice | [optional] [default to false] - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_credit_note_history - -> HistoryRecords create_credit_note_history(xero_tenant_id, credit_note_id, history_records) - -Allows you to retrieve a history records of an CreditNote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an CreditNote - result = api_instance.create_credit_note_history(xero_tenant_id, credit_note_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_credit_note_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_credit_notes - -> CreditNotes create_credit_notes(xero_tenant_id, credit_notes, opts) - -Allows you to create a credit note - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_notes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | Credit Notes with array of CreditNote object in body of request -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to create a credit note - result = api_instance.create_credit_notes(xero_tenant_id, credit_notes, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_credit_notes: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_notes** | [**CreditNotes**](CreditNotes.md)| Credit Notes with array of CreditNote object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**CreditNotes**](CreditNotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_currency - -> Currencies create_currency(xero_tenant_id, currency) - - - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -currency = { code: CurrencyCode.USD, description:"United States Dollar" } # Currency | Currency obejct in the body of request - -begin - result = api_instance.create_currency(xero_tenant_id, currency) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_currency: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **currency** | [**Currency**](Currency.md)| Currency obejct in the body of request | - -### Return type - -[**Currencies**](Currencies.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_employees - -> Employees create_employees(xero_tenant_id, employees, opts) - -Allows you to create new employees used in Xero payrun - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | Employees with array of Employee object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create new employees used in Xero payrun - result = api_instance.create_employees(xero_tenant_id, employees, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_employees: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **employees** | [**Employees**](Employees.md)| Employees with array of Employee object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Employees**](Employees.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_expense_claim_history - -> HistoryRecords create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) - -Allows you to create a history records of an ExpenseClaim - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history records of an ExpenseClaim - result = api_instance.create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_expense_claim_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_expense_claims - -> ExpenseClaims create_expense_claims(xero_tenant_id, expense_claims) - -Allows you to retrieve expense claims - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] } # ExpenseClaims | ExpenseClaims with array of ExpenseClaim object in body of request - -begin - #Allows you to retrieve expense claims - result = api_instance.create_expense_claims(xero_tenant_id, expense_claims) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_expense_claims: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **expense_claims** | [**ExpenseClaims**](ExpenseClaims.md)| ExpenseClaims with array of ExpenseClaim object in body of request | - -### Return type - -[**ExpenseClaims**](ExpenseClaims.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_invoice_attachment_by_file_name - -> Attachments create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts) - -Allows you to create an Attachment on invoices or purchase bills by it's filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -file_name = 'xero-dev.jpg' # String | Name of the file you are attaching -body = 'body_example' # String | Byte array of file in body of request -opts = { - include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice -} - -begin - #Allows you to create an Attachment on invoices or purchase bills by it's filename - result = api_instance.create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_invoice_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **file_name** | **String**| Name of the file you are attaching | - **body** | **String**| Byte array of file in body of request | - **include_online** | **Boolean**| Allows an attachment to be seen by the end customer within their online invoice | [optional] [default to false] - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_invoice_history - -> HistoryRecords create_invoice_history(xero_tenant_id, invoice_id, history_records) - -Allows you to retrieve a history records of an invoice - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an invoice - result = api_instance.create_invoice_history(xero_tenant_id, invoice_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_invoice_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_invoices - -> Invoices create_invoices(xero_tenant_id, invoices, opts) - -Allows you to create one or more sales invoices or purchase bills - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] } # Invoices | Invoices with an array of invoice objects in body of request -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to create one or more sales invoices or purchase bills - result = api_instance.create_invoices(xero_tenant_id, invoices, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_invoices: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoices** | [**Invoices**](Invoices.md)| Invoices with an array of invoice objects in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Invoices**](Invoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_item_history - -> HistoryRecords create_item_history(xero_tenant_id, item_id, history_records) - -Allows you to create a history record for items - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for items - result = api_instance.create_item_history(xero_tenant_id, item_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_item_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **item_id** | [**String**](.md)| Unique identifier for an Item | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_items - -> Items create_items(xero_tenant_id, items, opts) - -Allows you to create one or more items - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] } # Items | Items with an array of Item objects in body of request -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to create one or more items - result = api_instance.create_items(xero_tenant_id, items, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_items: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **items** | [**Items**](Items.md)| Items with an array of Item objects in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Items**](Items.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_linked_transaction - -> LinkedTransactions create_linked_transaction(xero_tenant_id, linked_transaction) - -Allows you to create linked transactions (billable expenses) - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"} # LinkedTransaction | LinkedTransaction object in body of request - -begin - #Allows you to create linked transactions (billable expenses) - result = api_instance.create_linked_transaction(xero_tenant_id, linked_transaction) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_linked_transaction: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **linked_transaction** | [**LinkedTransaction**](LinkedTransaction.md)| LinkedTransaction object in body of request | - -### Return type - -[**LinkedTransactions**](LinkedTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_manual_journal_attachment_by_file_name - -> Attachments create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) - -Allows you to create a specified Attachment on ManualJournal by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create a specified Attachment on ManualJournal by file name - result = api_instance.create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_manual_journal_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | - **file_name** | **String**| The name of the file being attached to a ManualJournal | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_manual_journals - -> ManualJournals create_manual_journals(xero_tenant_id, manual_journals, opts) - -Allows you to create one or more manual journals - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | ManualJournals array with ManualJournal object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create one or more manual journals - result = api_instance.create_manual_journals(xero_tenant_id, manual_journals, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_manual_journals: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journals** | [**ManualJournals**](ManualJournals.md)| ManualJournals array with ManualJournal object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**ManualJournals**](ManualJournals.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_overpayment_allocations - -> Allocations create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts) - -Allows you to create a single allocation for an overpayment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment -allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] } # Allocations | Allocations array with Allocation object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create a single allocation for an overpayment - result = api_instance.create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_overpayment_allocations: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | - **allocations** | [**Allocations**](Allocations.md)| Allocations array with Allocation object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Allocations**](Allocations.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_overpayment_history - -> HistoryRecords create_overpayment_history(xero_tenant_id, overpayment_id, history_records) - -Allows you to create history records of an Overpayment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create history records of an Overpayment - result = api_instance.create_overpayment_history(xero_tenant_id, overpayment_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_overpayment_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_payment - -> Payments create_payment(xero_tenant_id, payment) - -Allows you to create a single payment for invoices or credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } # Payment | Request body with a single Payment object - -begin - #Allows you to create a single payment for invoices or credit notes - result = api_instance.create_payment(xero_tenant_id, payment) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_payment: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **payment** | [**Payment**](Payment.md)| Request body with a single Payment object | - -### Return type - -[**Payments**](Payments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_payment_history - -> HistoryRecords create_payment_history(xero_tenant_id, payment_id, history_records) - -Allows you to create a history record for a payment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for a payment - result = api_instance.create_payment_history(xero_tenant_id, payment_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_payment_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **payment_id** | [**String**](.md)| Unique identifier for a Payment | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_payment_service - -> PaymentServices create_payment_service(xero_tenant_id, payment_services) - -Allows you to create payment services - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_services = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] } # PaymentServices | PaymentServices array with PaymentService object in body of request - -begin - #Allows you to create payment services - result = api_instance.create_payment_service(xero_tenant_id, payment_services) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_payment_service: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **payment_services** | [**PaymentServices**](PaymentServices.md)| PaymentServices array with PaymentService object in body of request | - -### Return type - -[**PaymentServices**](PaymentServices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_payments - -> Payments create_payments(xero_tenant_id, payments, opts) - -Allows you to create multiple payments for invoices or credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] } # Payments | Payments array with Payment object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create multiple payments for invoices or credit notes - result = api_instance.create_payments(xero_tenant_id, payments, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_payments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **payments** | [**Payments**](Payments.md)| Payments array with Payment object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Payments**](Payments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_prepayment_allocations - -> Allocations create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts) - -Allows you to create an Allocation for prepayments - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Prepayment -allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] } # Allocations | Allocations with an array of Allocation object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create an Allocation for prepayments - result = api_instance.create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_prepayment_allocations: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **prepayment_id** | [**String**](.md)| Unique identifier for Prepayment | - **allocations** | [**Allocations**](Allocations.md)| Allocations with an array of Allocation object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Allocations**](Allocations.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_prepayment_history - -> HistoryRecords create_prepayment_history(xero_tenant_id, prepayment_id, history_records) - -Allows you to create a history record for an Prepayment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for an Prepayment - result = api_instance.create_prepayment_history(xero_tenant_id, prepayment_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_prepayment_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **prepayment_id** | [**String**](.md)| Unique identifier for a PrePayment | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_purchase_order_history - -> HistoryRecords create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) - -Allows you to create HistoryRecord for purchase orders - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create HistoryRecord for purchase orders - result = api_instance.create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_purchase_order_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_purchase_orders - -> PurchaseOrders create_purchase_orders(xero_tenant_id, purchase_orders, opts) - -Allows you to create one or more purchase orders - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_orders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | PurchaseOrders with an array of PurchaseOrder object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create one or more purchase orders - result = api_instance.create_purchase_orders(xero_tenant_id, purchase_orders, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_purchase_orders: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| PurchaseOrders with an array of PurchaseOrder object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**PurchaseOrders**](PurchaseOrders.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_quote_attachment_by_file_name - -> Attachments create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) - -Allows you to create Attachment on Quote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object -file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create Attachment on Quote - result = api_instance.create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_quote_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for Quote object | - **file_name** | **String**| Name of the attachment | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_quote_history - -> HistoryRecords create_quote_history(xero_tenant_id, quote_id, history_records) - -Allows you to retrieve a history records of an quote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an quote - result = api_instance.create_quote_history(xero_tenant_id, quote_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_quote_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for an Quote | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_quotes - -> Quotes create_quotes(xero_tenant_id, quotes, opts) - -Allows you to create one or more quotes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | Quotes with an array of Quote object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create one or more quotes - result = api_instance.create_quotes(xero_tenant_id, quotes, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_quotes: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quotes** | [**Quotes**](Quotes.md)| Quotes with an array of Quote object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Quotes**](Quotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_receipt - -> Receipts create_receipt(xero_tenant_id, receipts, opts) - -Allows you to create draft expense claim receipts for any user - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] } # Receipts | Receipts with an array of Receipt object in body of request -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to create draft expense claim receipts for any user - result = api_instance.create_receipt(xero_tenant_id, receipts, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_receipt: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipts** | [**Receipts**](Receipts.md)| Receipts with an array of Receipt object in body of request | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Receipts**](Receipts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_receipt_attachment_by_file_name - -> Attachments create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) - -Allows you to create Attachment on expense claim receipts by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create Attachment on expense claim receipts by file name - result = api_instance.create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_receipt_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - **file_name** | **String**| The name of the file being attached to the Receipt | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_receipt_history - -> HistoryRecords create_receipt_history(xero_tenant_id, receipt_id, history_records) - -Allows you to retrieve a history records of an Receipt - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an Receipt - result = api_instance.create_receipt_history(xero_tenant_id, receipt_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_receipt_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_repeating_invoice_attachment_by_file_name - -> Attachments create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) - -Allows you to create attachment on repeating invoices by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create attachment on repeating invoices by file name - result = api_instance.create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_repeating_invoice_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - **file_name** | **String**| The name of the file being attached to a Repeating Invoice | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## create_repeating_invoice_history - -> HistoryRecords create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) - -Allows you to create history for a repeating invoice - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create history for a repeating invoice - result = api_instance.create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_repeating_invoice_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_tax_rates - -> TaxRates create_tax_rates(xero_tenant_id, tax_rates) - -Allows you to create one or more Tax Rates - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tax_rates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] } # TaxRates | TaxRates array with TaxRate object in body of request - -begin - #Allows you to create one or more Tax Rates - result = api_instance.create_tax_rates(xero_tenant_id, tax_rates) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_tax_rates: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tax_rates** | [**TaxRates**](TaxRates.md)| TaxRates array with TaxRate object in body of request | - -### Return type - -[**TaxRates**](TaxRates.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_tracking_category - -> TrackingCategories create_tracking_category(xero_tenant_id, tracking_category) - -Allows you to create tracking categories - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category = { name:"FooBar" } # TrackingCategory | TrackingCategory object in body of request - -begin - #Allows you to create tracking categories - result = api_instance.create_tracking_category(xero_tenant_id, tracking_category) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_tracking_category: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tracking_category** | [**TrackingCategory**](TrackingCategory.md)| TrackingCategory object in body of request | - -### Return type - -[**TrackingCategories**](TrackingCategories.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_tracking_options - -> TrackingOptions create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option) - -Allows you to create options for a specified tracking category - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_option = { name:"Bar" } # TrackingOption | TrackingOption object in body of request - -begin - #Allows you to create options for a specified tracking category - result = api_instance.create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->create_tracking_options: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | - **tracking_option** | [**TrackingOption**](TrackingOption.md)| TrackingOption object in body of request | - -### Return type - -[**TrackingOptions**](TrackingOptions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## delete_account - -> Accounts delete_account(xero_tenant_id, account_id) - -Allows you to delete a chart of accounts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object - -begin - #Allows you to delete a chart of accounts - result = api_instance.delete_account(xero_tenant_id, account_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_account: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for retrieving single object | - -### Return type - -[**Accounts**](Accounts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## delete_contact_group_contact - -> delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) - -Allows you to delete a specific Contact from a Contact Group - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to delete a specific Contact from a Contact Group - api_instance.delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_contact_group_contact: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - -### Return type - -nil (empty response body) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## delete_contact_group_contacts - -> delete_contact_group_contacts(xero_tenant_id, contact_group_id) - -Allows you to delete all Contacts from a Contact Group - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group - -begin - #Allows you to delete all Contacts from a Contact Group - api_instance.delete_contact_group_contacts(xero_tenant_id, contact_group_id) -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_contact_group_contacts: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | - -### Return type - -nil (empty response body) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: Not defined - - -## delete_item - -> delete_item(xero_tenant_id, item_id) - -Allows you to delete a specified item - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item - -begin - #Allows you to delete a specified item - api_instance.delete_item(xero_tenant_id, item_id) -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_item: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **item_id** | [**String**](.md)| Unique identifier for an Item | - -### Return type - -nil (empty response body) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## delete_linked_transaction - -> delete_linked_transaction(xero_tenant_id, linked_transaction_id) - -Allows you to delete a specified linked transactions (billable expenses) - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction - -begin - #Allows you to delete a specified linked transactions (billable expenses) - api_instance.delete_linked_transaction(xero_tenant_id, linked_transaction_id) -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_linked_transaction: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **linked_transaction_id** | [**String**](.md)| Unique identifier for a LinkedTransaction | - -### Return type - -nil (empty response body) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## delete_payment - -> Payments delete_payment(xero_tenant_id, payment_id, payment_delete) - -Allows you to update a specified payment for invoices and credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -payment_delete = { status:"DELETED" } # PaymentDelete | - -begin - #Allows you to update a specified payment for invoices and credit notes - result = api_instance.delete_payment(xero_tenant_id, payment_id, payment_delete) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_payment: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **payment_id** | [**String**](.md)| Unique identifier for a Payment | - **payment_delete** | [**PaymentDelete**](PaymentDelete.md)| | - -### Return type - -[**Payments**](Payments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## delete_tracking_category - -> TrackingCategories delete_tracking_category(xero_tenant_id, tracking_category_id) - -Allows you to delete tracking categories - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory - -begin - #Allows you to delete tracking categories - result = api_instance.delete_tracking_category(xero_tenant_id, tracking_category_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_tracking_category: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | - -### Return type - -[**TrackingCategories**](TrackingCategories.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## delete_tracking_options - -> TrackingOptions delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id) - -Allows you to delete a specified option for a specified tracking category - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option - -begin - #Allows you to delete a specified option for a specified tracking category - result = api_instance.delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->delete_tracking_options: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | - **tracking_option_id** | [**String**](.md)| Unique identifier for a Tracking Option | - -### Return type - -[**TrackingOptions**](TrackingOptions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## email_invoice - -> email_invoice(xero_tenant_id, invoice_id, request_empty) - -Allows you to email a copy of invoice to related Contact - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -request_empty = {} # RequestEmpty | - -begin - #Allows you to email a copy of invoice to related Contact - api_instance.email_invoice(xero_tenant_id, invoice_id, request_empty) -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->email_invoice: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **request_empty** | [**RequestEmpty**](RequestEmpty.md)| | - -### Return type - -nil (empty response body) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## get_account - -> Accounts get_account(xero_tenant_id, account_id) - -Allows you to retrieve a single chart of accounts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object - -begin - #Allows you to retrieve a single chart of accounts - result = api_instance.get_account(xero_tenant_id, account_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_account: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for retrieving single object | - -### Return type - -[**Accounts**](Accounts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_account_attachment_by_file_name - -> File get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type) - -Allows you to retrieve Attachment on Account by Filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object -file_name = 'xero-dev.jpg' # String | Name of the attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachment on Account by Filename - result = api_instance.get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_account_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for Account object | - **file_name** | **String**| Name of the attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_account_attachment_by_id - -> File get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type) - -Allows you to retrieve specific Attachment on Account - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specific Attachment on Account - result = api_instance.get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_account_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for Account object | - **attachment_id** | [**String**](.md)| Unique identifier for Attachment object | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_account_attachments - -> Attachments get_account_attachments(xero_tenant_id, account_id) - -Allows you to retrieve Attachments for accounts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object - -begin - #Allows you to retrieve Attachments for accounts - result = api_instance.get_account_attachments(xero_tenant_id, account_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_account_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for Account object | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_accounts - -> Accounts get_accounts(xero_tenant_id, opts) - -Allows you to retrieve the full chart of accounts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Account.StatusEnum.ACTIVE + '\" AND Type==\"' + Account.BankAccountTypeEnum.BANK + '\"', # String | Filter by an any element - order: 'Name ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve the full chart of accounts - result = api_instance.get_accounts(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_accounts: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**Accounts**](Accounts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transaction - -> BankTransactions get_bank_transaction(xero_tenant_id, bank_transaction_id, opts) - -Allows you to retrieve a single spend or receive money transaction - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve a single spend or receive money transaction - result = api_instance.get_bank_transaction(xero_tenant_id, bank_transaction_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transaction: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**BankTransactions**](BankTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transaction_attachment_by_file_name - -> File get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type) - -Allows you to retrieve Attachments on BankTransaction by Filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -file_name = 'xero-dev.jpg' # String | The name of the file being attached -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on BankTransaction by Filename - result = api_instance.get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - **file_name** | **String**| The name of the file being attached | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_bank_transaction_attachment_by_id - -> File get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type) - -Allows you to retrieve Attachments on a specific BankTransaction - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on a specific BankTransaction - result = api_instance.get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - **attachment_id** | [**String**](.md)| Xero generated unique identifier for an attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_bank_transaction_attachments - -> Attachments get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id) - -Allows you to retrieve any attachments to bank transactions - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction - -begin - #Allows you to retrieve any attachments to bank transactions - result = api_instance.get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transaction_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transactions - -> BankTransactions get_bank_transactions(xero_tenant_id, opts) - -Allows you to retrieve any spend or receive money transactions - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + BankTransaction.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Type ASC', # String | Order by an any element - page: 1, # Integer | Up to 100 bank transactions will be returned in a single API call with line items details - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve any spend or receive money transactions - result = api_instance.get_bank_transactions(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transactions: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **page** | **Integer**| Up to 100 bank transactions will be returned in a single API call with line items details | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**BankTransactions**](BankTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transactions_history - -> HistoryRecords get_bank_transactions_history(xero_tenant_id, bank_transaction_id) - -Allows you to retrieve history from a bank transactions - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction - -begin - #Allows you to retrieve history from a bank transactions - result = api_instance.get_bank_transactions_history(xero_tenant_id, bank_transaction_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transactions_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transfer - -> BankTransfers get_bank_transfer(xero_tenant_id, bank_transfer_id) - -Allows you to retrieve any bank transfers - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer - -begin - #Allows you to retrieve any bank transfers - result = api_instance.get_bank_transfer(xero_tenant_id, bank_transfer_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transfer: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - -### Return type - -[**BankTransfers**](BankTransfers.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transfer_attachment_by_file_name - -> File get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type) - -Allows you to retrieve Attachments on BankTransfer by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on BankTransfer by file name - result = api_instance.get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - **file_name** | **String**| The name of the file being attached to a Bank Transfer | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_bank_transfer_attachment_by_id - -> File get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type) - -Allows you to retrieve Attachments on BankTransfer - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an Attachment to a bank transfer -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on BankTransfer - result = api_instance.get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - **attachment_id** | [**String**](.md)| Xero generated unique identifier for an Attachment to a bank transfer | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_bank_transfer_attachments - -> Attachments get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id) - -Allows you to retrieve Attachments from bank transfers - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer - -begin - #Allows you to retrieve Attachments from bank transfers - result = api_instance.get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transfer_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transfer_history - -> HistoryRecords get_bank_transfer_history(xero_tenant_id, bank_transfer_id) - -Allows you to retrieve history from a bank transfers - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer - -begin - #Allows you to retrieve history from a bank transfers - result = api_instance.get_bank_transfer_history(xero_tenant_id, bank_transfer_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transfer_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_bank_transfers - -> BankTransfers get_bank_transfers(xero_tenant_id, opts) - -Allows you to retrieve all bank transfers - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + BankTransfer.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Amount ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve all bank transfers - result = api_instance.get_bank_transfers(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_bank_transfers: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**BankTransfers**](BankTransfers.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_batch_payment_history - -> HistoryRecords get_batch_payment_history(xero_tenant_id, batch_payment_id) - -Allows you to retrieve history from a Batch Payment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment - -begin - #Allows you to retrieve history from a Batch Payment - result = api_instance.get_batch_payment_history(xero_tenant_id, batch_payment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_batch_payment_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **batch_payment_id** | [**String**](.md)| Unique identifier for BatchPayment | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_batch_payments - -> BatchPayments get_batch_payments(xero_tenant_id, opts) - -Retrieve either one or many BatchPayments for invoices - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + BatchPayment.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Date ASC' # String | Order by an any element -} - -begin - #Retrieve either one or many BatchPayments for invoices - result = api_instance.get_batch_payments(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_batch_payments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**BatchPayments**](BatchPayments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_branding_theme - -> BrandingThemes get_branding_theme(xero_tenant_id, branding_theme_id) - -Allows you to retrieve a specific BrandingThemes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme - -begin - #Allows you to retrieve a specific BrandingThemes - result = api_instance.get_branding_theme(xero_tenant_id, branding_theme_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_branding_theme: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **branding_theme_id** | [**String**](.md)| Unique identifier for a Branding Theme | - -### Return type - -[**BrandingThemes**](BrandingThemes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_branding_theme_payment_services - -> PaymentServices get_branding_theme_payment_services(xero_tenant_id, branding_theme_id) - -Allows you to retrieve the Payment services for a Branding Theme - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme - -begin - #Allows you to retrieve the Payment services for a Branding Theme - result = api_instance.get_branding_theme_payment_services(xero_tenant_id, branding_theme_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_branding_theme_payment_services: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **branding_theme_id** | [**String**](.md)| Unique identifier for a Branding Theme | - -### Return type - -[**PaymentServices**](PaymentServices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_branding_themes - -> BrandingThemes get_branding_themes(xero_tenant_id) - -Allows you to retrieve all the BrandingThemes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve all the BrandingThemes - result = api_instance.get_branding_themes(xero_tenant_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_branding_themes: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - -### Return type - -[**BrandingThemes**](BrandingThemes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_contact - -> Contacts get_contact(xero_tenant_id, contact_id) - -Allows you to retrieve a single contacts in a Xero organisation - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve a single contacts in a Xero organisation - result = api_instance.get_contact(xero_tenant_id, contact_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - -### Return type - -[**Contacts**](Contacts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_contact_attachment_by_file_name - -> File get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type) - -Allows you to retrieve Attachments on Contacts by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on Contacts by file name - result = api_instance.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **file_name** | **String**| Name for the file you are attaching | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_contact_attachment_by_id - -> File get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type) - -Allows you to retrieve Attachments on Contacts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on Contacts - result = api_instance.get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_contact_attachments - -> Attachments get_contact_attachments(xero_tenant_id, contact_id) - -Allows you to retrieve, add and update contacts in a Xero organisation - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve, add and update contacts in a Xero organisation - result = api_instance.get_contact_attachments(xero_tenant_id, contact_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_contact_cis_settings - -> CISSettings get_contact_cis_settings(xero_tenant_id, contact_id) - -Allows you to retrieve CISSettings for a contact in a Xero organisation - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve CISSettings for a contact in a Xero organisation - result = api_instance.get_contact_cis_settings(xero_tenant_id, contact_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact_cis_settings: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - -### Return type - -[**CISSettings**](CISSettings.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_contact_group - -> ContactGroups get_contact_group(xero_tenant_id, contact_group_id) - -Allows you to retrieve a unique Contact Group by ID - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group - -begin - #Allows you to retrieve a unique Contact Group by ID - result = api_instance.get_contact_group(xero_tenant_id, contact_group_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact_group: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | - -### Return type - -[**ContactGroups**](ContactGroups.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_contact_groups - -> ContactGroups get_contact_groups(xero_tenant_id, opts) - -Allows you to retrieve the ContactID and Name of all the contacts in a contact group - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - where: 'Status==\"' + ContactGroup.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Name ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve the ContactID and Name of all the contacts in a contact group - result = api_instance.get_contact_groups(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact_groups: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**ContactGroups**](ContactGroups.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_contact_history - -> HistoryRecords get_contact_history(xero_tenant_id, contact_id) - -Allows you to retrieve a history records of an Contact - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve a history records of an Contact - result = api_instance.get_contact_history(xero_tenant_id, contact_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contact_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_contacts - -> Contacts get_contacts(xero_tenant_id, opts) - -Allows you to retrieve all contacts in a Xero organisation - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Contact.ContactStatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Name ASC', # String | Order by an any element - i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. - page: 1, # Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call. - include_archived: true # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response -} - -begin - #Allows you to retrieve all contacts in a Xero organisation - result = api_instance.get_contacts(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_contacts: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **i_ds** | [**Array<String>**](String.md)| Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. | [optional] - **page** | **Integer**| e.g. page=1 - Up to 100 contacts will be returned in a single API call. | [optional] - **include_archived** | **Boolean**| e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response | [optional] - -### Return type - -[**Contacts**](Contacts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_credit_note - -> CreditNotes get_credit_note(xero_tenant_id, credit_note_id, opts) - -Allows you to retrieve a specific credit note - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve a specific credit note - result = api_instance.get_credit_note(xero_tenant_id, credit_note_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_credit_note: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**CreditNotes**](CreditNotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_credit_note_as_pdf - -> File get_credit_note_as_pdf(xero_tenant_id, credit_note_id) - -Allows you to retrieve Credit Note as PDF files - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note - -begin - #Allows you to retrieve Credit Note as PDF files - result = api_instance.get_credit_note_as_pdf(xero_tenant_id, credit_note_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_credit_note_as_pdf: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/pdf - - -## get_credit_note_attachment_by_file_name - -> File get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type) - -Allows you to retrieve Attachments on CreditNote by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on CreditNote by file name - result = api_instance.get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_credit_note_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **file_name** | **String**| Name of the file you are attaching to Credit Note | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_credit_note_attachment_by_id - -> File get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type) - -Allows you to retrieve Attachments on CreditNote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on CreditNote - result = api_instance.get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_credit_note_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_credit_note_attachments - -> Attachments get_credit_note_attachments(xero_tenant_id, credit_note_id) - -Allows you to retrieve Attachments for credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note - -begin - #Allows you to retrieve Attachments for credit notes - result = api_instance.get_credit_note_attachments(xero_tenant_id, credit_note_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_credit_note_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_credit_note_history - -> HistoryRecords get_credit_note_history(xero_tenant_id, credit_note_id) - -Allows you to retrieve a history records of an CreditNote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note - -begin - #Allows you to retrieve a history records of an CreditNote - result = api_instance.get_credit_note_history(xero_tenant_id, credit_note_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_credit_note_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_credit_notes - -> CreditNotes get_credit_notes(xero_tenant_id, opts) - -Allows you to retrieve any credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + CreditNote.StatusEnum.DRAFT + '\"', # String | Filter by an any element - order: 'CreditNoteNumber ASC', # String | Order by an any element - page: 1, # Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve any credit notes - result = api_instance.get_credit_notes(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_credit_notes: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **page** | **Integer**| e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**CreditNotes**](CreditNotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_currencies - -> Currencies get_currencies(xero_tenant_id, opts) - -Allows you to retrieve currencies for your organisation - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - where: 'Status==\"' + Currency.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Code ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve currencies for your organisation - result = api_instance.get_currencies(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_currencies: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**Currencies**](Currencies.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_employee - -> Employees get_employee(xero_tenant_id, employee_id) - -Allows you to retrieve a specific employee used in Xero payrun - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -employee_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Employee - -begin - #Allows you to retrieve a specific employee used in Xero payrun - result = api_instance.get_employee(xero_tenant_id, employee_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_employee: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **employee_id** | [**String**](.md)| Unique identifier for a Employee | - -### Return type - -[**Employees**](Employees.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_employees - -> Employees get_employees(xero_tenant_id, opts) - -Allows you to retrieve employees used in Xero payrun - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Employee.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve employees used in Xero payrun - result = api_instance.get_employees(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_employees: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**Employees**](Employees.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_expense_claim - -> ExpenseClaims get_expense_claim(xero_tenant_id, expense_claim_id) - -Allows you to retrieve a specified expense claim - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim - -begin - #Allows you to retrieve a specified expense claim - result = api_instance.get_expense_claim(xero_tenant_id, expense_claim_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_expense_claim: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | - -### Return type - -[**ExpenseClaims**](ExpenseClaims.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_expense_claim_history - -> HistoryRecords get_expense_claim_history(xero_tenant_id, expense_claim_id) - -Allows you to retrieve a history records of an ExpenseClaim - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim - -begin - #Allows you to retrieve a history records of an ExpenseClaim - result = api_instance.get_expense_claim_history(xero_tenant_id, expense_claim_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_expense_claim_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_expense_claims - -> ExpenseClaims get_expense_claims(xero_tenant_id, opts) - -Allows you to retrieve expense claims - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + ExpenseClaim.StatusEnum.SUBMITTED + '\"', # String | Filter by an any element - order: 'Status ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve expense claims - result = api_instance.get_expense_claims(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_expense_claims: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**ExpenseClaims**](ExpenseClaims.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_invoice - -> Invoices get_invoice(xero_tenant_id, invoice_id, opts) - -Allows you to retrieve a specified sales invoice or purchase bill - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve a specified sales invoice or purchase bill - result = api_instance.get_invoice(xero_tenant_id, invoice_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoice: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Invoices**](Invoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_invoice_as_pdf - -> File get_invoice_as_pdf(xero_tenant_id, invoice_id) - -Allows you to retrieve invoices or purchase bills as PDF files - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve invoices or purchase bills as PDF files - result = api_instance.get_invoice_as_pdf(xero_tenant_id, invoice_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoice_as_pdf: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/pdf - - -## get_invoice_attachment_by_file_name - -> File get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type) - -Allows you to retrieve Attachment on invoices or purchase bills by it's filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -file_name = 'xero-dev.jpg' # String | Name of the file you are attaching -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachment on invoices or purchase bills by it's filename - result = api_instance.get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoice_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **file_name** | **String**| Name of the file you are attaching | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_invoice_attachment_by_id - -> File get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type) - -Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID - result = api_instance.get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoice_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **attachment_id** | [**String**](.md)| Unique identifier for an Attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_invoice_attachments - -> Attachments get_invoice_attachments(xero_tenant_id, invoice_id) - -Allows you to retrieve Attachments on invoices or purchase bills - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve Attachments on invoices or purchase bills - result = api_instance.get_invoice_attachments(xero_tenant_id, invoice_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoice_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_invoice_history - -> HistoryRecords get_invoice_history(xero_tenant_id, invoice_id) - -Allows you to retrieve a history records of an invoice - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve a history records of an invoice - result = api_instance.get_invoice_history(xero_tenant_id, invoice_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoice_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_invoice_reminders - -> InvoiceReminders get_invoice_reminders(xero_tenant_id) - -Allows you to retrieve invoice reminder settings - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve invoice reminder settings - result = api_instance.get_invoice_reminders(xero_tenant_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoice_reminders: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - -### Return type - -[**InvoiceReminders**](InvoiceReminders.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_invoices - -> Invoices get_invoices(xero_tenant_id, opts) - -Allows you to retrieve any sales invoices or purchase bills - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Invoice.StatusEnum.DRAFT + '\"', # String | Filter by an any element - order: 'InvoiceNumber ASC', # String | Order by an any element - i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma-separated list of InvoicesIDs. - invoice_numbers: ['null'], # Array | Filter by a comma-separated list of InvoiceNumbers. - contact_i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma-separated list of ContactIDs. - statuses: ['null'], # Array | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. - page: 1, # Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice - include_archived: true, # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - created_by_my_app: false, # Boolean | When set to true you'll only retrieve Invoices created by your app - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve any sales invoices or purchase bills - result = api_instance.get_invoices(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_invoices: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **i_ds** | [**Array<String>**](String.md)| Filter by a comma-separated list of InvoicesIDs. | [optional] - **invoice_numbers** | [**Array<String>**](String.md)| Filter by a comma-separated list of InvoiceNumbers. | [optional] - **contact_i_ds** | [**Array<String>**](String.md)| Filter by a comma-separated list of ContactIDs. | [optional] - **statuses** | [**Array<String>**](String.md)| Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. | [optional] - **page** | **Integer**| e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice | [optional] - **include_archived** | **Boolean**| e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response | [optional] - **created_by_my_app** | **Boolean**| When set to true you'll only retrieve Invoices created by your app | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Invoices**](Invoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_item - -> Items get_item(xero_tenant_id, item_id, opts) - -Allows you to retrieve a specified item - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve a specified item - result = api_instance.get_item(xero_tenant_id, item_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_item: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **item_id** | [**String**](.md)| Unique identifier for an Item | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Items**](Items.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_item_history - -> HistoryRecords get_item_history(xero_tenant_id, item_id) - -Allows you to retrieve history for items - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item - -begin - #Allows you to retrieve history for items - result = api_instance.get_item_history(xero_tenant_id, item_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_item_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **item_id** | [**String**](.md)| Unique identifier for an Item | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_items - -> Items get_items(xero_tenant_id, opts) - -Allows you to retrieve any items - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'IsSold==true', # String | Filter by an any element - order: 'Code ASC', # String | Order by an any element - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve any items - result = api_instance.get_items(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_items: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Items**](Items.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_journal - -> Journals get_journal(xero_tenant_id, journal_id) - -Allows you to retrieve a specified journals. - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Journal - -begin - #Allows you to retrieve a specified journals. - result = api_instance.get_journal(xero_tenant_id, journal_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_journal: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **journal_id** | [**String**](.md)| Unique identifier for a Journal | - -### Return type - -[**Journals**](Journals.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_journals - -> Journals get_journals(xero_tenant_id, opts) - -Allows you to retrieve any journals. - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - offset: 10, # Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned - payments_only: true # Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. -} - -begin - #Allows you to retrieve any journals. - result = api_instance.get_journals(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_journals: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **offset** | **Integer**| Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned | [optional] - **payments_only** | **Boolean**| Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. | [optional] - -### Return type - -[**Journals**](Journals.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_linked_transaction - -> LinkedTransactions get_linked_transaction(xero_tenant_id, linked_transaction_id) - -Allows you to retrieve a specified linked transactions (billable expenses) - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction - -begin - #Allows you to retrieve a specified linked transactions (billable expenses) - result = api_instance.get_linked_transaction(xero_tenant_id, linked_transaction_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_linked_transaction: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **linked_transaction_id** | [**String**](.md)| Unique identifier for a LinkedTransaction | - -### Return type - -[**LinkedTransactions**](LinkedTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_linked_transactions - -> LinkedTransactions get_linked_transactions(xero_tenant_id, opts) - -Retrieve linked transactions (billable expenses) - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - page: 1, # Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. - linked_transaction_id: '00000000-0000-0000-000-000000000000', # String | The Xero identifier for an Linked Transaction - source_transaction_id: '00000000-0000-0000-000-000000000000', # String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice - contact_id: '00000000-0000-0000-000-000000000000', # String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. - status: 'APPROVED', # String | Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status - target_transaction_id: '00000000-0000-0000-000-000000000000' # String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice -} - -begin - #Retrieve linked transactions (billable expenses) - result = api_instance.get_linked_transactions(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_linked_transactions: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **page** | **Integer**| Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. | [optional] - **linked_transaction_id** | **String**| The Xero identifier for an Linked Transaction | [optional] - **source_transaction_id** | **String**| Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice | [optional] - **contact_id** | **String**| Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. | [optional] - **status** | **String**| Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status | [optional] - **target_transaction_id** | **String**| Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice | [optional] - -### Return type - -[**LinkedTransactions**](LinkedTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_manual_journal - -> ManualJournals get_manual_journal(xero_tenant_id, manual_journal_id) - -Allows you to retrieve a specified manual journals - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal - -begin - #Allows you to retrieve a specified manual journals - result = api_instance.get_manual_journal(xero_tenant_id, manual_journal_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_manual_journal: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | - -### Return type - -[**ManualJournals**](ManualJournals.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_manual_journal_attachment_by_file_name - -> File get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type) - -Allows you to retrieve specified Attachment on ManualJournal by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specified Attachment on ManualJournal by file name - result = api_instance.get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | - **file_name** | **String**| The name of the file being attached to a ManualJournal | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_manual_journal_attachment_by_id - -> File get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type) - -Allows you to retrieve specified Attachment on ManualJournals - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specified Attachment on ManualJournals - result = api_instance.get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | - **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_manual_journal_attachments - -> Attachments get_manual_journal_attachments(xero_tenant_id, manual_journal_id) - -Allows you to retrieve Attachment for manual journals - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal - -begin - #Allows you to retrieve Attachment for manual journals - result = api_instance.get_manual_journal_attachments(xero_tenant_id, manual_journal_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_manual_journal_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_manual_journals - -> ManualJournals get_manual_journals(xero_tenant_id, opts) - -Allows you to retrieve any manual journals - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + ManualJournal.StatusEnum.DRAFT + '\"', # String | Filter by an any element - order: 'Date ASC', # String | Order by an any element - page: 1 # Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment -} - -begin - #Allows you to retrieve any manual journals - result = api_instance.get_manual_journals(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_manual_journals: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **page** | **Integer**| e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment | [optional] - -### Return type - -[**ManualJournals**](ManualJournals.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_online_invoice - -> OnlineInvoices get_online_invoice(xero_tenant_id, invoice_id) - -Allows you to retrieve a URL to an online invoice - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve a URL to an online invoice - result = api_instance.get_online_invoice(xero_tenant_id, invoice_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_online_invoice: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - -### Return type - -[**OnlineInvoices**](OnlineInvoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_organisation_cis_settings - -> CISOrgSetting get_organisation_cis_settings(xero_tenant_id, organisation_id) - -Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -organisation_id = '00000000-0000-0000-000-000000000000' # String | The unique Xero identifier for an organisation - -begin - #Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. - result = api_instance.get_organisation_cis_settings(xero_tenant_id, organisation_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_organisation_cis_settings: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **organisation_id** | [**String**](.md)| The unique Xero identifier for an organisation | - -### Return type - -[**CISOrgSetting**](CISOrgSetting.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_organisations - -> Organisations get_organisations(xero_tenant_id) - -Allows you to retrieve Organisation details - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve Organisation details - result = api_instance.get_organisations(xero_tenant_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_organisations: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - -### Return type - -[**Organisations**](Organisations.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_overpayment - -> Overpayments get_overpayment(xero_tenant_id, overpayment_id) - -Allows you to retrieve a specified overpayments - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment - -begin - #Allows you to retrieve a specified overpayments - result = api_instance.get_overpayment(xero_tenant_id, overpayment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_overpayment: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | - -### Return type - -[**Overpayments**](Overpayments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_overpayment_history - -> HistoryRecords get_overpayment_history(xero_tenant_id, overpayment_id) - -Allows you to retrieve a history records of an Overpayment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment - -begin - #Allows you to retrieve a history records of an Overpayment - result = api_instance.get_overpayment_history(xero_tenant_id, overpayment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_overpayment_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_overpayments - -> Overpayments get_overpayments(xero_tenant_id, opts) - -Allows you to retrieve overpayments - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Overpayment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element - order: 'RemainingCredit ASC', # String | Order by an any element - page: 1, # Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve overpayments - result = api_instance.get_overpayments(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_overpayments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **page** | **Integer**| e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Overpayments**](Overpayments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_payment - -> Payments get_payment(xero_tenant_id, payment_id) - -Allows you to retrieve a specified payment for invoices and credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment - -begin - #Allows you to retrieve a specified payment for invoices and credit notes - result = api_instance.get_payment(xero_tenant_id, payment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_payment: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **payment_id** | [**String**](.md)| Unique identifier for a Payment | - -### Return type - -[**Payments**](Payments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_payment_history - -> HistoryRecords get_payment_history(xero_tenant_id, payment_id) - -Allows you to retrieve history records of a payment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment - -begin - #Allows you to retrieve history records of a payment - result = api_instance.get_payment_history(xero_tenant_id, payment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_payment_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **payment_id** | [**String**](.md)| Unique identifier for a Payment | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_payment_services - -> PaymentServices get_payment_services(xero_tenant_id) - -Allows you to retrieve payment services - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve payment services - result = api_instance.get_payment_services(xero_tenant_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_payment_services: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - -### Return type - -[**PaymentServices**](PaymentServices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_payments - -> Payments get_payments(xero_tenant_id, opts) - -Allows you to retrieve payments for invoices and credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Payment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element - order: 'Amount ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve payments for invoices and credit notes - result = api_instance.get_payments(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_payments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**Payments**](Payments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_prepayment - -> Prepayments get_prepayment(xero_tenant_id, prepayment_id) - -Allows you to retrieve a specified prepayments - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment - -begin - #Allows you to retrieve a specified prepayments - result = api_instance.get_prepayment(xero_tenant_id, prepayment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_prepayment: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **prepayment_id** | [**String**](.md)| Unique identifier for a PrePayment | - -### Return type - -[**Prepayments**](Prepayments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_prepayment_as_pdf - -> File get_prepayment_as_pdf(xero_tenant_id, prepayment_id) - -Allows you to retrieve prepayments as PDF files - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment - -begin - #Allows you to retrieve prepayments as PDF files - result = api_instance.get_prepayment_as_pdf(xero_tenant_id, prepayment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_prepayment_as_pdf: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **prepayment_id** | [**String**](.md)| Unique identifier for a PrePayment | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/pdf - - -## get_prepayment_history - -> HistoryRecords get_prepayment_history(xero_tenant_id, prepayment_id) - -Allows you to retrieve a history records of an Prepayment - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment - -begin - #Allows you to retrieve a history records of an Prepayment - result = api_instance.get_prepayment_history(xero_tenant_id, prepayment_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_prepayment_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **prepayment_id** | [**String**](.md)| Unique identifier for a PrePayment | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_prepayments - -> Prepayments get_prepayments(xero_tenant_id, opts) - -Allows you to retrieve prepayments - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Prepayment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element - order: 'Reference ASC', # String | Order by an any element - page: 1, # Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve prepayments - result = api_instance.get_prepayments(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_prepayments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **page** | **Integer**| e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Prepayments**](Prepayments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_purchase_order - -> PurchaseOrders get_purchase_order(xero_tenant_id, purchase_order_id) - -Allows you to retrieve a specified purchase orders - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder - -begin - #Allows you to retrieve a specified purchase orders - result = api_instance.get_purchase_order(xero_tenant_id, purchase_order_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_purchase_order: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | - -### Return type - -[**PurchaseOrders**](PurchaseOrders.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_purchase_order_as_pdf - -> File get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) - -Allows you to retrieve purchase orders as PDF files - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Order - -begin - #Allows you to retrieve purchase orders as PDF files - result = api_instance.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_purchase_order_as_pdf: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_id** | [**String**](.md)| Unique identifier for an Purchase Order | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/pdf - - -## get_purchase_order_by_number - -> PurchaseOrders get_purchase_order_by_number(xero_tenant_id, purchase_order_number) - -Allows you to retrieve a specified purchase orders - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_number = 'PO1234' # String | Unique identifier for a PurchaseOrder - -begin - #Allows you to retrieve a specified purchase orders - result = api_instance.get_purchase_order_by_number(xero_tenant_id, purchase_order_number) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_purchase_order_by_number: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_number** | **String**| Unique identifier for a PurchaseOrder | - -### Return type - -[**PurchaseOrders**](PurchaseOrders.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_purchase_order_history - -> HistoryRecords get_purchase_order_history(xero_tenant_id, purchase_order_id) - -Allows you to retrieve history for PurchaseOrder - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder - -begin - #Allows you to retrieve history for PurchaseOrder - result = api_instance.get_purchase_order_history(xero_tenant_id, purchase_order_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_purchase_order_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_purchase_orders - -> PurchaseOrders get_purchase_orders(xero_tenant_id, opts) - -Allows you to retrieve purchase orders - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - status: 'SUBMITTED', # String | Filter by purchase order status - date_from: '2019-12-01', # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - date_to: '2019-12-31', # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - order: 'PurchaseOrderNumber ASC', # String | Order by an any element - page: 1 # Integer | To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. -} - -begin - #Allows you to retrieve purchase orders - result = api_instance.get_purchase_orders(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_purchase_orders: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **status** | **String**| Filter by purchase order status | [optional] - **date_from** | **String**| Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 | [optional] - **date_to** | **String**| Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 | [optional] - **order** | **String**| Order by an any element | [optional] - **page** | **Integer**| To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. | [optional] - -### Return type - -[**PurchaseOrders**](PurchaseOrders.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_quote - -> Quotes get_quote(xero_tenant_id, quote_id) - -Allows you to retrieve a specified quote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote - -begin - #Allows you to retrieve a specified quote - result = api_instance.get_quote(xero_tenant_id, quote_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_quote: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for an Quote | - -### Return type - -[**Quotes**](Quotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_quote_as_pdf - -> File get_quote_as_pdf(xero_tenant_id, quote_id) - -Allows you to retrieve quotes as PDF files - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote - -begin - #Allows you to retrieve quotes as PDF files - result = api_instance.get_quote_as_pdf(xero_tenant_id, quote_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_quote_as_pdf: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for an Quote | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/pdf - - -## get_quote_attachment_by_file_name - -> File get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type) - -Allows you to retrieve Attachment on Quote by Filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object -file_name = 'xero-dev.jpg' # String | Name of the attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachment on Quote by Filename - result = api_instance.get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_quote_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for Quote object | - **file_name** | **String**| Name of the attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_quote_attachment_by_id - -> File get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type) - -Allows you to retrieve specific Attachment on Quote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specific Attachment on Quote - result = api_instance.get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_quote_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for Quote object | - **attachment_id** | [**String**](.md)| Unique identifier for Attachment object | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_quote_attachments - -> Attachments get_quote_attachments(xero_tenant_id, quote_id) - -Allows you to retrieve Attachments for Quotes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object - -begin - #Allows you to retrieve Attachments for Quotes - result = api_instance.get_quote_attachments(xero_tenant_id, quote_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_quote_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for Quote object | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_quote_history - -> HistoryRecords get_quote_history(xero_tenant_id, quote_id) - -Allows you to retrieve a history records of an quote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote - -begin - #Allows you to retrieve a history records of an quote - result = api_instance.get_quote_history(xero_tenant_id, quote_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_quote_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for an Quote | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_quotes - -> Quotes get_quotes(xero_tenant_id, opts) - -Allows you to retrieve any sales quotes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - date_from: Date.parse('2013-10-20'), # Date | Filter for quotes after a particular date - date_to: Date.parse('2013-10-20'), # Date | Filter for quotes before a particular date - expiry_date_from: Date.parse('2013-10-20'), # Date | Filter for quotes expiring after a particular date - expiry_date_to: Date.parse('2013-10-20'), # Date | Filter for quotes before a particular date - contact_id: '00000000-0000-0000-000-000000000000', # String | Filter for quotes belonging to a particular contact - status: 'status_example', # String | Filter for quotes of a particular Status - page: 1, # Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote - order: 'ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve any sales quotes - result = api_instance.get_quotes(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_quotes: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **date_from** | **Date**| Filter for quotes after a particular date | [optional] - **date_to** | **Date**| Filter for quotes before a particular date | [optional] - **expiry_date_from** | **Date**| Filter for quotes expiring after a particular date | [optional] - **expiry_date_to** | **Date**| Filter for quotes before a particular date | [optional] - **contact_id** | [**String**](.md)| Filter for quotes belonging to a particular contact | [optional] - **status** | **String**| Filter for quotes of a particular Status | [optional] - **page** | **Integer**| e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**Quotes**](Quotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_receipt - -> Receipts get_receipt(xero_tenant_id, receipt_id, opts) - -Allows you to retrieve a specified draft expense claim receipts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve a specified draft expense claim receipts - result = api_instance.get_receipt(xero_tenant_id, receipt_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_receipt: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Receipts**](Receipts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_receipt_attachment_by_file_name - -> File get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type) - -Allows you to retrieve Attachments on expense claim receipts by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on expense claim receipts by file name - result = api_instance.get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_receipt_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - **file_name** | **String**| The name of the file being attached to the Receipt | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_receipt_attachment_by_id - -> File get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type) - -Allows you to retrieve Attachments on expense claim receipts by ID - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on expense claim receipts by ID - result = api_instance.get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_receipt_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_receipt_attachments - -> Attachments get_receipt_attachments(xero_tenant_id, receipt_id) - -Allows you to retrieve Attachments for expense claim receipts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt - -begin - #Allows you to retrieve Attachments for expense claim receipts - result = api_instance.get_receipt_attachments(xero_tenant_id, receipt_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_receipt_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_receipt_history - -> HistoryRecords get_receipt_history(xero_tenant_id, receipt_id) - -Allows you to retrieve a history records of an Receipt - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt - -begin - #Allows you to retrieve a history records of an Receipt - result = api_instance.get_receipt_history(xero_tenant_id, receipt_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_receipt_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_receipts - -> Receipts get_receipts(xero_tenant_id, opts) - -Allows you to retrieve draft expense claim receipts for any user - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Receipt.StatusEnum.DRAFT + '\"', # String | Filter by an any element - order: 'ReceiptNumber ASC', # String | Order by an any element - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve draft expense claim receipts for any user - result = api_instance.get_receipts(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_receipts: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Receipts**](Receipts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_repeating_invoice - -> RepeatingInvoices get_repeating_invoice(xero_tenant_id, repeating_invoice_id) - -Allows you to retrieve a specified repeating invoice - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice - -begin - #Allows you to retrieve a specified repeating invoice - result = api_instance.get_repeating_invoice(xero_tenant_id, repeating_invoice_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_repeating_invoice: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - -### Return type - -[**RepeatingInvoices**](RepeatingInvoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_repeating_invoice_attachment_by_file_name - -> File get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type) - -Allows you to retrieve specified attachment on repeating invoices by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specified attachment on repeating invoices by file name - result = api_instance.get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - **file_name** | **String**| The name of the file being attached to a Repeating Invoice | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_repeating_invoice_attachment_by_id - -> File get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type) - -Allows you to retrieve a specified Attachments on repeating invoices - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve a specified Attachments on repeating invoices - result = api_instance.get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | - **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | - -### Return type - -**File** - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/octet-stream - - -## get_repeating_invoice_attachments - -> Attachments get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id) - -Allows you to retrieve Attachments on repeating invoice - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice - -begin - #Allows you to retrieve Attachments on repeating invoice - result = api_instance.get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_repeating_invoice_attachments: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_repeating_invoice_history - -> HistoryRecords get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id) - -Allows you to retrieve history for a repeating invoice - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice - -begin - #Allows you to retrieve history for a repeating invoice - result = api_instance.get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_repeating_invoice_history: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - -### Return type - -[**HistoryRecords**](HistoryRecords.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_repeating_invoices - -> RepeatingInvoices get_repeating_invoices(xero_tenant_id, opts) - -Allows you to retrieve any repeating invoices - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - where: 'Status==\"' + RepeatingInvoice.StatusEnum.DRAFT + '\"', # String | Filter by an any element - order: 'Total ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve any repeating invoices - result = api_instance.get_repeating_invoices(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_repeating_invoices: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**RepeatingInvoices**](RepeatingInvoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_aged_payables_by_contact - -> ReportWithRows get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts) - -Allows you to retrieve report for AgedPayablesByContact - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -opts = { - date: Date.parse('2013-10-20'), # Date | The date of the Aged Payables By Contact report - from_date: Date.parse('2013-10-20'), # Date | The from date of the Aged Payables By Contact report - to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Payables By Contact report -} - -begin - #Allows you to retrieve report for AgedPayablesByContact - result = api_instance.get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_aged_payables_by_contact: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **date** | **Date**| The date of the Aged Payables By Contact report | [optional] - **from_date** | **Date**| The from date of the Aged Payables By Contact report | [optional] - **to_date** | **Date**| The to date of the Aged Payables By Contact report | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_aged_receivables_by_contact - -> ReportWithRows get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts) - -Allows you to retrieve report for AgedReceivablesByContact - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -opts = { - date: Date.parse('2013-10-20'), # Date | The date of the Aged Receivables By Contact report - from_date: Date.parse('2013-10-20'), # Date | The from date of the Aged Receivables By Contact report - to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Receivables By Contact report -} - -begin - #Allows you to retrieve report for AgedReceivablesByContact - result = api_instance.get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_aged_receivables_by_contact: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **date** | **Date**| The date of the Aged Receivables By Contact report | [optional] - **from_date** | **Date**| The from date of the Aged Receivables By Contact report | [optional] - **to_date** | **Date**| The to date of the Aged Receivables By Contact report | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_ba_sor_gst - -> ReportWithRows get_report_ba_sor_gst(xero_tenant_id, report_id) - -Allows you to retrieve report for BAS only valid for AU orgs - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -report_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Report - -begin - #Allows you to retrieve report for BAS only valid for AU orgs - result = api_instance.get_report_ba_sor_gst(xero_tenant_id, report_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_ba_sor_gst: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **report_id** | **String**| Unique identifier for a Report | - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_ba_sor_gst_list - -> ReportWithRows get_report_ba_sor_gst_list(xero_tenant_id) - -Allows you to retrieve report for BAS only valid for AU orgs - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve report for BAS only valid for AU orgs - result = api_instance.get_report_ba_sor_gst_list(xero_tenant_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_ba_sor_gst_list: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_balance_sheet - -> ReportWithRows get_report_balance_sheet(xero_tenant_id, opts) - -Allows you to retrieve report for BalanceSheet - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - date: '2019-11-01', # String | The date of the Balance Sheet report - periods: 3, # Integer | The number of periods for the Balance Sheet report - timeframe: 'MONTH', # String | The period size to compare to (MONTH, QUARTER, YEAR) - tracking_option_id1: '00000000-0000-0000-000-000000000000', # String | The tracking option 1 for the Balance Sheet report - tracking_option_id2: '00000000-0000-0000-000-000000000000', # String | The tracking option 2 for the Balance Sheet report - standard_layout: true, # Boolean | The standard layout boolean for the Balance Sheet report - payments_only: false # Boolean | return a cash basis for the Balance Sheet report -} - -begin - #Allows you to retrieve report for BalanceSheet - result = api_instance.get_report_balance_sheet(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_balance_sheet: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **date** | **String**| The date of the Balance Sheet report | [optional] - **periods** | **Integer**| The number of periods for the Balance Sheet report | [optional] - **timeframe** | **String**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] - **tracking_option_id1** | **String**| The tracking option 1 for the Balance Sheet report | [optional] - **tracking_option_id2** | **String**| The tracking option 2 for the Balance Sheet report | [optional] - **standard_layout** | **Boolean**| The standard layout boolean for the Balance Sheet report | [optional] - **payments_only** | **Boolean**| return a cash basis for the Balance Sheet report | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_bank_summary - -> ReportWithRows get_report_bank_summary(xero_tenant_id, opts) - -Allows you to retrieve report for BankSummary - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - from_date: Date.parse('2019-11-01'), # Date | The from date for the Bank Summary report e.g. 2018-03-31 - to_date: Date.parse('2019-11-30') # Date | The to date for the Bank Summary report e.g. 2018-03-31 -} - -begin - #Allows you to retrieve report for BankSummary - result = api_instance.get_report_bank_summary(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_bank_summary: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **from_date** | **Date**| The from date for the Bank Summary report e.g. 2018-03-31 | [optional] - **to_date** | **Date**| The to date for the Bank Summary report e.g. 2018-03-31 | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_budget_summary - -> ReportWithRows get_report_budget_summary(xero_tenant_id, opts) - -Allows you to retrieve report for Budget Summary - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - date: Date.parse('2019-03-31'), # Date | The date for the Bank Summary report e.g. 2018-03-31 - period: 2, # Integer | The number of periods to compare (integer between 1 and 12) - timeframe: 3 # Integer | The period size to compare to (1=month, 3=quarter, 12=year) -} - -begin - #Allows you to retrieve report for Budget Summary - result = api_instance.get_report_budget_summary(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_budget_summary: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **date** | **Date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] - **period** | **Integer**| The number of periods to compare (integer between 1 and 12) | [optional] - **timeframe** | **Integer**| The period size to compare to (1=month, 3=quarter, 12=year) | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_executive_summary - -> ReportWithRows get_report_executive_summary(xero_tenant_id, opts) - -Allows you to retrieve report for ExecutiveSummary - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - date: Date.parse('2019-03-31') # Date | The date for the Bank Summary report e.g. 2018-03-31 -} - -begin - #Allows you to retrieve report for ExecutiveSummary - result = api_instance.get_report_executive_summary(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_executive_summary: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **date** | **Date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_profit_and_loss - -> ReportWithRows get_report_profit_and_loss(xero_tenant_id, opts) - -Allows you to retrieve report for ProfitAndLoss - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - from_date: Date.parse('2019-03-01'), # Date | The from date for the ProfitAndLoss report e.g. 2018-03-31 - to_date: Date.parse('2019-03-31'), # Date | The to date for the ProfitAndLoss report e.g. 2018-03-31 - periods: 3, # Integer | The number of periods to compare (integer between 1 and 12) - timeframe: 'MONTH', # String | The period size to compare to (MONTH, QUARTER, YEAR) - tracking_category_id: '00000000-0000-0000-000-000000000000', # String | The trackingCategory 1 for the ProfitAndLoss report - tracking_category_id2: '00000000-0000-0000-000-000000000000', # String | The trackingCategory 2 for the ProfitAndLoss report - tracking_option_id: '00000000-0000-0000-000-000000000000', # String | The tracking option 1 for the ProfitAndLoss report - tracking_option_id2: '00000000-0000-0000-000-000000000000', # String | The tracking option 2 for the ProfitAndLoss report - standard_layout: true, # Boolean | Return the standard layout for the ProfitAndLoss report - payments_only: false # Boolean | Return cash only basis for the ProfitAndLoss report -} - -begin - #Allows you to retrieve report for ProfitAndLoss - result = api_instance.get_report_profit_and_loss(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_profit_and_loss: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **from_date** | **Date**| The from date for the ProfitAndLoss report e.g. 2018-03-31 | [optional] - **to_date** | **Date**| The to date for the ProfitAndLoss report e.g. 2018-03-31 | [optional] - **periods** | **Integer**| The number of periods to compare (integer between 1 and 12) | [optional] - **timeframe** | **String**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] - **tracking_category_id** | **String**| The trackingCategory 1 for the ProfitAndLoss report | [optional] - **tracking_category_id2** | **String**| The trackingCategory 2 for the ProfitAndLoss report | [optional] - **tracking_option_id** | **String**| The tracking option 1 for the ProfitAndLoss report | [optional] - **tracking_option_id2** | **String**| The tracking option 2 for the ProfitAndLoss report | [optional] - **standard_layout** | **Boolean**| Return the standard layout for the ProfitAndLoss report | [optional] - **payments_only** | **Boolean**| Return cash only basis for the ProfitAndLoss report | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_ten_ninety_nine - -> Reports get_report_ten_ninety_nine(xero_tenant_id, opts) - -Allows you to retrieve report for TenNinetyNine - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - report_year: '2019' # String | The year of the 1099 report -} - -begin - #Allows you to retrieve report for TenNinetyNine - result = api_instance.get_report_ten_ninety_nine(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_ten_ninety_nine: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **report_year** | **String**| The year of the 1099 report | [optional] - -### Return type - -[**Reports**](Reports.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_report_trial_balance - -> ReportWithRows get_report_trial_balance(xero_tenant_id, opts) - -Allows you to retrieve report for TrialBalance - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - date: Date.parse('2019-10-31'), # Date | The date for the Trial Balance report e.g. 2018-03-31 - payments_only: true # Boolean | Return cash only basis for the Trial Balance report -} - -begin - #Allows you to retrieve report for TrialBalance - result = api_instance.get_report_trial_balance(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_report_trial_balance: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **date** | **Date**| The date for the Trial Balance report e.g. 2018-03-31 | [optional] - **payments_only** | **Boolean**| Return cash only basis for the Trial Balance report | [optional] - -### Return type - -[**ReportWithRows**](ReportWithRows.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_tax_rates - -> TaxRates get_tax_rates(xero_tenant_id, opts) - -Allows you to retrieve Tax Rates - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - where: 'Status==\"' + TaxRate.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Name ASC', # String | Order by an any element - tax_type: 'INPUT' # String | Filter by tax type -} - -begin - #Allows you to retrieve Tax Rates - result = api_instance.get_tax_rates(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_tax_rates: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **tax_type** | **String**| Filter by tax type | [optional] - -### Return type - -[**TaxRates**](TaxRates.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_tracking_categories - -> TrackingCategories get_tracking_categories(xero_tenant_id, opts) - -Allows you to retrieve tracking categories and options - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - where: 'Status==\"' + TrackingCategory.StatusEnum.ACTIVE + '\"', # String | Filter by an any element - order: 'Name ASC', # String | Order by an any element - include_archived: true # Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response -} - -begin - #Allows you to retrieve tracking categories and options - result = api_instance.get_tracking_categories(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_tracking_categories: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - **include_archived** | **Boolean**| e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response | [optional] - -### Return type - -[**TrackingCategories**](TrackingCategories.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_tracking_category - -> TrackingCategories get_tracking_category(xero_tenant_id, tracking_category_id) - -Allows you to retrieve tracking categories and options for specified category - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory - -begin - #Allows you to retrieve tracking categories and options for specified category - result = api_instance.get_tracking_category(xero_tenant_id, tracking_category_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_tracking_category: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | - -### Return type - -[**TrackingCategories**](TrackingCategories.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_user - -> Users get_user(xero_tenant_id, user_id) - -Allows you to retrieve a specified user - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -user_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a User - -begin - #Allows you to retrieve a specified user - result = api_instance.get_user(xero_tenant_id, user_id) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_user: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **user_id** | [**String**](.md)| Unique identifier for a User | - -### Return type - -[**Users**](Users.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_users - -> Users get_users(xero_tenant_id, opts) - -Allows you to retrieve users - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -opts = { - if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'IsSubscriber==true', # String | Filter by an any element - order: 'LastName ASC' # String | Order by an any element -} - -begin - #Allows you to retrieve users - result = api_instance.get_users(xero_tenant_id, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->get_users: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] - **where** | **String**| Filter by an any element | [optional] - **order** | **String**| Order by an any element | [optional] - -### Return type - -[**Users**](Users.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## update_account - -> Accounts update_account(xero_tenant_id, account_id, accounts) - -Allows you to update a chart of accounts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object -accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] } # Accounts | Request of type Accounts array with one Account - -begin - #Allows you to update a chart of accounts - result = api_instance.update_account(xero_tenant_id, account_id, accounts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_account: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for retrieving single object | - **accounts** | [**Accounts**](Accounts.md)| Request of type Accounts array with one Account | - -### Return type - -[**Accounts**](Accounts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_account_attachment_by_file_name - -> Attachments update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) - -Allows you to update Attachment on Account by Filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object -file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on Account by Filename - result = api_instance.update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_account_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **account_id** | [**String**](.md)| Unique identifier for Account object | - **file_name** | **String**| Name of the attachment | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_bank_transaction - -> BankTransactions update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts) - -Allows you to update a single spend or receive money transaction - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] } # BankTransactions | -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update a single spend or receive money transaction - result = api_instance.update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_bank_transaction: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - **bank_transactions** | [**BankTransactions**](BankTransactions.md)| | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**BankTransactions**](BankTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_bank_transaction_attachment_by_file_name - -> Attachments update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) - -Allows you to update an Attachment on BankTransaction by Filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -file_name = 'xero-dev.jpg' # String | The name of the file being attached -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update an Attachment on BankTransaction by Filename - result = api_instance.update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_bank_transaction_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | - **file_name** | **String**| The name of the file being attached | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_bank_transfer_attachment_by_file_name - -> Attachments update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) - - - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -body = 'body_example' # String | Byte array of file in body of request - -begin - result = api_instance.update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_bank_transfer_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | - **file_name** | **String**| The name of the file being attached to a Bank Transfer | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_contact - -> Contacts update_contact(xero_tenant_id, contact_id, contacts) - - - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] } # Contacts | an array of Contacts containing single Contact object with properties to update - -begin - result = api_instance.update_contact(xero_tenant_id, contact_id, contacts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_contact: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **contacts** | [**Contacts**](Contacts.md)| an array of Contacts containing single Contact object with properties to update | - -### Return type - -[**Contacts**](Contacts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_contact_attachment_by_file_name - -> Attachments update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) - - - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -body = 'body_example' # String | Byte array of file in body of request - -begin - result = api_instance.update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_contact_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_id** | [**String**](.md)| Unique identifier for a Contact | - **file_name** | **String**| Name for the file you are attaching | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_contact_group - -> ContactGroups update_contact_group(xero_tenant_id, contact_group_id, contact_groups) - -Allows you to update a Contact Group - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group -contact_groups = { contactGroups:[ { name:"Vendor" } ] } # ContactGroups | an array of Contact groups with Name of specific group to update - -begin - #Allows you to update a Contact Group - result = api_instance.update_contact_group(xero_tenant_id, contact_group_id, contact_groups) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_contact_group: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | - **contact_groups** | [**ContactGroups**](ContactGroups.md)| an array of Contact groups with Name of specific group to update | - -### Return type - -[**ContactGroups**](ContactGroups.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_credit_note - -> CreditNotes update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts) - -Allows you to update a specific credit note - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -credit_notes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] } # CreditNotes | an array of Credit Notes containing credit note details to update -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update a specific credit note - result = api_instance.update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_credit_note: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **credit_notes** | [**CreditNotes**](CreditNotes.md)| an array of Credit Notes containing credit note details to update | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**CreditNotes**](CreditNotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_credit_note_attachment_by_file_name - -> Attachments update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body) - -Allows you to update Attachments on CreditNote by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachments on CreditNote by file name - result = api_instance.update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_credit_note_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | - **file_name** | **String**| Name of the file you are attaching to Credit Note | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_expense_claim - -> ExpenseClaims update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims) - -Allows you to update specified expense claims - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim -expense_claims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] } # ExpenseClaims | - -begin - #Allows you to update specified expense claims - result = api_instance.update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_expense_claim: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | - **expense_claims** | [**ExpenseClaims**](ExpenseClaims.md)| | - -### Return type - -[**ExpenseClaims**](ExpenseClaims.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_invoice - -> Invoices update_invoice(xero_tenant_id, invoice_id, invoices, opts) - -Allows you to update a specified sales invoices or purchase bills - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] } # Invoices | -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update a specified sales invoices or purchase bills - result = api_instance.update_invoice(xero_tenant_id, invoice_id, invoices, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_invoice: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **invoices** | [**Invoices**](Invoices.md)| | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Invoices**](Invoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_invoice_attachment_by_file_name - -> Attachments update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body) - -Allows you to update Attachment on invoices or purchase bills by it's filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -file_name = 'xero-dev.jpg' # String | Name of the file you are attaching -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on invoices or purchase bills by it's filename - result = api_instance.update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_invoice_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | - **file_name** | **String**| Name of the file you are attaching | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_item - -> Items update_item(xero_tenant_id, item_id, items, opts) - -Allows you to update a specified item - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item -items = { items:[ { code:"abc123", description:"Hello Xero" } ] } # Items | -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update a specified item - result = api_instance.update_item(xero_tenant_id, item_id, items, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_item: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **item_id** | [**String**](.md)| Unique identifier for an Item | - **items** | [**Items**](Items.md)| | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Items**](Items.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_linked_transaction - -> LinkedTransactions update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions) - -Allows you to update a specified linked transactions (billable expenses) - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction -linked_transactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] } # LinkedTransactions | - -begin - #Allows you to update a specified linked transactions (billable expenses) - result = api_instance.update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_linked_transaction: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **linked_transaction_id** | [**String**](.md)| Unique identifier for a LinkedTransaction | - **linked_transactions** | [**LinkedTransactions**](LinkedTransactions.md)| | - -### Return type - -[**LinkedTransactions**](LinkedTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_manual_journal - -> ManualJournals update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals) - -Allows you to update a specified manual journal - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal -manual_journals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] } # ManualJournals | - -begin - #Allows you to update a specified manual journal - result = api_instance.update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_manual_journal: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | - **manual_journals** | [**ManualJournals**](ManualJournals.md)| | - -### Return type - -[**ManualJournals**](ManualJournals.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_manual_journal_attachment_by_file_name - -> Attachments update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) - -Allows you to update a specified Attachment on ManualJournal by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update a specified Attachment on ManualJournal by file name - result = api_instance.update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_manual_journal_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | - **file_name** | **String**| The name of the file being attached to a ManualJournal | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_or_create_bank_transactions - -> BankTransactions update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts) - -Allows you to update or create one or more spend or receive money transaction - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update or create one or more spend or receive money transaction - result = api_instance.update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_bank_transactions: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transactions** | [**BankTransactions**](BankTransactions.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**BankTransactions**](BankTransactions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_contacts - -> Contacts update_or_create_contacts(xero_tenant_id, contacts, opts) - -Allows you to update OR create one or more contacts in a Xero organisation - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to update OR create one or more contacts in a Xero organisation - result = api_instance.update_or_create_contacts(xero_tenant_id, contacts, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_contacts: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **contacts** | [**Contacts**](Contacts.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Contacts**](Contacts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_credit_notes - -> CreditNotes update_or_create_credit_notes(xero_tenant_id, credit_notes, opts) - -Allows you to update OR create one or more credit notes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_notes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | an array of Credit Notes with a single CreditNote object. -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update OR create one or more credit notes - result = api_instance.update_or_create_credit_notes(xero_tenant_id, credit_notes, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_credit_notes: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **credit_notes** | [**CreditNotes**](CreditNotes.md)| an array of Credit Notes with a single CreditNote object. | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**CreditNotes**](CreditNotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_employees - -> Employees update_or_create_employees(xero_tenant_id, employees, opts) - -Allows you to create a single new employees used in Xero payrun - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | Employees with array of Employee object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create a single new employees used in Xero payrun - result = api_instance.update_or_create_employees(xero_tenant_id, employees, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_employees: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **employees** | [**Employees**](Employees.md)| Employees with array of Employee object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Employees**](Employees.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_invoices - -> Invoices update_or_create_invoices(xero_tenant_id, invoices, opts) - -Allows you to update OR create one or more sales invoices or purchase bills - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] } # Invoices | -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update OR create one or more sales invoices or purchase bills - result = api_instance.update_or_create_invoices(xero_tenant_id, invoices, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_invoices: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **invoices** | [**Invoices**](Invoices.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Invoices**](Invoices.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_items - -> Items update_or_create_items(xero_tenant_id, items, opts) - -Allows you to update or create one or more items - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] } # Items | -opts = { - summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to update or create one or more items - result = api_instance.update_or_create_items(xero_tenant_id, items, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_items: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **items** | [**Items**](Items.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Items**](Items.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_manual_journals - -> ManualJournals update_or_create_manual_journals(xero_tenant_id, manual_journals, opts) - -Allows you to create a single manual journal - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | ManualJournals array with ManualJournal object in body of request -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to create a single manual journal - result = api_instance.update_or_create_manual_journals(xero_tenant_id, manual_journals, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_manual_journals: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **manual_journals** | [**ManualJournals**](ManualJournals.md)| ManualJournals array with ManualJournal object in body of request | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**ManualJournals**](ManualJournals.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_purchase_orders - -> PurchaseOrders update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts) - -Allows you to update or create one or more purchase orders - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_orders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to update or create one or more purchase orders - result = api_instance.update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_purchase_orders: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**PurchaseOrders**](PurchaseOrders.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_or_create_quotes - -> Quotes update_or_create_quotes(xero_tenant_id, quotes, opts) - -Allows you to update OR create one or more quotes - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | -opts = { - summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors -} - -begin - #Allows you to update OR create one or more quotes - result = api_instance.update_or_create_quotes(xero_tenant_id, quotes, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_or_create_quotes: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quotes** | [**Quotes**](Quotes.md)| | - **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] - -### Return type - -[**Quotes**](Quotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_purchase_order - -> PurchaseOrders update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders) - -Allows you to update a specified purchase order - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder -purchase_orders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] } # PurchaseOrders | - -begin - #Allows you to update a specified purchase order - result = api_instance.update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_purchase_order: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | - **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| | - -### Return type - -[**PurchaseOrders**](PurchaseOrders.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_quote - -> Quotes update_quote(xero_tenant_id, quote_id, quotes) - -Allows you to update a specified quote - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote -quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]} # Quotes | - -begin - #Allows you to update a specified quote - result = api_instance.update_quote(xero_tenant_id, quote_id, quotes) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_quote: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for an Quote | - **quotes** | [**Quotes**](Quotes.md)| | - -### Return type - -[**Quotes**](Quotes.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_quote_attachment_by_file_name - -> Attachments update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) - -Allows you to update Attachment on Quote by Filename - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object -file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on Quote by Filename - result = api_instance.update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_quote_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **quote_id** | [**String**](.md)| Unique identifier for Quote object | - **file_name** | **String**| Name of the attachment | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_receipt - -> Receipts update_receipt(xero_tenant_id, receipt_id, receipts, opts) - -Allows you to retrieve a specified draft expense claim receipts - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] } # Receipts | -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - -begin - #Allows you to retrieve a specified draft expense claim receipts - result = api_instance.update_receipt(xero_tenant_id, receipt_id, receipts, opts) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_receipt: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - **receipts** | [**Receipts**](Receipts.md)| | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] - -### Return type - -[**Receipts**](Receipts.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_receipt_attachment_by_file_name - -> Attachments update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) - -Allows you to update Attachment on expense claim receipts by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on expense claim receipts by file name - result = api_instance.update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_receipt_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | - **file_name** | **String**| The name of the file being attached to the Receipt | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_repeating_invoice_attachment_by_file_name - -> Attachments update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) - -Allows you to update specified attachment on repeating invoices by file name - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update specified attachment on repeating invoices by file name - result = api_instance.update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_repeating_invoice_attachment_by_file_name: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | - **file_name** | **String**| The name of the file being attached to a Repeating Invoice | - **body** | **String**| Byte array of file in body of request | - -### Return type - -[**Attachments**](Attachments.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/octet-stream -- **Accept**: application/json - - -## update_tax_rate - -> TaxRates update_tax_rate(xero_tenant_id, tax_rates) - -Allows you to update Tax Rates - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tax_rates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] } # TaxRates | - -begin - #Allows you to update Tax Rates - result = api_instance.update_tax_rate(xero_tenant_id, tax_rates) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_tax_rate: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tax_rates** | [**TaxRates**](TaxRates.md)| | - -### Return type - -[**TaxRates**](TaxRates.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_tracking_category - -> TrackingCategories update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) - -Allows you to update tracking categories - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_category = { name:"Avengers" } # TrackingCategory | - -begin - #Allows you to update tracking categories - result = api_instance.update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_tracking_category: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | - **tracking_category** | [**TrackingCategory**](TrackingCategory.md)| | - -### Return type - -[**TrackingCategories**](TrackingCategories.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## update_tracking_options - -> TrackingOptions update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option) - -Allows you to update options for a specified tracking category - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option -tracking_option = { name:"Vision" } # TrackingOption | - -begin - #Allows you to update options for a specified tracking category - result = api_instance.update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option) - p result -rescue XeroRuby::Accounting::ApiError => e - puts "Exception when calling AccountingApi->update_tracking_options: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | - **tracking_option_id** | [**String**](.md)| Unique identifier for a Tracking Option | - **tracking_option** | [**TrackingOption**](TrackingOption.md)| | - -### Return type - -[**TrackingOptions**](TrackingOptions.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - diff --git a/docs/accounting/Accounts.md b/docs/accounting/Accounts.md deleted file mode 100644 index 0260f731..00000000 --- a/docs/accounting/Accounts.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Accounts - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accounts** | [**Array<Account>**](Account.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Accounts.new(accounts: null) -``` - - diff --git a/docs/accounting/AccountsPayable.md b/docs/accounting/AccountsPayable.md deleted file mode 100644 index 812ad37d..00000000 --- a/docs/accounting/AccountsPayable.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::AccountsPayable - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**outstanding** | **Float** | | [optional] -**overdue** | **Float** | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::AccountsPayable.new(outstanding: null, - overdue: null) -``` - - diff --git a/docs/accounting/AccountsReceivable.md b/docs/accounting/AccountsReceivable.md deleted file mode 100644 index 4380c5b3..00000000 --- a/docs/accounting/AccountsReceivable.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::AccountsReceivable - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**outstanding** | **Float** | | [optional] -**overdue** | **Float** | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::AccountsReceivable.new(outstanding: null, - overdue: null) -``` - - diff --git a/docs/accounting/Address.md b/docs/accounting/Address.md deleted file mode 100644 index 251cb8b4..00000000 --- a/docs/accounting/Address.md +++ /dev/null @@ -1,35 +0,0 @@ -# XeroRuby::Accounting::Address - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**address_type** | **String** | define the type of address | [optional] -**address_line1** | **String** | max length = 500 | [optional] -**address_line2** | **String** | max length = 500 | [optional] -**address_line3** | **String** | max length = 500 | [optional] -**address_line4** | **String** | max length = 500 | [optional] -**city** | **String** | max length = 255 | [optional] -**region** | **String** | max length = 255 | [optional] -**postal_code** | **String** | max length = 50 | [optional] -**country** | **String** | max length = 50, [A-Z], [a-z] only | [optional] -**attention_to** | **String** | max length = 255 | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Address.new(address_type: null, - address_line1: null, - address_line2: null, - address_line3: null, - address_line4: null, - city: null, - region: null, - postal_code: null, - country: null, - attention_to: null) -``` - - diff --git a/docs/accounting/Allocation.md b/docs/accounting/Allocation.md deleted file mode 100644 index 0c0b8bed..00000000 --- a/docs/accounting/Allocation.md +++ /dev/null @@ -1,21 +0,0 @@ -# XeroRuby::Accounting::Allocation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invoice** | [**Invoice**](Invoice.md) | | -**amount** | **Float** | the amount being applied to the invoice | -**date** | **Date** | the date the allocation is applied YYYY-MM-DD. | - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Allocation.new(invoice: null, - amount: null, - date: null) -``` - - diff --git a/docs/accounting/Allocations.md b/docs/accounting/Allocations.md deleted file mode 100644 index 56aa691b..00000000 --- a/docs/accounting/Allocations.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Allocations - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**allocations** | [**Array<Allocation>**](Allocation.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Allocations.new(allocations: null) -``` - - diff --git a/docs/accounting/Attachment.md b/docs/accounting/Attachment.md deleted file mode 100644 index 94ecc6b0..00000000 --- a/docs/accounting/Attachment.md +++ /dev/null @@ -1,27 +0,0 @@ -# XeroRuby::Accounting::Attachment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attachment_id** | **String** | Unique ID for the file | [optional] -**file_name** | **String** | Name of the file | [optional] -**url** | **String** | URL to the file on xero.com | [optional] -**mime_type** | **String** | Type of file | [optional] -**content_length** | **Float** | Length of the file content | [optional] -**include_online** | **Boolean** | Include the file with the online invoice | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Attachment.new(attachment_id: 00000000-0000-0000-0000-000000000000, - file_name: xero-dev.jpg, - url: https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg, - mime_type: image/jpg, - content_length: null, - include_online: null) -``` - - diff --git a/docs/accounting/Attachments.md b/docs/accounting/Attachments.md deleted file mode 100644 index 5cf6a0f3..00000000 --- a/docs/accounting/Attachments.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Attachments - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**attachments** | [**Array<Attachment>**](Attachment.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Attachments.new(attachments: null) -``` - - diff --git a/docs/accounting/Balances.md b/docs/accounting/Balances.md deleted file mode 100644 index a3918dd6..00000000 --- a/docs/accounting/Balances.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::Balances - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accounts_receivable** | [**AccountsReceivable**](AccountsReceivable.md) | | [optional] -**accounts_payable** | [**AccountsPayable**](AccountsPayable.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Balances.new(accounts_receivable: null, - accounts_payable: null) -``` - - diff --git a/docs/accounting/BankTransaction.md b/docs/accounting/BankTransaction.md deleted file mode 100644 index ef09baaa..00000000 --- a/docs/accounting/BankTransaction.md +++ /dev/null @@ -1,59 +0,0 @@ -# XeroRuby::Accounting::BankTransaction - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | See Bank Transaction Types | -**contact** | [**Contact**](Contact.md) | | -**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | -**bank_account** | [**Account**](Account.md) | | -**is_reconciled** | **Boolean** | Boolean to show if transaction is reconciled | [optional] -**date** | **Date** | Date of transaction – YYYY-MM-DD | [optional] -**reference** | **String** | Reference for the transaction. Only supported for SPEND and RECEIVE transactions. | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**currency_rate** | **Float** | Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. | [optional] -**url** | **String** | URL link to a source document – shown as “Go to App Name” | [optional] -**status** | **String** | See Bank Transaction Status Codes | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**sub_total** | **Float** | Total of bank transaction excluding taxes | [optional] -**total_tax** | **Float** | Total tax on bank transaction | [optional] -**total** | **Float** | Total of bank transaction tax inclusive | [optional] -**bank_transaction_id** | **String** | Xero generated unique identifier for bank transaction | [optional] -**prepayment_id** | **String** | Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT | [optional] -**overpayment_id** | **String** | Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT | [optional] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**has_attachments** | **Boolean** | Boolean to indicate if a bank transaction has an attachment | [optional] [default to false] -**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BankTransaction.new(type: null, - contact: null, - line_items: null, - bank_account: null, - is_reconciled: null, - date: null, - reference: null, - currency_code: null, - currency_rate: null, - url: null, - status: null, - line_amount_types: null, - sub_total: null, - total_tax: null, - total: null, - bank_transaction_id: 00000000-0000-0000-0000-000000000000, - prepayment_id: 00000000-0000-0000-0000-000000000000, - overpayment_id: 00000000-0000-0000-0000-000000000000, - updated_date_utc: null, - has_attachments: false, - status_attribute_string: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/BankTransactions.md b/docs/accounting/BankTransactions.md deleted file mode 100644 index d938bf93..00000000 --- a/docs/accounting/BankTransactions.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::BankTransactions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bank_transactions** | [**Array<BankTransaction>**](BankTransaction.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BankTransactions.new(bank_transactions: null) -``` - - diff --git a/docs/accounting/BankTransfer.md b/docs/accounting/BankTransfer.md deleted file mode 100644 index 592da40b..00000000 --- a/docs/accounting/BankTransfer.md +++ /dev/null @@ -1,37 +0,0 @@ -# XeroRuby::Accounting::BankTransfer - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**from_bank_account** | [**Account**](Account.md) | | -**to_bank_account** | [**Account**](Account.md) | | -**amount** | **String** | amount of the transaction | -**date** | **Date** | The date of the Transfer YYYY-MM-DD | [optional] -**bank_transfer_id** | **String** | The identifier of the Bank Transfer | [optional] -**currency_rate** | **Float** | The currency rate | [optional] -**from_bank_transaction_id** | **String** | The Bank Transaction ID for the source account | [optional] -**to_bank_transaction_id** | **String** | The Bank Transaction ID for the destination account | [optional] -**has_attachments** | **Boolean** | Boolean to indicate if a Bank Transfer has an attachment | [optional] [default to false] -**created_date_utc** | **DateTime** | UTC timestamp of creation date of bank transfer | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BankTransfer.new(from_bank_account: null, - to_bank_account: null, - amount: null, - date: null, - bank_transfer_id: null, - currency_rate: null, - from_bank_transaction_id: null, - to_bank_transaction_id: null, - has_attachments: false, - created_date_utc: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/BankTransfers.md b/docs/accounting/BankTransfers.md deleted file mode 100644 index 51138aec..00000000 --- a/docs/accounting/BankTransfers.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::BankTransfers - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bank_transfers** | [**Array<BankTransfer>**](BankTransfer.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BankTransfers.new(bank_transfers: null) -``` - - diff --git a/docs/accounting/BatchPayment.md b/docs/accounting/BatchPayment.md deleted file mode 100644 index b36c2711..00000000 --- a/docs/accounting/BatchPayment.md +++ /dev/null @@ -1,47 +0,0 @@ -# XeroRuby::Accounting::BatchPayment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**account** | [**Account**](Account.md) | | [optional] -**reference** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] -**particulars** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] -**code** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] -**details** | **String** | (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 | [optional] -**narrative** | **String** | (UK Only) Only shows on the statement line in Xero. Max length =18 | [optional] -**batch_payment_id** | **String** | The Xero generated unique identifier for the bank transaction (read-only) | [optional] -**date_string** | **String** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] -**date** | **Date** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] -**amount** | **Float** | The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 | [optional] -**payments** | [**Array<Payment>**](Payment.md) | | [optional] -**type** | **String** | PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) | [optional] -**status** | **String** | AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. | [optional] -**total_amount** | **String** | The total of the payments that make up the batch (read-only) | [optional] -**updated_date_utc** | **DateTime** | UTC timestamp of last update to the payment | [optional] -**is_reconciled** | **String** | Booelan that tells you if the batch payment has been reconciled (read-only) | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BatchPayment.new(account: null, - reference: null, - particulars: null, - code: null, - details: null, - narrative: null, - batch_payment_id: null, - date_string: null, - date: null, - amount: null, - payments: null, - type: null, - status: null, - total_amount: null, - updated_date_utc: null, - is_reconciled: null) -``` - - diff --git a/docs/accounting/BatchPaymentDetails.md b/docs/accounting/BatchPaymentDetails.md deleted file mode 100644 index 4b9c0a65..00000000 --- a/docs/accounting/BatchPaymentDetails.md +++ /dev/null @@ -1,25 +0,0 @@ -# XeroRuby::Accounting::BatchPaymentDetails - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bank_account_number** | **String** | Bank account number for use with Batch Payments | [optional] -**bank_account_name** | **String** | Name of bank for use with Batch Payments | [optional] -**details** | **String** | (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 | [optional] -**code** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] -**reference** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BatchPaymentDetails.new(bank_account_number: 123-456-1111111, - bank_account_name: ACME Bank, - details: Hello World, - code: ABC, - reference: Foobar) -``` - - diff --git a/docs/accounting/BatchPayments.md b/docs/accounting/BatchPayments.md deleted file mode 100644 index 00f86438..00000000 --- a/docs/accounting/BatchPayments.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::BatchPayments - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**batch_payments** | [**Array<BatchPayment>**](BatchPayment.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BatchPayments.new(batch_payments: null) -``` - - diff --git a/docs/accounting/Bill.md b/docs/accounting/Bill.md deleted file mode 100644 index d54b1eda..00000000 --- a/docs/accounting/Bill.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::Bill - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**day** | **Integer** | Day of Month (0-31) | [optional] -**type** | [**PaymentTermType**](PaymentTermType.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Bill.new(day: null, - type: null) -``` - - diff --git a/docs/accounting/BrandingTheme.md b/docs/accounting/BrandingTheme.md deleted file mode 100644 index 655662f9..00000000 --- a/docs/accounting/BrandingTheme.md +++ /dev/null @@ -1,27 +0,0 @@ -# XeroRuby::Accounting::BrandingTheme - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**branding_theme_id** | **String** | Xero identifier | [optional] -**name** | **String** | Name of branding theme | [optional] -**logo_url** | **String** | The location of the image file used as the logo on this branding theme | [optional] -**type** | **String** | Always INVOICE | [optional] -**sort_order** | **Integer** | Integer – ranked order of branding theme. The default branding theme has a value of 0 | [optional] -**created_date_utc** | **DateTime** | UTC timestamp of creation date of branding theme | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BrandingTheme.new(branding_theme_id: null, - name: null, - logo_url: null, - type: null, - sort_order: null, - created_date_utc: null) -``` - - diff --git a/docs/accounting/BrandingThemes.md b/docs/accounting/BrandingThemes.md deleted file mode 100644 index 52d18f54..00000000 --- a/docs/accounting/BrandingThemes.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::BrandingThemes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**branding_themes** | [**Array<BrandingTheme>**](BrandingTheme.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::BrandingThemes.new(branding_themes: null) -``` - - diff --git a/docs/accounting/CISOrgSetting.md b/docs/accounting/CISOrgSetting.md deleted file mode 100644 index 1ada1f21..00000000 --- a/docs/accounting/CISOrgSetting.md +++ /dev/null @@ -1,21 +0,0 @@ -# XeroRuby::Accounting::CISOrgSetting - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cis_contractor_enabled** | **Boolean** | true or false - Boolean that describes if the organisation is a CIS Contractor | [optional] -**cis_sub_contractor_enabled** | **Boolean** | true or false - Boolean that describes if the organisation is a CIS SubContractor | [optional] -**rate** | **Integer** | CIS Deduction rate for the organisation | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::CISOrgSetting.new(cis_contractor_enabled: null, - cis_sub_contractor_enabled: null, - rate: null) -``` - - diff --git a/docs/accounting/CISSetting.md b/docs/accounting/CISSetting.md deleted file mode 100644 index fa88222a..00000000 --- a/docs/accounting/CISSetting.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::CISSetting - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cis_enabled** | **Boolean** | Boolean that describes if the contact is a CIS Subcontractor | [optional] -**rate** | **Integer** | CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::CISSetting.new(cis_enabled: null, - rate: null) -``` - - diff --git a/docs/accounting/CISSettings.md b/docs/accounting/CISSettings.md deleted file mode 100644 index d70ecfa9..00000000 --- a/docs/accounting/CISSettings.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::CISSettings - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**cis_settings** | [**Array<CISSetting>**](CISSetting.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::CISSettings.new(cis_settings: null) -``` - - diff --git a/docs/accounting/Contact.md b/docs/accounting/Contact.md deleted file mode 100644 index 6d4d5ce2..00000000 --- a/docs/accounting/Contact.md +++ /dev/null @@ -1,93 +0,0 @@ -# XeroRuby::Accounting::Contact - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**contact_id** | **String** | Xero identifier | [optional] -**contact_number** | **String** | This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. | [optional] -**account_number** | **String** | A user defined account number. This can be updated via the API and the Xero UI (max length = 50) | [optional] -**contact_status** | **String** | Current status of a contact – see contact status types | [optional] -**name** | **String** | Full name of contact/organisation (max length = 255) | [optional] -**first_name** | **String** | First name of contact person (max length = 255) | [optional] -**last_name** | **String** | Last name of contact person (max length = 255) | [optional] -**email_address** | **String** | Email address of contact person (umlauts not supported) (max length = 255) | [optional] -**skype_user_name** | **String** | Skype user name of contact | [optional] -**contact_persons** | [**Array<ContactPerson>**](ContactPerson.md) | See contact persons | [optional] -**bank_account_details** | **String** | Bank account number of contact | [optional] -**tax_number** | **String** | Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) | [optional] -**accounts_receivable_tax_type** | **String** | The tax type from TaxRates | [optional] -**accounts_payable_tax_type** | **String** | The tax type from TaxRates | [optional] -**addresses** | [**Array<Address>**](Address.md) | Store certain address types for a contact – see address types | [optional] -**phones** | [**Array<Phone>**](Phone.md) | Store certain phone types for a contact – see phone types | [optional] -**is_supplier** | **Boolean** | true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. | [optional] -**is_customer** | **Boolean** | true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. | [optional] -**default_currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**xero_network_key** | **String** | Store XeroNetworkKey for contacts. | [optional] -**sales_default_account_code** | **String** | The default sales account code for contacts | [optional] -**purchases_default_account_code** | **String** | The default purchases account code for contacts | [optional] -**sales_tracking_categories** | [**Array<SalesTrackingCategory>**](SalesTrackingCategory.md) | The default sales tracking categories for contacts | [optional] -**purchases_tracking_categories** | [**Array<SalesTrackingCategory>**](SalesTrackingCategory.md) | The default purchases tracking categories for contacts | [optional] -**tracking_category_name** | **String** | The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories | [optional] -**tracking_category_option** | **String** | The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories | [optional] -**payment_terms** | [**PaymentTerm**](PaymentTerm.md) | | [optional] -**updated_date_utc** | **DateTime** | UTC timestamp of last update to contact | [optional] -**contact_groups** | [**Array<ContactGroup>**](ContactGroup.md) | Displays which contact groups a contact is included in | [optional] -**website** | **String** | Website address for contact (read only) | [optional] -**branding_theme** | [**BrandingTheme**](BrandingTheme.md) | | [optional] -**batch_payments** | [**BatchPaymentDetails**](BatchPaymentDetails.md) | | [optional] -**discount** | **Float** | The default discount rate for the contact (read only) | [optional] -**balances** | [**Balances**](Balances.md) | | [optional] -**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] -**has_attachments** | **Boolean** | A boolean to indicate if a contact has an attachment | [optional] [default to false] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays validation errors returned from the API | [optional] -**has_validation_errors** | **Boolean** | A boolean to indicate if a contact has an validation errors | [optional] -**status_attribute_string** | **String** | Status of object | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Contact.new(contact_id: null, - contact_number: null, - account_number: null, - contact_status: null, - name: null, - first_name: null, - last_name: null, - email_address: null, - skype_user_name: null, - contact_persons: null, - bank_account_details: null, - tax_number: null, - accounts_receivable_tax_type: null, - accounts_payable_tax_type: null, - addresses: null, - phones: null, - is_supplier: null, - is_customer: null, - default_currency: null, - xero_network_key: null, - sales_default_account_code: null, - purchases_default_account_code: null, - sales_tracking_categories: null, - purchases_tracking_categories: null, - tracking_category_name: null, - tracking_category_option: null, - payment_terms: null, - updated_date_utc: null, - contact_groups: null, - website: null, - branding_theme: null, - batch_payments: null, - discount: null, - balances: null, - attachments: null, - has_attachments: false, - validation_errors: null, - has_validation_errors: null, - status_attribute_string: null) -``` - - diff --git a/docs/accounting/ContactGroup.md b/docs/accounting/ContactGroup.md deleted file mode 100644 index cd4f24fe..00000000 --- a/docs/accounting/ContactGroup.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::ContactGroup - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | The Name of the contact group. Required when creating a new contact group | [optional] -**status** | **String** | The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. | [optional] -**contact_group_id** | **String** | The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] -**contacts** | [**Array<Contact>**](Contact.md) | The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ContactGroup.new(name: null, - status: null, - contact_group_id: null, - contacts: null) -``` - - diff --git a/docs/accounting/ContactGroups.md b/docs/accounting/ContactGroups.md deleted file mode 100644 index 57c039b6..00000000 --- a/docs/accounting/ContactGroups.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::ContactGroups - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**contact_groups** | [**Array<ContactGroup>**](ContactGroup.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ContactGroups.new(contact_groups: null) -``` - - diff --git a/docs/accounting/ContactPerson.md b/docs/accounting/ContactPerson.md deleted file mode 100644 index 996035d5..00000000 --- a/docs/accounting/ContactPerson.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::ContactPerson - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**first_name** | **String** | First name of person | [optional] -**last_name** | **String** | Last name of person | [optional] -**email_address** | **String** | Email address of person | [optional] -**include_in_emails** | **Boolean** | boolean to indicate whether contact should be included on emails with invoices etc. | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ContactPerson.new(first_name: null, - last_name: null, - email_address: null, - include_in_emails: null) -``` - - diff --git a/docs/accounting/Contacts.md b/docs/accounting/Contacts.md deleted file mode 100644 index 98afdd46..00000000 --- a/docs/accounting/Contacts.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Contacts - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**contacts** | [**Array<Contact>**](Contact.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Contacts.new(contacts: null) -``` - - diff --git a/docs/accounting/CountryCode.md b/docs/accounting/CountryCode.md deleted file mode 100644 index 2363624f..00000000 --- a/docs/accounting/CountryCode.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::CountryCode - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::CountryCode.new() -``` - - diff --git a/docs/accounting/CreditNote.md b/docs/accounting/CreditNote.md deleted file mode 100644 index f6400020..00000000 --- a/docs/accounting/CreditNote.md +++ /dev/null @@ -1,67 +0,0 @@ -# XeroRuby::Accounting::CreditNote - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | See Credit Note Types | [optional] -**contact** | [**Contact**](Contact.md) | | [optional] -**date** | **Date** | The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation | [optional] -**status** | **String** | See Credit Note Status Codes | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | See Invoice Line Items | [optional] -**sub_total** | **Float** | The subtotal of the credit note excluding taxes | [optional] -**total_tax** | **Float** | The total tax on the credit note | [optional] -**total** | **Float** | The total of the Credit Note(subtotal + total tax) | [optional] -**updated_date_utc** | **DateTime** | UTC timestamp of last update to the credit note | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**fully_paid_on_date** | **Date** | Date when credit note was fully paid(UTC format) | [optional] -**credit_note_id** | **String** | Xero generated unique identifier | [optional] -**credit_note_number** | **String** | ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) | [optional] -**reference** | **String** | ACCRECCREDIT only – additional reference number | [optional] -**sent_to_contact** | **Boolean** | boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) | [optional] -**currency_rate** | **Float** | The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used | [optional] -**remaining_credit** | **Float** | The remaining credit balance on the Credit Note | [optional] -**allocations** | [**Array<Allocation>**](Allocation.md) | See Allocations | [optional] -**applied_amount** | **Float** | The amount of applied to an invoice | [optional] -**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] -**branding_theme_id** | **String** | See BrandingThemes | [optional] -**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] -**has_attachments** | **Boolean** | boolean to indicate if a credit note has an attachment | [optional] [default to false] -**has_errors** | **Boolean** | A boolean to indicate if a credit note has an validation errors | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::CreditNote.new(type: null, - contact: null, - date: null, - status: null, - line_amount_types: null, - line_items: null, - sub_total: null, - total_tax: null, - total: null, - updated_date_utc: null, - currency_code: null, - fully_paid_on_date: null, - credit_note_id: null, - credit_note_number: null, - reference: null, - sent_to_contact: null, - currency_rate: null, - remaining_credit: null, - allocations: null, - applied_amount: 2.0, - payments: null, - branding_theme_id: null, - status_attribute_string: null, - has_attachments: false, - has_errors: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/CreditNotes.md b/docs/accounting/CreditNotes.md deleted file mode 100644 index f63b5afb..00000000 --- a/docs/accounting/CreditNotes.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::CreditNotes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**credit_notes** | [**Array<CreditNote>**](CreditNote.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::CreditNotes.new(credit_notes: null) -``` - - diff --git a/docs/accounting/Currencies.md b/docs/accounting/Currencies.md deleted file mode 100644 index 0329982f..00000000 --- a/docs/accounting/Currencies.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Currencies - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**currencies** | [**Array<Currency>**](Currency.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Currencies.new(currencies: null) -``` - - diff --git a/docs/accounting/Currency.md b/docs/accounting/Currency.md deleted file mode 100644 index c2b8927c..00000000 --- a/docs/accounting/Currency.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::Currency - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**description** | **String** | Name of Currency | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Currency.new(code: null, - description: null) -``` - - diff --git a/docs/accounting/CurrencyCode.md b/docs/accounting/CurrencyCode.md deleted file mode 100644 index 41c95de1..00000000 --- a/docs/accounting/CurrencyCode.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::CurrencyCode - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::CurrencyCode.new() -``` - - diff --git a/docs/accounting/Element.md b/docs/accounting/Element.md deleted file mode 100644 index f3b23ea5..00000000 --- a/docs/accounting/Element.md +++ /dev/null @@ -1,31 +0,0 @@ -# XeroRuby::Accounting::Element - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Array of Validation Error message | [optional] -**batch_payment_id** | **String** | Unique ID for batch payment object with validation error | [optional] -**bank_transaction_id** | **String** | | [optional] -**credit_note_id** | **String** | | [optional] -**contact_id** | **String** | | [optional] -**invoice_id** | **String** | | [optional] -**item_id** | **String** | | [optional] -**purchase_order_id** | **String** | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Element.new(validation_errors: null, - batch_payment_id: null, - bank_transaction_id: null, - credit_note_id: null, - contact_id: null, - invoice_id: null, - item_id: null, - purchase_order_id: null) -``` - - diff --git a/docs/accounting/Employee.md b/docs/accounting/Employee.md deleted file mode 100644 index ac0f0708..00000000 --- a/docs/accounting/Employee.md +++ /dev/null @@ -1,31 +0,0 @@ -# XeroRuby::Accounting::Employee - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**employee_id** | **String** | The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] -**status** | **String** | Current status of an employee – see contact status types | [optional] -**first_name** | **String** | First name of an employee (max length = 255) | [optional] -**last_name** | **String** | Last name of an employee (max length = 255) | [optional] -**external_link** | [**ExternalLink**](ExternalLink.md) | | [optional] -**updated_date_utc** | **DateTime** | | [optional] -**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Employee.new(employee_id: null, - status: null, - first_name: null, - last_name: null, - external_link: null, - updated_date_utc: null, - status_attribute_string: ERROR, - validation_errors: null) -``` - - diff --git a/docs/accounting/Employees.md b/docs/accounting/Employees.md deleted file mode 100644 index eb025d5c..00000000 --- a/docs/accounting/Employees.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Employees - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**employees** | [**Array<Employee>**](Employee.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Employees.new(employees: null) -``` - - diff --git a/docs/accounting/Error.md b/docs/accounting/Error.md deleted file mode 100644 index 9fc959e1..00000000 --- a/docs/accounting/Error.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error_number** | **Integer** | Exception number | [optional] -**type** | **String** | Exception type | [optional] -**message** | **String** | Exception message | [optional] -**elements** | [**Array<Element>**](Element.md) | Array of Elements of validation Errors | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Error.new(error_number: null, - type: null, - message: null, - elements: null) -``` - - diff --git a/docs/accounting/ExpenseClaim.md b/docs/accounting/ExpenseClaim.md deleted file mode 100644 index b5e7c7d6..00000000 --- a/docs/accounting/ExpenseClaim.md +++ /dev/null @@ -1,39 +0,0 @@ -# XeroRuby::Accounting::ExpenseClaim - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expense_claim_id** | **String** | Xero generated unique identifier for an expense claim | [optional] -**status** | **String** | Current status of an expense claim – see status types | [optional] -**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] -**user** | [**User**](User.md) | | [optional] -**receipts** | [**Array<Receipt>**](Receipt.md) | | [optional] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**total** | **Float** | The total of an expense claim being paid | [optional] -**amount_due** | **Float** | The amount due to be paid for an expense claim | [optional] -**amount_paid** | **Float** | The amount still to pay for an expense claim | [optional] -**payment_due_date** | **Date** | The date when the expense claim is due to be paid YYYY-MM-DD | [optional] -**reporting_date** | **Date** | The date the expense claim will be reported in Xero YYYY-MM-DD | [optional] -**receipt_id** | **String** | The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ExpenseClaim.new(expense_claim_id: null, - status: null, - payments: null, - user: null, - receipts: null, - updated_date_utc: null, - total: null, - amount_due: null, - amount_paid: null, - payment_due_date: null, - reporting_date: null, - receipt_id: null) -``` - - diff --git a/docs/accounting/ExpenseClaims.md b/docs/accounting/ExpenseClaims.md deleted file mode 100644 index e8fa261d..00000000 --- a/docs/accounting/ExpenseClaims.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::ExpenseClaims - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**expense_claims** | [**Array<ExpenseClaim>**](ExpenseClaim.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ExpenseClaims.new(expense_claims: null) -``` - - diff --git a/docs/accounting/ExternalLink.md b/docs/accounting/ExternalLink.md deleted file mode 100644 index 172cebd6..00000000 --- a/docs/accounting/ExternalLink.md +++ /dev/null @@ -1,21 +0,0 @@ -# XeroRuby::Accounting::ExternalLink - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**link_type** | **String** | See External link types | [optional] -**url** | **String** | URL for service e.g. http://twitter.com/xeroapi | [optional] -**description** | **String** | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ExternalLink.new(link_type: null, - url: null, - description: null) -``` - - diff --git a/docs/accounting/HistoryRecord.md b/docs/accounting/HistoryRecord.md deleted file mode 100644 index 4f22ed61..00000000 --- a/docs/accounting/HistoryRecord.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::HistoryRecord - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**details** | **String** | details | [optional] -**changes** | **String** | Name of branding theme | [optional] -**user** | **String** | has a value of 0 | [optional] -**date_utc** | **DateTime** | UTC timestamp of creation date of branding theme | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::HistoryRecord.new(details: null, - changes: null, - user: null, - date_utc: null) -``` - - diff --git a/docs/accounting/HistoryRecords.md b/docs/accounting/HistoryRecords.md deleted file mode 100644 index 1cff4225..00000000 --- a/docs/accounting/HistoryRecords.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::HistoryRecords - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**history_records** | [**Array<HistoryRecord>**](HistoryRecord.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::HistoryRecords.new(history_records: null) -``` - - diff --git a/docs/accounting/Invoice.md b/docs/accounting/Invoice.md deleted file mode 100644 index a9af1d75..00000000 --- a/docs/accounting/Invoice.md +++ /dev/null @@ -1,91 +0,0 @@ -# XeroRuby::Accounting::Invoice - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | See Invoice Types | [optional] -**contact** | [**Contact**](Contact.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] -**date** | **Date** | Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation | [optional] -**due_date** | **Date** | Date invoice is due – YYYY-MM-DD | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**invoice_number** | **String** | ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) | [optional] -**reference** | **String** | ACCREC only – additional reference number (max length = 255) | [optional] -**branding_theme_id** | **String** | See BrandingThemes | [optional] -**url** | **String** | URL link to a source document – shown as “Go to [appName]” in the Xero app | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**currency_rate** | **Float** | The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) | [optional] -**status** | **String** | See Invoice Status Codes | [optional] -**sent_to_contact** | **Boolean** | Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved | [optional] -**expected_payment_date** | **Date** | Shown on sales invoices (Accounts Receivable) when this has been set | [optional] -**planned_payment_date** | **Date** | Shown on bills (Accounts Payable) when this has been set | [optional] -**cis_deduction** | **Float** | CIS deduction for UK contractors | [optional] -**sub_total** | **Float** | Total of invoice excluding taxes | [optional] -**total_tax** | **Float** | Total tax on invoice | [optional] -**total** | **Float** | Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts | [optional] -**total_discount** | **Float** | Total of discounts applied on the invoice line items | [optional] -**invoice_id** | **String** | Xero generated unique identifier for invoice | [optional] -**has_attachments** | **Boolean** | boolean to indicate if an invoice has an attachment | [optional] [default to false] -**is_discounted** | **Boolean** | boolean to indicate if an invoice has a discount | [optional] -**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] -**prepayments** | [**Array<Prepayment>**](Prepayment.md) | See Prepayments | [optional] -**overpayments** | [**Array<Overpayment>**](Overpayment.md) | See Overpayments | [optional] -**amount_due** | **Float** | Amount remaining to be paid on invoice | [optional] -**amount_paid** | **Float** | Sum of payments received for invoice | [optional] -**fully_paid_on_date** | **Date** | The date the invoice was fully paid. Only returned on fully paid invoices | [optional] -**amount_credited** | **Float** | Sum of all credit notes, over-payments and pre-payments applied to invoice | [optional] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**credit_notes** | [**Array<CreditNote>**](CreditNote.md) | Details of credit notes that have been applied to an invoice | [optional] -**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] -**has_errors** | **Boolean** | A boolean to indicate if a invoice has an validation errors | [optional] -**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] -**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Invoice.new(type: null, - contact: null, - line_items: null, - date: null, - due_date: null, - line_amount_types: null, - invoice_number: null, - reference: null, - branding_theme_id: null, - url: null, - currency_code: null, - currency_rate: null, - status: null, - sent_to_contact: null, - expected_payment_date: null, - planned_payment_date: null, - cis_deduction: null, - sub_total: null, - total_tax: null, - total: null, - total_discount: null, - invoice_id: null, - has_attachments: false, - is_discounted: null, - payments: null, - prepayments: null, - overpayments: null, - amount_due: null, - amount_paid: null, - fully_paid_on_date: null, - amount_credited: null, - updated_date_utc: null, - credit_notes: null, - attachments: null, - has_errors: null, - status_attribute_string: null, - validation_errors: null, - warnings: null) -``` - - diff --git a/docs/accounting/InvoiceReminder.md b/docs/accounting/InvoiceReminder.md deleted file mode 100644 index 04b1de25..00000000 --- a/docs/accounting/InvoiceReminder.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::InvoiceReminder - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enabled** | **Boolean** | setting for on or off | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::InvoiceReminder.new(enabled: null) -``` - - diff --git a/docs/accounting/InvoiceReminders.md b/docs/accounting/InvoiceReminders.md deleted file mode 100644 index 50f36f5b..00000000 --- a/docs/accounting/InvoiceReminders.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::InvoiceReminders - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invoice_reminders** | [**Array<InvoiceReminder>**](InvoiceReminder.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::InvoiceReminders.new(invoice_reminders: null) -``` - - diff --git a/docs/accounting/Invoices.md b/docs/accounting/Invoices.md deleted file mode 100644 index d240d4da..00000000 --- a/docs/accounting/Invoices.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Invoices - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invoices** | [**Array<Invoice>**](Invoice.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Invoices.new(invoices: null) -``` - - diff --git a/docs/accounting/Item.md b/docs/accounting/Item.md deleted file mode 100644 index a729242f..00000000 --- a/docs/accounting/Item.md +++ /dev/null @@ -1,47 +0,0 @@ -# XeroRuby::Accounting::Item - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **String** | User defined item code (max length = 30) | -**inventory_asset_account_code** | **String** | The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item | [optional] -**name** | **String** | The name of the item (max length = 50) | [optional] -**is_sold** | **Boolean** | Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. | [optional] -**is_purchased** | **Boolean** | Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. | [optional] -**description** | **String** | The sales description of the item (max length = 4000) | [optional] -**purchase_description** | **String** | The purchase description of the item (max length = 4000) | [optional] -**purchase_details** | [**Purchase**](Purchase.md) | | [optional] -**sales_details** | [**Purchase**](Purchase.md) | | [optional] -**is_tracked_as_inventory** | **Boolean** | True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. | [optional] -**total_cost_pool** | **Float** | The value of the item on hand. Calculated using average cost accounting. | [optional] -**quantity_on_hand** | **Float** | The quantity of the item on hand | [optional] -**updated_date_utc** | **DateTime** | Last modified date in UTC format | [optional] -**item_id** | **String** | The Xero identifier for an Item | [optional] -**status_attribute_string** | **String** | Status of object | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Item.new(code: null, - inventory_asset_account_code: null, - name: null, - is_sold: null, - is_purchased: null, - description: null, - purchase_description: null, - purchase_details: null, - sales_details: null, - is_tracked_as_inventory: null, - total_cost_pool: null, - quantity_on_hand: null, - updated_date_utc: null, - item_id: null, - status_attribute_string: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/Items.md b/docs/accounting/Items.md deleted file mode 100644 index 17802bf7..00000000 --- a/docs/accounting/Items.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Items - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**items** | [**Array<Item>**](Item.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Items.new(items: null) -``` - - diff --git a/docs/accounting/Journal.md b/docs/accounting/Journal.md deleted file mode 100644 index f6b7fc82..00000000 --- a/docs/accounting/Journal.md +++ /dev/null @@ -1,31 +0,0 @@ -# XeroRuby::Accounting::Journal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**journal_id** | **String** | Xero identifier | [optional] -**journal_date** | **Date** | Date the journal was posted | [optional] -**journal_number** | **Integer** | Xero generated journal number | [optional] -**created_date_utc** | **DateTime** | Created date UTC format | [optional] -**reference** | **String** | reference field for additional indetifying information | [optional] -**source_id** | **String** | The identifier for the source transaction (e.g. InvoiceID) | [optional] -**source_type** | **String** | The journal source type. The type of transaction that created the journal | [optional] -**journal_lines** | [**Array<JournalLine>**](JournalLine.md) | See JournalLines | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Journal.new(journal_id: null, - journal_date: null, - journal_number: null, - created_date_utc: null, - reference: null, - source_id: null, - source_type: null, - journal_lines: null) -``` - - diff --git a/docs/accounting/JournalLine.md b/docs/accounting/JournalLine.md deleted file mode 100644 index 55468a7e..00000000 --- a/docs/accounting/JournalLine.md +++ /dev/null @@ -1,39 +0,0 @@ -# XeroRuby::Accounting::JournalLine - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**journal_line_id** | **String** | Xero identifier for Journal | [optional] -**account_id** | **String** | See Accounts | [optional] -**account_code** | **String** | See Accounts | [optional] -**account_type** | [**AccountType**](AccountType.md) | | [optional] -**account_name** | **String** | See AccountCodes | [optional] -**description** | **String** | The description from the source transaction line item. Only returned if populated. | [optional] -**net_amount** | **Float** | Net amount of journal line. This will be a positive value for a debit and negative for a credit | [optional] -**gross_amount** | **Float** | Gross amount of journal line (NetAmount + TaxAmount). | [optional] -**tax_amount** | **Float** | Total tax on a journal line | [optional] -**tax_type** | **String** | The tax type from TaxRates | [optional] -**tax_name** | **String** | see TaxRates | [optional] -**tracking_categories** | [**Array<TrackingCategory>**](TrackingCategory.md) | Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::JournalLine.new(journal_line_id: 7be9db36-3598-4755-ba5c-c2dbc8c4a7a2, - account_id: ceef66a5-a545-413b-9312-78a53caadbc4, - account_code: 90.0, - account_type: null, - account_name: Checking Account, - description: My business checking account, - net_amount: 4130.98, - gross_amount: 4130.98, - tax_amount: 0.0, - tax_type: null, - tax_name: Tax Exempt, - tracking_categories: null) -``` - - diff --git a/docs/accounting/Journals.md b/docs/accounting/Journals.md deleted file mode 100644 index bccd124b..00000000 --- a/docs/accounting/Journals.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Journals - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**journals** | [**Array<Journal>**](Journal.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Journals.new(journals: null) -``` - - diff --git a/docs/accounting/LineAmountTypes.md b/docs/accounting/LineAmountTypes.md deleted file mode 100644 index 67e55198..00000000 --- a/docs/accounting/LineAmountTypes.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::LineAmountTypes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::LineAmountTypes.new() -``` - - diff --git a/docs/accounting/LineItem.md b/docs/accounting/LineItem.md deleted file mode 100644 index 3ec2f7ff..00000000 --- a/docs/accounting/LineItem.md +++ /dev/null @@ -1,41 +0,0 @@ -# XeroRuby::Accounting::LineItem - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**line_item_id** | **String** | LineItem unique ID | [optional] -**description** | **String** | Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character | [optional] -**quantity** | **Float** | LineItem Quantity | [optional] -**unit_amount** | **Float** | LineItem Unit Amount | [optional] -**item_code** | **String** | See Items | [optional] -**account_code** | **String** | See Accounts | [optional] -**tax_type** | **String** | The tax type from TaxRates | [optional] -**tax_amount** | **Float** | The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. | [optional] -**line_amount** | **Float** | If you wish to omit either of the <Quantity> or <UnitAmount> you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) | [optional] -**tracking** | [**Array<LineItemTracking>**](LineItemTracking.md) | Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. | [optional] -**discount_rate** | **Float** | Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts | [optional] -**discount_amount** | **Float** | Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. | [optional] -**repeating_invoice_id** | **String** | The Xero identifier for a Repeating Invoice | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::LineItem.new(line_item_id: 00000000-0000-0000-0000-000000000000, - description: null, - quantity: null, - unit_amount: null, - item_code: null, - account_code: null, - tax_type: null, - tax_amount: null, - line_amount: null, - tracking: null, - discount_rate: null, - discount_amount: null, - repeating_invoice_id: 00000000-0000-0000-0000-000000000000) -``` - - diff --git a/docs/accounting/LineItemTracking.md b/docs/accounting/LineItemTracking.md deleted file mode 100644 index e449245d..00000000 --- a/docs/accounting/LineItemTracking.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::LineItemTracking - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tracking_category_id** | **String** | The Xero identifier for a tracking category | [optional] -**tracking_option_id** | **String** | The Xero identifier for a tracking category option | [optional] -**name** | **String** | The name of the tracking category | [optional] -**option** | **String** | See Tracking Options | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::LineItemTracking.new(tracking_category_id: 00000000-0000-0000-0000-000000000000, - tracking_option_id: 00000000-0000-0000-0000-000000000000, - name: Region, - option: North) -``` - - diff --git a/docs/accounting/LinkedTransaction.md b/docs/accounting/LinkedTransaction.md deleted file mode 100644 index 08904c3a..00000000 --- a/docs/accounting/LinkedTransaction.md +++ /dev/null @@ -1,37 +0,0 @@ -# XeroRuby::Accounting::LinkedTransaction - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**source_transaction_id** | **String** | Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice | [optional] -**source_line_item_id** | **String** | The line item identifier from the source transaction. | [optional] -**contact_id** | **String** | Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. | [optional] -**target_transaction_id** | **String** | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice | [optional] -**target_line_item_id** | **String** | The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. | [optional] -**linked_transaction_id** | **String** | The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] -**status** | **String** | Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. | [optional] -**type** | **String** | This will always be BILLABLEEXPENSE. More types may be added in future. | [optional] -**updated_date_utc** | **DateTime** | The last modified date in UTC format | [optional] -**source_transaction_type_code** | **String** | The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::LinkedTransaction.new(source_transaction_id: null, - source_line_item_id: null, - contact_id: null, - target_transaction_id: null, - target_line_item_id: null, - linked_transaction_id: null, - status: null, - type: null, - updated_date_utc: null, - source_transaction_type_code: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/LinkedTransactions.md b/docs/accounting/LinkedTransactions.md deleted file mode 100644 index 3839a5fb..00000000 --- a/docs/accounting/LinkedTransactions.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::LinkedTransactions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**linked_transactions** | [**Array<LinkedTransaction>**](LinkedTransaction.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::LinkedTransactions.new(linked_transactions: null) -``` - - diff --git a/docs/accounting/ManualJournal.md b/docs/accounting/ManualJournal.md deleted file mode 100644 index 5b189fc2..00000000 --- a/docs/accounting/ManualJournal.md +++ /dev/null @@ -1,43 +0,0 @@ -# XeroRuby::Accounting::ManualJournal - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**narration** | **String** | Description of journal being posted | -**journal_lines** | [**Array<ManualJournalLine>**](ManualJournalLine.md) | See JournalLines | [optional] -**date** | **Date** | Date journal was posted – YYYY-MM-DD | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**status** | **String** | See Manual Journal Status Codes | [optional] -**url** | **String** | Url link to a source document – shown as “Go to [appName]” in the Xero app | [optional] -**show_on_cash_basis_reports** | **Boolean** | Boolean – default is true if not specified | [optional] -**has_attachments** | **Boolean** | Boolean to indicate if a manual journal has an attachment | [optional] [default to false] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**manual_journal_id** | **String** | The Xero identifier for a Manual Journal | [optional] -**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] -**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] -**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ManualJournal.new(narration: null, - journal_lines: null, - date: null, - line_amount_types: null, - status: null, - url: null, - show_on_cash_basis_reports: null, - has_attachments: false, - updated_date_utc: null, - manual_journal_id: null, - status_attribute_string: ERROR, - warnings: null, - validation_errors: null, - attachments: null) -``` - - diff --git a/docs/accounting/ManualJournalLine.md b/docs/accounting/ManualJournalLine.md deleted file mode 100644 index 5cd35619..00000000 --- a/docs/accounting/ManualJournalLine.md +++ /dev/null @@ -1,29 +0,0 @@ -# XeroRuby::Accounting::ManualJournalLine - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**line_amount** | **Float** | total for line. Debits are positive, credits are negative value | [optional] -**account_code** | **String** | See Accounts | [optional] -**description** | **String** | Description for journal line | [optional] -**tax_type** | **String** | The tax type from TaxRates | [optional] -**tracking** | [**Array<TrackingCategory>**](TrackingCategory.md) | Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. | [optional] -**tax_amount** | **Float** | The calculated tax amount based on the TaxType and LineAmount | [optional] -**is_blank** | **Boolean** | is the line blank | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ManualJournalLine.new(line_amount: -2569.0, - account_code: 720, - description: Coded incorrectly Office Equipment should be Computer Equipment, - tax_type: null, - tracking: null, - tax_amount: 0.0, - is_blank: false) -``` - - diff --git a/docs/accounting/ManualJournals.md b/docs/accounting/ManualJournals.md deleted file mode 100644 index 2e36a36f..00000000 --- a/docs/accounting/ManualJournals.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::ManualJournals - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**manual_journals** | [**Array<ManualJournal>**](ManualJournal.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ManualJournals.new(manual_journals: null) -``` - - diff --git a/docs/accounting/OnlineInvoice.md b/docs/accounting/OnlineInvoice.md deleted file mode 100644 index 61515486..00000000 --- a/docs/accounting/OnlineInvoice.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::OnlineInvoice - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**online_invoice_url** | **String** | the URL to an online invoice | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::OnlineInvoice.new(online_invoice_url: null) -``` - - diff --git a/docs/accounting/OnlineInvoices.md b/docs/accounting/OnlineInvoices.md deleted file mode 100644 index bea96603..00000000 --- a/docs/accounting/OnlineInvoices.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::OnlineInvoices - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**online_invoices** | [**Array<OnlineInvoice>**](OnlineInvoice.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::OnlineInvoices.new(online_invoices: null) -``` - - diff --git a/docs/accounting/Organisation.md b/docs/accounting/Organisation.md deleted file mode 100644 index 60a83784..00000000 --- a/docs/accounting/Organisation.md +++ /dev/null @@ -1,79 +0,0 @@ -# XeroRuby::Accounting::Organisation - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**organisation_id** | **String** | Unique Xero identifier | [optional] -**api_key** | **String** | Display a unique key used for Xero-to-Xero transactions | [optional] -**name** | **String** | Display name of organisation shown in Xero | [optional] -**legal_name** | **String** | Organisation name shown on Reports | [optional] -**pays_tax** | **Boolean** | Boolean to describe if organisation is registered with a local tax authority i.e. true, false | [optional] -**version** | **String** | See Version Types | [optional] -**organisation_type** | **String** | Organisation Type | [optional] -**base_currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**country_code** | [**CountryCode**](CountryCode.md) | | [optional] -**is_demo_company** | **Boolean** | Boolean to describe if organisation is a demo company. | [optional] -**organisation_status** | **String** | Will be set to ACTIVE if you can connect to organisation via the Xero API | [optional] -**registration_number** | **String** | Shows for New Zealand, Australian and UK organisations | [optional] -**tax_number** | **String** | Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). | [optional] -**financial_year_end_day** | **Integer** | Calendar day e.g. 0-31 | [optional] -**financial_year_end_month** | **Integer** | Calendar Month e.g. 1-12 | [optional] -**sales_tax_basis** | **String** | The accounting basis used for tax returns. See Sales Tax Basis | [optional] -**sales_tax_period** | **String** | The frequency with which tax returns are processed. See Sales Tax Period | [optional] -**default_sales_tax** | **String** | The default for LineAmountTypes on sales transactions | [optional] -**default_purchases_tax** | **String** | The default for LineAmountTypes on purchase transactions | [optional] -**period_lock_date** | **Date** | Shown if set. See lock dates | [optional] -**end_of_year_lock_date** | **Date** | Shown if set. See lock dates | [optional] -**created_date_utc** | **DateTime** | Timestamp when the organisation was created in Xero | [optional] -**timezone** | [**TimeZone**](TimeZone.md) | | [optional] -**organisation_entity_type** | **String** | Organisation Type | [optional] -**short_code** | **String** | A unique identifier for the organisation. Potential uses. | [optional] -**_class** | **String** | Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) | [optional] -**edition** | **String** | BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) | [optional] -**line_of_business** | **String** | Description of business type as defined in Organisation settings | [optional] -**addresses** | [**Array<Address>**](Address.md) | Address details for organisation – see Addresses | [optional] -**phones** | [**Array<Phone>**](Phone.md) | Phones details for organisation – see Phones | [optional] -**external_links** | [**Array<ExternalLink>**](ExternalLink.md) | Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below | [optional] -**payment_terms** | [**PaymentTerm**](PaymentTerm.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Organisation.new(organisation_id: 8be9db36-3598-4755-ba5c-c2dbc8c4a7a2, - api_key: null, - name: null, - legal_name: null, - pays_tax: null, - version: null, - organisation_type: null, - base_currency: null, - country_code: null, - is_demo_company: null, - organisation_status: null, - registration_number: null, - tax_number: null, - financial_year_end_day: null, - financial_year_end_month: null, - sales_tax_basis: null, - sales_tax_period: null, - default_sales_tax: null, - default_purchases_tax: null, - period_lock_date: null, - end_of_year_lock_date: null, - created_date_utc: null, - timezone: null, - organisation_entity_type: null, - short_code: null, - _class: null, - edition: null, - line_of_business: null, - addresses: null, - phones: null, - external_links: null, - payment_terms: null) -``` - - diff --git a/docs/accounting/Organisations.md b/docs/accounting/Organisations.md deleted file mode 100644 index 8e83e8f8..00000000 --- a/docs/accounting/Organisations.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Organisations - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**organisations** | [**Array<Organisation>**](Organisation.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Organisations.new(organisations: null) -``` - - diff --git a/docs/accounting/Overpayment.md b/docs/accounting/Overpayment.md deleted file mode 100644 index 94c4b024..00000000 --- a/docs/accounting/Overpayment.md +++ /dev/null @@ -1,53 +0,0 @@ -# XeroRuby::Accounting::Overpayment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | See Overpayment Types | [optional] -**contact** | [**Contact**](Contact.md) | | [optional] -**date** | **Date** | The date the overpayment is created YYYY-MM-DD | [optional] -**status** | **String** | See Overpayment Status Codes | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | See Overpayment Line Items | [optional] -**sub_total** | **Float** | The subtotal of the overpayment excluding taxes | [optional] -**total_tax** | **Float** | The total tax on the overpayment | [optional] -**total** | **Float** | The total of the overpayment (subtotal + total tax) | [optional] -**updated_date_utc** | **DateTime** | UTC timestamp of last update to the overpayment | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**overpayment_id** | **String** | Xero generated unique identifier | [optional] -**currency_rate** | **Float** | The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used | [optional] -**remaining_credit** | **Float** | The remaining credit balance on the overpayment | [optional] -**allocations** | [**Array<Allocation>**](Allocation.md) | See Allocations | [optional] -**applied_amount** | **Float** | The amount of applied to an invoice | [optional] -**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] -**has_attachments** | **Boolean** | boolean to indicate if a overpayment has an attachment | [optional] [default to false] -**attachments** | [**Array<Attachment>**](Attachment.md) | See Attachments | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Overpayment.new(type: null, - contact: null, - date: null, - status: null, - line_amount_types: null, - line_items: null, - sub_total: null, - total_tax: null, - total: null, - updated_date_utc: null, - currency_code: null, - overpayment_id: null, - currency_rate: null, - remaining_credit: null, - allocations: null, - applied_amount: 2.0, - payments: null, - has_attachments: false, - attachments: null) -``` - - diff --git a/docs/accounting/Overpayments.md b/docs/accounting/Overpayments.md deleted file mode 100644 index 899adeb5..00000000 --- a/docs/accounting/Overpayments.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Overpayments - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**overpayments** | [**Array<Overpayment>**](Overpayment.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Overpayments.new(overpayments: null) -``` - - diff --git a/docs/accounting/Payment.md b/docs/accounting/Payment.md deleted file mode 100644 index 359a0380..00000000 --- a/docs/accounting/Payment.md +++ /dev/null @@ -1,63 +0,0 @@ -# XeroRuby::Accounting::Payment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**invoice** | [**Invoice**](Invoice.md) | | [optional] -**credit_note** | [**CreditNote**](CreditNote.md) | | [optional] -**prepayment** | [**Prepayment**](Prepayment.md) | | [optional] -**overpayment** | [**Overpayment**](Overpayment.md) | | [optional] -**invoice_number** | **String** | Number of invoice or credit note you are applying payment to e.g.INV-4003 | [optional] -**credit_note_number** | **String** | Number of invoice or credit note you are applying payment to e.g. INV-4003 | [optional] -**account** | [**Account**](Account.md) | | [optional] -**code** | **String** | Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) | [optional] -**date** | **Date** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] -**currency_rate** | **Float** | Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 | [optional] -**amount** | **Float** | The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 | [optional] -**reference** | **String** | An optional description for the payment e.g. Direct Debit | [optional] -**is_reconciled** | **Boolean** | An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET | [optional] -**status** | **String** | The status of the payment. | [optional] -**payment_type** | **String** | See Payment Types. | [optional] -**updated_date_utc** | **DateTime** | UTC timestamp of last update to the payment | [optional] -**payment_id** | **String** | The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] -**bank_account_number** | **String** | The suppliers bank account number the payment is being made to | [optional] -**particulars** | **String** | The suppliers bank account number the payment is being made to | [optional] -**details** | **String** | The information to appear on the supplier's bank account | [optional] -**has_account** | **Boolean** | A boolean to indicate if a contact has an validation errors | [optional] -**has_validation_errors** | **Boolean** | A boolean to indicate if a contact has an validation errors | [optional] -**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Payment.new(invoice: null, - credit_note: null, - prepayment: null, - overpayment: null, - invoice_number: null, - credit_note_number: null, - account: null, - code: null, - date: null, - currency_rate: null, - amount: null, - reference: null, - is_reconciled: null, - status: null, - payment_type: null, - updated_date_utc: null, - payment_id: null, - bank_account_number: null, - particulars: null, - details: null, - has_account: null, - has_validation_errors: null, - status_attribute_string: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/PaymentDelete.md b/docs/accounting/PaymentDelete.md deleted file mode 100644 index 12ac9164..00000000 --- a/docs/accounting/PaymentDelete.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::PaymentDelete - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **String** | The status of the payment. | [default to 'DELETED'] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::PaymentDelete.new(status: null) -``` - - diff --git a/docs/accounting/PaymentService.md b/docs/accounting/PaymentService.md deleted file mode 100644 index 0b0d77d8..00000000 --- a/docs/accounting/PaymentService.md +++ /dev/null @@ -1,27 +0,0 @@ -# XeroRuby::Accounting::PaymentService - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**payment_service_id** | **String** | Xero identifier | [optional] -**payment_service_name** | **String** | Name of payment service | [optional] -**payment_service_url** | **String** | The custom payment URL | [optional] -**pay_now_text** | **String** | The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card | [optional] -**payment_service_type** | **String** | This will always be CUSTOM for payment services created via the API. | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::PaymentService.new(payment_service_id: null, - payment_service_name: null, - payment_service_url: null, - pay_now_text: null, - payment_service_type: null, - validation_errors: null) -``` - - diff --git a/docs/accounting/PaymentServices.md b/docs/accounting/PaymentServices.md deleted file mode 100644 index b93fa57b..00000000 --- a/docs/accounting/PaymentServices.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::PaymentServices - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**payment_services** | [**Array<PaymentService>**](PaymentService.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::PaymentServices.new(payment_services: null) -``` - - diff --git a/docs/accounting/PaymentTerm.md b/docs/accounting/PaymentTerm.md deleted file mode 100644 index 037bd9ed..00000000 --- a/docs/accounting/PaymentTerm.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::PaymentTerm - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bills** | [**Bill**](Bill.md) | | [optional] -**sales** | [**Bill**](Bill.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::PaymentTerm.new(bills: null, - sales: null) -``` - - diff --git a/docs/accounting/PaymentTermType.md b/docs/accounting/PaymentTermType.md deleted file mode 100644 index 52219b37..00000000 --- a/docs/accounting/PaymentTermType.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::PaymentTermType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::PaymentTermType.new() -``` - - diff --git a/docs/accounting/Payments.md b/docs/accounting/Payments.md deleted file mode 100644 index 9506b5d8..00000000 --- a/docs/accounting/Payments.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Payments - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**payments** | [**Array<Payment>**](Payment.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Payments.new(payments: null) -``` - - diff --git a/docs/accounting/Phone.md b/docs/accounting/Phone.md deleted file mode 100644 index 5477c5f6..00000000 --- a/docs/accounting/Phone.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::Phone - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**phone_type** | **String** | | [optional] -**phone_number** | **String** | max length = 50 | [optional] -**phone_area_code** | **String** | max length = 10 | [optional] -**phone_country_code** | **String** | max length = 20 | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Phone.new(phone_type: null, - phone_number: null, - phone_area_code: null, - phone_country_code: null) -``` - - diff --git a/docs/accounting/Prepayment.md b/docs/accounting/Prepayment.md deleted file mode 100644 index 8fdfc6fd..00000000 --- a/docs/accounting/Prepayment.md +++ /dev/null @@ -1,53 +0,0 @@ -# XeroRuby::Accounting::Prepayment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | See Prepayment Types | [optional] -**contact** | [**Contact**](Contact.md) | | [optional] -**date** | **Date** | The date the prepayment is created YYYY-MM-DD | [optional] -**status** | **String** | See Prepayment Status Codes | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | See Prepayment Line Items | [optional] -**sub_total** | **Float** | The subtotal of the prepayment excluding taxes | [optional] -**total_tax** | **Float** | The total tax on the prepayment | [optional] -**total** | **Float** | The total of the prepayment(subtotal + total tax) | [optional] -**reference** | **String** | Returns Invoice number field. Reference field isn't available. | [optional] -**updated_date_utc** | **DateTime** | UTC timestamp of last update to the prepayment | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**prepayment_id** | **String** | Xero generated unique identifier | [optional] -**currency_rate** | **Float** | The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used | [optional] -**remaining_credit** | **Float** | The remaining credit balance on the prepayment | [optional] -**allocations** | [**Array<Allocation>**](Allocation.md) | See Allocations | [optional] -**applied_amount** | **Float** | The amount of applied to an invoice | [optional] -**has_attachments** | **Boolean** | boolean to indicate if a prepayment has an attachment | [optional] [default to false] -**attachments** | [**Array<Attachment>**](Attachment.md) | See Attachments | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Prepayment.new(type: null, - contact: null, - date: null, - status: null, - line_amount_types: null, - line_items: null, - sub_total: null, - total_tax: null, - total: null, - reference: null, - updated_date_utc: null, - currency_code: null, - prepayment_id: null, - currency_rate: null, - remaining_credit: null, - allocations: null, - applied_amount: 2.0, - has_attachments: false, - attachments: null) -``` - - diff --git a/docs/accounting/Prepayments.md b/docs/accounting/Prepayments.md deleted file mode 100644 index eb097e83..00000000 --- a/docs/accounting/Prepayments.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Prepayments - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**prepayments** | [**Array<Prepayment>**](Prepayment.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Prepayments.new(prepayments: null) -``` - - diff --git a/docs/accounting/Purchase.md b/docs/accounting/Purchase.md deleted file mode 100644 index c5fdecb4..00000000 --- a/docs/accounting/Purchase.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::Purchase - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**unit_price** | **Float** | Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. | [optional] -**account_code** | **String** | Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items | [optional] -**cogs_account_code** | **String** | Cost of goods sold account. Only applicable to the purchase details of tracked items. | [optional] -**tax_type** | **String** | The tax type from TaxRates | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Purchase.new(unit_price: null, - account_code: null, - cogs_account_code: null, - tax_type: null) -``` - - diff --git a/docs/accounting/PurchaseOrder.md b/docs/accounting/PurchaseOrder.md deleted file mode 100644 index 262f2316..00000000 --- a/docs/accounting/PurchaseOrder.md +++ /dev/null @@ -1,71 +0,0 @@ -# XeroRuby::Accounting::PurchaseOrder - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**contact** | [**Contact**](Contact.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] -**date** | **Date** | Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation | [optional] -**delivery_date** | **Date** | Date the goods are to be delivered – YYYY-MM-DD | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**purchase_order_number** | **String** | Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) | [optional] -**reference** | **String** | Additional reference number | [optional] -**branding_theme_id** | **String** | See BrandingThemes | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**status** | **String** | See Purchase Order Status Codes | [optional] -**sent_to_contact** | **Boolean** | Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed | [optional] -**delivery_address** | **String** | The address the goods are to be delivered to | [optional] -**attention_to** | **String** | The person that the delivery is going to | [optional] -**telephone** | **String** | The phone number for the person accepting the delivery | [optional] -**delivery_instructions** | **String** | A free text feild for instructions (500 characters max) | [optional] -**expected_arrival_date** | **Date** | The date the goods are expected to arrive. | [optional] -**purchase_order_id** | **String** | Xero generated unique identifier for purchase order | [optional] -**currency_rate** | **Float** | The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. | [optional] -**sub_total** | **Float** | Total of purchase order excluding taxes | [optional] -**total_tax** | **Float** | Total tax on purchase order | [optional] -**total** | **Float** | Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) | [optional] -**total_discount** | **Float** | Total of discounts applied on the purchase order line items | [optional] -**has_attachments** | **Boolean** | boolean to indicate if a purchase order has an attachment | [optional] [default to false] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] -**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] -**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::PurchaseOrder.new(contact: null, - line_items: null, - date: null, - delivery_date: null, - line_amount_types: null, - purchase_order_number: null, - reference: null, - branding_theme_id: null, - currency_code: null, - status: null, - sent_to_contact: null, - delivery_address: null, - attention_to: null, - telephone: null, - delivery_instructions: null, - expected_arrival_date: null, - purchase_order_id: null, - currency_rate: null, - sub_total: null, - total_tax: null, - total: null, - total_discount: null, - has_attachments: false, - updated_date_utc: null, - status_attribute_string: null, - validation_errors: null, - warnings: null, - attachments: null) -``` - - diff --git a/docs/accounting/PurchaseOrders.md b/docs/accounting/PurchaseOrders.md deleted file mode 100644 index 12b2826b..00000000 --- a/docs/accounting/PurchaseOrders.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::PurchaseOrders - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**purchase_orders** | [**Array<PurchaseOrder>**](PurchaseOrder.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::PurchaseOrders.new(purchase_orders: null) -``` - - diff --git a/docs/accounting/Quote.md b/docs/accounting/Quote.md deleted file mode 100644 index b20d8397..00000000 --- a/docs/accounting/Quote.md +++ /dev/null @@ -1,59 +0,0 @@ -# XeroRuby::Accounting::Quote - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**quote_id** | **String** | QuoteID GUID is automatically generated and is returned after create or GET. | [optional] -**quote_number** | **String** | Unique alpha numeric code identifying a quote (Max Length = 255) | [optional] -**reference** | **String** | Additional reference number | [optional] -**terms** | **String** | Terms of the quote | [optional] -**contact** | [**Contact**](Contact.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] -**date** | **Date** | Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation | [optional] -**date_string** | **String** | Date the quote was issued (YYYY-MM-DD) | [optional] -**expiry_date** | **Date** | Date the quote expires – YYYY-MM-DD. | [optional] -**expiry_date_string** | **String** | Date the quote expires – YYYY-MM-DD. | [optional] -**status** | [**QuoteStatusCodes**](QuoteStatusCodes.md) | | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**currency_rate** | **Float** | The currency rate for a multicurrency quote | [optional] -**sub_total** | **Float** | Total of quote excluding taxes. | [optional] -**total_tax** | **Float** | Total tax on quote | [optional] -**total** | **Float** | Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts | [optional] -**total_discount** | **Float** | Total of discounts applied on the quote line items | [optional] -**title** | **String** | Title text for the quote | [optional] -**summary** | **String** | Summary text for the quote | [optional] -**branding_theme_id** | **String** | See BrandingThemes | [optional] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**line_amount_types** | [**QuoteLineAmountTypes**](QuoteLineAmountTypes.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Quote.new(quote_id: null, - quote_number: null, - reference: null, - terms: null, - contact: null, - line_items: null, - date: null, - date_string: null, - expiry_date: null, - expiry_date_string: null, - status: null, - currency_code: null, - currency_rate: null, - sub_total: null, - total_tax: null, - total: null, - total_discount: null, - title: null, - summary: null, - branding_theme_id: null, - updated_date_utc: null, - line_amount_types: null) -``` - - diff --git a/docs/accounting/QuoteLineAmountTypes.md b/docs/accounting/QuoteLineAmountTypes.md deleted file mode 100644 index b2140631..00000000 --- a/docs/accounting/QuoteLineAmountTypes.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::QuoteLineAmountTypes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::QuoteLineAmountTypes.new() -``` - - diff --git a/docs/accounting/QuoteStatusCodes.md b/docs/accounting/QuoteStatusCodes.md deleted file mode 100644 index 443ff002..00000000 --- a/docs/accounting/QuoteStatusCodes.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::QuoteStatusCodes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::QuoteStatusCodes.new() -``` - - diff --git a/docs/accounting/Quotes.md b/docs/accounting/Quotes.md deleted file mode 100644 index 28ca980d..00000000 --- a/docs/accounting/Quotes.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Quotes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**quotes** | [**Array<Quote>**](Quote.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Quotes.new(quotes: null) -``` - - diff --git a/docs/accounting/Receipt.md b/docs/accounting/Receipt.md deleted file mode 100644 index 5f44e6df..00000000 --- a/docs/accounting/Receipt.md +++ /dev/null @@ -1,51 +0,0 @@ -# XeroRuby::Accounting::Receipt - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**date** | **Date** | Date of receipt – YYYY-MM-DD | [optional] -**contact** | [**Contact**](Contact.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | | [optional] -**user** | [**User**](User.md) | | [optional] -**reference** | **String** | Additional reference number | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**sub_total** | **Float** | Total of receipt excluding taxes | [optional] -**total_tax** | **Float** | Total tax on receipt | [optional] -**total** | **Float** | Total of receipt tax inclusive (i.e. SubTotal + TotalTax) | [optional] -**receipt_id** | **String** | Xero generated unique identifier for receipt | [optional] -**status** | **String** | Current status of receipt – see status types | [optional] -**receipt_number** | **String** | Xero generated sequence number for receipt in current claim for a given user | [optional] -**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] -**has_attachments** | **Boolean** | boolean to indicate if a receipt has an attachment | [optional] [default to false] -**url** | **String** | URL link to a source document – shown as “Go to [appName]” in the Xero app | [optional] -**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] -**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] -**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Receipt.new(date: null, - contact: null, - line_items: null, - user: null, - reference: null, - line_amount_types: null, - sub_total: null, - total_tax: null, - total: null, - receipt_id: null, - status: null, - receipt_number: null, - updated_date_utc: null, - has_attachments: false, - url: null, - validation_errors: null, - warnings: null, - attachments: null) -``` - - diff --git a/docs/accounting/Receipts.md b/docs/accounting/Receipts.md deleted file mode 100644 index 3327dc32..00000000 --- a/docs/accounting/Receipts.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Receipts - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**receipts** | [**Array<Receipt>**](Receipt.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Receipts.new(receipts: null) -``` - - diff --git a/docs/accounting/RepeatingInvoice.md b/docs/accounting/RepeatingInvoice.md deleted file mode 100644 index 16acd6e2..00000000 --- a/docs/accounting/RepeatingInvoice.md +++ /dev/null @@ -1,47 +0,0 @@ -# XeroRuby::Accounting::RepeatingInvoice - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | **String** | See Invoice Types | [optional] -**contact** | [**Contact**](Contact.md) | | [optional] -**schedule** | [**Schedule**](Schedule.md) | | [optional] -**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] -**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] -**reference** | **String** | ACCREC only – additional reference number | [optional] -**branding_theme_id** | **String** | See BrandingThemes | [optional] -**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] -**status** | **String** | One of the following - DRAFT or AUTHORISED – See Invoice Status Codes | [optional] -**sub_total** | **Float** | Total of invoice excluding taxes | [optional] -**total_tax** | **Float** | Total tax on invoice | [optional] -**total** | **Float** | Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) | [optional] -**repeating_invoice_id** | **String** | Xero generated unique identifier for repeating invoice template | [optional] -**id** | **String** | Xero generated unique identifier for repeating invoice template | [optional] -**has_attachments** | **Boolean** | boolean to indicate if an invoice has an attachment | [optional] [default to false] -**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::RepeatingInvoice.new(type: null, - contact: null, - schedule: null, - line_items: null, - line_amount_types: null, - reference: null, - branding_theme_id: null, - currency_code: null, - status: null, - sub_total: null, - total_tax: null, - total: null, - repeating_invoice_id: null, - id: null, - has_attachments: false, - attachments: null) -``` - - diff --git a/docs/accounting/RepeatingInvoices.md b/docs/accounting/RepeatingInvoices.md deleted file mode 100644 index 3a80aaea..00000000 --- a/docs/accounting/RepeatingInvoices.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::RepeatingInvoices - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**repeating_invoices** | [**Array<RepeatingInvoice>**](RepeatingInvoice.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::RepeatingInvoices.new(repeating_invoices: null) -``` - - diff --git a/docs/accounting/Report.md b/docs/accounting/Report.md deleted file mode 100644 index dcb380a3..00000000 --- a/docs/accounting/Report.md +++ /dev/null @@ -1,29 +0,0 @@ -# XeroRuby::Accounting::Report - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**report_id** | **String** | See Prepayment Types | [optional] -**report_name** | **String** | See Prepayment Types | [optional] -**report_type** | **String** | See Prepayment Types | [optional] -**report_title** | **String** | See Prepayment Types | [optional] -**report_date** | **String** | Date of report | [optional] -**updated_date_utc** | **DateTime** | Updated Date | [optional] -**contacts** | [**Array<TenNinteyNineContact>**](TenNinteyNineContact.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Report.new(report_id: null, - report_name: null, - report_type: null, - report_title: null, - report_date: null, - updated_date_utc: null, - contacts: null) -``` - - diff --git a/docs/accounting/ReportAttribute.md b/docs/accounting/ReportAttribute.md deleted file mode 100644 index cf98388f..00000000 --- a/docs/accounting/ReportAttribute.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::ReportAttribute - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **String** | | [optional] -**value** | **String** | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ReportAttribute.new(id: null, - value: null) -``` - - diff --git a/docs/accounting/ReportCell.md b/docs/accounting/ReportCell.md deleted file mode 100644 index b87b96a7..00000000 --- a/docs/accounting/ReportCell.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::ReportCell - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **String** | | [optional] -**attributes** | [**Array<ReportAttribute>**](ReportAttribute.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ReportCell.new(value: null, - attributes: null) -``` - - diff --git a/docs/accounting/ReportFields.md b/docs/accounting/ReportFields.md deleted file mode 100644 index 8e505ae8..00000000 --- a/docs/accounting/ReportFields.md +++ /dev/null @@ -1,21 +0,0 @@ -# XeroRuby::Accounting::ReportFields - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**field_id** | **String** | | [optional] -**description** | **String** | | [optional] -**value** | **String** | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ReportFields.new(field_id: null, - description: null, - value: null) -``` - - diff --git a/docs/accounting/ReportRow.md b/docs/accounting/ReportRow.md deleted file mode 100644 index 16c6388a..00000000 --- a/docs/accounting/ReportRow.md +++ /dev/null @@ -1,21 +0,0 @@ -# XeroRuby::Accounting::ReportRow - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**row_type** | [**RowType**](RowType.md) | | [optional] -**title** | **String** | | [optional] -**cells** | [**Array<ReportCell>**](ReportCell.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ReportRow.new(row_type: null, - title: null, - cells: null) -``` - - diff --git a/docs/accounting/ReportRows.md b/docs/accounting/ReportRows.md deleted file mode 100644 index ac43b80d..00000000 --- a/docs/accounting/ReportRows.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::ReportRows - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**row_type** | [**RowType**](RowType.md) | | [optional] -**title** | **String** | | [optional] -**cells** | [**Array<ReportCell>**](ReportCell.md) | | [optional] -**rows** | [**Array<ReportRow>**](ReportRow.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ReportRows.new(row_type: null, - title: null, - cells: null, - rows: null) -``` - - diff --git a/docs/accounting/ReportWithRow.md b/docs/accounting/ReportWithRow.md deleted file mode 100644 index 8b5f671f..00000000 --- a/docs/accounting/ReportWithRow.md +++ /dev/null @@ -1,33 +0,0 @@ -# XeroRuby::Accounting::ReportWithRow - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**report_id** | **String** | Report id | [optional] -**report_name** | **String** | Name of the report | [optional] -**report_title** | **String** | Title of the report | [optional] -**report_type** | **String** | The type of report (BalanceSheet,ProfitLoss, etc) | [optional] -**report_titles** | **Array<String>** | Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) | [optional] -**report_date** | **String** | Date of report | [optional] -**rows** | [**Array<ReportRows>**](ReportRows.md) | | [optional] -**updated_date_utc** | **DateTime** | Updated Date | [optional] -**fields** | [**Array<ReportFields>**](ReportFields.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ReportWithRow.new(report_id: null, - report_name: null, - report_title: null, - report_type: null, - report_titles: null, - report_date: null, - rows: null, - updated_date_utc: null, - fields: null) -``` - - diff --git a/docs/accounting/ReportWithRows.md b/docs/accounting/ReportWithRows.md deleted file mode 100644 index a949b8a3..00000000 --- a/docs/accounting/ReportWithRows.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::ReportWithRows - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reports** | [**Array<ReportWithRow>**](ReportWithRow.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ReportWithRows.new(reports: null) -``` - - diff --git a/docs/accounting/Reports.md b/docs/accounting/Reports.md deleted file mode 100644 index 1556e082..00000000 --- a/docs/accounting/Reports.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Reports - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**reports** | [**Array<Report>**](Report.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Reports.new(reports: null) -``` - - diff --git a/docs/accounting/RequestEmpty.md b/docs/accounting/RequestEmpty.md deleted file mode 100644 index 6e1a8775..00000000 --- a/docs/accounting/RequestEmpty.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::RequestEmpty - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**status** | **String** | Need at least one field to create an empty JSON payload | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::RequestEmpty.new(status: null) -``` - - diff --git a/docs/accounting/RowType.md b/docs/accounting/RowType.md deleted file mode 100644 index a83a9c18..00000000 --- a/docs/accounting/RowType.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::RowType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::RowType.new() -``` - - diff --git a/docs/accounting/SalesTrackingCategory.md b/docs/accounting/SalesTrackingCategory.md deleted file mode 100644 index dfe75953..00000000 --- a/docs/accounting/SalesTrackingCategory.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Accounting::SalesTrackingCategory - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tracking_category_name** | **String** | The default sales tracking category name for contacts | [optional] -**tracking_option_name** | **String** | The default purchase tracking category name for contacts | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::SalesTrackingCategory.new(tracking_category_name: null, - tracking_option_name: null) -``` - - diff --git a/docs/accounting/Schedule.md b/docs/accounting/Schedule.md deleted file mode 100644 index acb68f36..00000000 --- a/docs/accounting/Schedule.md +++ /dev/null @@ -1,29 +0,0 @@ -# XeroRuby::Accounting::Schedule - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**period** | **Integer** | Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) | [optional] -**unit** | **String** | One of the following - WEEKLY or MONTHLY | [optional] -**due_date** | **Integer** | Integer used with due date type e.g 20 (of following month), 31 (of current month) | [optional] -**due_date_type** | **String** | the payment terms | [optional] -**start_date** | **Date** | Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) | [optional] -**next_scheduled_date** | **Date** | The calendar date of the next invoice in the schedule to be generated | [optional] -**end_date** | **Date** | Invoice end date – only returned if the template has an end date set | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Schedule.new(period: null, - unit: null, - due_date: null, - due_date_type: null, - start_date: null, - next_scheduled_date: null, - end_date: null) -``` - - diff --git a/docs/accounting/TaxComponent.md b/docs/accounting/TaxComponent.md deleted file mode 100644 index 73d61537..00000000 --- a/docs/accounting/TaxComponent.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::TaxComponent - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of Tax Component | [optional] -**rate** | **Float** | Tax Rate (up to 4dp) | [optional] -**is_compound** | **Boolean** | Boolean to describe if Tax rate is compounded. | [optional] -**is_non_recoverable** | **Boolean** | Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TaxComponent.new(name: null, - rate: null, - is_compound: null, - is_non_recoverable: null) -``` - - diff --git a/docs/accounting/TaxRate.md b/docs/accounting/TaxRate.md deleted file mode 100644 index 045d24cc..00000000 --- a/docs/accounting/TaxRate.md +++ /dev/null @@ -1,39 +0,0 @@ -# XeroRuby::Accounting::TaxRate - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **String** | Name of tax rate | [optional] -**tax_type** | **String** | The tax type | [optional] -**tax_components** | [**Array<TaxComponent>**](TaxComponent.md) | See TaxComponents | [optional] -**status** | **String** | See Status Codes | [optional] -**report_tax_type** | **String** | See ReportTaxTypes | [optional] -**can_apply_to_assets** | **Boolean** | Boolean to describe if tax rate can be used for asset accounts i.e. true,false | [optional] -**can_apply_to_equity** | **Boolean** | Boolean to describe if tax rate can be used for equity accounts i.e true,false | [optional] -**can_apply_to_expenses** | **Boolean** | Boolean to describe if tax rate can be used for expense accounts i.e. true,false | [optional] -**can_apply_to_liabilities** | **Boolean** | Boolean to describe if tax rate can be used for liability accounts i.e. true,false | [optional] -**can_apply_to_revenue** | **Boolean** | Boolean to describe if tax rate can be used for revenue accounts i.e. true,false | [optional] -**display_tax_rate** | **Float** | Tax Rate (decimal to 4dp) e.g 12.5000 | [optional] -**effective_rate** | **Float** | Effective Tax Rate (decimal to 4dp) e.g 12.5000 | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TaxRate.new(name: null, - tax_type: null, - tax_components: null, - status: null, - report_tax_type: null, - can_apply_to_assets: null, - can_apply_to_equity: null, - can_apply_to_expenses: null, - can_apply_to_liabilities: null, - can_apply_to_revenue: null, - display_tax_rate: null, - effective_rate: null) -``` - - diff --git a/docs/accounting/TaxRates.md b/docs/accounting/TaxRates.md deleted file mode 100644 index 864490fd..00000000 --- a/docs/accounting/TaxRates.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::TaxRates - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tax_rates** | [**Array<TaxRate>**](TaxRate.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TaxRates.new(tax_rates: null) -``` - - diff --git a/docs/accounting/TaxType.md b/docs/accounting/TaxType.md deleted file mode 100644 index 3ea46a8c..00000000 --- a/docs/accounting/TaxType.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::TaxType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TaxType.new() -``` - - diff --git a/docs/accounting/TenNinteyNineContact.md b/docs/accounting/TenNinteyNineContact.md deleted file mode 100644 index abe0b22a..00000000 --- a/docs/accounting/TenNinteyNineContact.md +++ /dev/null @@ -1,59 +0,0 @@ -# XeroRuby::Accounting::TenNinteyNineContact - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**box1** | **Float** | Box 1 on 1099 Form | [optional] -**box2** | **Float** | Box 2 on 1099 Form | [optional] -**box3** | **Float** | Box 3 on 1099 Form | [optional] -**box4** | **Float** | Box 4 on 1099 Form | [optional] -**box5** | **Float** | Box 5 on 1099 Form | [optional] -**box6** | **Float** | Box 6 on 1099 Form | [optional] -**box7** | **Float** | Box 7 on 1099 Form | [optional] -**box8** | **Float** | Box 8 on 1099 Form | [optional] -**box9** | **Float** | Box 9 on 1099 Form | [optional] -**box10** | **Float** | Box 10 on 1099 Form | [optional] -**box11** | **Float** | Box 11 on 1099 Form | [optional] -**box13** | **Float** | Box 13 on 1099 Form | [optional] -**box14** | **Float** | Box 14 on 1099 Form | [optional] -**name** | **String** | Contact name on 1099 Form | [optional] -**federal_tax_id_type** | **String** | Contact Fed Tax ID type | [optional] -**city** | **String** | Contact city on 1099 Form | [optional] -**zip** | **String** | Contact zip on 1099 Form | [optional] -**state** | **String** | Contact State on 1099 Form | [optional] -**email** | **String** | Contact email on 1099 Form | [optional] -**street_address** | **String** | Contact address on 1099 Form | [optional] -**tax_id** | **String** | Contact tax id on 1099 Form | [optional] -**contact_id** | **String** | Contact contact id | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TenNinteyNineContact.new(box1: null, - box2: null, - box3: null, - box4: null, - box5: null, - box6: null, - box7: null, - box8: null, - box9: null, - box10: null, - box11: null, - box13: null, - box14: null, - name: null, - federal_tax_id_type: null, - city: null, - zip: null, - state: null, - email: null, - street_address: null, - tax_id: null, - contact_id: null) -``` - - diff --git a/docs/accounting/TimeZone.md b/docs/accounting/TimeZone.md deleted file mode 100644 index 722f6b8a..00000000 --- a/docs/accounting/TimeZone.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Accounting::TimeZone - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TimeZone.new() -``` - - diff --git a/docs/accounting/TrackingCategories.md b/docs/accounting/TrackingCategories.md deleted file mode 100644 index 226b2578..00000000 --- a/docs/accounting/TrackingCategories.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::TrackingCategories - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tracking_categories** | [**Array<TrackingCategory>**](TrackingCategory.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TrackingCategories.new(tracking_categories: null) -``` - - diff --git a/docs/accounting/TrackingCategory.md b/docs/accounting/TrackingCategory.md deleted file mode 100644 index 76017a01..00000000 --- a/docs/accounting/TrackingCategory.md +++ /dev/null @@ -1,27 +0,0 @@ -# XeroRuby::Accounting::TrackingCategory - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tracking_category_id** | **String** | The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] -**tracking_option_id** | **String** | The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f | [optional] -**name** | **String** | The name of the tracking category e.g. Department, Region (max length = 100) | [optional] -**option** | **String** | The option name of the tracking option e.g. East, West (max length = 100) | [optional] -**status** | **String** | The status of a tracking category | [optional] -**options** | [**Array<TrackingOption>**](TrackingOption.md) | See Tracking Options | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TrackingCategory.new(tracking_category_id: null, - tracking_option_id: null, - name: null, - option: null, - status: null, - options: null) -``` - - diff --git a/docs/accounting/TrackingOption.md b/docs/accounting/TrackingOption.md deleted file mode 100644 index dc18756c..00000000 --- a/docs/accounting/TrackingOption.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Accounting::TrackingOption - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tracking_option_id** | **String** | The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a | [optional] -**name** | **String** | The name of the tracking option e.g. Marketing, East (max length = 50) | [optional] -**status** | **String** | The status of a tracking option | [optional] -**tracking_category_id** | **String** | Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TrackingOption.new(tracking_option_id: null, - name: null, - status: null, - tracking_category_id: null) -``` - - diff --git a/docs/accounting/TrackingOptions.md b/docs/accounting/TrackingOptions.md deleted file mode 100644 index ed2937f9..00000000 --- a/docs/accounting/TrackingOptions.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::TrackingOptions - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**options** | [**Array<TrackingOption>**](TrackingOption.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::TrackingOptions.new(options: null) -``` - - diff --git a/docs/accounting/User.md b/docs/accounting/User.md deleted file mode 100644 index 0c6095a9..00000000 --- a/docs/accounting/User.md +++ /dev/null @@ -1,29 +0,0 @@ -# XeroRuby::Accounting::User - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**user_id** | **String** | Xero identifier | [optional] -**email_address** | **String** | Email address of user | [optional] -**first_name** | **String** | First name of user | [optional] -**last_name** | **String** | Last name of user | [optional] -**updated_date_utc** | **DateTime** | Timestamp of last change to user | [optional] -**is_subscriber** | **Boolean** | Boolean to indicate if user is the subscriber | [optional] -**organisation_role** | **String** | User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::User.new(user_id: null, - email_address: null, - first_name: null, - last_name: null, - updated_date_utc: null, - is_subscriber: null, - organisation_role: null) -``` - - diff --git a/docs/accounting/Users.md b/docs/accounting/Users.md deleted file mode 100644 index dbb042f4..00000000 --- a/docs/accounting/Users.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::Users - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**users** | [**Array<User>**](User.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::Users.new(users: null) -``` - - diff --git a/docs/accounting/ValidationError.md b/docs/accounting/ValidationError.md deleted file mode 100644 index db936d5b..00000000 --- a/docs/accounting/ValidationError.md +++ /dev/null @@ -1,17 +0,0 @@ -# XeroRuby::Accounting::ValidationError - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**message** | **String** | Validation error message | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Accounting' - -instance = XeroRuby::Accounting::ValidationError.new(message: null) -``` - - diff --git a/docs/assets/Asset.md b/docs/assets/Asset.md deleted file mode 100644 index 76f1a8a8..00000000 --- a/docs/assets/Asset.md +++ /dev/null @@ -1,45 +0,0 @@ -# XeroRuby::Assets::Asset - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**asset_id** | **String** | The Xero-generated Id for the asset | [optional] -**asset_name** | **String** | The name of the asset | -**asset_type_id** | **String** | The Xero-generated Id for the asset type | [optional] -**asset_number** | **String** | Must be unique. | [optional] -**purchase_date** | **Date** | The date the asset was purchased YYYY-MM-DD | [optional] -**purchase_price** | **Float** | The purchase price of the asset | [optional] -**disposal_price** | **Float** | The price the asset was disposed at | [optional] -**asset_status** | [**AssetStatus**](AssetStatus.md) | | [optional] -**warranty_expiry_date** | **String** | The date the asset’s warranty expires (if needed) YYYY-MM-DD | [optional] -**serial_number** | **String** | The asset's serial number | [optional] -**book_depreciation_setting** | [**BookDepreciationSetting**](BookDepreciationSetting.md) | | [optional] -**book_depreciation_detail** | [**BookDepreciationDetail**](BookDepreciationDetail.md) | | [optional] -**can_rollback** | **Boolean** | Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. | [optional] -**accounting_book_value** | **Float** | The accounting value of the asset | [optional] -**is_delete_enabled_for_date** | **Boolean** | Boolean to indicate whether delete is enabled | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::Asset.new(asset_id: 3b5b3a38-5649-495f-87a1-14a4e5918634, - asset_name: Awesome Truck 3, - asset_type_id: 3b5b3a38-5649-495f-87a1-14a4e5918634, - asset_number: FA-0013, - purchase_date: null, - purchase_price: 1000.0000, - disposal_price: 1.0000, - asset_status: null, - warranty_expiry_date: ca4c6b39-4f4f-43e8-98da-5e1f350a6694, - serial_number: ca4c6b39-4f4f-43e8-98da-5e1f350a6694, - book_depreciation_setting: null, - book_depreciation_detail: null, - can_rollback: true, - accounting_book_value: 0, - is_delete_enabled_for_date: true) -``` - - diff --git a/docs/assets/AssetApi.md b/docs/assets/AssetApi.md deleted file mode 100644 index a8a9f721..00000000 --- a/docs/assets/AssetApi.md +++ /dev/null @@ -1,414 +0,0 @@ -# XeroRuby::Assets::AssetApi - -All URIs are relative to *https://api.xero.com/assets.xro/1.0* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**create_asset**](AssetApi.md#create_asset) | **POST** /Assets | adds a fixed asset -[**create_asset_type**](AssetApi.md#create_asset_type) | **POST** /AssetTypes | adds a fixed asset type -[**get_asset_by_id**](AssetApi.md#get_asset_by_id) | **GET** /Assets/{id} | retrieves fixed asset by id -[**get_asset_settings**](AssetApi.md#get_asset_settings) | **GET** /Settings | searches fixed asset settings -[**get_asset_types**](AssetApi.md#get_asset_types) | **GET** /AssetTypes | searches fixed asset types -[**get_assets**](AssetApi.md#get_assets) | **GET** /Assets | searches fixed asset - - - -## create_asset - -> Asset create_asset(xero_tenant_id, asset) - -adds a fixed asset - -Adds an asset to the system - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -asset = { "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01", "purchasePrice":100.0, "disposalPrice":23.23, "assetStatus":"Draft", "bookDepreciationSetting":{ "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.5, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "currentCapitalGain":5.32, "currentGainLoss":3.88, "depreciationStartDate":"2020-01-02", "costLimit":100.0, "currentAccumDepreciationAmount":2.25 }, "AccountingBookValue":99.5 } # Asset | Fixed asset you are creating - -begin - #adds a fixed asset - result = api_instance.create_asset(xero_tenant_id, asset) - p result -rescue XeroRuby::Assets::ApiError => e - puts "Exception when calling AssetApi->create_asset: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **asset** | [**Asset**](Asset.md)| Fixed asset you are creating | - -### Return type - -[**Asset**](Asset.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## create_asset_type - -> AssetType create_asset_type(xero_tenant_id, opts) - -adds a fixed asset type - -Adds an fixed asset type to the system - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -opts = { - asset_type: { "assetTypeName":"Machinery11004", "fixedAssetAccountId":"3d8d063a-c148-4bb8-8b3c-a5e2ad3b1e82", "depreciationExpenseAccountId":"d1602f69-f900-4616-8d34-90af393fa368", "accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8", "bookDepreciationSetting":{ "depreciationMethod":"DiminishingValue100", "averagingMethod":"ActualDays", "depreciationRate":0.05, "depreciationCalculationMethod":"None" } } # AssetType | Asset type to add -} - -begin - #adds a fixed asset type - result = api_instance.create_asset_type(xero_tenant_id, opts) - p result -rescue XeroRuby::Assets::ApiError => e - puts "Exception when calling AssetApi->create_asset_type: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **asset_type** | [**AssetType**](AssetType.md)| Asset type to add | [optional] - -### Return type - -[**AssetType**](AssetType.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: application/json -- **Accept**: application/json - - -## get_asset_by_id - -> Asset get_asset_by_id(xero_tenant_id, id) - -retrieves fixed asset by id - -By passing in the appropriate asset id, you can search for a specific fixed asset in the system - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -id = '4f7bcdcb-5ec1-4258-9558-19f662fccdfe' # String | fixed asset id for single object - -begin - #retrieves fixed asset by id - result = api_instance.get_asset_by_id(xero_tenant_id, id) - p result -rescue XeroRuby::Assets::ApiError => e - puts "Exception when calling AssetApi->get_asset_by_id: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **id** | [**String**](.md)| fixed asset id for single object | - -### Return type - -[**Asset**](Asset.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_asset_settings - -> Setting get_asset_settings(xero_tenant_id) - -searches fixed asset settings - -By passing in the appropriate options, you can search for available fixed asset types in the system - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant - -begin - #searches fixed asset settings - result = api_instance.get_asset_settings(xero_tenant_id) - p result -rescue XeroRuby::Assets::ApiError => e - puts "Exception when calling AssetApi->get_asset_settings: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - -### Return type - -[**Setting**](Setting.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_asset_types - -> Array<AssetType> get_asset_types(xero_tenant_id) - -searches fixed asset types - -By passing in the appropriate options, you can search for available fixed asset types in the system - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant - -begin - #searches fixed asset types - result = api_instance.get_asset_types(xero_tenant_id) - p result -rescue XeroRuby::Assets::ApiError => e - puts "Exception when calling AssetApi->get_asset_types: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - -### Return type - -[**Array<AssetType>**](AssetType.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - - -## get_assets - -> Assets get_assets(xero_tenant_id, status, opts) - -searches fixed asset - -By passing in the appropriate options, you can search for available fixed asset in the system - -### Example - -```ruby -# load the gem -require 'xero-ruby' - -creds = { - client_id: ENV['CLIENT_ID'], - client_secret: ENV['CLIENT_SECRET'], - redirect_uri: ENV['REDIRECT_URI'], - scopes: ENV['SCOPES'] -} -xero_client = XeroRuby::ApiClient.new(credentials: creds) - -token_set = fetch_valid_token_set(user) # example - -xero_client.refresh_token_set(token_set) - -# If using the Accounting API -api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -status = XeroRuby::Assets::AssetStatusQueryParam.new # AssetStatusQueryParam | Required when retrieving a collection of assets. See Asset Status Codes -opts = { - page: 1, # Integer | Results are paged. This specifies which page of the results to return. The default page is 1. - page_size: 5, # Integer | The number of records returned per page. By default the number of records returned is 10. - order_by: 'AssetName', # String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. - sort_direction: 'ASC', # String | ASC or DESC - filter_by: 'Draft' # String | A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. -} - -begin - #searches fixed asset - result = api_instance.get_assets(xero_tenant_id, status, opts) - p result -rescue XeroRuby::Assets::ApiError => e - puts "Exception when calling AssetApi->get_assets: #{e}" -end -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **xero_tenant_id** | **String**| Xero identifier for Tenant | - **status** | [**AssetStatusQueryParam**](.md)| Required when retrieving a collection of assets. See Asset Status Codes | - **page** | **Integer**| Results are paged. This specifies which page of the results to return. The default page is 1. | [optional] - **page_size** | **Integer**| The number of records returned per page. By default the number of records returned is 10. | [optional] - **order_by** | **String**| Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. | [optional] - **sort_direction** | **String**| ASC or DESC | [optional] - **filter_by** | **String**| A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. | [optional] - -### Return type - -[**Assets**](Assets.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - diff --git a/docs/assets/AssetStatus.md b/docs/assets/AssetStatus.md deleted file mode 100644 index 20f5f516..00000000 --- a/docs/assets/AssetStatus.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Assets::AssetStatus - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::AssetStatus.new() -``` - - diff --git a/docs/assets/AssetStatusQueryParam.md b/docs/assets/AssetStatusQueryParam.md deleted file mode 100644 index 894c0bdd..00000000 --- a/docs/assets/AssetStatusQueryParam.md +++ /dev/null @@ -1,16 +0,0 @@ -# XeroRuby::Assets::AssetStatusQueryParam - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::AssetStatusQueryParam.new() -``` - - diff --git a/docs/assets/AssetType.md b/docs/assets/AssetType.md deleted file mode 100644 index cdff54ab..00000000 --- a/docs/assets/AssetType.md +++ /dev/null @@ -1,29 +0,0 @@ -# XeroRuby::Assets::AssetType - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**asset_type_id** | **String** | Xero generated unique identifier for asset types | -**asset_type_name** | **String** | The name of the asset type | -**fixed_asset_account_id** | **String** | The asset account for fixed assets of this type | [optional] -**depreciation_expense_account_id** | **String** | The expense account for the depreciation of fixed assets of this type | [optional] -**accumulated_depreciation_account_id** | **String** | The account for accumulated depreciation of fixed assets of this type | [optional] -**book_depreciation_setting** | [**BookDepreciationSetting**](BookDepreciationSetting.md) | | -**locks** | **Integer** | All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::AssetType.new(asset_type_id: 5da209c5-5e19-4a43-b925-71b776c49ced, - asset_type_name: Computer Equipment, - fixed_asset_account_id: 24e260f1-bfc4-4766-ad7f-8a8ce01de879, - depreciation_expense_account_id: b23fc79b-d66b-44b0-a240-e138e086fcbc, - accumulated_depreciation_account_id: ca4c6b39-4f4f-43e8-98da-5e1f350a6694, - book_depreciation_setting: null, - locks: 33) -``` - - diff --git a/docs/assets/Assets.md b/docs/assets/Assets.md deleted file mode 100644 index 5cb72fd2..00000000 --- a/docs/assets/Assets.md +++ /dev/null @@ -1,19 +0,0 @@ -# XeroRuby::Assets::Assets - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**pagination** | [**Pagination**](Pagination.md) | | [optional] -**items** | [**Array<Asset>**](Asset.md) | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::Assets.new(pagination: null, - items: null) -``` - - diff --git a/docs/assets/BookDepreciationDetail.md b/docs/assets/BookDepreciationDetail.md deleted file mode 100644 index 0117c97b..00000000 --- a/docs/assets/BookDepreciationDetail.md +++ /dev/null @@ -1,29 +0,0 @@ -# XeroRuby::Assets::BookDepreciationDetail - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**current_capital_gain** | **Float** | When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. | [optional] -**current_gain_loss** | **Float** | When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. | [optional] -**depreciation_start_date** | **Date** | YYYY-MM-DD | [optional] -**cost_limit** | **Float** | The value of the asset you want to depreciate, if this is less than the cost of the asset. | [optional] -**residual_value** | **Float** | The value of the asset remaining when you've fully depreciated it. | [optional] -**prior_accum_depreciation_amount** | **Float** | All depreciation prior to the current financial year. | [optional] -**current_accum_depreciation_amount** | **Float** | All depreciation occurring in the current financial year. | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::BookDepreciationDetail.new(current_capital_gain: 5.25, - current_gain_loss: 10.5, - depreciation_start_date: null, - cost_limit: 9000.0, - residual_value: 10000.0, - prior_accum_depreciation_amount: 0.45, - current_accum_depreciation_amount: 5.0) -``` - - diff --git a/docs/assets/BookDepreciationSetting.md b/docs/assets/BookDepreciationSetting.md deleted file mode 100644 index febeb256..00000000 --- a/docs/assets/BookDepreciationSetting.md +++ /dev/null @@ -1,31 +0,0 @@ -# XeroRuby::Assets::BookDepreciationSetting - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**depreciation_method** | **String** | The method of depreciation applied to this asset. See Depreciation Methods | [optional] -**averaging_method** | **String** | The method of averaging applied to this asset. See Averaging Methods | [optional] -**depreciation_rate** | **Float** | The rate of depreciation (e.g. 0.05) | [optional] -**effective_life_years** | **Integer** | Effective life of the asset in years (e.g. 5) | [optional] -**depreciation_calculation_method** | **String** | See Depreciation Calculation Methods | [optional] -**depreciable_object_id** | **String** | Unique Xero identifier for the depreciable object | [optional] -**depreciable_object_type** | **String** | The type of asset object | [optional] -**book_effective_date_of_change_id** | **String** | Unique Xero identifier for the effective date change | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::BookDepreciationSetting.new(depreciation_method: StraightLine, - averaging_method: ActualDays, - depreciation_rate: 0.05, - effective_life_years: 5, - depreciation_calculation_method: None, - depreciable_object_id: 68f17094-af97-4f1b-b36b-013b45b6ad3c, - depreciable_object_type: Asset, - book_effective_date_of_change_id: 68f17094-af97-4f1b-b36b-013b45b6ad3c) -``` - - diff --git a/docs/assets/Error.md b/docs/assets/Error.md deleted file mode 100644 index 6882a2a4..00000000 --- a/docs/assets/Error.md +++ /dev/null @@ -1,25 +0,0 @@ -# XeroRuby::Assets::Error - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**resource_validation_errors** | [**Array<ResourceValidationErrorsElement>**](ResourceValidationErrorsElement.md) | Array of elements of resource validation errors | [optional] -**field_validation_errors** | [**Array<FieldValidationErrorsElement>**](FieldValidationErrorsElement.md) | Array of elements of field validation errors | [optional] -**type** | **String** | The internal type of error, not accessible externally | [optional] -**title** | **String** | Title of the error | [optional] -**detail** | **String** | Detail of the error | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::Error.new(resource_validation_errors: null, - field_validation_errors: null, - type: null, - title: null, - detail: null) -``` - - diff --git a/docs/assets/FieldValidationErrorsElement.md b/docs/assets/FieldValidationErrorsElement.md deleted file mode 100644 index eda00fa1..00000000 --- a/docs/assets/FieldValidationErrorsElement.md +++ /dev/null @@ -1,27 +0,0 @@ -# XeroRuby::Assets::FieldValidationErrorsElement - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**field_name** | **String** | The field name of the erroneous field | [optional] -**value_provided** | **String** | The provided value | [optional] -**localised_message** | **String** | Explaination of the field validation error | [optional] -**type** | **String** | Internal type of the field validation error message | [optional] -**title** | **String** | Title of the field validation error | [optional] -**detail** | **String** | Detail of the field validation error | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::FieldValidationErrorsElement.new(field_name: null, - value_provided: null, - localised_message: null, - type: null, - title: null, - detail: null) -``` - - diff --git a/docs/assets/Pagination.md b/docs/assets/Pagination.md deleted file mode 100644 index eabecc70..00000000 --- a/docs/assets/Pagination.md +++ /dev/null @@ -1,23 +0,0 @@ -# XeroRuby::Assets::Pagination - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**page** | **Integer** | | [optional] -**page_size** | **Integer** | | [optional] -**page_count** | **Integer** | | [optional] -**item_count** | **Integer** | | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::Pagination.new(page: 1, - page_size: 10, - page_count: 1, - item_count: 2) -``` - - diff --git a/docs/assets/ResourceValidationErrorsElement.md b/docs/assets/ResourceValidationErrorsElement.md deleted file mode 100644 index ef1e02e4..00000000 --- a/docs/assets/ResourceValidationErrorsElement.md +++ /dev/null @@ -1,25 +0,0 @@ -# XeroRuby::Assets::ResourceValidationErrorsElement - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**resource_name** | **String** | The field name of the erroneous field | [optional] -**localised_message** | **String** | Explaination of the resource validation error | [optional] -**type** | **String** | Internal type of the resource error message | [optional] -**title** | **String** | Title of the resource validation error | [optional] -**detail** | **String** | Detail of the resource validation error | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::ResourceValidationErrorsElement.new(resource_name: null, - localised_message: null, - type: null, - title: null, - detail: null) -``` - - diff --git a/docs/assets/Setting.md b/docs/assets/Setting.md deleted file mode 100644 index 05c0c193..00000000 --- a/docs/assets/Setting.md +++ /dev/null @@ -1,31 +0,0 @@ -# XeroRuby::Assets::Setting - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**asset_number_prefix** | **String** | The prefix used for fixed asset numbers (“FA-” by default) | [optional] -**asset_number_sequence** | **String** | The next available sequence number | [optional] -**asset_start_date** | **Date** | The date depreciation calculations started on registered fixed assets in Xero | [optional] -**last_depreciation_date** | **Date** | The last depreciation date | [optional] -**default_gain_on_disposal_account_id** | **String** | Default account that gains are posted to | [optional] -**default_loss_on_disposal_account_id** | **String** | Default account that losses are posted to | [optional] -**default_capital_gain_on_disposal_account_id** | **String** | Default account that capital gains are posted to | [optional] -**opt_in_for_tax** | **Boolean** | opt in for tax calculation | [optional] - -## Code Sample - -```ruby -require 'XeroRuby::Assets' - -instance = XeroRuby::Assets::Setting.new(asset_number_prefix: FA-, - asset_number_sequence: 0022, - asset_start_date: null, - last_depreciation_date: null, - default_gain_on_disposal_account_id: 346ddb97-739a-4274-b43b-66aa3218d17c, - default_loss_on_disposal_account_id: 1b798541-24e2-4855-9309-c023a0b576f3, - default_capital_gain_on_disposal_account_id: 6d6a0bdb-e118-45d8-a023-2ad617ec1cb7, - opt_in_for_tax: false) -``` - - diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb deleted file mode 100644 index 5f472e9a..00000000 --- a/lib/xero-ruby.rb +++ /dev/null @@ -1,161 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -# Common files -require 'xero-ruby/api_client' -require 'xero-ruby/api_error' -require 'xero-ruby/version' -require 'xero-ruby/configuration' - -# Models -require 'xero-ruby/models/assets/asset' -require 'xero-ruby/models/assets/asset_status' -require 'xero-ruby/models/assets/asset_status_query_param' -require 'xero-ruby/models/assets/asset_type' -require 'xero-ruby/models/assets/assets' -require 'xero-ruby/models/assets/book_depreciation_detail' -require 'xero-ruby/models/assets/book_depreciation_setting' -require 'xero-ruby/models/assets/error' -require 'xero-ruby/models/assets/field_validation_errors_element' -require 'xero-ruby/models/assets/pagination' -require 'xero-ruby/models/assets/resource_validation_errors_element' -require 'xero-ruby/models/assets/setting' -require 'xero-ruby/models/accounting/account' -require 'xero-ruby/models/accounting/account_type' -require 'xero-ruby/models/accounting/accounts' -require 'xero-ruby/models/accounting/accounts_payable' -require 'xero-ruby/models/accounting/accounts_receivable' -require 'xero-ruby/models/accounting/address' -require 'xero-ruby/models/accounting/allocation' -require 'xero-ruby/models/accounting/allocations' -require 'xero-ruby/models/accounting/attachment' -require 'xero-ruby/models/accounting/attachments' -require 'xero-ruby/models/accounting/balances' -require 'xero-ruby/models/accounting/bank_transaction' -require 'xero-ruby/models/accounting/bank_transactions' -require 'xero-ruby/models/accounting/bank_transfer' -require 'xero-ruby/models/accounting/bank_transfers' -require 'xero-ruby/models/accounting/batch_payment' -require 'xero-ruby/models/accounting/batch_payment_details' -require 'xero-ruby/models/accounting/batch_payments' -require 'xero-ruby/models/accounting/bill' -require 'xero-ruby/models/accounting/branding_theme' -require 'xero-ruby/models/accounting/branding_themes' -require 'xero-ruby/models/accounting/cis_org_setting' -require 'xero-ruby/models/accounting/cis_setting' -require 'xero-ruby/models/accounting/cis_settings' -require 'xero-ruby/models/accounting/contact' -require 'xero-ruby/models/accounting/contact_group' -require 'xero-ruby/models/accounting/contact_groups' -require 'xero-ruby/models/accounting/contact_person' -require 'xero-ruby/models/accounting/contacts' -require 'xero-ruby/models/accounting/country_code' -require 'xero-ruby/models/accounting/credit_note' -require 'xero-ruby/models/accounting/credit_notes' -require 'xero-ruby/models/accounting/currencies' -require 'xero-ruby/models/accounting/currency' -require 'xero-ruby/models/accounting/currency_code' -require 'xero-ruby/models/accounting/element' -require 'xero-ruby/models/accounting/employee' -require 'xero-ruby/models/accounting/employees' -require 'xero-ruby/models/accounting/error' -require 'xero-ruby/models/accounting/expense_claim' -require 'xero-ruby/models/accounting/expense_claims' -require 'xero-ruby/models/accounting/external_link' -require 'xero-ruby/models/accounting/history_record' -require 'xero-ruby/models/accounting/history_records' -require 'xero-ruby/models/accounting/invoice' -require 'xero-ruby/models/accounting/invoice_reminder' -require 'xero-ruby/models/accounting/invoice_reminders' -require 'xero-ruby/models/accounting/invoices' -require 'xero-ruby/models/accounting/item' -require 'xero-ruby/models/accounting/items' -require 'xero-ruby/models/accounting/journal' -require 'xero-ruby/models/accounting/journal_line' -require 'xero-ruby/models/accounting/journals' -require 'xero-ruby/models/accounting/line_amount_types' -require 'xero-ruby/models/accounting/line_item' -require 'xero-ruby/models/accounting/line_item_tracking' -require 'xero-ruby/models/accounting/linked_transaction' -require 'xero-ruby/models/accounting/linked_transactions' -require 'xero-ruby/models/accounting/manual_journal' -require 'xero-ruby/models/accounting/manual_journal_line' -require 'xero-ruby/models/accounting/manual_journals' -require 'xero-ruby/models/accounting/online_invoice' -require 'xero-ruby/models/accounting/online_invoices' -require 'xero-ruby/models/accounting/organisation' -require 'xero-ruby/models/accounting/organisations' -require 'xero-ruby/models/accounting/overpayment' -require 'xero-ruby/models/accounting/overpayments' -require 'xero-ruby/models/accounting/payment' -require 'xero-ruby/models/accounting/payment_delete' -require 'xero-ruby/models/accounting/payment_service' -require 'xero-ruby/models/accounting/payment_services' -require 'xero-ruby/models/accounting/payment_term' -require 'xero-ruby/models/accounting/payment_term_type' -require 'xero-ruby/models/accounting/payments' -require 'xero-ruby/models/accounting/phone' -require 'xero-ruby/models/accounting/prepayment' -require 'xero-ruby/models/accounting/prepayments' -require 'xero-ruby/models/accounting/purchase' -require 'xero-ruby/models/accounting/purchase_order' -require 'xero-ruby/models/accounting/purchase_orders' -require 'xero-ruby/models/accounting/quote' -require 'xero-ruby/models/accounting/quote_line_amount_types' -require 'xero-ruby/models/accounting/quote_status_codes' -require 'xero-ruby/models/accounting/quotes' -require 'xero-ruby/models/accounting/receipt' -require 'xero-ruby/models/accounting/receipts' -require 'xero-ruby/models/accounting/repeating_invoice' -require 'xero-ruby/models/accounting/repeating_invoices' -require 'xero-ruby/models/accounting/report' -require 'xero-ruby/models/accounting/report_attribute' -require 'xero-ruby/models/accounting/report_cell' -require 'xero-ruby/models/accounting/report_fields' -require 'xero-ruby/models/accounting/report_row' -require 'xero-ruby/models/accounting/report_rows' -require 'xero-ruby/models/accounting/report_with_row' -require 'xero-ruby/models/accounting/report_with_rows' -require 'xero-ruby/models/accounting/reports' -require 'xero-ruby/models/accounting/request_empty' -require 'xero-ruby/models/accounting/row_type' -require 'xero-ruby/models/accounting/sales_tracking_category' -require 'xero-ruby/models/accounting/schedule' -require 'xero-ruby/models/accounting/tax_component' -require 'xero-ruby/models/accounting/tax_rate' -require 'xero-ruby/models/accounting/tax_rates' -require 'xero-ruby/models/accounting/tax_type' -require 'xero-ruby/models/accounting/ten_nintey_nine_contact' -require 'xero-ruby/models/accounting/time_zone' -require 'xero-ruby/models/accounting/tracking_categories' -require 'xero-ruby/models/accounting/tracking_category' -require 'xero-ruby/models/accounting/tracking_option' -require 'xero-ruby/models/accounting/tracking_options' -require 'xero-ruby/models/accounting/user' -require 'xero-ruby/models/accounting/users' -require 'xero-ruby/models/accounting/validation_error' - -# APIs -require 'xero-ruby/api/asset_api' -require 'xero-ruby/api/accounting_api' - -module XeroRuby - class << self - def configure - if block_given? - yield(Configuration.default) - else - Configuration.default - end - end - end -end diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb deleted file mode 100644 index a2941bfd..00000000 --- a/lib/xero-ruby/api/accounting_api.rb +++ /dev/null @@ -1,15672 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'cgi' - -module XeroRuby - class AccountingApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.new) - @api_client = api_client - end - # Allows you to create a new chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account [Account] Account object in body of request - # @param [Hash] opts the optional parameters - # @return [Accounts] - def create_account(xero_tenant_id, account, opts = {}) - data, _status_code, _headers = create_account_with_http_info(xero_tenant_id, account, opts) - data - end - - # Allows you to create a new chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account [Account] Account object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers - def create_account_with_http_info(xero_tenant_id, account, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_account ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_account" - end - # verify the required parameter 'account' is set - if @api_client.config.client_side_validation && account.nil? - fail ArgumentError, "Missing the required parameter 'account' when calling AccountingApi.create_account" - end - # resource path - local_var_path = '/Accounts' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(account) - - # return_type - return_type = opts[:return_type] || 'Accounts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create Attachment on Account - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, opts = {}) - data, _status_code, _headers = create_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts) - data - end - - # Allows you to create Attachment on Account - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_account_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_account_attachment_by_file_name" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.create_account_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_account_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_account_attachment_by_file_name" - end - # resource path - local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to createa an Attachment on BankTransaction by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param file_name [String] The name of the file being attached - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) - data, _status_code, _headers = create_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts) - data - end - - # Allows you to createa an Attachment on BankTransaction by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param file_name [String] The name of the file being attached - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transaction_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create history record for a bank transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records, opts = {}) - data, _status_code, _headers = create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_transaction_id, history_records, opts) - data - end - - # Allows you to create history record for a bank transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_transaction_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transaction_history_record ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transaction_history_record" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.create_bank_transaction_history_record" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_bank_transaction_history_record" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}/History'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_bank_transaction_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create one or more spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [BankTransactions] - def create_bank_transactions(xero_tenant_id, bank_transactions, opts = {}) - data, _status_code, _headers = create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts) - data - end - - # Allows you to create one or more spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers - def create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transactions ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transactions" - end - # verify the required parameter 'bank_transactions' is set - if @api_client.config.client_side_validation && bank_transactions.nil? - fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.create_bank_transactions" - end - # resource path - local_var_path = '/BankTransactions' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(bank_transactions) - - # return_type - return_type = opts[:return_type] || 'BankTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfers [BankTransfers] BankTransfers with array of BankTransfer objects in request body - # @param [Hash] opts the optional parameters - # @return [BankTransfers] - def create_bank_transfer(xero_tenant_id, bank_transfers, opts = {}) - data, _status_code, _headers = create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts) - data - end - - # Allows you to create a bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfers [BankTransfers] BankTransfers with array of BankTransfer objects in request body - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers - def create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transfer" - end - # verify the required parameter 'bank_transfers' is set - if @api_client.config.client_side_validation && bank_transfers.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfers' when calling AccountingApi.create_bank_transfer" - end - # resource path - local_var_path = '/BankTransfers' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(bank_transfers) - - # return_type - return_type = opts[:return_type] || 'BankTransfers' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param file_name [String] The name of the file being attached to a Bank Transfer - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) - data, _status_code, _headers = create_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts) - data - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param file_name [String] The name of the file being attached to a Bank Transfer - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records, opts = {}) - data, _status_code, _headers = create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_transfer_id, history_records, opts) - data - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_transfer_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer_history_record ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transfer_history_record" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.create_bank_transfer_history_record" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_bank_transfer_history_record" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}/History'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Create one or many BatchPayments for invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [BatchPayments] - def create_batch_payment(xero_tenant_id, batch_payments, opts = {}) - data, _status_code, _headers = create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts) - data - end - - # Create one or many BatchPayments for invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers - def create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_batch_payment ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_batch_payment" - end - # verify the required parameter 'batch_payments' is set - if @api_client.config.client_side_validation && batch_payments.nil? - fail ArgumentError, "Missing the required parameter 'batch_payments' when calling AccountingApi.create_batch_payment" - end - # resource path - local_var_path = '/BatchPayments' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(batch_payments) - - # return_type - return_type = opts[:return_type] || 'BatchPayments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_batch_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a history record for a Batch Payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param batch_payment_id [String] Unique identifier for BatchPayment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records, opts = {}) - data, _status_code, _headers = create_batch_payment_history_record_with_http_info(xero_tenant_id, batch_payment_id, history_records, opts) - data - end - - # Allows you to create a history record for a Batch Payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param batch_payment_id [String] Unique identifier for BatchPayment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_batch_payment_history_record_with_http_info(xero_tenant_id, batch_payment_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_batch_payment_history_record ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_batch_payment_history_record" - end - # verify the required parameter 'batch_payment_id' is set - if @api_client.config.client_side_validation && batch_payment_id.nil? - fail ArgumentError, "Missing the required parameter 'batch_payment_id' when calling AccountingApi.create_batch_payment_history_record" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_batch_payment_history_record" - end - # resource path - local_var_path = '/BatchPayments/{BatchPaymentID}/History'.sub('{' + 'BatchPaymentID' + '}', batch_payment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_batch_payment_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allow for the creation of new custom payment service for specified Branding Theme - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param branding_theme_id [String] Unique identifier for a Branding Theme - # @param payment_service [PaymentService] PaymentService object in body of request - # @param [Hash] opts the optional parameters - # @return [PaymentServices] - def create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service, opts = {}) - data, _status_code, _headers = create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_service, opts) - data - end - - # Allow for the creation of new custom payment service for specified Branding Theme - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param branding_theme_id [String] Unique identifier for a Branding Theme - # @param payment_service [PaymentService] PaymentService object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers - def create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_service, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_branding_theme_payment_services ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_branding_theme_payment_services" - end - # verify the required parameter 'branding_theme_id' is set - if @api_client.config.client_side_validation && branding_theme_id.nil? - fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.create_branding_theme_payment_services" - end - # verify the required parameter 'payment_service' is set - if @api_client.config.client_side_validation && payment_service.nil? - fail ArgumentError, "Missing the required parameter 'payment_service' when calling AccountingApi.create_branding_theme_payment_services" - end - # resource path - local_var_path = '/BrandingThemes/{BrandingThemeID}/PaymentServices'.sub('{' + 'BrandingThemeID' + '}', branding_theme_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(payment_service) - - # return_type - return_type = opts[:return_type] || 'PaymentServices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_branding_theme_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param file_name [String] Name for the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, opts = {}) - data, _status_code, _headers = create_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts) - data - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param file_name [String] Name for the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_attachment_by_file_name" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.create_contact_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_contact_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_contact_attachment_by_file_name" - end - # resource path - local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a contact group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_groups [ContactGroups] ContactGroups with an array of names in request body - # @param [Hash] opts the optional parameters - # @return [ContactGroups] - def create_contact_group(xero_tenant_id, contact_groups, opts = {}) - data, _status_code, _headers = create_contact_group_with_http_info(xero_tenant_id, contact_groups, opts) - data - end - - # Allows you to create a contact group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_groups [ContactGroups] ContactGroups with an array of names in request body - # @param [Hash] opts the optional parameters - # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers - def create_contact_group_with_http_info(xero_tenant_id, contact_groups, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_group ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_group" - end - # verify the required parameter 'contact_groups' is set - if @api_client.config.client_side_validation && contact_groups.nil? - fail ArgumentError, "Missing the required parameter 'contact_groups' when calling AccountingApi.create_contact_group" - end - # resource path - local_var_path = '/ContactGroups' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(contact_groups) - - # return_type - return_type = opts[:return_type] || 'ContactGroups' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to add Contacts to a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param contacts [Contacts] Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request - # @param [Hash] opts the optional parameters - # @return [Contacts] - def create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts, opts = {}) - data, _status_code, _headers = create_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, contacts, opts) - data - end - - # Allows you to add Contacts to a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param contacts [Contacts] Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers - def create_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, contacts, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_group_contacts ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_group_contacts" - end - # verify the required parameter 'contact_group_id' is set - if @api_client.config.client_side_validation && contact_group_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.create_contact_group_contacts" - end - # verify the required parameter 'contacts' is set - if @api_client.config.client_side_validation && contacts.nil? - fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.create_contact_group_contacts" - end - # resource path - local_var_path = '/ContactGroups/{ContactGroupID}/Contacts'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(contacts) - - # return_type - return_type = opts[:return_type] || 'Contacts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_contact_group_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an Contact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_contact_history(xero_tenant_id, contact_id, history_records, opts = {}) - data, _status_code, _headers = create_contact_history_with_http_info(xero_tenant_id, contact_id, history_records, opts) - data - end - - # Allows you to retrieve a history records of an Contact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_contact_history_with_http_info(xero_tenant_id, contact_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_history" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.create_contact_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_contact_history" - end - # resource path - local_var_path = '/Contacts/{ContactID}/History'.sub('{' + 'ContactID' + '}', contact_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_contact_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a multiple contacts (bulk) in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Contacts] - def create_contacts(xero_tenant_id, contacts, opts = {}) - data, _status_code, _headers = create_contacts_with_http_info(xero_tenant_id, contacts, opts) - data - end - - # Allows you to create a multiple contacts (bulk) in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers - def create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_contacts ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contacts" - end - # verify the required parameter 'contacts' is set - if @api_client.config.client_side_validation && contacts.nil? - fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.create_contacts" - end - # resource path - local_var_path = '/Contacts' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(contacts) - - # return_type - return_type = opts[:return_type] || 'Contacts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create Allocation on CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param allocations [Allocations] Allocations with array of Allocation object in body of request. - # @param [Hash] opts the optional parameters - # @return [Allocations] - def create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations, opts = {}) - data, _status_code, _headers = create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts) - data - end - - # Allows you to create Allocation on CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param allocations [Allocations] Allocations with array of Allocation object in body of request. - # @param [Hash] opts the optional parameters - # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers - def create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_allocation ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_allocation" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_allocation" - end - # verify the required parameter 'allocations' is set - if @api_client.config.client_side_validation && allocations.nil? - fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_credit_note_allocation" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/Allocations'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(allocations) - - # return_type - return_type = opts[:return_type] || 'Allocations' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_allocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create Attachments on CreditNote by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param file_name [String] Name of the file you are attaching to Credit Note - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false) - # @return [Attachments] - def create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {}) - data, _status_code, _headers = create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts) - data - end - - # Allows you to create Attachments on CreditNote by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param file_name [String] Name of the file you are attaching to Credit Note - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_attachment_by_file_name" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_credit_note_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_credit_note_attachment_by_file_name" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_credit_note_history(xero_tenant_id, credit_note_id, history_records, opts = {}) - data, _status_code, _headers = create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, history_records, opts) - data - end - - # Allows you to retrieve a history records of an CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_history" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_credit_note_history" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/History'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a credit note - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [CreditNotes] - def create_credit_notes(xero_tenant_id, credit_notes, opts = {}) - data, _status_code, _headers = create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts) - data - end - - # Allows you to create a credit note - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers - def create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_notes ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_notes" - end - # verify the required parameter 'credit_notes' is set - if @api_client.config.client_side_validation && credit_notes.nil? - fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.create_credit_notes" - end - # resource path - local_var_path = '/CreditNotes' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(credit_notes) - - # return_type - return_type = opts[:return_type] || 'CreditNotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param currency [Currency] Currency obejct in the body of request - # @param [Hash] opts the optional parameters - # @return [Currencies] - def create_currency(xero_tenant_id, currency, opts = {}) - data, _status_code, _headers = create_currency_with_http_info(xero_tenant_id, currency, opts) - data - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param currency [Currency] Currency obejct in the body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Currencies, Integer, Hash)>] Currencies data, response status code and response headers - def create_currency_with_http_info(xero_tenant_id, currency, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_currency ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_currency" - end - # verify the required parameter 'currency' is set - if @api_client.config.client_side_validation && currency.nil? - fail ArgumentError, "Missing the required parameter 'currency' when calling AccountingApi.create_currency" - end - # resource path - local_var_path = '/Currencies' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(currency) - - # return_type - return_type = opts[:return_type] || 'Currencies' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create new employees used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param employees [Employees] Employees with array of Employee object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Employees] - def create_employees(xero_tenant_id, employees, opts = {}) - data, _status_code, _headers = create_employees_with_http_info(xero_tenant_id, employees, opts) - data - end - - # Allows you to create new employees used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param employees [Employees] Employees with array of Employee object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers - def create_employees_with_http_info(xero_tenant_id, employees, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_employees ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_employees" - end - # verify the required parameter 'employees' is set - if @api_client.config.client_side_validation && employees.nil? - fail ArgumentError, "Missing the required parameter 'employees' when calling AccountingApi.create_employees" - end - # resource path - local_var_path = '/Employees' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(employees) - - # return_type - return_type = opts[:return_type] || 'Employees' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a history records of an ExpenseClaim - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records, opts = {}) - data, _status_code, _headers = create_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, history_records, opts) - data - end - - # Allows you to create a history records of an ExpenseClaim - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_expense_claim_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_expense_claim_history" - end - # verify the required parameter 'expense_claim_id' is set - if @api_client.config.client_side_validation && expense_claim_id.nil? - fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.create_expense_claim_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_expense_claim_history" - end - # resource path - local_var_path = '/ExpenseClaims/{ExpenseClaimID}/History'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_expense_claim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve expense claims - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claims [ExpenseClaims] ExpenseClaims with array of ExpenseClaim object in body of request - # @param [Hash] opts the optional parameters - # @return [ExpenseClaims] - def create_expense_claims(xero_tenant_id, expense_claims, opts = {}) - data, _status_code, _headers = create_expense_claims_with_http_info(xero_tenant_id, expense_claims, opts) - data - end - - # Allows you to retrieve expense claims - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claims [ExpenseClaims] ExpenseClaims with array of ExpenseClaim object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers - def create_expense_claims_with_http_info(xero_tenant_id, expense_claims, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_expense_claims ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_expense_claims" - end - # verify the required parameter 'expense_claims' is set - if @api_client.config.client_side_validation && expense_claims.nil? - fail ArgumentError, "Missing the required parameter 'expense_claims' when calling AccountingApi.create_expense_claims" - end - # resource path - local_var_path = '/ExpenseClaims' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(expense_claims) - - # return_type - return_type = opts[:return_type] || 'ExpenseClaims' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_expense_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create an Attachment on invoices or purchase bills by it's filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param file_name [String] Name of the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false) - # @return [Attachments] - def create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {}) - data, _status_code, _headers = create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts) - data - end - - # Allows you to create an Attachment on invoices or purchase bills by it's filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param file_name [String] Name of the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_invoice_attachment_by_file_name" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.create_invoice_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_invoice_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_invoice_attachment_by_file_name" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_invoice_history(xero_tenant_id, invoice_id, history_records, opts = {}) - data, _status_code, _headers = create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_records, opts) - data - end - - # Allows you to retrieve a history records of an invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_invoice_history" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.create_invoice_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_invoice_history" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/History'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create one or more sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoices [Invoices] Invoices with an array of invoice objects in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Invoices] - def create_invoices(xero_tenant_id, invoices, opts = {}) - data, _status_code, _headers = create_invoices_with_http_info(xero_tenant_id, invoices, opts) - data - end - - # Allows you to create one or more sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoices [Invoices] Invoices with an array of invoice objects in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers - def create_invoices_with_http_info(xero_tenant_id, invoices, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoices ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_invoices" - end - # verify the required parameter 'invoices' is set - if @api_client.config.client_side_validation && invoices.nil? - fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.create_invoices" - end - # resource path - local_var_path = '/Invoices' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(invoices) - - # return_type - return_type = opts[:return_type] || 'Invoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a history record for items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_item_history(xero_tenant_id, item_id, history_records, opts = {}) - data, _status_code, _headers = create_item_history_with_http_info(xero_tenant_id, item_id, history_records, opts) - data - end - - # Allows you to create a history record for items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_item_history_with_http_info(xero_tenant_id, item_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_item_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_item_history" - end - # verify the required parameter 'item_id' is set - if @api_client.config.client_side_validation && item_id.nil? - fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.create_item_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_item_history" - end - # resource path - local_var_path = '/Items/{ItemID}/History'.sub('{' + 'ItemID' + '}', item_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_item_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create one or more items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param items [Items] Items with an array of Item objects in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Items] - def create_items(xero_tenant_id, items, opts = {}) - data, _status_code, _headers = create_items_with_http_info(xero_tenant_id, items, opts) - data - end - - # Allows you to create one or more items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param items [Items] Items with an array of Item objects in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers - def create_items_with_http_info(xero_tenant_id, items, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_items ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_items" - end - # verify the required parameter 'items' is set - if @api_client.config.client_side_validation && items.nil? - fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.create_items" - end - # resource path - local_var_path = '/Items' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(items) - - # return_type - return_type = opts[:return_type] || 'Items' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction [LinkedTransaction] LinkedTransaction object in body of request - # @param [Hash] opts the optional parameters - # @return [LinkedTransactions] - def create_linked_transaction(xero_tenant_id, linked_transaction, opts = {}) - data, _status_code, _headers = create_linked_transaction_with_http_info(xero_tenant_id, linked_transaction, opts) - data - end - - # Allows you to create linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction [LinkedTransaction] LinkedTransaction object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers - def create_linked_transaction_with_http_info(xero_tenant_id, linked_transaction, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_linked_transaction ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_linked_transaction" - end - # verify the required parameter 'linked_transaction' is set - if @api_client.config.client_side_validation && linked_transaction.nil? - fail ArgumentError, "Missing the required parameter 'linked_transaction' when calling AccountingApi.create_linked_transaction" - end - # resource path - local_var_path = '/LinkedTransactions' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(linked_transaction) - - # return_type - return_type = opts[:return_type] || 'LinkedTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a specified Attachment on ManualJournal by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param file_name [String] The name of the file being attached to a ManualJournal - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) - data, _status_code, _headers = create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts) - data - end - - # Allows you to create a specified Attachment on ManualJournal by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param file_name [String] The name of the file being attached to a ManualJournal - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journal_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'manual_journal_id' is set - if @api_client.config.client_side_validation && manual_journal_id.nil? - fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.create_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_manual_journal_attachment_by_file_name" - end - # resource path - local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create one or more manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [ManualJournals] - def create_manual_journals(xero_tenant_id, manual_journals, opts = {}) - data, _status_code, _headers = create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts) - data - end - - # Allows you to create one or more manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers - def create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journals ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_manual_journals" - end - # verify the required parameter 'manual_journals' is set - if @api_client.config.client_side_validation && manual_journals.nil? - fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.create_manual_journals" - end - # resource path - local_var_path = '/ManualJournals' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(manual_journals) - - # return_type - return_type = opts[:return_type] || 'ManualJournals' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a single allocation for an overpayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param allocations [Allocations] Allocations array with Allocation object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Allocations] - def create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts = {}) - data, _status_code, _headers = create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts) - data - end - - # Allows you to create a single allocation for an overpayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param allocations [Allocations] Allocations array with Allocation object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers - def create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_overpayment_allocations ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_overpayment_allocations" - end - # verify the required parameter 'overpayment_id' is set - if @api_client.config.client_side_validation && overpayment_id.nil? - fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.create_overpayment_allocations" - end - # verify the required parameter 'allocations' is set - if @api_client.config.client_side_validation && allocations.nil? - fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_overpayment_allocations" - end - # resource path - local_var_path = '/Overpayments/{OverpaymentID}/Allocations'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(allocations) - - # return_type - return_type = opts[:return_type] || 'Allocations' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_overpayment_allocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create history records of an Overpayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_overpayment_history(xero_tenant_id, overpayment_id, history_records, opts = {}) - data, _status_code, _headers = create_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, history_records, opts) - data - end - - # Allows you to create history records of an Overpayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_overpayment_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_overpayment_history" - end - # verify the required parameter 'overpayment_id' is set - if @api_client.config.client_side_validation && overpayment_id.nil? - fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.create_overpayment_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_overpayment_history" - end - # resource path - local_var_path = '/Overpayments/{OverpaymentID}/History'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_overpayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a single payment for invoices or credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment [Payment] Request body with a single Payment object - # @param [Hash] opts the optional parameters - # @return [Payments] - def create_payment(xero_tenant_id, payment, opts = {}) - data, _status_code, _headers = create_payment_with_http_info(xero_tenant_id, payment, opts) - data - end - - # Allows you to create a single payment for invoices or credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment [Payment] Request body with a single Payment object - # @param [Hash] opts the optional parameters - # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers - def create_payment_with_http_info(xero_tenant_id, payment, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payment" - end - # verify the required parameter 'payment' is set - if @api_client.config.client_side_validation && payment.nil? - fail ArgumentError, "Missing the required parameter 'payment' when calling AccountingApi.create_payment" - end - # resource path - local_var_path = '/Payments' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(payment) - - # return_type - return_type = opts[:return_type] || 'Payments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a history record for a payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_payment_history(xero_tenant_id, payment_id, history_records, opts = {}) - data, _status_code, _headers = create_payment_history_with_http_info(xero_tenant_id, payment_id, history_records, opts) - data - end - - # Allows you to create a history record for a payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_payment_history_with_http_info(xero_tenant_id, payment_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payment_history" - end - # verify the required parameter 'payment_id' is set - if @api_client.config.client_side_validation && payment_id.nil? - fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.create_payment_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_payment_history" - end - # resource path - local_var_path = '/Payments/{PaymentID}/History'.sub('{' + 'PaymentID' + '}', payment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create payment services - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request - # @param [Hash] opts the optional parameters - # @return [PaymentServices] - def create_payment_service(xero_tenant_id, payment_services, opts = {}) - data, _status_code, _headers = create_payment_service_with_http_info(xero_tenant_id, payment_services, opts) - data - end - - # Allows you to create payment services - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers - def create_payment_service_with_http_info(xero_tenant_id, payment_services, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment_service ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payment_service" - end - # verify the required parameter 'payment_services' is set - if @api_client.config.client_side_validation && payment_services.nil? - fail ArgumentError, "Missing the required parameter 'payment_services' when calling AccountingApi.create_payment_service" - end - # resource path - local_var_path = '/PaymentServices' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(payment_services) - - # return_type - return_type = opts[:return_type] || 'PaymentServices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_payment_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create multiple payments for invoices or credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payments [Payments] Payments array with Payment object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Payments] - def create_payments(xero_tenant_id, payments, opts = {}) - data, _status_code, _headers = create_payments_with_http_info(xero_tenant_id, payments, opts) - data - end - - # Allows you to create multiple payments for invoices or credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payments [Payments] Payments array with Payment object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers - def create_payments_with_http_info(xero_tenant_id, payments, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_payments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payments" - end - # verify the required parameter 'payments' is set - if @api_client.config.client_side_validation && payments.nil? - fail ArgumentError, "Missing the required parameter 'payments' when calling AccountingApi.create_payments" - end - # resource path - local_var_path = '/Payments' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(payments) - - # return_type - return_type = opts[:return_type] || 'Payments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create an Allocation for prepayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for Prepayment - # @param allocations [Allocations] Allocations with an array of Allocation object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Allocations] - def create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts = {}) - data, _status_code, _headers = create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts) - data - end - - # Allows you to create an Allocation for prepayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for Prepayment - # @param allocations [Allocations] Allocations with an array of Allocation object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers - def create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_prepayment_allocations ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_prepayment_allocations" - end - # verify the required parameter 'prepayment_id' is set - if @api_client.config.client_side_validation && prepayment_id.nil? - fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.create_prepayment_allocations" - end - # verify the required parameter 'allocations' is set - if @api_client.config.client_side_validation && allocations.nil? - fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_prepayment_allocations" - end - # resource path - local_var_path = '/Prepayments/{PrepaymentID}/Allocations'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(allocations) - - # return_type - return_type = opts[:return_type] || 'Allocations' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_prepayment_allocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a history record for an Prepayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_prepayment_history(xero_tenant_id, prepayment_id, history_records, opts = {}) - data, _status_code, _headers = create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, history_records, opts) - data - end - - # Allows you to create a history record for an Prepayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_prepayment_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_prepayment_history" - end - # verify the required parameter 'prepayment_id' is set - if @api_client.config.client_side_validation && prepayment_id.nil? - fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.create_prepayment_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_prepayment_history" - end - # resource path - local_var_path = '/Prepayments/{PrepaymentID}/History'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_prepayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create HistoryRecord for purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records, opts = {}) - data, _status_code, _headers = create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, history_records, opts) - data - end - - # Allows you to create HistoryRecord for purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_purchase_order_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_purchase_order_history" - end - # verify the required parameter 'purchase_order_id' is set - if @api_client.config.client_side_validation && purchase_order_id.nil? - fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.create_purchase_order_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_purchase_order_history" - end - # resource path - local_var_path = '/PurchaseOrders/{PurchaseOrderID}/History'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_purchase_order_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create one or more purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [PurchaseOrders] - def create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) - data, _status_code, _headers = create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts) - data - end - - # Allows you to create one or more purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers - def create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_purchase_orders ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_purchase_orders" - end - # verify the required parameter 'purchase_orders' is set - if @api_client.config.client_side_validation && purchase_orders.nil? - fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.create_purchase_orders" - end - # resource path - local_var_path = '/PurchaseOrders' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(purchase_orders) - - # return_type - return_type = opts[:return_type] || 'PurchaseOrders' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create Attachment on Quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body, opts = {}) - data, _status_code, _headers = create_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts) - data - end - - # Allows you to create Attachment on Quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_quote_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_quote_attachment_by_file_name" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.create_quote_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_quote_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_quote_attachment_by_file_name" - end - # resource path - local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_quote_history(xero_tenant_id, quote_id, history_records, opts = {}) - data, _status_code, _headers = create_quote_history_with_http_info(xero_tenant_id, quote_id, history_records, opts) - data - end - - # Allows you to retrieve a history records of an quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_quote_history_with_http_info(xero_tenant_id, quote_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_quote_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_quote_history" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.create_quote_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_quote_history" - end - # resource path - local_var_path = '/Quotes/{QuoteID}/History'.sub('{' + 'QuoteID' + '}', quote_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_quote_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create one or more quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quotes [Quotes] Quotes with an array of Quote object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Quotes] - def create_quotes(xero_tenant_id, quotes, opts = {}) - data, _status_code, _headers = create_quotes_with_http_info(xero_tenant_id, quotes, opts) - data - end - - # Allows you to create one or more quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quotes [Quotes] Quotes with an array of Quote object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers - def create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_quotes ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_quotes" - end - # verify the required parameter 'quotes' is set - if @api_client.config.client_side_validation && quotes.nil? - fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.create_quotes" - end - # resource path - local_var_path = '/Quotes' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(quotes) - - # return_type - return_type = opts[:return_type] || 'Quotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create draft expense claim receipts for any user - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipts [Receipts] Receipts with an array of Receipt object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Receipts] - def create_receipt(xero_tenant_id, receipts, opts = {}) - data, _status_code, _headers = create_receipt_with_http_info(xero_tenant_id, receipts, opts) - data - end - - # Allows you to create draft expense claim receipts for any user - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipts [Receipts] Receipts with an array of Receipt object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers - def create_receipt_with_http_info(xero_tenant_id, receipts, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_receipt" - end - # verify the required parameter 'receipts' is set - if @api_client.config.client_side_validation && receipts.nil? - fail ArgumentError, "Missing the required parameter 'receipts' when calling AccountingApi.create_receipt" - end - # resource path - local_var_path = '/Receipts' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(receipts) - - # return_type - return_type = opts[:return_type] || 'Receipts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create Attachment on expense claim receipts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param file_name [String] The name of the file being attached to the Receipt - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body, opts = {}) - data, _status_code, _headers = create_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts) - data - end - - # Allows you to create Attachment on expense claim receipts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param file_name [String] The name of the file being attached to the Receipt - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_receipt_attachment_by_file_name" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.create_receipt_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_receipt_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_receipt_attachment_by_file_name" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an Receipt - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_receipt_history(xero_tenant_id, receipt_id, history_records, opts = {}) - data, _status_code, _headers = create_receipt_history_with_http_info(xero_tenant_id, receipt_id, history_records, opts) - data - end - - # Allows you to retrieve a history records of an Receipt - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_receipt_history_with_http_info(xero_tenant_id, receipt_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_receipt_history" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.create_receipt_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_receipt_history" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}/History'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_receipt_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create attachment on repeating invoices by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param file_name [String] The name of the file being attached to a Repeating Invoice - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) - data, _status_code, _headers = create_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts) - data - end - - # Allows you to create attachment on repeating invoices by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param file_name [String] The name of the file being attached to a Repeating Invoice - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def create_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_repeating_invoice_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create history for a repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records, opts = {}) - data, _status_code, _headers = create_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, history_records, opts) - data - end - - # Allows you to create history for a repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def create_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, history_records, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_repeating_invoice_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_repeating_invoice_history" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.create_repeating_invoice_history" - end - # verify the required parameter 'history_records' is set - if @api_client.config.client_side_validation && history_records.nil? - fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_repeating_invoice_history" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/History'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(history_records) - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_repeating_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create one or more Tax Rates - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tax_rates [TaxRates] TaxRates array with TaxRate object in body of request - # @param [Hash] opts the optional parameters - # @return [TaxRates] - def create_tax_rates(xero_tenant_id, tax_rates, opts = {}) - data, _status_code, _headers = create_tax_rates_with_http_info(xero_tenant_id, tax_rates, opts) - data - end - - # Allows you to create one or more Tax Rates - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tax_rates [TaxRates] TaxRates array with TaxRate object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers - def create_tax_rates_with_http_info(xero_tenant_id, tax_rates, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_tax_rates ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_tax_rates" - end - # verify the required parameter 'tax_rates' is set - if @api_client.config.client_side_validation && tax_rates.nil? - fail ArgumentError, "Missing the required parameter 'tax_rates' when calling AccountingApi.create_tax_rates" - end - # resource path - local_var_path = '/TaxRates' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(tax_rates) - - # return_type - return_type = opts[:return_type] || 'TaxRates' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_tax_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create tracking categories - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category [TrackingCategory] TrackingCategory object in body of request - # @param [Hash] opts the optional parameters - # @return [TrackingCategories] - def create_tracking_category(xero_tenant_id, tracking_category, opts = {}) - data, _status_code, _headers = create_tracking_category_with_http_info(xero_tenant_id, tracking_category, opts) - data - end - - # Allows you to create tracking categories - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category [TrackingCategory] TrackingCategory object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers - def create_tracking_category_with_http_info(xero_tenant_id, tracking_category, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_tracking_category ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_tracking_category" - end - # verify the required parameter 'tracking_category' is set - if @api_client.config.client_side_validation && tracking_category.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category' when calling AccountingApi.create_tracking_category" - end - # resource path - local_var_path = '/TrackingCategories' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(tracking_category) - - # return_type - return_type = opts[:return_type] || 'TrackingCategories' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create options for a specified tracking category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_option [TrackingOption] TrackingOption object in body of request - # @param [Hash] opts the optional parameters - # @return [TrackingOptions] - def create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option, opts = {}) - data, _status_code, _headers = create_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option, opts) - data - end - - # Allows you to create options for a specified tracking category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_option [TrackingOption] TrackingOption object in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers - def create_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.create_tracking_options ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_tracking_options" - end - # verify the required parameter 'tracking_category_id' is set - if @api_client.config.client_side_validation && tracking_category_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.create_tracking_options" - end - # verify the required parameter 'tracking_option' is set - if @api_client.config.client_side_validation && tracking_option.nil? - fail ArgumentError, "Missing the required parameter 'tracking_option' when calling AccountingApi.create_tracking_options" - end - # resource path - local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(tracking_option) - - # return_type - return_type = opts[:return_type] || 'TrackingOptions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#create_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to delete a chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for retrieving single object - # @param [Hash] opts the optional parameters - # @return [Accounts] - def delete_account(xero_tenant_id, account_id, opts = {}) - data, _status_code, _headers = delete_account_with_http_info(xero_tenant_id, account_id, opts) - data - end - - # Allows you to delete a chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for retrieving single object - # @param [Hash] opts the optional parameters - # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers - def delete_account_with_http_info(xero_tenant_id, account_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_account ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_account" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.delete_account" - end - # resource path - local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Accounts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to delete a specific Contact from a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id, opts = {}) - delete_contact_group_contact_with_http_info(xero_tenant_id, contact_group_id, contact_id, opts) - nil - end - - # Allows you to delete a specific Contact from a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_contact_group_contact_with_http_info(xero_tenant_id, contact_group_id, contact_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_contact_group_contact ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_contact_group_contact" - end - # verify the required parameter 'contact_group_id' is set - if @api_client.config.client_side_validation && contact_group_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.delete_contact_group_contact" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.delete_contact_group_contact" - end - # resource path - local_var_path = '/ContactGroups/{ContactGroupID}/Contacts/{ContactID}'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s).sub('{' + 'ContactID' + '}', contact_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_contact_group_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to delete all Contacts from a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_contact_group_contacts(xero_tenant_id, contact_group_id, opts = {}) - delete_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, opts) - nil - end - - # Allows you to delete all Contacts from a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_contact_group_contacts ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_contact_group_contacts" - end - # verify the required parameter 'contact_group_id' is set - if @api_client.config.client_side_validation && contact_group_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.delete_contact_group_contacts" - end - # resource path - local_var_path = '/ContactGroups/{ContactGroupID}/Contacts'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_contact_group_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to delete a specified item - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_item(xero_tenant_id, item_id, opts = {}) - delete_item_with_http_info(xero_tenant_id, item_id, opts) - nil - end - - # Allows you to delete a specified item - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_item_with_http_info(xero_tenant_id, item_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_item ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_item" - end - # verify the required parameter 'item_id' is set - if @api_client.config.client_side_validation && item_id.nil? - fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.delete_item" - end - # resource path - local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to delete a specified linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction - # @param [Hash] opts the optional parameters - # @return [nil] - def delete_linked_transaction(xero_tenant_id, linked_transaction_id, opts = {}) - delete_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts) - nil - end - - # Allows you to delete a specified linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_linked_transaction ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_linked_transaction" - end - # verify the required parameter 'linked_transaction_id' is set - if @api_client.config.client_side_validation && linked_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.delete_linked_transaction" - end - # resource path - local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified payment for invoices and credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param payment_delete [PaymentDelete] - # @param [Hash] opts the optional parameters - # @return [Payments] - def delete_payment(xero_tenant_id, payment_id, payment_delete, opts = {}) - data, _status_code, _headers = delete_payment_with_http_info(xero_tenant_id, payment_id, payment_delete, opts) - data - end - - # Allows you to update a specified payment for invoices and credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param payment_delete [PaymentDelete] - # @param [Hash] opts the optional parameters - # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers - def delete_payment_with_http_info(xero_tenant_id, payment_id, payment_delete, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_payment ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_payment" - end - # verify the required parameter 'payment_id' is set - if @api_client.config.client_side_validation && payment_id.nil? - fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.delete_payment" - end - # verify the required parameter 'payment_delete' is set - if @api_client.config.client_side_validation && payment_delete.nil? - fail ArgumentError, "Missing the required parameter 'payment_delete' when calling AccountingApi.delete_payment" - end - # resource path - local_var_path = '/Payments/{PaymentID}'.sub('{' + 'PaymentID' + '}', payment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(payment_delete) - - # return_type - return_type = opts[:return_type] || 'Payments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to delete tracking categories - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param [Hash] opts the optional parameters - # @return [TrackingCategories] - def delete_tracking_category(xero_tenant_id, tracking_category_id, opts = {}) - data, _status_code, _headers = delete_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts) - data - end - - # Allows you to delete tracking categories - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param [Hash] opts the optional parameters - # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers - def delete_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_tracking_category ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_tracking_category" - end - # verify the required parameter 'tracking_category_id' is set - if @api_client.config.client_side_validation && tracking_category_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.delete_tracking_category" - end - # resource path - local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'TrackingCategories' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to delete a specified option for a specified tracking category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_option_id [String] Unique identifier for a Tracking Option - # @param [Hash] opts the optional parameters - # @return [TrackingOptions] - def delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, opts = {}) - data, _status_code, _headers = delete_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, opts) - data - end - - # Allows you to delete a specified option for a specified tracking category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_option_id [String] Unique identifier for a Tracking Option - # @param [Hash] opts the optional parameters - # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers - def delete_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.delete_tracking_options ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_tracking_options" - end - # verify the required parameter 'tracking_category_id' is set - if @api_client.config.client_side_validation && tracking_category_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.delete_tracking_options" - end - # verify the required parameter 'tracking_option_id' is set - if @api_client.config.client_side_validation && tracking_option_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_option_id' when calling AccountingApi.delete_tracking_options" - end - # resource path - local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s).sub('{' + 'TrackingOptionID' + '}', tracking_option_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'TrackingOptions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#delete_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to email a copy of invoice to related Contact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param request_empty [RequestEmpty] - # @param [Hash] opts the optional parameters - # @return [nil] - def email_invoice(xero_tenant_id, invoice_id, request_empty, opts = {}) - email_invoice_with_http_info(xero_tenant_id, invoice_id, request_empty, opts) - nil - end - - # Allows you to email a copy of invoice to related Contact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param request_empty [RequestEmpty] - # @param [Hash] opts the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def email_invoice_with_http_info(xero_tenant_id, invoice_id, request_empty, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.email_invoice ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.email_invoice" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.email_invoice" - end - # verify the required parameter 'request_empty' is set - if @api_client.config.client_side_validation && request_empty.nil? - fail ArgumentError, "Missing the required parameter 'request_empty' when calling AccountingApi.email_invoice" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/Email'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(request_empty) - - # return_type - return_type = opts[:return_type] - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#email_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a single chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for retrieving single object - # @param [Hash] opts the optional parameters - # @return [Accounts] - def get_account(xero_tenant_id, account_id, opts = {}) - data, _status_code, _headers = get_account_with_http_info(xero_tenant_id, account_id, opts) - data - end - - # Allows you to retrieve a single chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for retrieving single object - # @param [Hash] opts the optional parameters - # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers - def get_account_with_http_info(xero_tenant_id, account_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_account ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account" - end - # resource path - local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Accounts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachment on Account by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param file_name [String] Name of the attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachment on Account by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param file_name [String] Name of the attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account_attachment_by_file_name" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_account_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_account_attachment_by_file_name" - end - # resource path - local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve specific Attachment on Account - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param attachment_id [String] Unique identifier for Attachment object - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_account_attachment_by_id_with_http_info(xero_tenant_id, account_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve specific Attachment on Account - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param attachment_id [String] Unique identifier for Attachment object - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_account_attachment_by_id_with_http_info(xero_tenant_id, account_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account_attachment_by_id" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_account_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_account_attachment_by_id" - end - # resource path - local_var_path = '/Accounts/{AccountID}/Attachments/{AttachmentID}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_account_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments for accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_account_attachments(xero_tenant_id, account_id, opts = {}) - data, _status_code, _headers = get_account_attachments_with_http_info(xero_tenant_id, account_id, opts) - data - end - - # Allows you to retrieve Attachments for accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_account_attachments_with_http_info(xero_tenant_id, account_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account_attachments" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachments" - end - # resource path - local_var_path = '/Accounts/{AccountID}/Attachments'.sub('{' + 'AccountID' + '}', account_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_account_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve the full chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Accounts] - def get_accounts(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_accounts_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve the full chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers - def get_accounts_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_accounts ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_accounts" - end - # resource path - local_var_path = '/Accounts' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Accounts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a single spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [BankTransactions] - def get_bank_transaction(xero_tenant_id, bank_transaction_id, opts = {}) - data, _status_code, _headers = get_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, opts) - data - end - - # Allows you to retrieve a single spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers - def get_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'BankTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on BankTransaction by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param file_name [String] The name of the file being attached - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachments on BankTransaction by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param file_name [String] The name of the file being attached - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on a specific BankTransaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param attachment_id [String] Xero generated unique identifier for an attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_bank_transaction_attachment_by_id_with_http_info(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve Attachments on a specific BankTransaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param attachment_id [String] Xero generated unique identifier for an attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_bank_transaction_attachment_by_id_with_http_info(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction_attachment_by_id" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_bank_transaction_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transaction_attachment_by_id" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any attachments to bank transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id, opts = {}) - data, _status_code, _headers = get_bank_transaction_attachments_with_http_info(xero_tenant_id, bank_transaction_id, opts) - data - end - - # Allows you to retrieve any attachments to bank transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_bank_transaction_attachments_with_http_info(xero_tenant_id, bank_transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction_attachments" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachments" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}/Attachments'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any spend or receive money transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page Up to 100 bank transactions will be returned in a single API call with line items details - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [BankTransactions] - def get_bank_transactions(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_bank_transactions_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any spend or receive money transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page Up to 100 bank transactions will be returned in a single API call with line items details - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers - def get_bank_transactions_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transactions ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transactions" - end - # resource path - local_var_path = '/BankTransactions' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'BankTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve history from a bank transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_bank_transactions_history(xero_tenant_id, bank_transaction_id, opts = {}) - data, _status_code, _headers = get_bank_transactions_history_with_http_info(xero_tenant_id, bank_transaction_id, opts) - data - end - - # Allows you to retrieve history from a bank transactions - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_bank_transactions_history_with_http_info(xero_tenant_id, bank_transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transactions_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transactions_history" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transactions_history" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}/History'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transactions_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param [Hash] opts the optional parameters - # @return [BankTransfers] - def get_bank_transfer(xero_tenant_id, bank_transfer_id, opts = {}) - data, _status_code, _headers = get_bank_transfer_with_http_info(xero_tenant_id, bank_transfer_id, opts) - data - end - - # Allows you to retrieve any bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param [Hash] opts the optional parameters - # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers - def get_bank_transfer_with_http_info(xero_tenant_id, bank_transfer_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'BankTransfers' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on BankTransfer by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param file_name [String] The name of the file being attached to a Bank Transfer - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachments on BankTransfer by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param file_name [String] The name of the file being attached to a Bank Transfer - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on BankTransfer - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param attachment_id [String] Xero generated unique identifier for an Attachment to a bank transfer - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_bank_transfer_attachment_by_id_with_http_info(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve Attachments on BankTransfer - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param attachment_id [String] Xero generated unique identifier for an Attachment to a bank transfer - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_bank_transfer_attachment_by_id_with_http_info(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_attachment_by_id" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_bank_transfer_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transfer_attachment_by_id" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments from bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id, opts = {}) - data, _status_code, _headers = get_bank_transfer_attachments_with_http_info(xero_tenant_id, bank_transfer_id, opts) - data - end - - # Allows you to retrieve Attachments from bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_bank_transfer_attachments_with_http_info(xero_tenant_id, bank_transfer_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_attachments" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachments" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}/Attachments'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve history from a bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_bank_transfer_history(xero_tenant_id, bank_transfer_id, opts = {}) - data, _status_code, _headers = get_bank_transfer_history_with_http_info(xero_tenant_id, bank_transfer_id, opts) - data - end - - # Allows you to retrieve history from a bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_bank_transfer_history_with_http_info(xero_tenant_id, bank_transfer_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_history" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_history" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}/History'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve all bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [BankTransfers] - def get_bank_transfers(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_bank_transfers_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve all bank transfers - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers - def get_bank_transfers_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfers ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfers" - end - # resource path - local_var_path = '/BankTransfers' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'BankTransfers' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve history from a Batch Payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param batch_payment_id [String] Unique identifier for BatchPayment - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_batch_payment_history(xero_tenant_id, batch_payment_id, opts = {}) - data, _status_code, _headers = get_batch_payment_history_with_http_info(xero_tenant_id, batch_payment_id, opts) - data - end - - # Allows you to retrieve history from a Batch Payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param batch_payment_id [String] Unique identifier for BatchPayment - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_batch_payment_history_with_http_info(xero_tenant_id, batch_payment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_batch_payment_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_batch_payment_history" - end - # verify the required parameter 'batch_payment_id' is set - if @api_client.config.client_side_validation && batch_payment_id.nil? - fail ArgumentError, "Missing the required parameter 'batch_payment_id' when calling AccountingApi.get_batch_payment_history" - end - # resource path - local_var_path = '/BatchPayments/{BatchPaymentID}/History'.sub('{' + 'BatchPaymentID' + '}', batch_payment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_batch_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve either one or many BatchPayments for invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [BatchPayments] - def get_batch_payments(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_batch_payments_with_http_info(xero_tenant_id, opts) - data - end - - # Retrieve either one or many BatchPayments for invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers - def get_batch_payments_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_batch_payments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_batch_payments" - end - # resource path - local_var_path = '/BatchPayments' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'BatchPayments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_batch_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specific BrandingThemes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param branding_theme_id [String] Unique identifier for a Branding Theme - # @param [Hash] opts the optional parameters - # @return [BrandingThemes] - def get_branding_theme(xero_tenant_id, branding_theme_id, opts = {}) - data, _status_code, _headers = get_branding_theme_with_http_info(xero_tenant_id, branding_theme_id, opts) - data - end - - # Allows you to retrieve a specific BrandingThemes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param branding_theme_id [String] Unique identifier for a Branding Theme - # @param [Hash] opts the optional parameters - # @return [Array<(BrandingThemes, Integer, Hash)>] BrandingThemes data, response status code and response headers - def get_branding_theme_with_http_info(xero_tenant_id, branding_theme_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_theme ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_branding_theme" - end - # verify the required parameter 'branding_theme_id' is set - if @api_client.config.client_side_validation && branding_theme_id.nil? - fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.get_branding_theme" - end - # resource path - local_var_path = '/BrandingThemes/{BrandingThemeID}'.sub('{' + 'BrandingThemeID' + '}', branding_theme_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'BrandingThemes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_branding_theme\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve the Payment services for a Branding Theme - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param branding_theme_id [String] Unique identifier for a Branding Theme - # @param [Hash] opts the optional parameters - # @return [PaymentServices] - def get_branding_theme_payment_services(xero_tenant_id, branding_theme_id, opts = {}) - data, _status_code, _headers = get_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, opts) - data - end - - # Allows you to retrieve the Payment services for a Branding Theme - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param branding_theme_id [String] Unique identifier for a Branding Theme - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers - def get_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_theme_payment_services ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_branding_theme_payment_services" - end - # verify the required parameter 'branding_theme_id' is set - if @api_client.config.client_side_validation && branding_theme_id.nil? - fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.get_branding_theme_payment_services" - end - # resource path - local_var_path = '/BrandingThemes/{BrandingThemeID}/PaymentServices'.sub('{' + 'BrandingThemeID' + '}', branding_theme_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'PaymentServices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_branding_theme_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve all the BrandingThemes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [BrandingThemes] - def get_branding_themes(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_branding_themes_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve all the BrandingThemes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array<(BrandingThemes, Integer, Hash)>] BrandingThemes data, response status code and response headers - def get_branding_themes_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_themes ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_branding_themes" - end - # resource path - local_var_path = '/BrandingThemes' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'BrandingThemes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_branding_themes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a single contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [Contacts] - def get_contact(xero_tenant_id, contact_id, opts = {}) - data, _status_code, _headers = get_contact_with_http_info(xero_tenant_id, contact_id, opts) - data - end - - # Allows you to retrieve a single contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers - def get_contact_with_http_info(xero_tenant_id, contact_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact" - end - # resource path - local_var_path = '/Contacts/{ContactID}'.sub('{' + 'ContactID' + '}', contact_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Contacts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on Contacts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param file_name [String] Name for the file you are attaching - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachments on Contacts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param file_name [String] Name for the file you are attaching - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_attachment_by_file_name" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_contact_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_contact_attachment_by_file_name" - end - # resource path - local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on Contacts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_contact_attachment_by_id_with_http_info(xero_tenant_id, contact_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve Attachments on Contacts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_contact_attachment_by_id_with_http_info(xero_tenant_id, contact_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_attachment_by_id" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_contact_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_contact_attachment_by_id" - end - # resource path - local_var_path = '/Contacts/{ContactID}/Attachments/{AttachmentID}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve, add and update contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_contact_attachments(xero_tenant_id, contact_id, opts = {}) - data, _status_code, _headers = get_contact_attachments_with_http_info(xero_tenant_id, contact_id, opts) - data - end - - # Allows you to retrieve, add and update contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_contact_attachments_with_http_info(xero_tenant_id, contact_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_attachments" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachments" - end - # resource path - local_var_path = '/Contacts/{ContactID}/Attachments'.sub('{' + 'ContactID' + '}', contact_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve CISSettings for a contact in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [CISSettings] - def get_contact_cis_settings(xero_tenant_id, contact_id, opts = {}) - data, _status_code, _headers = get_contact_cis_settings_with_http_info(xero_tenant_id, contact_id, opts) - data - end - - # Allows you to retrieve CISSettings for a contact in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [Array<(CISSettings, Integer, Hash)>] CISSettings data, response status code and response headers - def get_contact_cis_settings_with_http_info(xero_tenant_id, contact_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_cis_settings ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_cis_settings" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_cis_settings" - end - # resource path - local_var_path = '/Contacts/{ContactID}/CISSettings'.sub('{' + 'ContactID' + '}', contact_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'CISSettings' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a unique Contact Group by ID - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param [Hash] opts the optional parameters - # @return [ContactGroups] - def get_contact_group(xero_tenant_id, contact_group_id, opts = {}) - data, _status_code, _headers = get_contact_group_with_http_info(xero_tenant_id, contact_group_id, opts) - data - end - - # Allows you to retrieve a unique Contact Group by ID - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param [Hash] opts the optional parameters - # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers - def get_contact_group_with_http_info(xero_tenant_id, contact_group_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_group ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_group" - end - # verify the required parameter 'contact_group_id' is set - if @api_client.config.client_side_validation && contact_group_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.get_contact_group" - end - # resource path - local_var_path = '/ContactGroups/{ContactGroupID}'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ContactGroups' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve the ContactID and Name of all the contacts in a contact group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [ContactGroups] - def get_contact_groups(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_contact_groups_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve the ContactID and Name of all the contacts in a contact group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers - def get_contact_groups_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_groups ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_groups" - end - # resource path - local_var_path = '/ContactGroups' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ContactGroups' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an Contact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_contact_history(xero_tenant_id, contact_id, opts = {}) - data, _status_code, _headers = get_contact_history_with_http_info(xero_tenant_id, contact_id, opts) - data - end - - # Allows you to retrieve a history records of an Contact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_contact_history_with_http_info(xero_tenant_id, contact_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_history" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_history" - end - # resource path - local_var_path = '/Contacts/{ContactID}/History'.sub('{' + 'ContactID' + '}', contact_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contact_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve all contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Array] :i_ds Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. - # @option opts [Integer] :page e.g. page=1 - Up to 100 contacts will be returned in a single API call. - # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - # @return [Contacts] - def get_contacts(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_contacts_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve all contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Array] :i_ds Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. - # @option opts [Integer] :page e.g. page=1 - Up to 100 contacts will be returned in a single API call. - # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers - def get_contacts_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_contacts ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contacts" - end - # resource path - local_var_path = '/Contacts' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'IDs'] = @api_client.build_collection_param(opts[:'i_ds'], :csv) if !opts[:'i_ds'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Contacts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specific credit note - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [CreditNotes] - def get_credit_note(xero_tenant_id, credit_note_id, opts = {}) - data, _status_code, _headers = get_credit_note_with_http_info(xero_tenant_id, credit_note_id, opts) - data - end - - # Allows you to retrieve a specific credit note - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers - def get_credit_note_with_http_info(xero_tenant_id, credit_note_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'CreditNotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_credit_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Credit Note as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @return [File] - def get_credit_note_as_pdf(xero_tenant_id, credit_note_id, opts = {}) - data, _status_code, _headers = get_credit_note_as_pdf_with_http_info(xero_tenant_id, credit_note_id, opts) - data - end - - # Allows you to retrieve Credit Note as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_credit_note_as_pdf_with_http_info(xero_tenant_id, credit_note_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_as_pdf ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_as_pdf" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_as_pdf" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on CreditNote by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param file_name [String] Name of the file you are attaching to Credit Note - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachments on CreditNote by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param file_name [String] Name of the file you are attaching to Credit Note - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_attachment_by_file_name" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_credit_note_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_credit_note_attachment_by_file_name" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_credit_note_attachment_by_id_with_http_info(xero_tenant_id, credit_note_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve Attachments on CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_credit_note_attachment_by_id_with_http_info(xero_tenant_id, credit_note_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_attachment_by_id" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_credit_note_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_credit_note_attachment_by_id" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments for credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_credit_note_attachments(xero_tenant_id, credit_note_id, opts = {}) - data, _status_code, _headers = get_credit_note_attachments_with_http_info(xero_tenant_id, credit_note_id, opts) - data - end - - # Allows you to retrieve Attachments for credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_credit_note_attachments_with_http_info(xero_tenant_id, credit_note_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_attachments" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachments" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/Attachments'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_credit_note_history(xero_tenant_id, credit_note_id, opts = {}) - data, _status_code, _headers = get_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, opts) - data - end - - # Allows you to retrieve a history records of an CreditNote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_history" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_history" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/History'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [CreditNotes] - def get_credit_notes(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_credit_notes_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers - def get_credit_notes_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_notes ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_notes" - end - # resource path - local_var_path = '/CreditNotes' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'CreditNotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve currencies for your organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Currencies] - def get_currencies(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_currencies_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve currencies for your organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(Currencies, Integer, Hash)>] Currencies data, response status code and response headers - def get_currencies_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_currencies ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_currencies" - end - # resource path - local_var_path = '/Currencies' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Currencies' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_currencies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specific employee used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param employee_id [String] Unique identifier for a Employee - # @param [Hash] opts the optional parameters - # @return [Employees] - def get_employee(xero_tenant_id, employee_id, opts = {}) - data, _status_code, _headers = get_employee_with_http_info(xero_tenant_id, employee_id, opts) - data - end - - # Allows you to retrieve a specific employee used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param employee_id [String] Unique identifier for a Employee - # @param [Hash] opts the optional parameters - # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers - def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_employee ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_employee" - end - # verify the required parameter 'employee_id' is set - if @api_client.config.client_side_validation && employee_id.nil? - fail ArgumentError, "Missing the required parameter 'employee_id' when calling AccountingApi.get_employee" - end - # resource path - local_var_path = '/Employees/{EmployeeID}'.sub('{' + 'EmployeeID' + '}', employee_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Employees' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve employees used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Employees] - def get_employees(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_employees_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve employees used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers - def get_employees_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_employees ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_employees" - end - # resource path - local_var_path = '/Employees' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Employees' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified expense claim - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param [Hash] opts the optional parameters - # @return [ExpenseClaims] - def get_expense_claim(xero_tenant_id, expense_claim_id, opts = {}) - data, _status_code, _headers = get_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, opts) - data - end - - # Allows you to retrieve a specified expense claim - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param [Hash] opts the optional parameters - # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers - def get_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claim ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_expense_claim" - end - # verify the required parameter 'expense_claim_id' is set - if @api_client.config.client_side_validation && expense_claim_id.nil? - fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.get_expense_claim" - end - # resource path - local_var_path = '/ExpenseClaims/{ExpenseClaimID}'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ExpenseClaims' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_expense_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an ExpenseClaim - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_expense_claim_history(xero_tenant_id, expense_claim_id, opts = {}) - data, _status_code, _headers = get_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, opts) - data - end - - # Allows you to retrieve a history records of an ExpenseClaim - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claim_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_expense_claim_history" - end - # verify the required parameter 'expense_claim_id' is set - if @api_client.config.client_side_validation && expense_claim_id.nil? - fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.get_expense_claim_history" - end - # resource path - local_var_path = '/ExpenseClaims/{ExpenseClaimID}/History'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_expense_claim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve expense claims - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [ExpenseClaims] - def get_expense_claims(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_expense_claims_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve expense claims - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers - def get_expense_claims_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claims ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_expense_claims" - end - # resource path - local_var_path = '/ExpenseClaims' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ExpenseClaims' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_expense_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified sales invoice or purchase bill - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Invoices] - def get_invoice(xero_tenant_id, invoice_id, opts = {}) - data, _status_code, _headers = get_invoice_with_http_info(xero_tenant_id, invoice_id, opts) - data - end - - # Allows you to retrieve a specified sales invoice or purchase bill - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers - def get_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Invoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve invoices or purchase bills as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [File] - def get_invoice_as_pdf(xero_tenant_id, invoice_id, opts = {}) - data, _status_code, _headers = get_invoice_as_pdf_with_http_info(xero_tenant_id, invoice_id, opts) - data - end - - # Allows you to retrieve invoices or purchase bills as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_invoice_as_pdf_with_http_info(xero_tenant_id, invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_as_pdf ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_as_pdf" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_as_pdf" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoice_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachment on invoices or purchase bills by it's filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param file_name [String] Name of the file you are attaching - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachment on invoices or purchase bills by it's filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param file_name [String] Name of the file you are attaching - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_attachment_by_file_name" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_invoice_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_invoice_attachment_by_file_name" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param attachment_id [String] Unique identifier for an Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_invoice_attachment_by_id_with_http_info(xero_tenant_id, invoice_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param attachment_id [String] Unique identifier for an Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_invoice_attachment_by_id_with_http_info(xero_tenant_id, invoice_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_attachment_by_id" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_invoice_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_invoice_attachment_by_id" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/Attachments/{AttachmentID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_invoice_attachments(xero_tenant_id, invoice_id, opts = {}) - data, _status_code, _headers = get_invoice_attachments_with_http_info(xero_tenant_id, invoice_id, opts) - data - end - - # Allows you to retrieve Attachments on invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_invoice_attachments_with_http_info(xero_tenant_id, invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_attachments" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachments" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/Attachments'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_invoice_history(xero_tenant_id, invoice_id, opts = {}) - data, _status_code, _headers = get_invoice_history_with_http_info(xero_tenant_id, invoice_id, opts) - data - end - - # Allows you to retrieve a history records of an invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_invoice_history_with_http_info(xero_tenant_id, invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_history" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_history" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/History'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve invoice reminder settings - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [InvoiceReminders] - def get_invoice_reminders(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_invoice_reminders_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve invoice reminder settings - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array<(InvoiceReminders, Integer, Hash)>] InvoiceReminders data, response status code and response headers - def get_invoice_reminders_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_reminders ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_reminders" - end - # resource path - local_var_path = '/InvoiceReminders/Settings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'InvoiceReminders' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoice_reminders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Array] :i_ds Filter by a comma-separated list of InvoicesIDs. - # @option opts [Array] :invoice_numbers Filter by a comma-separated list of InvoiceNumbers. - # @option opts [Array] :contact_i_ds Filter by a comma-separated list of ContactIDs. - # @option opts [Array] :statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. - # @option opts [Integer] :page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice - # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - # @option opts [Boolean] :created_by_my_app When set to true you'll only retrieve Invoices created by your app - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Invoices] - def get_invoices(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_invoices_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Array] :i_ds Filter by a comma-separated list of InvoicesIDs. - # @option opts [Array] :invoice_numbers Filter by a comma-separated list of InvoiceNumbers. - # @option opts [Array] :contact_i_ds Filter by a comma-separated list of ContactIDs. - # @option opts [Array] :statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. - # @option opts [Integer] :page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice - # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response - # @option opts [Boolean] :created_by_my_app When set to true you'll only retrieve Invoices created by your app - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers - def get_invoices_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoices ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoices" - end - # resource path - local_var_path = '/Invoices' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'IDs'] = @api_client.build_collection_param(opts[:'i_ds'], :csv) if !opts[:'i_ds'].nil? - query_params[:'InvoiceNumbers'] = @api_client.build_collection_param(opts[:'invoice_numbers'], :csv) if !opts[:'invoice_numbers'].nil? - query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_i_ds'], :csv) if !opts[:'contact_i_ds'].nil? - query_params[:'Statuses'] = @api_client.build_collection_param(opts[:'statuses'], :csv) if !opts[:'statuses'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil? - query_params[:'createdByMyApp'] = opts[:'created_by_my_app'] if !opts[:'created_by_my_app'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Invoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified item - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Items] - def get_item(xero_tenant_id, item_id, opts = {}) - data, _status_code, _headers = get_item_with_http_info(xero_tenant_id, item_id, opts) - data - end - - # Allows you to retrieve a specified item - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers - def get_item_with_http_info(xero_tenant_id, item_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_item ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_item" - end - # verify the required parameter 'item_id' is set - if @api_client.config.client_side_validation && item_id.nil? - fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.get_item" - end - # resource path - local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Items' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve history for items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_item_history(xero_tenant_id, item_id, opts = {}) - data, _status_code, _headers = get_item_history_with_http_info(xero_tenant_id, item_id, opts) - data - end - - # Allows you to retrieve history for items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_item_history_with_http_info(xero_tenant_id, item_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_item_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_item_history" - end - # verify the required parameter 'item_id' is set - if @api_client.config.client_side_validation && item_id.nil? - fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.get_item_history" - end - # resource path - local_var_path = '/Items/{ItemID}/History'.sub('{' + 'ItemID' + '}', item_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_item_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Items] - def get_items(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_items_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers - def get_items_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_items ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_items" - end - # resource path - local_var_path = '/Items' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Items' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified journals. - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param journal_id [String] Unique identifier for a Journal - # @param [Hash] opts the optional parameters - # @return [Journals] - def get_journal(xero_tenant_id, journal_id, opts = {}) - data, _status_code, _headers = get_journal_with_http_info(xero_tenant_id, journal_id, opts) - data - end - - # Allows you to retrieve a specified journals. - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param journal_id [String] Unique identifier for a Journal - # @param [Hash] opts the optional parameters - # @return [Array<(Journals, Integer, Hash)>] Journals data, response status code and response headers - def get_journal_with_http_info(xero_tenant_id, journal_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_journal ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_journal" - end - # verify the required parameter 'journal_id' is set - if @api_client.config.client_side_validation && journal_id.nil? - fail ArgumentError, "Missing the required parameter 'journal_id' when calling AccountingApi.get_journal" - end - # resource path - local_var_path = '/Journals/{JournalID}'.sub('{' + 'JournalID' + '}', journal_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Journals' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any journals. - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [Integer] :offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned - # @option opts [Boolean] :payments_only Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. - # @return [Journals] - def get_journals(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_journals_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any journals. - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [Integer] :offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned - # @option opts [Boolean] :payments_only Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. - # @return [Array<(Journals, Integer, Hash)>] Journals data, response status code and response headers - def get_journals_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_journals ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_journals" - end - # resource path - local_var_path = '/Journals' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? - query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Journals' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction - # @param [Hash] opts the optional parameters - # @return [LinkedTransactions] - def get_linked_transaction(xero_tenant_id, linked_transaction_id, opts = {}) - data, _status_code, _headers = get_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts) - data - end - - # Allows you to retrieve a specified linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction - # @param [Hash] opts the optional parameters - # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers - def get_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_linked_transaction ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_linked_transaction" - end - # verify the required parameter 'linked_transaction_id' is set - if @api_client.config.client_side_validation && linked_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.get_linked_transaction" - end - # resource path - local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'LinkedTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Retrieve linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Integer] :page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. - # @option opts [String] :linked_transaction_id The Xero identifier for an Linked Transaction - # @option opts [String] :source_transaction_id Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice - # @option opts [String] :contact_id Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. - # @option opts [String] :status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status - # @option opts [String] :target_transaction_id Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice - # @return [LinkedTransactions] - def get_linked_transactions(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_linked_transactions_with_http_info(xero_tenant_id, opts) - data - end - - # Retrieve linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Integer] :page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. - # @option opts [String] :linked_transaction_id The Xero identifier for an Linked Transaction - # @option opts [String] :source_transaction_id Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice - # @option opts [String] :contact_id Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. - # @option opts [String] :status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status - # @option opts [String] :target_transaction_id Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice - # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers - def get_linked_transactions_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_linked_transactions ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_linked_transactions" - end - # resource path - local_var_path = '/LinkedTransactions' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'LinkedTransactionID'] = opts[:'linked_transaction_id'] if !opts[:'linked_transaction_id'].nil? - query_params[:'SourceTransactionID'] = opts[:'source_transaction_id'] if !opts[:'source_transaction_id'].nil? - query_params[:'ContactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil? - query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil? - query_params[:'TargetTransactionID'] = opts[:'target_transaction_id'] if !opts[:'target_transaction_id'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'LinkedTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_linked_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param [Hash] opts the optional parameters - # @return [ManualJournals] - def get_manual_journal(xero_tenant_id, manual_journal_id, opts = {}) - data, _status_code, _headers = get_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, opts) - data - end - - # Allows you to retrieve a specified manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param [Hash] opts the optional parameters - # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers - def get_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal" - end - # verify the required parameter 'manual_journal_id' is set - if @api_client.config.client_side_validation && manual_journal_id.nil? - fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal" - end - # resource path - local_var_path = '/ManualJournals/{ManualJournalID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ManualJournals' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve specified Attachment on ManualJournal by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param file_name [String] The name of the file being attached to a ManualJournal - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve specified Attachment on ManualJournal by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param file_name [String] The name of the file being attached to a ManualJournal - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'manual_journal_id' is set - if @api_client.config.client_side_validation && manual_journal_id.nil? - fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_manual_journal_attachment_by_file_name" - end - # resource path - local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve specified Attachment on ManualJournals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_manual_journal_attachment_by_id_with_http_info(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve specified Attachment on ManualJournals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_manual_journal_attachment_by_id_with_http_info(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal_attachment_by_id" - end - # verify the required parameter 'manual_journal_id' is set - if @api_client.config.client_side_validation && manual_journal_id.nil? - fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_manual_journal_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_manual_journal_attachment_by_id" - end - # resource path - local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachment for manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_manual_journal_attachments(xero_tenant_id, manual_journal_id, opts = {}) - data, _status_code, _headers = get_manual_journal_attachments_with_http_info(xero_tenant_id, manual_journal_id, opts) - data - end - - # Allows you to retrieve Attachment for manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_manual_journal_attachments_with_http_info(xero_tenant_id, manual_journal_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal_attachments" - end - # verify the required parameter 'manual_journal_id' is set - if @api_client.config.client_side_validation && manual_journal_id.nil? - fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachments" - end - # resource path - local_var_path = '/ManualJournals/{ManualJournalID}/Attachments'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment - # @return [ManualJournals] - def get_manual_journals(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_manual_journals_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any manual journals - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment - # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers - def get_manual_journals_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journals ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journals" - end - # resource path - local_var_path = '/ManualJournals' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ManualJournals' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a URL to an online invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [OnlineInvoices] - def get_online_invoice(xero_tenant_id, invoice_id, opts = {}) - data, _status_code, _headers = get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts) - data - end - - # Allows you to retrieve a URL to an online invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param [Hash] opts the optional parameters - # @return [Array<(OnlineInvoices, Integer, Hash)>] OnlineInvoices data, response status code and response headers - def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_online_invoice ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_online_invoice" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_online_invoice" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/OnlineInvoice'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'OnlineInvoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_online_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param organisation_id [String] The unique Xero identifier for an organisation - # @param [Hash] opts the optional parameters - # @return [CISOrgSetting] - def get_organisation_cis_settings(xero_tenant_id, organisation_id, opts = {}) - data, _status_code, _headers = get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts) - data - end - - # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param organisation_id [String] The unique Xero identifier for an organisation - # @param [Hash] opts the optional parameters - # @return [Array<(CISOrgSetting, Integer, Hash)>] CISOrgSetting data, response status code and response headers - def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisation_cis_settings ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisation_cis_settings" - end - # verify the required parameter 'organisation_id' is set - if @api_client.config.client_side_validation && organisation_id.nil? - fail ArgumentError, "Missing the required parameter 'organisation_id' when calling AccountingApi.get_organisation_cis_settings" - end - # resource path - local_var_path = '/Organisation/{OrganisationID}/CISSettings'.sub('{' + 'OrganisationID' + '}', organisation_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'CISOrgSetting' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_organisation_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Organisation details - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Organisations] - def get_organisations(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_organisations_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve Organisation details - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array<(Organisations, Integer, Hash)>] Organisations data, response status code and response headers - def get_organisations_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisations ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisations" - end - # resource path - local_var_path = '/Organisation' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Organisations' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_organisations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified overpayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param [Hash] opts the optional parameters - # @return [Overpayments] - def get_overpayment(xero_tenant_id, overpayment_id, opts = {}) - data, _status_code, _headers = get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts) - data - end - - # Allows you to retrieve a specified overpayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param [Hash] opts the optional parameters - # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers - def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayment" - end - # verify the required parameter 'overpayment_id' is set - if @api_client.config.client_side_validation && overpayment_id.nil? - fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment" - end - # resource path - local_var_path = '/Overpayments/{OverpaymentID}'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Overpayments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_overpayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an Overpayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_overpayment_history(xero_tenant_id, overpayment_id, opts = {}) - data, _status_code, _headers = get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts) - data - end - - # Allows you to retrieve a history records of an Overpayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param overpayment_id [String] Unique identifier for a Overpayment - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayment_history" - end - # verify the required parameter 'overpayment_id' is set - if @api_client.config.client_side_validation && overpayment_id.nil? - fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment_history" - end - # resource path - local_var_path = '/Overpayments/{OverpaymentID}/History'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_overpayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve overpayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Overpayments] - def get_overpayments(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_overpayments_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve overpayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers - def get_overpayments_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayments" - end - # resource path - local_var_path = '/Overpayments' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Overpayments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_overpayments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified payment for invoices and credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param [Hash] opts the optional parameters - # @return [Payments] - def get_payment(xero_tenant_id, payment_id, opts = {}) - data, _status_code, _headers = get_payment_with_http_info(xero_tenant_id, payment_id, opts) - data - end - - # Allows you to retrieve a specified payment for invoices and credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param [Hash] opts the optional parameters - # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers - def get_payment_with_http_info(xero_tenant_id, payment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payment" - end - # verify the required parameter 'payment_id' is set - if @api_client.config.client_side_validation && payment_id.nil? - fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.get_payment" - end - # resource path - local_var_path = '/Payments/{PaymentID}'.sub('{' + 'PaymentID' + '}', payment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Payments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve history records of a payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_payment_history(xero_tenant_id, payment_id, opts = {}) - data, _status_code, _headers = get_payment_history_with_http_info(xero_tenant_id, payment_id, opts) - data - end - - # Allows you to retrieve history records of a payment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param payment_id [String] Unique identifier for a Payment - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_payment_history_with_http_info(xero_tenant_id, payment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payment_history" - end - # verify the required parameter 'payment_id' is set - if @api_client.config.client_side_validation && payment_id.nil? - fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.get_payment_history" - end - # resource path - local_var_path = '/Payments/{PaymentID}/History'.sub('{' + 'PaymentID' + '}', payment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve payment services - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [PaymentServices] - def get_payment_services(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_payment_services_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve payment services - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers - def get_payment_services_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment_services ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payment_services" - end - # resource path - local_var_path = '/PaymentServices' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'PaymentServices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve payments for invoices and credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Payments] - def get_payments(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_payments_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve payments for invoices and credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers - def get_payments_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_payments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payments" - end - # resource path - local_var_path = '/Payments' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Payments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified prepayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param [Hash] opts the optional parameters - # @return [Prepayments] - def get_prepayment(xero_tenant_id, prepayment_id, opts = {}) - data, _status_code, _headers = get_prepayment_with_http_info(xero_tenant_id, prepayment_id, opts) - data - end - - # Allows you to retrieve a specified prepayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param [Hash] opts the optional parameters - # @return [Array<(Prepayments, Integer, Hash)>] Prepayments data, response status code and response headers - def get_prepayment_with_http_info(xero_tenant_id, prepayment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayment ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_prepayment" - end - # verify the required parameter 'prepayment_id' is set - if @api_client.config.client_side_validation && prepayment_id.nil? - fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.get_prepayment" - end - # resource path - local_var_path = '/Prepayments/{PrepaymentID}'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Prepayments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_prepayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve prepayments as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param [Hash] opts the optional parameters - # @return [File] - def get_prepayment_as_pdf(xero_tenant_id, prepayment_id, opts = {}) - data, _status_code, _headers = get_prepayment_as_pdf_with_http_info(xero_tenant_id, prepayment_id, opts) - data - end - - # Allows you to retrieve prepayments as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_prepayment_as_pdf_with_http_info(xero_tenant_id, prepayment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayment_as_pdf ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_prepayment_as_pdf" - end - # verify the required parameter 'prepayment_id' is set - if @api_client.config.client_side_validation && prepayment_id.nil? - fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.get_prepayment_as_pdf" - end - # resource path - local_var_path = '/Prepayments/{PrepaymentID}'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_prepayment_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an Prepayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_prepayment_history(xero_tenant_id, prepayment_id, opts = {}) - data, _status_code, _headers = get_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, opts) - data - end - - # Allows you to retrieve a history records of an Prepayment - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param prepayment_id [String] Unique identifier for a PrePayment - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayment_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_prepayment_history" - end - # verify the required parameter 'prepayment_id' is set - if @api_client.config.client_side_validation && prepayment_id.nil? - fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.get_prepayment_history" - end - # resource path - local_var_path = '/Prepayments/{PrepaymentID}/History'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_prepayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve prepayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Prepayments] - def get_prepayments(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_prepayments_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve prepayments - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Prepayments, Integer, Hash)>] Prepayments data, response status code and response headers - def get_prepayments_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_prepayments" - end - # resource path - local_var_path = '/Prepayments' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Prepayments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_prepayments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param [Hash] opts the optional parameters - # @return [PurchaseOrders] - def get_purchase_order(xero_tenant_id, purchase_order_id, opts = {}) - data, _status_code, _headers = get_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, opts) - data - end - - # Allows you to retrieve a specified purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param [Hash] opts the optional parameters - # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers - def get_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order" - end - # verify the required parameter 'purchase_order_id' is set - if @api_client.config.client_side_validation && purchase_order_id.nil? - fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order" - end - # resource path - local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'PurchaseOrders' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve purchase orders as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for an Purchase Order - # @param [Hash] opts the optional parameters - # @return [File] - def get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id, opts = {}) - data, _status_code, _headers = get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts) - data - end - - # Allows you to retrieve purchase orders as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for an Purchase Order - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_as_pdf ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_as_pdf" - end - # verify the required parameter 'purchase_order_id' is set - if @api_client.config.client_side_validation && purchase_order_id.nil? - fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_as_pdf" - end - # resource path - local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_number [String] Unique identifier for a PurchaseOrder - # @param [Hash] opts the optional parameters - # @return [PurchaseOrders] - def get_purchase_order_by_number(xero_tenant_id, purchase_order_number, opts = {}) - data, _status_code, _headers = get_purchase_order_by_number_with_http_info(xero_tenant_id, purchase_order_number, opts) - data - end - - # Allows you to retrieve a specified purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_number [String] Unique identifier for a PurchaseOrder - # @param [Hash] opts the optional parameters - # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers - def get_purchase_order_by_number_with_http_info(xero_tenant_id, purchase_order_number, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_by_number ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_by_number" - end - # verify the required parameter 'purchase_order_number' is set - if @api_client.config.client_side_validation && purchase_order_number.nil? - fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling AccountingApi.get_purchase_order_by_number" - end - # resource path - local_var_path = '/PurchaseOrders/{PurchaseOrderNumber}'.sub('{' + 'PurchaseOrderNumber' + '}', purchase_order_number.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'PurchaseOrders' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_by_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve history for PurchaseOrder - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_purchase_order_history(xero_tenant_id, purchase_order_id, opts = {}) - data, _status_code, _headers = get_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, opts) - data - end - - # Allows you to retrieve history for PurchaseOrder - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_history" - end - # verify the required parameter 'purchase_order_id' is set - if @api_client.config.client_side_validation && purchase_order_id.nil? - fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_history" - end - # resource path - local_var_path = '/PurchaseOrders/{PurchaseOrderID}/History'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :status Filter by purchase order status - # @option opts [String] :date_from Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - # @option opts [String] :date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. - # @return [PurchaseOrders] - def get_purchase_orders(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_purchase_orders_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :status Filter by purchase order status - # @option opts [String] :date_from Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - # @option opts [String] :date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 - # @option opts [String] :order Order by an any element - # @option opts [Integer] :page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. - # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers - def get_purchase_orders_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_orders ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_orders" - end - allowable_values = ["DRAFT", "SUBMITTED", "AUTHORISED", "BILLED", "DELETED"] - if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) - fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/PurchaseOrders' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil? - query_params[:'DateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil? - query_params[:'DateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'PurchaseOrders' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param [Hash] opts the optional parameters - # @return [Quotes] - def get_quote(xero_tenant_id, quote_id, opts = {}) - data, _status_code, _headers = get_quote_with_http_info(xero_tenant_id, quote_id, opts) - data - end - - # Allows you to retrieve a specified quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param [Hash] opts the optional parameters - # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers - def get_quote_with_http_info(xero_tenant_id, quote_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote" - end - # resource path - local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Quotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve quotes as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param [Hash] opts the optional parameters - # @return [File] - def get_quote_as_pdf(xero_tenant_id, quote_id, opts = {}) - data, _status_code, _headers = get_quote_as_pdf_with_http_info(xero_tenant_id, quote_id, opts) - data - end - - # Allows you to retrieve quotes as PDF files - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_quote_as_pdf_with_http_info(xero_tenant_id, quote_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_as_pdf ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_as_pdf" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_as_pdf" - end - # resource path - local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_quote_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachment on Quote by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param file_name [String] Name of the attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachment on Quote by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param file_name [String] Name of the attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_attachment_by_file_name" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_quote_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_quote_attachment_by_file_name" - end - # resource path - local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve specific Attachment on Quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param attachment_id [String] Unique identifier for Attachment object - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_quote_attachment_by_id_with_http_info(xero_tenant_id, quote_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve specific Attachment on Quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param attachment_id [String] Unique identifier for Attachment object - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_quote_attachment_by_id_with_http_info(xero_tenant_id, quote_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_attachment_by_id" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_quote_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_quote_attachment_by_id" - end - # resource path - local_var_path = '/Quotes/{QuoteID}/Attachments/{AttachmentID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments for Quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_quote_attachments(xero_tenant_id, quote_id, opts = {}) - data, _status_code, _headers = get_quote_attachments_with_http_info(xero_tenant_id, quote_id, opts) - data - end - - # Allows you to retrieve Attachments for Quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_quote_attachments_with_http_info(xero_tenant_id, quote_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_attachments" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachments" - end - # resource path - local_var_path = '/Quotes/{QuoteID}/Attachments'.sub('{' + 'QuoteID' + '}', quote_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_quote_history(xero_tenant_id, quote_id, opts = {}) - data, _status_code, _headers = get_quote_history_with_http_info(xero_tenant_id, quote_id, opts) - data - end - - # Allows you to retrieve a history records of an quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_quote_history_with_http_info(xero_tenant_id, quote_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_history" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_history" - end - # resource path - local_var_path = '/Quotes/{QuoteID}/History'.sub('{' + 'QuoteID' + '}', quote_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_quote_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any sales quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [Date] :date_from Filter for quotes after a particular date - # @option opts [Date] :date_to Filter for quotes before a particular date - # @option opts [Date] :expiry_date_from Filter for quotes expiring after a particular date - # @option opts [Date] :expiry_date_to Filter for quotes before a particular date - # @option opts [String] :contact_id Filter for quotes belonging to a particular contact - # @option opts [String] :status Filter for quotes of a particular Status - # @option opts [Integer] :page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote - # @option opts [String] :order Order by an any element - # @return [Quotes] - def get_quotes(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_quotes_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any sales quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [Date] :date_from Filter for quotes after a particular date - # @option opts [Date] :date_to Filter for quotes before a particular date - # @option opts [Date] :expiry_date_from Filter for quotes expiring after a particular date - # @option opts [Date] :expiry_date_to Filter for quotes before a particular date - # @option opts [String] :contact_id Filter for quotes belonging to a particular contact - # @option opts [String] :status Filter for quotes of a particular Status - # @option opts [Integer] :page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote - # @option opts [String] :order Order by an any element - # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers - def get_quotes_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_quotes ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quotes" - end - # resource path - local_var_path = '/Quotes' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'DateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil? - query_params[:'DateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil? - query_params[:'ExpiryDateFrom'] = opts[:'expiry_date_from'] if !opts[:'expiry_date_from'].nil? - query_params[:'ExpiryDateTo'] = opts[:'expiry_date_to'] if !opts[:'expiry_date_to'].nil? - query_params[:'ContactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil? - query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil? - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Quotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified draft expense claim receipts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Receipts] - def get_receipt(xero_tenant_id, receipt_id, opts = {}) - data, _status_code, _headers = get_receipt_with_http_info(xero_tenant_id, receipt_id, opts) - data - end - - # Allows you to retrieve a specified draft expense claim receipts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers - def get_receipt_with_http_info(xero_tenant_id, receipt_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Receipts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on expense claim receipts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param file_name [String] The name of the file being attached to the Receipt - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve Attachments on expense claim receipts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param file_name [String] The name of the file being attached to the Receipt - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_attachment_by_file_name" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_receipt_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_receipt_attachment_by_file_name" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on expense claim receipts by ID - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_receipt_attachment_by_id_with_http_info(xero_tenant_id, receipt_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve Attachments on expense claim receipts by ID - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_receipt_attachment_by_id_with_http_info(xero_tenant_id, receipt_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_attachment_by_id" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_receipt_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_receipt_attachment_by_id" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}/Attachments/{AttachmentID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments for expense claim receipts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_receipt_attachments(xero_tenant_id, receipt_id, opts = {}) - data, _status_code, _headers = get_receipt_attachments_with_http_info(xero_tenant_id, receipt_id, opts) - data - end - - # Allows you to retrieve Attachments for expense claim receipts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_receipt_attachments_with_http_info(xero_tenant_id, receipt_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_attachments" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachments" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}/Attachments'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a history records of an Receipt - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_receipt_history(xero_tenant_id, receipt_id, opts = {}) - data, _status_code, _headers = get_receipt_history_with_http_info(xero_tenant_id, receipt_id, opts) - data - end - - # Allows you to retrieve a history records of an Receipt - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_receipt_history_with_http_info(xero_tenant_id, receipt_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_history" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_history" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}/History'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_receipt_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve draft expense claim receipts for any user - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Receipts] - def get_receipts(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_receipts_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve draft expense claim receipts for any user - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers - def get_receipts_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipts ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipts" - end - # resource path - local_var_path = '/Receipts' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Receipts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_receipts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param [Hash] opts the optional parameters - # @return [RepeatingInvoices] - def get_repeating_invoice(xero_tenant_id, repeating_invoice_id, opts = {}) - data, _status_code, _headers = get_repeating_invoice_with_http_info(xero_tenant_id, repeating_invoice_id, opts) - data - end - - # Allows you to retrieve a specified repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param [Hash] opts the optional parameters - # @return [Array<(RepeatingInvoices, Integer, Hash)>] RepeatingInvoices data, response status code and response headers - def get_repeating_invoice_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'RepeatingInvoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve specified attachment on repeating invoices by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param file_name [String] The name of the file being attached to a Repeating Invoice - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts = {}) - data, _status_code, _headers = get_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts) - data - end - - # Allows you to retrieve specified attachment on repeating invoices by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param file_name [String] The name of the file being attached to a Repeating Invoice - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified Attachments on repeating invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [File] - def get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts = {}) - data, _status_code, _headers = get_repeating_invoice_attachment_by_id_with_http_info(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts) - data - end - - # Allows you to retrieve a specified Attachments on repeating invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param attachment_id [String] Unique identifier for a Attachment - # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - # @param [Hash] opts the optional parameters - # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers - def get_repeating_invoice_attachment_by_id_with_http_info(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachment_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id" - end - # verify the required parameter 'content_type' is set - if @api_client.config.client_side_validation && content_type.nil? - fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_repeating_invoice_attachment_by_id" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'contentType'] = content_type - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'File' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Attachments on repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param [Hash] opts the optional parameters - # @return [Attachments] - def get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id, opts = {}) - data, _status_code, _headers = get_repeating_invoice_attachments_with_http_info(xero_tenant_id, repeating_invoice_id, opts) - data - end - - # Allows you to retrieve Attachments on repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def get_repeating_invoice_attachments_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachments ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_attachments" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachments" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve history for a repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param [Hash] opts the optional parameters - # @return [HistoryRecords] - def get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, opts = {}) - data, _status_code, _headers = get_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, opts) - data - end - - # Allows you to retrieve history for a repeating invoice - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param [Hash] opts the optional parameters - # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers - def get_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_history ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_history" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_history" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/History'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'HistoryRecords' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve any repeating invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [RepeatingInvoices] - def get_repeating_invoices(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_repeating_invoices_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve any repeating invoices - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(RepeatingInvoices, Integer, Hash)>] RepeatingInvoices data, response status code and response headers - def get_repeating_invoices_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoices ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoices" - end - # resource path - local_var_path = '/RepeatingInvoices' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'RepeatingInvoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for AgedPayablesByContact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date of the Aged Payables By Contact report - # @option opts [Date] :from_date The from date of the Aged Payables By Contact report - # @option opts [Date] :to_date The to date of the Aged Payables By Contact report - # @return [ReportWithRows] - def get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts = {}) - data, _status_code, _headers = get_report_aged_payables_by_contact_with_http_info(xero_tenant_id, contact_id, opts) - data - end - - # Allows you to retrieve report for AgedPayablesByContact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date of the Aged Payables By Contact report - # @option opts [Date] :from_date The from date of the Aged Payables By Contact report - # @option opts [Date] :to_date The to date of the Aged Payables By Contact report - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_aged_payables_by_contact_with_http_info(xero_tenant_id, contact_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_aged_payables_by_contact ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_aged_payables_by_contact" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_report_aged_payables_by_contact" - end - # resource path - local_var_path = '/Reports/AgedPayablesByContact' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'contactId'] = contact_id - query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? - query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? - query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_aged_payables_by_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for AgedReceivablesByContact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date of the Aged Receivables By Contact report - # @option opts [Date] :from_date The from date of the Aged Receivables By Contact report - # @option opts [Date] :to_date The to date of the Aged Receivables By Contact report - # @return [ReportWithRows] - def get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts = {}) - data, _status_code, _headers = get_report_aged_receivables_by_contact_with_http_info(xero_tenant_id, contact_id, opts) - data - end - - # Allows you to retrieve report for AgedReceivablesByContact - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date of the Aged Receivables By Contact report - # @option opts [Date] :from_date The from date of the Aged Receivables By Contact report - # @option opts [Date] :to_date The to date of the Aged Receivables By Contact report - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_aged_receivables_by_contact_with_http_info(xero_tenant_id, contact_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_aged_receivables_by_contact ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_aged_receivables_by_contact" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_report_aged_receivables_by_contact" - end - # resource path - local_var_path = '/Reports/AgedReceivablesByContact' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'contactId'] = contact_id - query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? - query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? - query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_aged_receivables_by_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for BAS only valid for AU orgs - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param report_id [String] Unique identifier for a Report - # @param [Hash] opts the optional parameters - # @return [ReportWithRows] - def get_report_ba_sor_gst(xero_tenant_id, report_id, opts = {}) - data, _status_code, _headers = get_report_ba_sor_gst_with_http_info(xero_tenant_id, report_id, opts) - data - end - - # Allows you to retrieve report for BAS only valid for AU orgs - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param report_id [String] Unique identifier for a Report - # @param [Hash] opts the optional parameters - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_ba_sor_gst_with_http_info(xero_tenant_id, report_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ba_sor_gst ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_ba_sor_gst" - end - # verify the required parameter 'report_id' is set - if @api_client.config.client_side_validation && report_id.nil? - fail ArgumentError, "Missing the required parameter 'report_id' when calling AccountingApi.get_report_ba_sor_gst" - end - # resource path - local_var_path = '/Reports/{ReportID}'.sub('{' + 'ReportID' + '}', report_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_ba_sor_gst\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for BAS only valid for AU orgs - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [ReportWithRows] - def get_report_ba_sor_gst_list(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_ba_sor_gst_list_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for BAS only valid for AU orgs - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_ba_sor_gst_list_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ba_sor_gst_list ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_ba_sor_gst_list" - end - # resource path - local_var_path = '/Reports' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_ba_sor_gst_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for BalanceSheet - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :date The date of the Balance Sheet report - # @option opts [Integer] :periods The number of periods for the Balance Sheet report - # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) - # @option opts [String] :tracking_option_id1 The tracking option 1 for the Balance Sheet report - # @option opts [String] :tracking_option_id2 The tracking option 2 for the Balance Sheet report - # @option opts [Boolean] :standard_layout The standard layout boolean for the Balance Sheet report - # @option opts [Boolean] :payments_only return a cash basis for the Balance Sheet report - # @return [ReportWithRows] - def get_report_balance_sheet(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_balance_sheet_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for BalanceSheet - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :date The date of the Balance Sheet report - # @option opts [Integer] :periods The number of periods for the Balance Sheet report - # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) - # @option opts [String] :tracking_option_id1 The tracking option 1 for the Balance Sheet report - # @option opts [String] :tracking_option_id2 The tracking option 2 for the Balance Sheet report - # @option opts [Boolean] :standard_layout The standard layout boolean for the Balance Sheet report - # @option opts [Boolean] :payments_only return a cash basis for the Balance Sheet report - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_balance_sheet_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_balance_sheet ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_balance_sheet" - end - allowable_values = ["MONTH", "QUARTER", "YEAR"] - if @api_client.config.client_side_validation && opts[:'timeframe'] && !allowable_values.include?(opts[:'timeframe']) - fail ArgumentError, "invalid value for \"timeframe\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/Reports/BalanceSheet' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? - query_params[:'periods'] = opts[:'periods'] if !opts[:'periods'].nil? - query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil? - query_params[:'trackingOptionID1'] = opts[:'tracking_option_id1'] if !opts[:'tracking_option_id1'].nil? - query_params[:'trackingOptionID2'] = opts[:'tracking_option_id2'] if !opts[:'tracking_option_id2'].nil? - query_params[:'standardLayout'] = opts[:'standard_layout'] if !opts[:'standard_layout'].nil? - query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_balance_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for BankSummary - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :from_date The from date for the Bank Summary report e.g. 2018-03-31 - # @option opts [Date] :to_date The to date for the Bank Summary report e.g. 2018-03-31 - # @return [ReportWithRows] - def get_report_bank_summary(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_bank_summary_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for BankSummary - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :from_date The from date for the Bank Summary report e.g. 2018-03-31 - # @option opts [Date] :to_date The to date for the Bank Summary report e.g. 2018-03-31 - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_bank_summary_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_bank_summary ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_bank_summary" - end - # resource path - local_var_path = '/Reports/BankSummary' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? - query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_bank_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for Budget Summary - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 - # @option opts [Integer] :period The number of periods to compare (integer between 1 and 12) - # @option opts [Integer] :timeframe The period size to compare to (1=month, 3=quarter, 12=year) - # @return [ReportWithRows] - def get_report_budget_summary(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_budget_summary_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for Budget Summary - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 - # @option opts [Integer] :period The number of periods to compare (integer between 1 and 12) - # @option opts [Integer] :timeframe The period size to compare to (1=month, 3=quarter, 12=year) - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_budget_summary_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_budget_summary ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_budget_summary" - end - # resource path - local_var_path = '/Reports/BudgetSummary' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? - query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil? - query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_budget_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for ExecutiveSummary - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 - # @return [ReportWithRows] - def get_report_executive_summary(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_executive_summary_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for ExecutiveSummary - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_executive_summary_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_executive_summary ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_executive_summary" - end - # resource path - local_var_path = '/Reports/ExecutiveSummary' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_executive_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for ProfitAndLoss - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :from_date The from date for the ProfitAndLoss report e.g. 2018-03-31 - # @option opts [Date] :to_date The to date for the ProfitAndLoss report e.g. 2018-03-31 - # @option opts [Integer] :periods The number of periods to compare (integer between 1 and 12) - # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) - # @option opts [String] :tracking_category_id The trackingCategory 1 for the ProfitAndLoss report - # @option opts [String] :tracking_category_id2 The trackingCategory 2 for the ProfitAndLoss report - # @option opts [String] :tracking_option_id The tracking option 1 for the ProfitAndLoss report - # @option opts [String] :tracking_option_id2 The tracking option 2 for the ProfitAndLoss report - # @option opts [Boolean] :standard_layout Return the standard layout for the ProfitAndLoss report - # @option opts [Boolean] :payments_only Return cash only basis for the ProfitAndLoss report - # @return [ReportWithRows] - def get_report_profit_and_loss(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_profit_and_loss_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for ProfitAndLoss - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :from_date The from date for the ProfitAndLoss report e.g. 2018-03-31 - # @option opts [Date] :to_date The to date for the ProfitAndLoss report e.g. 2018-03-31 - # @option opts [Integer] :periods The number of periods to compare (integer between 1 and 12) - # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) - # @option opts [String] :tracking_category_id The trackingCategory 1 for the ProfitAndLoss report - # @option opts [String] :tracking_category_id2 The trackingCategory 2 for the ProfitAndLoss report - # @option opts [String] :tracking_option_id The tracking option 1 for the ProfitAndLoss report - # @option opts [String] :tracking_option_id2 The tracking option 2 for the ProfitAndLoss report - # @option opts [Boolean] :standard_layout Return the standard layout for the ProfitAndLoss report - # @option opts [Boolean] :payments_only Return cash only basis for the ProfitAndLoss report - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_profit_and_loss_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_profit_and_loss ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_profit_and_loss" - end - allowable_values = ["MONTH", "QUARTER", "YEAR"] - if @api_client.config.client_side_validation && opts[:'timeframe'] && !allowable_values.include?(opts[:'timeframe']) - fail ArgumentError, "invalid value for \"timeframe\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/Reports/ProfitAndLoss' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? - query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? - query_params[:'periods'] = opts[:'periods'] if !opts[:'periods'].nil? - query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil? - query_params[:'trackingCategoryID'] = opts[:'tracking_category_id'] if !opts[:'tracking_category_id'].nil? - query_params[:'trackingCategoryID2'] = opts[:'tracking_category_id2'] if !opts[:'tracking_category_id2'].nil? - query_params[:'trackingOptionID'] = opts[:'tracking_option_id'] if !opts[:'tracking_option_id'].nil? - query_params[:'trackingOptionID2'] = opts[:'tracking_option_id2'] if !opts[:'tracking_option_id2'].nil? - query_params[:'standardLayout'] = opts[:'standard_layout'] if !opts[:'standard_layout'].nil? - query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_profit_and_loss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for TenNinetyNine - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :report_year The year of the 1099 report - # @return [Reports] - def get_report_ten_ninety_nine(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_ten_ninety_nine_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for TenNinetyNine - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :report_year The year of the 1099 report - # @return [Array<(Reports, Integer, Hash)>] Reports data, response status code and response headers - def get_report_ten_ninety_nine_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ten_ninety_nine ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_ten_ninety_nine" - end - # resource path - local_var_path = '/Reports/TenNinetyNine' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'reportYear'] = opts[:'report_year'] if !opts[:'report_year'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Reports' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_ten_ninety_nine\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve report for TrialBalance - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date for the Trial Balance report e.g. 2018-03-31 - # @option opts [Boolean] :payments_only Return cash only basis for the Trial Balance report - # @return [ReportWithRows] - def get_report_trial_balance(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_report_trial_balance_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve report for TrialBalance - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [Date] :date The date for the Trial Balance report e.g. 2018-03-31 - # @option opts [Boolean] :payments_only Return cash only basis for the Trial Balance report - # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers - def get_report_trial_balance_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_trial_balance ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_trial_balance" - end - # resource path - local_var_path = '/Reports/TrialBalance' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? - query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'ReportWithRows' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_report_trial_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve Tax Rates - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [String] :tax_type Filter by tax type - # @return [TaxRates] - def get_tax_rates(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_tax_rates_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve Tax Rates - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [String] :tax_type Filter by tax type - # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers - def get_tax_rates_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_tax_rates ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_tax_rates" - end - # resource path - local_var_path = '/TaxRates' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'TaxType'] = opts[:'tax_type'] if !opts[:'tax_type'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'TaxRates' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_tax_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve tracking categories and options - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Boolean] :include_archived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response - # @return [TrackingCategories] - def get_tracking_categories(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_tracking_categories_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve tracking categories and options - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @option opts [Boolean] :include_archived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response - # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers - def get_tracking_categories_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_tracking_categories ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_tracking_categories" - end - # resource path - local_var_path = '/TrackingCategories' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'TrackingCategories' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_tracking_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve tracking categories and options for specified category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param [Hash] opts the optional parameters - # @return [TrackingCategories] - def get_tracking_category(xero_tenant_id, tracking_category_id, opts = {}) - data, _status_code, _headers = get_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts) - data - end - - # Allows you to retrieve tracking categories and options for specified category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param [Hash] opts the optional parameters - # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers - def get_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_tracking_category ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_tracking_category" - end - # verify the required parameter 'tracking_category_id' is set - if @api_client.config.client_side_validation && tracking_category_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.get_tracking_category" - end - # resource path - local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'TrackingCategories' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified user - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param user_id [String] Unique identifier for a User - # @param [Hash] opts the optional parameters - # @return [Users] - def get_user(xero_tenant_id, user_id, opts = {}) - data, _status_code, _headers = get_user_with_http_info(xero_tenant_id, user_id, opts) - data - end - - # Allows you to retrieve a specified user - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param user_id [String] Unique identifier for a User - # @param [Hash] opts the optional parameters - # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers - def get_user_with_http_info(xero_tenant_id, user_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_user ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_user" - end - # verify the required parameter 'user_id' is set - if @api_client.config.client_side_validation && user_id.nil? - fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountingApi.get_user" - end - # resource path - local_var_path = '/Users/{UserID}'.sub('{' + 'UserID' + '}', user_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Users' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve users - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Users] - def get_users(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_users_with_http_info(xero_tenant_id, opts) - data - end - - # Allows you to retrieve users - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned - # @option opts [String] :where Filter by an any element - # @option opts [String] :order Order by an any element - # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers - def get_users_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.get_users ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_users" - end - # resource path - local_var_path = '/Users' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? - query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Users' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for retrieving single object - # @param accounts [Accounts] Request of type Accounts array with one Account - # @param [Hash] opts the optional parameters - # @return [Accounts] - def update_account(xero_tenant_id, account_id, accounts, opts = {}) - data, _status_code, _headers = update_account_with_http_info(xero_tenant_id, account_id, accounts, opts) - data - end - - # Allows you to update a chart of accounts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for retrieving single object - # @param accounts [Accounts] Request of type Accounts array with one Account - # @param [Hash] opts the optional parameters - # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers - def update_account_with_http_info(xero_tenant_id, account_id, accounts, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_account ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_account" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.update_account" - end - # verify the required parameter 'accounts' is set - if @api_client.config.client_side_validation && accounts.nil? - fail ArgumentError, "Missing the required parameter 'accounts' when calling AccountingApi.update_account" - end - # resource path - local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(accounts) - - # return_type - return_type = opts[:return_type] || 'Accounts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update Attachment on Account by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, opts = {}) - data, _status_code, _headers = update_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts) - data - end - - # Allows you to update Attachment on Account by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param account_id [String] Unique identifier for Account object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_account_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_account_attachment_by_file_name" - end - # verify the required parameter 'account_id' is set - if @api_client.config.client_side_validation && account_id.nil? - fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.update_account_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_account_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_account_attachment_by_file_name" - end - # resource path - local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a single spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param bank_transactions [BankTransactions] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [BankTransactions] - def update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {}) - data, _status_code, _headers = update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts) - data - end - - # Allows you to update a single spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param bank_transactions [BankTransactions] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers - def update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transaction" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction" - end - # verify the required parameter 'bank_transactions' is set - if @api_client.config.client_side_validation && bank_transactions.nil? - fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_bank_transaction" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(bank_transactions) - - # return_type - return_type = opts[:return_type] || 'BankTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_bank_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update an Attachment on BankTransaction by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param file_name [String] The name of the file being attached - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) - data, _status_code, _headers = update_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts) - data - end - - # Allows you to update an Attachment on BankTransaction by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction - # @param file_name [String] The name of the file being attached - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" - end - # resource path - local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param file_name [String] The name of the file being attached to a Bank Transfer - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) - data, _status_code, _headers = update_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts) - data - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer - # @param file_name [String] The name of the file being attached to a Bank Transfer - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transfer_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'bank_transfer_id' is set - if @api_client.config.client_side_validation && bank_transfer_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" - end - # resource path - local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param contacts [Contacts] an array of Contacts containing single Contact object with properties to update - # @param [Hash] opts the optional parameters - # @return [Contacts] - def update_contact(xero_tenant_id, contact_id, contacts, opts = {}) - data, _status_code, _headers = update_contact_with_http_info(xero_tenant_id, contact_id, contacts, opts) - data - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param contacts [Contacts] an array of Contacts containing single Contact object with properties to update - # @param [Hash] opts the optional parameters - # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers - def update_contact_with_http_info(xero_tenant_id, contact_id, contacts, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_contact" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.update_contact" - end - # verify the required parameter 'contacts' is set - if @api_client.config.client_side_validation && contacts.nil? - fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.update_contact" - end - # resource path - local_var_path = '/Contacts/{ContactID}'.sub('{' + 'ContactID' + '}', contact_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(contacts) - - # return_type - return_type = opts[:return_type] || 'Contacts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param file_name [String] Name for the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, opts = {}) - data, _status_code, _headers = update_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts) - data - end - - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_id [String] Unique identifier for a Contact - # @param file_name [String] Name for the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_contact_attachment_by_file_name" - end - # verify the required parameter 'contact_id' is set - if @api_client.config.client_side_validation && contact_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.update_contact_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_contact_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_contact_attachment_by_file_name" - end - # resource path - local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param contact_groups [ContactGroups] an array of Contact groups with Name of specific group to update - # @param [Hash] opts the optional parameters - # @return [ContactGroups] - def update_contact_group(xero_tenant_id, contact_group_id, contact_groups, opts = {}) - data, _status_code, _headers = update_contact_group_with_http_info(xero_tenant_id, contact_group_id, contact_groups, opts) - data - end - - # Allows you to update a Contact Group - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contact_group_id [String] Unique identifier for a Contact Group - # @param contact_groups [ContactGroups] an array of Contact groups with Name of specific group to update - # @param [Hash] opts the optional parameters - # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers - def update_contact_group_with_http_info(xero_tenant_id, contact_group_id, contact_groups, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact_group ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_contact_group" - end - # verify the required parameter 'contact_group_id' is set - if @api_client.config.client_side_validation && contact_group_id.nil? - fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.update_contact_group" - end - # verify the required parameter 'contact_groups' is set - if @api_client.config.client_side_validation && contact_groups.nil? - fail ArgumentError, "Missing the required parameter 'contact_groups' when calling AccountingApi.update_contact_group" - end - # resource path - local_var_path = '/ContactGroups/{ContactGroupID}'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(contact_groups) - - # return_type - return_type = opts[:return_type] || 'ContactGroups' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specific credit note - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param credit_notes [CreditNotes] an array of Credit Notes containing credit note details to update - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [CreditNotes] - def update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts = {}) - data, _status_code, _headers = update_credit_note_with_http_info(xero_tenant_id, credit_note_id, credit_notes, opts) - data - end - - # Allows you to update a specific credit note - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param credit_notes [CreditNotes] an array of Credit Notes containing credit note details to update - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers - def update_credit_note_with_http_info(xero_tenant_id, credit_note_id, credit_notes, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_credit_note ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_credit_note" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.update_credit_note" - end - # verify the required parameter 'credit_notes' is set - if @api_client.config.client_side_validation && credit_notes.nil? - fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.update_credit_note" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(credit_notes) - - # return_type - return_type = opts[:return_type] || 'CreditNotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_credit_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update Attachments on CreditNote by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param file_name [String] Name of the file you are attaching to Credit Note - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {}) - data, _status_code, _headers = update_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts) - data - end - - # Allows you to update Attachments on CreditNote by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_note_id [String] Unique identifier for a Credit Note - # @param file_name [String] Name of the file you are attaching to Credit Note - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_credit_note_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_credit_note_attachment_by_file_name" - end - # verify the required parameter 'credit_note_id' is set - if @api_client.config.client_side_validation && credit_note_id.nil? - fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.update_credit_note_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_credit_note_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_credit_note_attachment_by_file_name" - end - # resource path - local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update specified expense claims - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param expense_claims [ExpenseClaims] - # @param [Hash] opts the optional parameters - # @return [ExpenseClaims] - def update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims, opts = {}) - data, _status_code, _headers = update_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, expense_claims, opts) - data - end - - # Allows you to update specified expense claims - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param expense_claim_id [String] Unique identifier for a ExpenseClaim - # @param expense_claims [ExpenseClaims] - # @param [Hash] opts the optional parameters - # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers - def update_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, expense_claims, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_expense_claim ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_expense_claim" - end - # verify the required parameter 'expense_claim_id' is set - if @api_client.config.client_side_validation && expense_claim_id.nil? - fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.update_expense_claim" - end - # verify the required parameter 'expense_claims' is set - if @api_client.config.client_side_validation && expense_claims.nil? - fail ArgumentError, "Missing the required parameter 'expense_claims' when calling AccountingApi.update_expense_claim" - end - # resource path - local_var_path = '/ExpenseClaims/{ExpenseClaimID}'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(expense_claims) - - # return_type - return_type = opts[:return_type] || 'ExpenseClaims' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_expense_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param invoices [Invoices] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Invoices] - def update_invoice(xero_tenant_id, invoice_id, invoices, opts = {}) - data, _status_code, _headers = update_invoice_with_http_info(xero_tenant_id, invoice_id, invoices, opts) - data - end - - # Allows you to update a specified sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param invoices [Invoices] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers - def update_invoice_with_http_info(xero_tenant_id, invoice_id, invoices, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_invoice ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_invoice" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.update_invoice" - end - # verify the required parameter 'invoices' is set - if @api_client.config.client_side_validation && invoices.nil? - fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.update_invoice" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(invoices) - - # return_type - return_type = opts[:return_type] || 'Invoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update Attachment on invoices or purchase bills by it's filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param file_name [String] Name of the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {}) - data, _status_code, _headers = update_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts) - data - end - - # Allows you to update Attachment on invoices or purchase bills by it's filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoice_id [String] Unique identifier for an Invoice - # @param file_name [String] Name of the file you are attaching - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_invoice_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_invoice_attachment_by_file_name" - end - # verify the required parameter 'invoice_id' is set - if @api_client.config.client_side_validation && invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.update_invoice_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_invoice_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_invoice_attachment_by_file_name" - end - # resource path - local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified item - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param items [Items] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Items] - def update_item(xero_tenant_id, item_id, items, opts = {}) - data, _status_code, _headers = update_item_with_http_info(xero_tenant_id, item_id, items, opts) - data - end - - # Allows you to update a specified item - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param item_id [String] Unique identifier for an Item - # @param items [Items] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers - def update_item_with_http_info(xero_tenant_id, item_id, items, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_item ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_item" - end - # verify the required parameter 'item_id' is set - if @api_client.config.client_side_validation && item_id.nil? - fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.update_item" - end - # verify the required parameter 'items' is set - if @api_client.config.client_side_validation && items.nil? - fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.update_item" - end - # resource path - local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(items) - - # return_type - return_type = opts[:return_type] || 'Items' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction - # @param linked_transactions [LinkedTransactions] - # @param [Hash] opts the optional parameters - # @return [LinkedTransactions] - def update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions, opts = {}) - data, _status_code, _headers = update_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, linked_transactions, opts) - data - end - - # Allows you to update a specified linked transactions (billable expenses) - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction - # @param linked_transactions [LinkedTransactions] - # @param [Hash] opts the optional parameters - # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers - def update_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, linked_transactions, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_linked_transaction ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_linked_transaction" - end - # verify the required parameter 'linked_transaction_id' is set - if @api_client.config.client_side_validation && linked_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.update_linked_transaction" - end - # verify the required parameter 'linked_transactions' is set - if @api_client.config.client_side_validation && linked_transactions.nil? - fail ArgumentError, "Missing the required parameter 'linked_transactions' when calling AccountingApi.update_linked_transaction" - end - # resource path - local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(linked_transactions) - - # return_type - return_type = opts[:return_type] || 'LinkedTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified manual journal - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param manual_journals [ManualJournals] - # @param [Hash] opts the optional parameters - # @return [ManualJournals] - def update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals, opts = {}) - data, _status_code, _headers = update_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, manual_journals, opts) - data - end - - # Allows you to update a specified manual journal - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param manual_journals [ManualJournals] - # @param [Hash] opts the optional parameters - # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers - def update_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, manual_journals, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_manual_journal ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_manual_journal" - end - # verify the required parameter 'manual_journal_id' is set - if @api_client.config.client_side_validation && manual_journal_id.nil? - fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.update_manual_journal" - end - # verify the required parameter 'manual_journals' is set - if @api_client.config.client_side_validation && manual_journals.nil? - fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.update_manual_journal" - end - # resource path - local_var_path = '/ManualJournals/{ManualJournalID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(manual_journals) - - # return_type - return_type = opts[:return_type] || 'ManualJournals' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_manual_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified Attachment on ManualJournal by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param file_name [String] The name of the file being attached to a ManualJournal - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) - data, _status_code, _headers = update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts) - data - end - - # Allows you to update a specified Attachment on ManualJournal by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journal_id [String] Unique identifier for a ManualJournal - # @param file_name [String] The name of the file being attached to a ManualJournal - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_manual_journal_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'manual_journal_id' is set - if @api_client.config.client_side_validation && manual_journal_id.nil? - fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.update_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_manual_journal_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_manual_journal_attachment_by_file_name" - end - # resource path - local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update or create one or more spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transactions [BankTransactions] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [BankTransactions] - def update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts = {}) - data, _status_code, _headers = update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts) - data - end - - # Allows you to update or create one or more spend or receive money transaction - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transactions [BankTransactions] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers - def update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_bank_transactions ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_bank_transactions" - end - # verify the required parameter 'bank_transactions' is set - if @api_client.config.client_side_validation && bank_transactions.nil? - fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_or_create_bank_transactions" - end - # resource path - local_var_path = '/BankTransactions' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(bank_transactions) - - # return_type - return_type = opts[:return_type] || 'BankTransactions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update OR create one or more contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contacts [Contacts] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Contacts] - def update_or_create_contacts(xero_tenant_id, contacts, opts = {}) - data, _status_code, _headers = update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts) - data - end - - # Allows you to update OR create one or more contacts in a Xero organisation - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param contacts [Contacts] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers - def update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_contacts ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_contacts" - end - # verify the required parameter 'contacts' is set - if @api_client.config.client_side_validation && contacts.nil? - fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.update_or_create_contacts" - end - # resource path - local_var_path = '/Contacts' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(contacts) - - # return_type - return_type = opts[:return_type] || 'Contacts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update OR create one or more credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object. - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [CreditNotes] - def update_or_create_credit_notes(xero_tenant_id, credit_notes, opts = {}) - data, _status_code, _headers = update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts) - data - end - - # Allows you to update OR create one or more credit notes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object. - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers - def update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_credit_notes ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_credit_notes" - end - # verify the required parameter 'credit_notes' is set - if @api_client.config.client_side_validation && credit_notes.nil? - fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.update_or_create_credit_notes" - end - # resource path - local_var_path = '/CreditNotes' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(credit_notes) - - # return_type - return_type = opts[:return_type] || 'CreditNotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a single new employees used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param employees [Employees] Employees with array of Employee object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Employees] - def update_or_create_employees(xero_tenant_id, employees, opts = {}) - data, _status_code, _headers = update_or_create_employees_with_http_info(xero_tenant_id, employees, opts) - data - end - - # Allows you to create a single new employees used in Xero payrun - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param employees [Employees] Employees with array of Employee object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers - def update_or_create_employees_with_http_info(xero_tenant_id, employees, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_employees ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_employees" - end - # verify the required parameter 'employees' is set - if @api_client.config.client_side_validation && employees.nil? - fail ArgumentError, "Missing the required parameter 'employees' when calling AccountingApi.update_or_create_employees" - end - # resource path - local_var_path = '/Employees' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(employees) - - # return_type - return_type = opts[:return_type] || 'Employees' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update OR create one or more sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoices [Invoices] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Invoices] - def update_or_create_invoices(xero_tenant_id, invoices, opts = {}) - data, _status_code, _headers = update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts) - data - end - - # Allows you to update OR create one or more sales invoices or purchase bills - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param invoices [Invoices] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers - def update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_invoices ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_invoices" - end - # verify the required parameter 'invoices' is set - if @api_client.config.client_side_validation && invoices.nil? - fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.update_or_create_invoices" - end - # resource path - local_var_path = '/Invoices' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(invoices) - - # return_type - return_type = opts[:return_type] || 'Invoices' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update or create one or more items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param items [Items] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Items] - def update_or_create_items(xero_tenant_id, items, opts = {}) - data, _status_code, _headers = update_or_create_items_with_http_info(xero_tenant_id, items, opts) - data - end - - # Allows you to update or create one or more items - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param items [Items] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers - def update_or_create_items_with_http_info(xero_tenant_id, items, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_items ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_items" - end - # verify the required parameter 'items' is set - if @api_client.config.client_side_validation && items.nil? - fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.update_or_create_items" - end - # resource path - local_var_path = '/Items' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(items) - - # return_type - return_type = opts[:return_type] || 'Items' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to create a single manual journal - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [ManualJournals] - def update_or_create_manual_journals(xero_tenant_id, manual_journals, opts = {}) - data, _status_code, _headers = update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts) - data - end - - # Allows you to create a single manual journal - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers - def update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_manual_journals ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_manual_journals" - end - # verify the required parameter 'manual_journals' is set - if @api_client.config.client_side_validation && manual_journals.nil? - fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.update_or_create_manual_journals" - end - # resource path - local_var_path = '/ManualJournals' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(manual_journals) - - # return_type - return_type = opts[:return_type] || 'ManualJournals' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update or create one or more purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_orders [PurchaseOrders] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [PurchaseOrders] - def update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) - data, _status_code, _headers = update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts) - data - end - - # Allows you to update or create one or more purchase orders - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_orders [PurchaseOrders] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers - def update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_purchase_orders ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_purchase_orders" - end - # verify the required parameter 'purchase_orders' is set - if @api_client.config.client_side_validation && purchase_orders.nil? - fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.update_or_create_purchase_orders" - end - # resource path - local_var_path = '/PurchaseOrders' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(purchase_orders) - - # return_type - return_type = opts[:return_type] || 'PurchaseOrders' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update OR create one or more quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quotes [Quotes] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) - # @return [Quotes] - def update_or_create_quotes(xero_tenant_id, quotes, opts = {}) - data, _status_code, _headers = update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts) - data - end - - # Allows you to update OR create one or more quotes - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quotes [Quotes] - # @param [Hash] opts the optional parameters - # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors - # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers - def update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_quotes ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_quotes" - end - # verify the required parameter 'quotes' is set - if @api_client.config.client_side_validation && quotes.nil? - fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.update_or_create_quotes" - end - # resource path - local_var_path = '/Quotes' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(quotes) - - # return_type - return_type = opts[:return_type] || 'Quotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_or_create_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified purchase order - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param purchase_orders [PurchaseOrders] - # @param [Hash] opts the optional parameters - # @return [PurchaseOrders] - def update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders, opts = {}) - data, _status_code, _headers = update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purchase_orders, opts) - data - end - - # Allows you to update a specified purchase order - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param purchase_order_id [String] Unique identifier for a PurchaseOrder - # @param purchase_orders [PurchaseOrders] - # @param [Hash] opts the optional parameters - # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers - def update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purchase_orders, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_purchase_order ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_purchase_order" - end - # verify the required parameter 'purchase_order_id' is set - if @api_client.config.client_side_validation && purchase_order_id.nil? - fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.update_purchase_order" - end - # verify the required parameter 'purchase_orders' is set - if @api_client.config.client_side_validation && purchase_orders.nil? - fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.update_purchase_order" - end - # resource path - local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(purchase_orders) - - # return_type - return_type = opts[:return_type] || 'PurchaseOrders' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_purchase_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update a specified quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param quotes [Quotes] - # @param [Hash] opts the optional parameters - # @return [Quotes] - def update_quote(xero_tenant_id, quote_id, quotes, opts = {}) - data, _status_code, _headers = update_quote_with_http_info(xero_tenant_id, quote_id, quotes, opts) - data - end - - # Allows you to update a specified quote - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for an Quote - # @param quotes [Quotes] - # @param [Hash] opts the optional parameters - # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers - def update_quote_with_http_info(xero_tenant_id, quote_id, quotes, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_quote ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_quote" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.update_quote" - end - # verify the required parameter 'quotes' is set - if @api_client.config.client_side_validation && quotes.nil? - fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.update_quote" - end - # resource path - local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(quotes) - - # return_type - return_type = opts[:return_type] || 'Quotes' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update Attachment on Quote by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body, opts = {}) - data, _status_code, _headers = update_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts) - data - end - - # Allows you to update Attachment on Quote by Filename - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param quote_id [String] Unique identifier for Quote object - # @param file_name [String] Name of the attachment - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_quote_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_quote_attachment_by_file_name" - end - # verify the required parameter 'quote_id' is set - if @api_client.config.client_side_validation && quote_id.nil? - fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.update_quote_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_quote_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_quote_attachment_by_file_name" - end - # resource path - local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to retrieve a specified draft expense claim receipts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param receipts [Receipts] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Receipts] - def update_receipt(xero_tenant_id, receipt_id, receipts, opts = {}) - data, _status_code, _headers = update_receipt_with_http_info(xero_tenant_id, receipt_id, receipts, opts) - data - end - - # Allows you to retrieve a specified draft expense claim receipts - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param receipts [Receipts] - # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts - # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers - def update_receipt_with_http_info(xero_tenant_id, receipt_id, receipts, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_receipt ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_receipt" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.update_receipt" - end - # verify the required parameter 'receipts' is set - if @api_client.config.client_side_validation && receipts.nil? - fail ArgumentError, "Missing the required parameter 'receipts' when calling AccountingApi.update_receipt" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(receipts) - - # return_type - return_type = opts[:return_type] || 'Receipts' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update Attachment on expense claim receipts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param file_name [String] The name of the file being attached to the Receipt - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body, opts = {}) - data, _status_code, _headers = update_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts) - data - end - - # Allows you to update Attachment on expense claim receipts by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param receipt_id [String] Unique identifier for a Receipt - # @param file_name [String] The name of the file being attached to the Receipt - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_receipt_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_receipt_attachment_by_file_name" - end - # verify the required parameter 'receipt_id' is set - if @api_client.config.client_side_validation && receipt_id.nil? - fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.update_receipt_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_receipt_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_receipt_attachment_by_file_name" - end - # resource path - local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update specified attachment on repeating invoices by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param file_name [String] The name of the file being attached to a Repeating Invoice - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Attachments] - def update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) - data, _status_code, _headers = update_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts) - data - end - - # Allows you to update specified attachment on repeating invoices by file name - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice - # @param file_name [String] The name of the file being attached to a Repeating Invoice - # @param body [String] Byte array of file in body of request - # @param [Hash] opts the optional parameters - # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers - def update_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_repeating_invoice_attachment_by_file_name ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'repeating_invoice_id' is set - if @api_client.config.client_side_validation && repeating_invoice_id.nil? - fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'file_name' is set - if @api_client.config.client_side_validation && file_name.nil? - fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" - end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" - end - # resource path - local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(body) - - # return_type - return_type = opts[:return_type] || 'Attachments' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update Tax Rates - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tax_rates [TaxRates] - # @param [Hash] opts the optional parameters - # @return [TaxRates] - def update_tax_rate(xero_tenant_id, tax_rates, opts = {}) - data, _status_code, _headers = update_tax_rate_with_http_info(xero_tenant_id, tax_rates, opts) - data - end - - # Allows you to update Tax Rates - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tax_rates [TaxRates] - # @param [Hash] opts the optional parameters - # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers - def update_tax_rate_with_http_info(xero_tenant_id, tax_rates, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_tax_rate ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_tax_rate" - end - # verify the required parameter 'tax_rates' is set - if @api_client.config.client_side_validation && tax_rates.nil? - fail ArgumentError, "Missing the required parameter 'tax_rates' when calling AccountingApi.update_tax_rate" - end - # resource path - local_var_path = '/TaxRates' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(tax_rates) - - # return_type - return_type = opts[:return_type] || 'TaxRates' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_tax_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update tracking categories - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_category [TrackingCategory] - # @param [Hash] opts the optional parameters - # @return [TrackingCategories] - def update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category, opts = {}) - data, _status_code, _headers = update_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, tracking_category, opts) - data - end - - # Allows you to update tracking categories - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_category [TrackingCategory] - # @param [Hash] opts the optional parameters - # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers - def update_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, tracking_category, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_tracking_category ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_tracking_category" - end - # verify the required parameter 'tracking_category_id' is set - if @api_client.config.client_side_validation && tracking_category_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.update_tracking_category" - end - # verify the required parameter 'tracking_category' is set - if @api_client.config.client_side_validation && tracking_category.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category' when calling AccountingApi.update_tracking_category" - end - # resource path - local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(tracking_category) - - # return_type - return_type = opts[:return_type] || 'TrackingCategories' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # Allows you to update options for a specified tracking category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_option_id [String] Unique identifier for a Tracking Option - # @param tracking_option [TrackingOption] - # @param [Hash] opts the optional parameters - # @return [TrackingOptions] - def update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts = {}) - data, _status_code, _headers = update_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts) - data - end - - # Allows you to update options for a specified tracking category - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param tracking_category_id [String] Unique identifier for a TrackingCategory - # @param tracking_option_id [String] Unique identifier for a Tracking Option - # @param tracking_option [TrackingOption] - # @param [Hash] opts the optional parameters - # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers - def update_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AccountingApi.update_tracking_options ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_tracking_options" - end - # verify the required parameter 'tracking_category_id' is set - if @api_client.config.client_side_validation && tracking_category_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.update_tracking_options" - end - # verify the required parameter 'tracking_option_id' is set - if @api_client.config.client_side_validation && tracking_option_id.nil? - fail ArgumentError, "Missing the required parameter 'tracking_option_id' when calling AccountingApi.update_tracking_options" - end - # verify the required parameter 'tracking_option' is set - if @api_client.config.client_side_validation && tracking_option.nil? - fail ArgumentError, "Missing the required parameter 'tracking_option' when calling AccountingApi.update_tracking_options" - end - # resource path - local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s).sub('{' + 'TrackingOptionID' + '}', tracking_option_id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'xero-tenant-id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(tracking_option) - - # return_type - return_type = opts[:return_type] || 'TrackingOptions' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AccountingApi#update_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb deleted file mode 100644 index a7e51994..00000000 --- a/lib/xero-ruby/api/asset_api.rb +++ /dev/null @@ -1,452 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'cgi' - -module XeroRuby - class AssetApi - attr_accessor :api_client - - def initialize(api_client = ApiClient.new) - @api_client = api_client - end - # adds a fixed asset - # Adds an asset to the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param asset [Asset] Fixed asset you are creating - # @param [Hash] opts the optional parameters - # @return [Asset] - def create_asset(xero_tenant_id, asset, opts = {}) - data, _status_code, _headers = create_asset_with_http_info(xero_tenant_id, asset, opts) - data - end - - # adds a fixed asset - # Adds an asset to the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param asset [Asset] Fixed asset you are creating - # @param [Hash] opts the optional parameters - # @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers - def create_asset_with_http_info(xero_tenant_id, asset, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AssetApi.create_asset ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset" - end - # verify the required parameter 'asset' is set - if @api_client.config.client_side_validation && asset.nil? - fail ArgumentError, "Missing the required parameter 'asset' when calling AssetApi.create_asset" - end - # resource path - local_var_path = '/Assets' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Xero-Tenant-Id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(asset) - - # return_type - return_type = opts[:return_type] || 'Asset' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AssetApi#create_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # adds a fixed asset type - # Adds an fixed asset type to the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [AssetType] :asset_type Asset type to add - # @return [AssetType] - def create_asset_type(xero_tenant_id, opts = {}) - data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, opts) - data - end - - # adds a fixed asset type - # Adds an fixed asset type to the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @option opts [AssetType] :asset_type Asset type to add - # @return [Array<(AssetType, Integer, Hash)>] AssetType data, response status code and response headers - def create_asset_type_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AssetApi.create_asset_type ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset_type" - end - # resource path - local_var_path = '/AssetTypes' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) - header_params[:'Xero-Tenant-Id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] || @api_client.object_to_http_body(opts[:'asset_type']) - - # return_type - return_type = opts[:return_type] || 'AssetType' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AssetApi#create_asset_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # retrieves fixed asset by id - # By passing in the appropriate asset id, you can search for a specific fixed asset in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param id [String] fixed asset id for single object - # @param [Hash] opts the optional parameters - # @return [Asset] - def get_asset_by_id(xero_tenant_id, id, opts = {}) - data, _status_code, _headers = get_asset_by_id_with_http_info(xero_tenant_id, id, opts) - data - end - - # retrieves fixed asset by id - # By passing in the appropriate asset id, you can search for a specific fixed asset in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param id [String] fixed asset id for single object - # @param [Hash] opts the optional parameters - # @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers - def get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_by_id ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_by_id" - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling AssetApi.get_asset_by_id" - end - # resource path - local_var_path = '/Assets/{id}'.sub('{' + 'id' + '}', id.to_s) - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Xero-Tenant-Id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Asset' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AssetApi#get_asset_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # searches fixed asset settings - # By passing in the appropriate options, you can search for available fixed asset types in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Setting] - def get_asset_settings(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_asset_settings_with_http_info(xero_tenant_id, opts) - data - end - - # searches fixed asset settings - # By passing in the appropriate options, you can search for available fixed asset types in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array<(Setting, Integer, Hash)>] Setting data, response status code and response headers - def get_asset_settings_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_settings ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_settings" - end - # resource path - local_var_path = '/Settings' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Xero-Tenant-Id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Setting' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AssetApi#get_asset_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # searches fixed asset types - # By passing in the appropriate options, you can search for available fixed asset types in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array] - def get_asset_types(xero_tenant_id, opts = {}) - data, _status_code, _headers = get_asset_types_with_http_info(xero_tenant_id, opts) - data - end - - # searches fixed asset types - # By passing in the appropriate options, you can search for available fixed asset types in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param [Hash] opts the optional parameters - # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers - def get_asset_types_with_http_info(xero_tenant_id, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_types ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_types" - end - # resource path - local_var_path = '/AssetTypes' - - # query parameters - query_params = opts[:query_params] || {} - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Xero-Tenant-Id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Array' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AssetApi#get_asset_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - - # searches fixed asset - # By passing in the appropriate options, you can search for available fixed asset in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes - # @param [Hash] opts the optional parameters - # @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1. - # @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10. - # @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. - # @option opts [String] :sort_direction ASC or DESC - # @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. - # @return [Assets] - def get_assets(xero_tenant_id, status, opts = {}) - data, _status_code, _headers = get_assets_with_http_info(xero_tenant_id, status, opts) - data - end - - # searches fixed asset - # By passing in the appropriate options, you can search for available fixed asset in the system - # @param xero_tenant_id [String] Xero identifier for Tenant - # @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes - # @param [Hash] opts the optional parameters - # @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1. - # @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10. - # @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. - # @option opts [String] :sort_direction ASC or DESC - # @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. - # @return [Array<(Assets, Integer, Hash)>] Assets data, response status code and response headers - def get_assets_with_http_info(xero_tenant_id, status, opts = {}) - if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: AssetApi.get_assets ...' - end - # verify the required parameter 'xero_tenant_id' is set - if @api_client.config.client_side_validation && xero_tenant_id.nil? - fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_assets" - end - # verify the required parameter 'status' is set - if @api_client.config.client_side_validation && status.nil? - fail ArgumentError, "Missing the required parameter 'status' when calling AssetApi.get_assets" - end - allowable_values = ["AssetType", "AssetName", "AssetNumber", "PurchaseDate", "PurchasePrice", "DisposalDate", "DisposalPrice"] - if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by']) - fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}" - end - allowable_values = ["asc", "desc"] - if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction']) - fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}" - end - allowable_values = ["AssetName", "AssetNumber", "Description", "AssetTypeName"] - if @api_client.config.client_side_validation && opts[:'filter_by'] && !allowable_values.include?(opts[:'filter_by']) - fail ArgumentError, "invalid value for \"filter_by\", must be one of #{allowable_values}" - end - # resource path - local_var_path = '/Assets' - - # query parameters - query_params = opts[:query_params] || {} - query_params[:'status'] = status - query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? - query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil? - query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil? - query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? - - # header parameters - header_params = opts[:header_params] || {} - # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - header_params[:'Xero-Tenant-Id'] = xero_tenant_id - - # form parameters - form_params = opts[:form_params] || {} - - # http body (model) - post_body = opts[:body] - - # return_type - return_type = opts[:return_type] || 'Assets' - - # auth_names - auth_names = opts[:auth_names] || ['OAuth2'] - - new_options = opts.merge( - :header_params => header_params, - :query_params => query_params, - :form_params => form_params, - :body => post_body, - :auth_names => auth_names, - :return_type => return_type - ) - - data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) - if @api_client.config.debugging - @api_client.config.logger.debug "API called: AssetApi#get_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" - end - return data, status_code, headers - end - end -end diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb deleted file mode 100644 index 2b4f9814..00000000 --- a/lib/xero-ruby/api_client.rb +++ /dev/null @@ -1,488 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'date' -require 'json' -require 'logger' -require 'tempfile' -require 'faraday' - -module XeroRuby - class ApiClient - # The Configuration object holding settings to be used in the API client. - attr_accessor :config - - # Defines the headers to be used in HTTP requests of all API calls by default. - # - # @return [Hash] - attr_accessor :default_headers - - # Initializes the ApiClient - # @option config [Configuration] Configuration for initializing the object, default to Configuration.default - def initialize(config: Configuration.default, credentials: {}) - @client_id = credentials[:client_id] - @client_secret = credentials[:client_secret] - @redirect_uri = credentials[:redirect_uri] - @scopes = credentials[:scopes] - @config = config - @user_agent = "xero-ruby-#{VERSION}" - @default_headers = { - 'Content-Type' => 'application/json', - 'User-Agent' => @user_agent - } - end - - def authorization_url - url = "#{@config.login_url}?response_type=code&client_id=#{@client_id}&redirect_uri=#{@redirect_uri}&scope=#{@scopes}" - return url - end - - def accounting_api - @config.base_url = @config.accounting_url - XeroRuby::AccountingApi.new(self) - end - - def asset_api - @config.base_url = @config.asset_url - XeroRuby::AssetApi.new(self) - end - - # Token Helpers - def token_set - XeroRuby.configure.token_set - end - - def access_token - XeroRuby.configure.access_token - end - - def set_token_set(token_set) - # helper to set the token_set on a client once the user has y - # has a valid token set ( access_token & refresh_token ) - XeroRuby.configure.token_set = token_set - set_access_token(token_set['access_token']) - end - - def set_access_token(access_token) - XeroRuby.configure.access_token = access_token - end - - def get_token_set_from_callback(params) - data = { - grant_type: 'authorization_code', - code: params['code'], - redirect_uri: @redirect_uri - } - return token_request(data) - end - - def refresh_token_set(token_set) - data = { - grant_type: 'refresh_token', - refresh_token: token_set['refresh_token'] - } - return token_request(data) - end - - def token_request(data) - response = Faraday.post(@config.token_url) do |req| - req.headers['Authorization'] = "Basic " + Base64.strict_encode64("#{@client_id}:#{@client_secret}") - req.headers['Content-Type'] = 'application/x-www-form-urlencoded' - req.body = URI.encode_www_form(data) - end - body = JSON.parse(response.body) - set_token_set(body) - return body - end - - # Connection heplers - def connections - response = Faraday.get('https://api.xero.com/connections') do |req| - req.headers['Authorization'] = "Bearer #{access_token}" - req.headers['Content-Type'] = 'application/json' - end - body = JSON.parse(response.body) - return body - end - - def disconnect(connection_id) - Faraday.delete("https://api.xero.com/connections/#{connection_id}") do |req| - req.headers['Authorization'] = "Bearer #{access_token}" - req.headers['Content-Type'] = 'application/json' - end - return connections - end - - # Call an API with given options. - # - # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: - # the data deserialized from response body (could be nil), response status code and response headers. - def call_api(http_method, path, opts = {}) - ssl_options = { - :ca_file => @config.ssl_ca_file, - :verify => @config.ssl_verify, - :verify_mode => @config.ssl_verify_mode, - :client_cert => @config.ssl_client_cert, - :client_key => @config.ssl_client_key - } - - connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| - conn.basic_auth(config.username, config.password) - if opts[:header_params]["Content-Type"] == "multipart/form-data" - conn.request :multipart - conn.request :url_encoded - end - conn.adapter(Faraday.default_adapter) - end - - begin - response = connection.public_send(http_method.to_sym.downcase) do |req| - build_request(http_method, path, req, opts) - end - - if @config.debugging - @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" - end - - unless response.success? - if response.status == 0 - # Errors from libcurl will be made visible here - fail ApiError.new(:code => 0, - :message => response.return_message) - else - fail ApiError.new(:code => response.status, - :response_headers => response.headers, - :response_body => response.body), - response.reason_phrase - end - end - rescue Faraday::TimeoutError - fail ApiError.new('Connection timed out') - end - - if opts[:return_type] - data = deserialize(response, opts[:return_type]) - else - data = nil - end - return data, response.status, response.headers - end - - # Builds the HTTP request - # - # @param [String] http_method HTTP method/verb (e.g. POST) - # @param [String] path URL path (e.g. /account/new) - # @option opts [Hash] :header_params Header parameters - # @option opts [Hash] :query_params Query parameters - # @option opts [Hash] :form_params Query parameters - # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request - def build_request(http_method, path, request, opts = {}) - url = build_request_url(path) - http_method = http_method.to_sym.downcase - - header_params = @default_headers.merge(opts[:header_params] || {}) - query_params = opts[:query_params] || {} - form_params = opts[:form_params] || {} - - update_params_for_auth! header_params, query_params, opts[:auth_names] - - req_opts = { - :method => http_method, - :headers => header_params, - :params => query_params, - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :verbose => @config.debugging - } - - if [:post, :patch, :put, :delete].include?(http_method) - req_body = build_request_body(header_params, form_params, opts[:body]) - req_opts.update :body => req_body - if @config.debugging - @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" - end - end - request.headers = header_params - request.body = req_body - request.url url - request.params = query_params - download_file(request) if opts[:return_type] == 'File' - request - end - - # Builds the HTTP request body - # - # @param [Hash] header_params Header parameters - # @param [Hash] form_params Query parameters - # @param [Object] body HTTP body (JSON/XML) - # @return [String] HTTP body data in the form of string - def build_request_body(header_params, form_params, body) - # http form - if header_params['Content-Type'] == 'application/x-www-form-urlencoded' - data = URI.encode_www_form(form_params) - elsif header_params['Content-Type'] == 'multipart/form-data' - data = {} - form_params.each do |key, value| - case value - when ::File, ::Tempfile - # TODO hardcode to application/octet-stream, need better way to detect content type - data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) - when ::Array, nil - # let Faraday handle Array and nil parameters - data[key] = value - else - data[key] = value.to_s - end - end - elsif body - data = body.is_a?(String) ? body : body.to_json - else - data = nil - end - data - end - - # Check if the given MIME is a JSON MIME. - # JSON MIME examples: - # application/json - # application/json; charset=UTF8 - # APPLICATION/JSON - # */* - # @param [String] mime MIME - # @return [Boolean] True if the MIME is application/json - def json_mime?(mime) - (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? - end - - # Deserialize the response to the given return type. - # - # @param [Response] response HTTP response - # @param [String] return_type some examples: "User", "Array", "Hash" - def deserialize(response, return_type) - body = response.body - - # handle file downloading - return the File instance processed in request callbacks - # note that response body is empty when the file is written in chunks in request on_body callback - return @tempfile if return_type == 'File' - - return nil if body.nil? || body.empty? - - # return response body directly for String return type - return body if return_type == 'String' - - # ensuring a default content type - content_type = response.headers['Content-Type'] || 'application/json' - - fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) - - begin - data = JSON.parse("[#{body}]", :symbolize_names => true)[0] - rescue JSON::ParserError => e - if %w(String Date DateTime).include?(return_type) - data = body - else - raise e - end - end - - convert_to_type data, return_type - end - - # Convert data to the given return type. - # @param [Object] data Data to be converted - # @param [String] return_type Return type - # @return [Mixed] Data in a particular type - def convert_to_type(data, return_type) - return nil if data.nil? - case return_type - when 'String' - data.to_s - when 'Integer' - data.to_i - when 'Float' - data.to_f - when 'Boolean' - data == true - when 'DateTime' - # parse date time (expecting ISO 8601 format) - DateTime.parse data - when 'Date' - # parse date time (expecting ISO 8601 format) - Date.parse data - when 'Object' - # generic object (usually a Hash), return directly - data - when /\AArray<(.+)>\z/ - # e.g. Array - sub_type = $1 - data.map { |item| convert_to_type(item, sub_type) } - when /\AHash\\z/ - # e.g. Hash - sub_type = $1 - {}.tap do |hash| - data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } - end - else - begin - XeroRuby::Accounting.const_get(return_type).build_from_hash(data) - rescue - XeroRuby::Assets.const_get(return_type).build_from_hash(data) - # rescue - # XeroRuby::.const_get(return_type).build_from_hash(data) - end - end - end - - # Save response body into a file in (the defined) temporary folder, using the filename - # from the "Content-Disposition" header if provided, otherwise a random filename. - # The response body is written to the file in chunks in order to handle files which - # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby - # process can use. - # - # @see Configuration#temp_folder_path - def download_file(request) - tempfile = nil - encoding = nil - request.on_headers do |response| - content_disposition = response.headers['Content-Disposition'] - if content_disposition && content_disposition =~ /filename=/i - filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] - prefix = sanitize_filename(filename) - else - prefix = 'download-' - end - prefix = prefix + '-' unless prefix.end_with?('-') - encoding = response.body.encoding - tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) - @tempfile = tempfile - end - request.on_body do |chunk| - chunk.force_encoding(encoding) - tempfile.write(chunk) - end - request.on_complete do |response| - tempfile.close if tempfile - @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ - "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ - "will be deleted automatically with GC. It's also recommended to delete the temp file "\ - "explicitly with `tempfile.delete`" - end - end - - # Sanitize filename by removing path. - # e.g. ../../sun.gif becomes sun.gif - # - # @param [String] filename the filename to be sanitized - # @return [String] the sanitized filename - def sanitize_filename(filename) - filename.gsub(/.*[\/\\]/, '') - end - - def build_request_url(path) - # Add leading and trailing slashes to path - path = "/#{path}".gsub(/\/+/, '/') - @config.base_url + path - end - - # Update hearder and query params based on authentication settings. - # - # @param [Hash] header_params Header parameters - # @param [Hash] query_params Query parameters - # @param [String] auth_names Authentication scheme name - def update_params_for_auth!(header_params, query_params, auth_names) - Array(auth_names).each do |auth_name| - auth_setting = @config.auth_settings[auth_name] - next unless auth_setting - case auth_setting[:in] - when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] - when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] - else fail ArgumentError, 'Authentication token must be in `query` of `header`' - end - end - end - - # Sets user agent in HTTP header - # - # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) - def user_agent=(user_agent) - @user_agent = user_agent - @default_headers['User-Agent'] = @user_agent - end - - # Return Accept header based on an array of accepts provided. - # @param [Array] accepts array for Accept - # @return [String] the Accept header (e.g. application/json) - def select_header_accept(accepts) - return nil if accepts.nil? || accepts.empty? - # use JSON when present, otherwise use all of the provided - json_accept = accepts.find { |s| json_mime?(s) } - json_accept || accepts.join(',') - end - - # Return Content-Type header based on an array of content types provided. - # @param [Array] content_types array for Content-Type - # @return [String] the Content-Type header (e.g. application/json) - def select_header_content_type(content_types) - # use application/json by default - return 'application/json' if content_types.nil? || content_types.empty? - # use JSON when present, otherwise use the first one - json_content_type = content_types.find { |s| json_mime?(s) } - json_content_type || content_types.first - end - - # Convert object (array, hash, object, etc) to JSON string. - # @param [Object] model object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_http_body(model) - return model if model.nil? || model.is_a?(String) - local_body = nil - if model.is_a?(Array) - local_body = model.map { |m| object_to_hash(m) } - else - local_body = object_to_hash(model) - end - local_body.to_json - end - - # Convert object(non-array) to hash. - # @param [Object] obj object to be converted into JSON string - # @return [String] JSON string representation of the object - def object_to_hash(obj) - if obj.respond_to?(:to_hash) - obj.to_hash - else - obj - end - end - - # Build parameter value according to the given collection format. - # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi - def build_collection_param(param, collection_format) - case collection_format - when :csv - param.join(',') - when :ssv - param.join(' ') - when :tsv - param.join("\t") - when :pipes - param.join('|') - when :multi - # return the array directly as typhoeus will handle it as expected - param - else - fail "unknown collection format: #{collection_format.inspect}" - end - end - end -end diff --git a/lib/xero-ruby/api_error.rb b/lib/xero-ruby/api_error.rb deleted file mode 100644 index f68d1efd..00000000 --- a/lib/xero-ruby/api_error.rb +++ /dev/null @@ -1,57 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -module XeroRuby - class ApiError < StandardError - attr_reader :code, :response_headers, :response_body - - # Usage examples: - # ApiError.new - # ApiError.new("message") - # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") - # ApiError.new(:code => 404, :message => "Not Found") - def initialize(arg = nil) - if arg.is_a? Hash - if arg.key?(:message) || arg.key?('message') - super(arg[:message] || arg['message']) - else - super arg - end - - arg.each do |k, v| - instance_variable_set "@#{k}", v - end - else - super arg - end - end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - end -end diff --git a/lib/xero-ruby/configuration.rb b/lib/xero-ruby/configuration.rb deleted file mode 100644 index e6b4967a..00000000 --- a/lib/xero-ruby/configuration.rb +++ /dev/null @@ -1,259 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -module XeroRuby - class Configuration - # Defines url scheme - attr_accessor :scheme - - # Defines url host - attr_accessor :host - - # Defines url base path & url for overwriting - attr_accessor :base_path - attr_accessor :base_url - - # Defines url for identity routes - attr_accessor :login_url - attr_accessor :token_url - - # Defines base paths for seperate API's - attr_accessor :accounting_url - attr_accessor :asset_url - - # Defines API keys used with API Key authentications. - # - # @return [Hash] key: parameter name, value: parameter value (API key) - # - # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) - # config.api_key['api_key'] = 'xxx' - attr_accessor :api_key - - # Defines API key prefixes used with API Key authentications. - # - # @return [Hash] key: parameter name, value: API key prefix - # - # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) - # config.api_key_prefix['api_key'] = 'Token' - attr_accessor :api_key_prefix - - # Defines the username used with HTTP basic authentication. - # - # @return [String] - attr_accessor :username - - # Defines the password used with HTTP basic authentication. - # - # @return [String] - attr_accessor :password - - # Defines the access token (Bearer) used with OAuth2. - attr_accessor :access_token - - # Defines the token set used with OAuth2. May include id/access/refresh token & other meta info. - attr_accessor :token_set - - # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response - # details will be logged with `logger.debug` (see the `logger` attribute). - # Default to false. - # - # @return [true, false] - attr_accessor :debugging - - # Defines the logger used for debugging. - # Default to `Rails.logger` (when in Rails) or logging to STDOUT. - # - # @return [#debug] - attr_accessor :logger - - # Defines the temporary folder to store downloaded files - # (for API endpoints that have file response). - # Default to use `Tempfile`. - # - # @return [String] - attr_accessor :temp_folder_path - - # The time limit for HTTP request in seconds. - # Default to 0 (never times out). - attr_accessor :timeout - - # Set this to false to skip client side validation in the operation. - # Default to true. - # @return [true, false] - attr_accessor :client_side_validation - - ### TLS/SSL setting - # Set this to false to skip verifying SSL certificate when calling API from https server. - # Default to true. - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - # @return [true, false] - attr_accessor :ssl_verify - - ### TLS/SSL setting - # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) - # - # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. - # - attr_accessor :ssl_verify_mode - - ### TLS/SSL setting - # Set this to customize the certificate file to verify the peer. - # - # @return [String] the path to the certificate file - attr_accessor :ssl_ca_file - - ### TLS/SSL setting - # Client certificate file (for client certificate) - attr_accessor :ssl_client_cert - - ### TLS/SSL setting - # Client private key file (for client certificate) - attr_accessor :ssl_client_key - - # Set this to customize parameters encoding of array parameter with multi collectionFormat. - # Default to nil. - # - # @see The params_encoding option of Ethon. Related source code: - # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 - attr_accessor :params_encoding - - attr_accessor :inject_format - - attr_accessor :force_ending_format - - def initialize - @scheme = 'https' - @host = 'api.xero.com' - @base_path = '/api.xro/2.0' - @login_url = 'https://login.xero.com/identity/connect/authorize' - @token_url = 'https://identity.xero.com/connect/token' - @accounting_url = 'https://api.xero.com/api.xro/2.0' - @asset_url = 'https://api.xero.com/assets.xro/1.0' - @api_key = {} - @api_key_prefix = {} - @timeout = 0 - @client_side_validation = true - @ssl_verify = true - @ssl_verify_mode = nil - @ssl_ca_file = nil - @ssl_client_cert = nil - @ssl_client_key = nil - @debugging = false - @inject_format = false - @force_ending_format = false - @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) - - yield(self) if block_given? - end - - # The default Configuration object. - def self.default - @@default ||= Configuration.new - end - - def configure - yield(self) if block_given? - end - - def scheme=(scheme) - # remove :// from scheme - @scheme = scheme.sub(/:\/\//, '') - end - - def host=(host) - # remove http(s):// and anything after a slash - @host = host.sub(/https?:\/\//, '').split('/').first - end - - def base_path=(base_path) - # Add leading and trailing slashes to base_path - @base_path = "/#{base_path}".gsub(/\/+/, '/') - @base_path = '' if @base_path == '/' - end - - def base_url=(api_url) - @base_url = api_url - end - - # Gets API key (with prefix if set). - # @param [String] param_name the parameter name of API key auth - def api_key_with_prefix(param_name) - if @api_key_prefix[param_name] - "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" - else - @api_key[param_name] - end - end - - # Gets Basic Auth token string - def basic_auth_token - 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") - end - - # Returns Auth Settings hash for api client. - def auth_settings - { - 'OAuth2' => - { - type: 'oauth2', - in: 'header', - key: 'Authorization', - value: "Bearer #{access_token}" - }, - } - end - - # Returns an array of Server setting - def server_settings - [ - { - url: "https://api.xero.com/api.xro/2.0", - description: "Xero Accounting API servers", - } - ] - end - - # Returns URL based on server settings - # - # @param index array index of the server settings - # @param variables hash of variable and the corresponding value - def server_url(index, variables = {}) - servers = server_settings - - # check array index out of bound - if (index < 0 || index >= servers.size) - fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" - end - - server = servers[index] - url = server[:url] - - # go through variable and assign a value - server[:variables].each do |name, variable| - if variables.key?(name) - if (server[:variables][name][:enum_values].include? variables[name]) - url.gsub! "{" + name.to_s + "}", variables[name] - else - fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." - end - else - # use default value - url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] - end - end - - url - end - end -end diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb deleted file mode 100644 index 01bbe4de..00000000 --- a/lib/xero-ruby/models/accounting/account.rb +++ /dev/null @@ -1,496 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Account - # Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) - attr_accessor :code - - # Name of account (max length = 150) - attr_accessor :name - - # The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - attr_accessor :account_id - - attr_accessor :type - - # For bank accounts only (Account Type BANK) - attr_accessor :bank_account_number - - # Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes - attr_accessor :status - - # Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) - attr_accessor :description - - # For bank accounts only. See Bank Account types - attr_accessor :bank_account_type - - attr_accessor :currency_code - - # The tax type from TaxRates - attr_accessor :tax_type - - # Boolean – describes whether account can have payments applied to it - attr_accessor :enable_payments_to_account - - # Boolean – describes whether account code is available for use with expense claims - attr_accessor :show_in_expense_claims - - # See Account Class Types - attr_accessor :_class - - # If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. - attr_accessor :system_account - - # Shown if set - attr_accessor :reporting_code - - # Shown if set - attr_accessor :reporting_code_name - - # boolean to indicate if an account has an attachment (read only) - attr_accessor :has_attachments - - # Last modified date UTC format - attr_accessor :updated_date_utc - - # Boolean – describes whether the account is shown in the watchlist widget on the dashboard - attr_accessor :add_to_watchlist - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'Code', - :'name' => :'Name', - :'account_id' => :'AccountID', - :'type' => :'Type', - :'bank_account_number' => :'BankAccountNumber', - :'status' => :'Status', - :'description' => :'Description', - :'bank_account_type' => :'BankAccountType', - :'currency_code' => :'CurrencyCode', - :'tax_type' => :'TaxType', - :'enable_payments_to_account' => :'EnablePaymentsToAccount', - :'show_in_expense_claims' => :'ShowInExpenseClaims', - :'_class' => :'Class', - :'system_account' => :'SystemAccount', - :'reporting_code' => :'ReportingCode', - :'reporting_code_name' => :'ReportingCodeName', - :'has_attachments' => :'HasAttachments', - :'updated_date_utc' => :'UpdatedDateUTC', - :'add_to_watchlist' => :'AddToWatchlist', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'name' => :'String', - :'account_id' => :'String', - :'type' => :'AccountType', - :'bank_account_number' => :'String', - :'status' => :'String', - :'description' => :'String', - :'bank_account_type' => :'String', - :'currency_code' => :'CurrencyCode', - :'tax_type' => :'String', - :'enable_payments_to_account' => :'Boolean', - :'show_in_expense_claims' => :'Boolean', - :'_class' => :'String', - :'system_account' => :'String', - :'reporting_code' => :'String', - :'reporting_code_name' => :'String', - :'has_attachments' => :'Boolean', - :'updated_date_utc' => :'DateTime', - :'add_to_watchlist' => :'Boolean', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Account` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'bank_account_number') - self.bank_account_number = attributes[:'bank_account_number'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'bank_account_type') - self.bank_account_type = attributes[:'bank_account_type'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - - if attributes.key?(:'enable_payments_to_account') - self.enable_payments_to_account = attributes[:'enable_payments_to_account'] - end - - if attributes.key?(:'show_in_expense_claims') - self.show_in_expense_claims = attributes[:'show_in_expense_claims'] - end - - if attributes.key?(:'_class') - self._class = attributes[:'_class'] - end - - if attributes.key?(:'system_account') - self.system_account = attributes[:'system_account'] - end - - if attributes.key?(:'reporting_code') - self.reporting_code = attributes[:'reporting_code'] - end - - if attributes.key?(:'reporting_code_name') - self.reporting_code_name = attributes[:'reporting_code_name'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'add_to_watchlist') - self.add_to_watchlist = attributes[:'add_to_watchlist'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@code.nil? && @code.to_s.length > 10 - invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 10.') - end - - if !@name.nil? && @name.to_s.length > 150 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 150.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@code.nil? && @code.to_s.length > 10 - return false if !@name.nil? && @name.to_s.length > 150 - status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) - return false unless status_validator.valid?(@status) - bank_account_type_validator = EnumAttributeValidator.new('String', ["BANK", "CREDITCARD", "PAYPAL", "NONE", ""]) - return false unless bank_account_type_validator.valid?(@bank_account_type) - _class_validator = EnumAttributeValidator.new('String', ["ASSET", "EQUITY", "EXPENSE", "LIABILITY", "REVENUE"]) - return false unless _class_validator.valid?(@_class) - system_account_validator = EnumAttributeValidator.new('String', ["DEBTORS", "CREDITORS", "BANKCURRENCYGAIN", "GST", "GSTONIMPORTS", "HISTORICAL", "REALISEDCURRENCYGAIN", "RETAINEDEARNINGS", "ROUNDING", "TRACKINGTRANSFERS", "UNPAIDEXPCLM", "UNREALISEDCURRENCYGAIN", "WAGEPAYABLES", "CISASSETS", "CISASSET", "CISLABOUR", "CISLABOUREXPENSE", "CISLABOURINCOME", "CISLIABILITY", "CISMATERIALS", ""]) - return false unless system_account_validator.valid?(@system_account) - true - end - - # Custom attribute writer method with validation - # @param [Object] code Value to be assigned - def code=(code) - if !code.nil? && code.to_s.length > 10 - fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 10.' - end - - @code = code - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if !name.nil? && name.to_s.length > 150 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 150.' - end - - @name = name - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] bank_account_type Object to be assigned - def bank_account_type=(bank_account_type) - validator = EnumAttributeValidator.new('String', ["BANK", "CREDITCARD", "PAYPAL", "NONE", ""]) - unless validator.valid?(bank_account_type) - fail ArgumentError, "invalid value for \"bank_account_type\", must be one of #{validator.allowable_values}." - end - @bank_account_type = bank_account_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] _class Object to be assigned - def _class=(_class) - validator = EnumAttributeValidator.new('String', ["ASSET", "EQUITY", "EXPENSE", "LIABILITY", "REVENUE"]) - unless validator.valid?(_class) - fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}." - end - @_class = _class - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] system_account Object to be assigned - def system_account=(system_account) - validator = EnumAttributeValidator.new('String', ["DEBTORS", "CREDITORS", "BANKCURRENCYGAIN", "GST", "GSTONIMPORTS", "HISTORICAL", "REALISEDCURRENCYGAIN", "RETAINEDEARNINGS", "ROUNDING", "TRACKINGTRANSFERS", "UNPAIDEXPCLM", "UNREALISEDCURRENCYGAIN", "WAGEPAYABLES", "CISASSETS", "CISASSET", "CISLABOUR", "CISLABOUREXPENSE", "CISLABOURINCOME", "CISLIABILITY", "CISMATERIALS", ""]) - unless validator.valid?(system_account) - fail ArgumentError, "invalid value for \"system_account\", must be one of #{validator.allowable_values}." - end - @system_account = system_account - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - name == o.name && - account_id == o.account_id && - type == o.type && - bank_account_number == o.bank_account_number && - status == o.status && - description == o.description && - bank_account_type == o.bank_account_type && - currency_code == o.currency_code && - tax_type == o.tax_type && - enable_payments_to_account == o.enable_payments_to_account && - show_in_expense_claims == o.show_in_expense_claims && - _class == o._class && - system_account == o.system_account && - reporting_code == o.reporting_code && - reporting_code_name == o.reporting_code_name && - has_attachments == o.has_attachments && - updated_date_utc == o.updated_date_utc && - add_to_watchlist == o.add_to_watchlist && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, name, account_id, type, bank_account_number, status, description, bank_account_type, currency_code, tax_type, enable_payments_to_account, show_in_expense_claims, _class, system_account, reporting_code, reporting_code_name, has_attachments, updated_date_utc, add_to_watchlist, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/account_type.rb b/lib/xero-ruby/models/accounting/account_type.rb deleted file mode 100644 index 0cdac88e..00000000 --- a/lib/xero-ruby/models/accounting/account_type.rb +++ /dev/null @@ -1,57 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class AccountType - BANK = "BANK".freeze - CURRENT = "CURRENT".freeze - CURRLIAB = "CURRLIAB".freeze - DEPRECIATN = "DEPRECIATN".freeze - DIRECTCOSTS = "DIRECTCOSTS".freeze - EQUITY = "EQUITY".freeze - EXPENSE = "EXPENSE".freeze - FIXED = "FIXED".freeze - INVENTORY = "INVENTORY".freeze - LIABILITY = "LIABILITY".freeze - NONCURRENT = "NONCURRENT".freeze - OTHERINCOME = "OTHERINCOME".freeze - OVERHEADS = "OVERHEADS".freeze - PREPAYMENT = "PREPAYMENT".freeze - REVENUE = "REVENUE".freeze - SALES = "SALES".freeze - TERMLIAB = "TERMLIAB".freeze - PAYGLIABILITY = "PAYGLIABILITY".freeze - PAYG = "PAYG".freeze - SUPERANNUATIONEXPENSE = "SUPERANNUATIONEXPENSE".freeze - SUPERANNUATIONLIABILITY = "SUPERANNUATIONLIABILITY".freeze - WAGESEXPENSE = "WAGESEXPENSE".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = AccountType.constants.select { |c| AccountType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #AccountType" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/accounts.rb b/lib/xero-ruby/models/accounting/accounts.rb deleted file mode 100644 index 3387a3ec..00000000 --- a/lib/xero-ruby/models/accounting/accounts.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Accounts - attr_accessor :accounts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts' => :'Accounts' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Accounts` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Accounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts') - if (value = attributes[:'accounts']).is_a?(Array) - self.accounts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts == o.accounts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/accounts_payable.rb b/lib/xero-ruby/models/accounting/accounts_payable.rb deleted file mode 100644 index 6c1041a4..00000000 --- a/lib/xero-ruby/models/accounting/accounts_payable.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class AccountsPayable - attr_accessor :outstanding - - attr_accessor :overdue - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'outstanding' => :'Outstanding', - :'overdue' => :'Overdue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'outstanding' => :'Float', - :'overdue' => :'Float' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::AccountsPayable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::AccountsPayable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'outstanding') - self.outstanding = attributes[:'outstanding'] - end - - if attributes.key?(:'overdue') - self.overdue = attributes[:'overdue'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - outstanding == o.outstanding && - overdue == o.overdue - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [outstanding, overdue].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/accounts_receivable.rb b/lib/xero-ruby/models/accounting/accounts_receivable.rb deleted file mode 100644 index ac763b69..00000000 --- a/lib/xero-ruby/models/accounting/accounts_receivable.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class AccountsReceivable - attr_accessor :outstanding - - attr_accessor :overdue - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'outstanding' => :'Outstanding', - :'overdue' => :'Overdue' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'outstanding' => :'Float', - :'overdue' => :'Float' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::AccountsReceivable` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::AccountsReceivable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'outstanding') - self.outstanding = attributes[:'outstanding'] - end - - if attributes.key?(:'overdue') - self.overdue = attributes[:'overdue'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - outstanding == o.outstanding && - overdue == o.overdue - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [outstanding, overdue].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/address.rb b/lib/xero-ruby/models/accounting/address.rb deleted file mode 100644 index a4642807..00000000 --- a/lib/xero-ruby/models/accounting/address.rb +++ /dev/null @@ -1,463 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Address - # define the type of address - attr_accessor :address_type - - # max length = 500 - attr_accessor :address_line1 - - # max length = 500 - attr_accessor :address_line2 - - # max length = 500 - attr_accessor :address_line3 - - # max length = 500 - attr_accessor :address_line4 - - # max length = 255 - attr_accessor :city - - # max length = 255 - attr_accessor :region - - # max length = 50 - attr_accessor :postal_code - - # max length = 50, [A-Z], [a-z] only - attr_accessor :country - - # max length = 255 - attr_accessor :attention_to - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'address_type' => :'AddressType', - :'address_line1' => :'AddressLine1', - :'address_line2' => :'AddressLine2', - :'address_line3' => :'AddressLine3', - :'address_line4' => :'AddressLine4', - :'city' => :'City', - :'region' => :'Region', - :'postal_code' => :'PostalCode', - :'country' => :'Country', - :'attention_to' => :'AttentionTo' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'address_type' => :'String', - :'address_line1' => :'String', - :'address_line2' => :'String', - :'address_line3' => :'String', - :'address_line4' => :'String', - :'city' => :'String', - :'region' => :'String', - :'postal_code' => :'String', - :'country' => :'String', - :'attention_to' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Address` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'address_type') - self.address_type = attributes[:'address_type'] - end - - if attributes.key?(:'address_line1') - self.address_line1 = attributes[:'address_line1'] - end - - if attributes.key?(:'address_line2') - self.address_line2 = attributes[:'address_line2'] - end - - if attributes.key?(:'address_line3') - self.address_line3 = attributes[:'address_line3'] - end - - if attributes.key?(:'address_line4') - self.address_line4 = attributes[:'address_line4'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'region') - self.region = attributes[:'region'] - end - - if attributes.key?(:'postal_code') - self.postal_code = attributes[:'postal_code'] - end - - if attributes.key?(:'country') - self.country = attributes[:'country'] - end - - if attributes.key?(:'attention_to') - self.attention_to = attributes[:'attention_to'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@address_line1.nil? && @address_line1.to_s.length > 500 - invalid_properties.push('invalid value for "address_line1", the character length must be smaller than or equal to 500.') - end - - if !@address_line2.nil? && @address_line2.to_s.length > 500 - invalid_properties.push('invalid value for "address_line2", the character length must be smaller than or equal to 500.') - end - - if !@address_line3.nil? && @address_line3.to_s.length > 500 - invalid_properties.push('invalid value for "address_line3", the character length must be smaller than or equal to 500.') - end - - if !@address_line4.nil? && @address_line4.to_s.length > 500 - invalid_properties.push('invalid value for "address_line4", the character length must be smaller than or equal to 500.') - end - - if !@city.nil? && @city.to_s.length > 255 - invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 255.') - end - - if !@region.nil? && @region.to_s.length > 255 - invalid_properties.push('invalid value for "region", the character length must be smaller than or equal to 255.') - end - - if !@postal_code.nil? && @postal_code.to_s.length > 50 - invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 50.') - end - - if !@country.nil? && @country.to_s.length > 50 - invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 50.') - end - - if !@attention_to.nil? && @attention_to.to_s.length > 255 - invalid_properties.push('invalid value for "attention_to", the character length must be smaller than or equal to 255.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - address_type_validator = EnumAttributeValidator.new('String', ["POBOX", "STREET", "DELIVERY"]) - return false unless address_type_validator.valid?(@address_type) - return false if !@address_line1.nil? && @address_line1.to_s.length > 500 - return false if !@address_line2.nil? && @address_line2.to_s.length > 500 - return false if !@address_line3.nil? && @address_line3.to_s.length > 500 - return false if !@address_line4.nil? && @address_line4.to_s.length > 500 - return false if !@city.nil? && @city.to_s.length > 255 - return false if !@region.nil? && @region.to_s.length > 255 - return false if !@postal_code.nil? && @postal_code.to_s.length > 50 - return false if !@country.nil? && @country.to_s.length > 50 - return false if !@attention_to.nil? && @attention_to.to_s.length > 255 - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] address_type Object to be assigned - def address_type=(address_type) - validator = EnumAttributeValidator.new('String', ["POBOX", "STREET", "DELIVERY"]) - unless validator.valid?(address_type) - fail ArgumentError, "invalid value for \"address_type\", must be one of #{validator.allowable_values}." - end - @address_type = address_type - end - - # Custom attribute writer method with validation - # @param [Object] address_line1 Value to be assigned - def address_line1=(address_line1) - if !address_line1.nil? && address_line1.to_s.length > 500 - fail ArgumentError, 'invalid value for "address_line1", the character length must be smaller than or equal to 500.' - end - - @address_line1 = address_line1 - end - - # Custom attribute writer method with validation - # @param [Object] address_line2 Value to be assigned - def address_line2=(address_line2) - if !address_line2.nil? && address_line2.to_s.length > 500 - fail ArgumentError, 'invalid value for "address_line2", the character length must be smaller than or equal to 500.' - end - - @address_line2 = address_line2 - end - - # Custom attribute writer method with validation - # @param [Object] address_line3 Value to be assigned - def address_line3=(address_line3) - if !address_line3.nil? && address_line3.to_s.length > 500 - fail ArgumentError, 'invalid value for "address_line3", the character length must be smaller than or equal to 500.' - end - - @address_line3 = address_line3 - end - - # Custom attribute writer method with validation - # @param [Object] address_line4 Value to be assigned - def address_line4=(address_line4) - if !address_line4.nil? && address_line4.to_s.length > 500 - fail ArgumentError, 'invalid value for "address_line4", the character length must be smaller than or equal to 500.' - end - - @address_line4 = address_line4 - end - - # Custom attribute writer method with validation - # @param [Object] city Value to be assigned - def city=(city) - if !city.nil? && city.to_s.length > 255 - fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 255.' - end - - @city = city - end - - # Custom attribute writer method with validation - # @param [Object] region Value to be assigned - def region=(region) - if !region.nil? && region.to_s.length > 255 - fail ArgumentError, 'invalid value for "region", the character length must be smaller than or equal to 255.' - end - - @region = region - end - - # Custom attribute writer method with validation - # @param [Object] postal_code Value to be assigned - def postal_code=(postal_code) - if !postal_code.nil? && postal_code.to_s.length > 50 - fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 50.' - end - - @postal_code = postal_code - end - - # Custom attribute writer method with validation - # @param [Object] country Value to be assigned - def country=(country) - if !country.nil? && country.to_s.length > 50 - fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 50.' - end - - @country = country - end - - # Custom attribute writer method with validation - # @param [Object] attention_to Value to be assigned - def attention_to=(attention_to) - if !attention_to.nil? && attention_to.to_s.length > 255 - fail ArgumentError, 'invalid value for "attention_to", the character length must be smaller than or equal to 255.' - end - - @attention_to = attention_to - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - address_type == o.address_type && - address_line1 == o.address_line1 && - address_line2 == o.address_line2 && - address_line3 == o.address_line3 && - address_line4 == o.address_line4 && - city == o.city && - region == o.region && - postal_code == o.postal_code && - country == o.country && - attention_to == o.attention_to - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [address_type, address_line1, address_line2, address_line3, address_line4, city, region, postal_code, country, attention_to].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/allocation.rb b/lib/xero-ruby/models/accounting/allocation.rb deleted file mode 100644 index 4a74ad18..00000000 --- a/lib/xero-ruby/models/accounting/allocation.rb +++ /dev/null @@ -1,238 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Allocation - attr_accessor :invoice - - # the amount being applied to the invoice - attr_accessor :amount - - # the date the allocation is applied YYYY-MM-DD. - attr_accessor :date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoice' => :'Invoice', - :'amount' => :'Amount', - :'date' => :'Date' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoice' => :'Invoice', - :'amount' => :'Float', - :'date' => :'Date' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Allocation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Allocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoice') - self.invoice = attributes[:'invoice'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @invoice.nil? - invalid_properties.push('invalid value for "invoice", invoice cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - if @date.nil? - invalid_properties.push('invalid value for "date", date cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @invoice.nil? - return false if @amount.nil? - return false if @date.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoice == o.invoice && - amount == o.amount && - date == o.date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoice, amount, date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/allocations.rb b/lib/xero-ruby/models/accounting/allocations.rb deleted file mode 100644 index 97405577..00000000 --- a/lib/xero-ruby/models/accounting/allocations.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Allocations - attr_accessor :allocations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'allocations' => :'Allocations' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'allocations' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Allocations` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Allocations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'allocations') - if (value = attributes[:'allocations']).is_a?(Array) - self.allocations = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - allocations == o.allocations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [allocations].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/attachment.rb b/lib/xero-ruby/models/accounting/attachment.rb deleted file mode 100644 index 90858b61..00000000 --- a/lib/xero-ruby/models/accounting/attachment.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Attachment - # Unique ID for the file - attr_accessor :attachment_id - - # Name of the file - attr_accessor :file_name - - # URL to the file on xero.com - attr_accessor :url - - # Type of file - attr_accessor :mime_type - - # Length of the file content - attr_accessor :content_length - - # Include the file with the online invoice - attr_accessor :include_online - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attachment_id' => :'AttachmentID', - :'file_name' => :'FileName', - :'url' => :'Url', - :'mime_type' => :'MimeType', - :'content_length' => :'ContentLength', - :'include_online' => :'IncludeOnline' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attachment_id' => :'String', - :'file_name' => :'String', - :'url' => :'String', - :'mime_type' => :'String', - :'content_length' => :'Float', - :'include_online' => :'Boolean' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Attachment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Attachment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attachment_id') - self.attachment_id = attributes[:'attachment_id'] - end - - if attributes.key?(:'file_name') - self.file_name = attributes[:'file_name'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'mime_type') - self.mime_type = attributes[:'mime_type'] - end - - if attributes.key?(:'content_length') - self.content_length = attributes[:'content_length'] - end - - if attributes.key?(:'include_online') - self.include_online = attributes[:'include_online'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attachment_id == o.attachment_id && - file_name == o.file_name && - url == o.url && - mime_type == o.mime_type && - content_length == o.content_length && - include_online == o.include_online - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attachment_id, file_name, url, mime_type, content_length, include_online].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/attachments.rb b/lib/xero-ruby/models/accounting/attachments.rb deleted file mode 100644 index dcb1096e..00000000 --- a/lib/xero-ruby/models/accounting/attachments.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Attachments - attr_accessor :attachments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'attachments' => :'Attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'attachments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Attachments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Attachments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/balances.rb b/lib/xero-ruby/models/accounting/balances.rb deleted file mode 100644 index 54ebf302..00000000 --- a/lib/xero-ruby/models/accounting/balances.rb +++ /dev/null @@ -1,213 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - # The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) - class Balances - attr_accessor :accounts_receivable - - attr_accessor :accounts_payable - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'accounts_receivable' => :'AccountsReceivable', - :'accounts_payable' => :'AccountsPayable' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'accounts_receivable' => :'AccountsReceivable', - :'accounts_payable' => :'AccountsPayable' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Balances` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Balances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'accounts_receivable') - self.accounts_receivable = attributes[:'accounts_receivable'] - end - - if attributes.key?(:'accounts_payable') - self.accounts_payable = attributes[:'accounts_payable'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - accounts_receivable == o.accounts_receivable && - accounts_payable == o.accounts_payable - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [accounts_receivable, accounts_payable].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/bank_transaction.rb b/lib/xero-ruby/models/accounting/bank_transaction.rb deleted file mode 100644 index f3359d2d..00000000 --- a/lib/xero-ruby/models/accounting/bank_transaction.rb +++ /dev/null @@ -1,482 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BankTransaction - # See Bank Transaction Types - attr_accessor :type - - attr_accessor :contact - - # See LineItems - attr_accessor :line_items - - attr_accessor :bank_account - - # Boolean to show if transaction is reconciled - attr_accessor :is_reconciled - - # Date of transaction – YYYY-MM-DD - attr_accessor :date - - # Reference for the transaction. Only supported for SPEND and RECEIVE transactions. - attr_accessor :reference - - attr_accessor :currency_code - - # Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. - attr_accessor :currency_rate - - # URL link to a source document – shown as “Go to App Name” - attr_accessor :url - - # See Bank Transaction Status Codes - attr_accessor :status - - attr_accessor :line_amount_types - - # Total of bank transaction excluding taxes - attr_accessor :sub_total - - # Total tax on bank transaction - attr_accessor :total_tax - - # Total of bank transaction tax inclusive - attr_accessor :total - - # Xero generated unique identifier for bank transaction - attr_accessor :bank_transaction_id - - # Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT - attr_accessor :prepayment_id - - # Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT - attr_accessor :overpayment_id - - # Last modified date UTC format - attr_accessor :updated_date_utc - - # Boolean to indicate if a bank transaction has an attachment - attr_accessor :has_attachments - - # A string to indicate if a invoice status - attr_accessor :status_attribute_string - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'Type', - :'contact' => :'Contact', - :'line_items' => :'LineItems', - :'bank_account' => :'BankAccount', - :'is_reconciled' => :'IsReconciled', - :'date' => :'Date', - :'reference' => :'Reference', - :'currency_code' => :'CurrencyCode', - :'currency_rate' => :'CurrencyRate', - :'url' => :'Url', - :'status' => :'Status', - :'line_amount_types' => :'LineAmountTypes', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'bank_transaction_id' => :'BankTransactionID', - :'prepayment_id' => :'PrepaymentID', - :'overpayment_id' => :'OverpaymentID', - :'updated_date_utc' => :'UpdatedDateUTC', - :'has_attachments' => :'HasAttachments', - :'status_attribute_string' => :'StatusAttributeString', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'contact' => :'Contact', - :'line_items' => :'Array', - :'bank_account' => :'Account', - :'is_reconciled' => :'Boolean', - :'date' => :'Date', - :'reference' => :'String', - :'currency_code' => :'CurrencyCode', - :'currency_rate' => :'Float', - :'url' => :'String', - :'status' => :'String', - :'line_amount_types' => :'LineAmountTypes', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'bank_transaction_id' => :'String', - :'prepayment_id' => :'String', - :'overpayment_id' => :'String', - :'updated_date_utc' => :'DateTime', - :'has_attachments' => :'Boolean', - :'status_attribute_string' => :'String', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'bank_account') - self.bank_account = attributes[:'bank_account'] - end - - if attributes.key?(:'is_reconciled') - self.is_reconciled = attributes[:'is_reconciled'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'bank_transaction_id') - self.bank_transaction_id = attributes[:'bank_transaction_id'] - end - - if attributes.key?(:'prepayment_id') - self.prepayment_id = attributes[:'prepayment_id'] - end - - if attributes.key?(:'overpayment_id') - self.overpayment_id = attributes[:'overpayment_id'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @type.nil? - invalid_properties.push('invalid value for "type", type cannot be nil.') - end - - if @contact.nil? - invalid_properties.push('invalid value for "contact", contact cannot be nil.') - end - - if @line_items.nil? - invalid_properties.push('invalid value for "line_items", line_items cannot be nil.') - end - - if @bank_account.nil? - invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @type.nil? - type_validator = EnumAttributeValidator.new('String', ["RECEIVE", "RECEIVE-OVERPAYMENT", "RECEIVE-PREPAYMENT", "SPEND", "SPEND-OVERPAYMENT", "SPEND-PREPAYMENT", "RECEIVE-TRANSFER", "SPEND-TRANSFER"]) - return false unless type_validator.valid?(@type) - return false if @contact.nil? - return false if @line_items.nil? - return false if @bank_account.nil? - status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED", "VOIDED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["RECEIVE", "RECEIVE-OVERPAYMENT", "RECEIVE-PREPAYMENT", "SPEND", "SPEND-OVERPAYMENT", "SPEND-PREPAYMENT", "RECEIVE-TRANSFER", "SPEND-TRANSFER"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED", "VOIDED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - contact == o.contact && - line_items == o.line_items && - bank_account == o.bank_account && - is_reconciled == o.is_reconciled && - date == o.date && - reference == o.reference && - currency_code == o.currency_code && - currency_rate == o.currency_rate && - url == o.url && - status == o.status && - line_amount_types == o.line_amount_types && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - bank_transaction_id == o.bank_transaction_id && - prepayment_id == o.prepayment_id && - overpayment_id == o.overpayment_id && - updated_date_utc == o.updated_date_utc && - has_attachments == o.has_attachments && - status_attribute_string == o.status_attribute_string && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, contact, line_items, bank_account, is_reconciled, date, reference, currency_code, currency_rate, url, status, line_amount_types, sub_total, total_tax, total, bank_transaction_id, prepayment_id, overpayment_id, updated_date_utc, has_attachments, status_attribute_string, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/bank_transactions.rb b/lib/xero-ruby/models/accounting/bank_transactions.rb deleted file mode 100644 index d3659718..00000000 --- a/lib/xero-ruby/models/accounting/bank_transactions.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BankTransactions - attr_accessor :bank_transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transactions' => :'BankTransactions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transactions' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transactions') - if (value = attributes[:'bank_transactions']).is_a?(Array) - self.bank_transactions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transactions == o.bank_transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/bank_transfer.rb b/lib/xero-ruby/models/accounting/bank_transfer.rb deleted file mode 100644 index 974e2ad0..00000000 --- a/lib/xero-ruby/models/accounting/bank_transfer.rb +++ /dev/null @@ -1,321 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BankTransfer - attr_accessor :from_bank_account - - attr_accessor :to_bank_account - - # amount of the transaction - attr_accessor :amount - - # The date of the Transfer YYYY-MM-DD - attr_accessor :date - - # The identifier of the Bank Transfer - attr_accessor :bank_transfer_id - - # The currency rate - attr_accessor :currency_rate - - # The Bank Transaction ID for the source account - attr_accessor :from_bank_transaction_id - - # The Bank Transaction ID for the destination account - attr_accessor :to_bank_transaction_id - - # Boolean to indicate if a Bank Transfer has an attachment - attr_accessor :has_attachments - - # UTC timestamp of creation date of bank transfer - attr_accessor :created_date_utc - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'from_bank_account' => :'FromBankAccount', - :'to_bank_account' => :'ToBankAccount', - :'amount' => :'Amount', - :'date' => :'Date', - :'bank_transfer_id' => :'BankTransferID', - :'currency_rate' => :'CurrencyRate', - :'from_bank_transaction_id' => :'FromBankTransactionID', - :'to_bank_transaction_id' => :'ToBankTransactionID', - :'has_attachments' => :'HasAttachments', - :'created_date_utc' => :'CreatedDateUTC', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'from_bank_account' => :'Account', - :'to_bank_account' => :'Account', - :'amount' => :'String', - :'date' => :'Date', - :'bank_transfer_id' => :'String', - :'currency_rate' => :'Float', - :'from_bank_transaction_id' => :'String', - :'to_bank_transaction_id' => :'String', - :'has_attachments' => :'Boolean', - :'created_date_utc' => :'DateTime', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransfer` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransfer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'from_bank_account') - self.from_bank_account = attributes[:'from_bank_account'] - end - - if attributes.key?(:'to_bank_account') - self.to_bank_account = attributes[:'to_bank_account'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'bank_transfer_id') - self.bank_transfer_id = attributes[:'bank_transfer_id'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'from_bank_transaction_id') - self.from_bank_transaction_id = attributes[:'from_bank_transaction_id'] - end - - if attributes.key?(:'to_bank_transaction_id') - self.to_bank_transaction_id = attributes[:'to_bank_transaction_id'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'created_date_utc') - self.created_date_utc = attributes[:'created_date_utc'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @from_bank_account.nil? - invalid_properties.push('invalid value for "from_bank_account", from_bank_account cannot be nil.') - end - - if @to_bank_account.nil? - invalid_properties.push('invalid value for "to_bank_account", to_bank_account cannot be nil.') - end - - if @amount.nil? - invalid_properties.push('invalid value for "amount", amount cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @from_bank_account.nil? - return false if @to_bank_account.nil? - return false if @amount.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - from_bank_account == o.from_bank_account && - to_bank_account == o.to_bank_account && - amount == o.amount && - date == o.date && - bank_transfer_id == o.bank_transfer_id && - currency_rate == o.currency_rate && - from_bank_transaction_id == o.from_bank_transaction_id && - to_bank_transaction_id == o.to_bank_transaction_id && - has_attachments == o.has_attachments && - created_date_utc == o.created_date_utc && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [from_bank_account, to_bank_account, amount, date, bank_transfer_id, currency_rate, from_bank_transaction_id, to_bank_transaction_id, has_attachments, created_date_utc, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/bank_transfers.rb b/lib/xero-ruby/models/accounting/bank_transfers.rb deleted file mode 100644 index 03dce00c..00000000 --- a/lib/xero-ruby/models/accounting/bank_transfers.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BankTransfers - attr_accessor :bank_transfers - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_transfers' => :'BankTransfers' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_transfers' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransfers` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransfers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_transfers') - if (value = attributes[:'bank_transfers']).is_a?(Array) - self.bank_transfers = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_transfers == o.bank_transfers - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_transfers].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/batch_payment.rb b/lib/xero-ruby/models/accounting/batch_payment.rb deleted file mode 100644 index cb49e2e3..00000000 --- a/lib/xero-ruby/models/accounting/batch_payment.rb +++ /dev/null @@ -1,475 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BatchPayment - attr_accessor :account - - # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - attr_accessor :reference - - # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - attr_accessor :particulars - - # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - attr_accessor :code - - # (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - attr_accessor :details - - # (UK Only) Only shows on the statement line in Xero. Max length =18 - attr_accessor :narrative - - # The Xero generated unique identifier for the bank transaction (read-only) - attr_accessor :batch_payment_id - - # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - attr_accessor :date_string - - # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - attr_accessor :date - - # The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - attr_accessor :amount - - attr_accessor :payments - - # PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) - attr_accessor :type - - # AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. - attr_accessor :status - - # The total of the payments that make up the batch (read-only) - attr_accessor :total_amount - - # UTC timestamp of last update to the payment - attr_accessor :updated_date_utc - - # Booelan that tells you if the batch payment has been reconciled (read-only) - attr_accessor :is_reconciled - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'account' => :'Account', - :'reference' => :'Reference', - :'particulars' => :'Particulars', - :'code' => :'Code', - :'details' => :'Details', - :'narrative' => :'Narrative', - :'batch_payment_id' => :'BatchPaymentID', - :'date_string' => :'DateString', - :'date' => :'Date', - :'amount' => :'Amount', - :'payments' => :'Payments', - :'type' => :'Type', - :'status' => :'Status', - :'total_amount' => :'TotalAmount', - :'updated_date_utc' => :'UpdatedDateUTC', - :'is_reconciled' => :'IsReconciled' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'account' => :'Account', - :'reference' => :'String', - :'particulars' => :'String', - :'code' => :'String', - :'details' => :'String', - :'narrative' => :'String', - :'batch_payment_id' => :'String', - :'date_string' => :'String', - :'date' => :'Date', - :'amount' => :'Float', - :'payments' => :'Array', - :'type' => :'String', - :'status' => :'String', - :'total_amount' => :'String', - :'updated_date_utc' => :'DateTime', - :'is_reconciled' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BatchPayment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BatchPayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'particulars') - self.particulars = attributes[:'particulars'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'narrative') - self.narrative = attributes[:'narrative'] - end - - if attributes.key?(:'batch_payment_id') - self.batch_payment_id = attributes[:'batch_payment_id'] - end - - if attributes.key?(:'date_string') - self.date_string = attributes[:'date_string'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'payments') - if (value = attributes[:'payments']).is_a?(Array) - self.payments = value - end - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'total_amount') - self.total_amount = attributes[:'total_amount'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'is_reconciled') - self.is_reconciled = attributes[:'is_reconciled'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@reference.nil? && @reference.to_s.length > 12 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 12.') - end - - if !@particulars.nil? && @particulars.to_s.length > 12 - invalid_properties.push('invalid value for "particulars", the character length must be smaller than or equal to 12.') - end - - if !@code.nil? && @code.to_s.length > 12 - invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 12.') - end - - if !@details.nil? && @details.to_s.length > 18 - invalid_properties.push('invalid value for "details", the character length must be smaller than or equal to 18.') - end - - if !@narrative.nil? && @narrative.to_s.length > 18 - invalid_properties.push('invalid value for "narrative", the character length must be smaller than or equal to 18.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@reference.nil? && @reference.to_s.length > 12 - return false if !@particulars.nil? && @particulars.to_s.length > 12 - return false if !@code.nil? && @code.to_s.length > 12 - return false if !@details.nil? && @details.to_s.length > 18 - return false if !@narrative.nil? && @narrative.to_s.length > 18 - type_validator = EnumAttributeValidator.new('String', ["PAYBATCH", "RECBATCH"]) - return false unless type_validator.valid?(@type) - status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if !reference.nil? && reference.to_s.length > 12 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 12.' - end - - @reference = reference - end - - # Custom attribute writer method with validation - # @param [Object] particulars Value to be assigned - def particulars=(particulars) - if !particulars.nil? && particulars.to_s.length > 12 - fail ArgumentError, 'invalid value for "particulars", the character length must be smaller than or equal to 12.' - end - - @particulars = particulars - end - - # Custom attribute writer method with validation - # @param [Object] code Value to be assigned - def code=(code) - if !code.nil? && code.to_s.length > 12 - fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 12.' - end - - @code = code - end - - # Custom attribute writer method with validation - # @param [Object] details Value to be assigned - def details=(details) - if !details.nil? && details.to_s.length > 18 - fail ArgumentError, 'invalid value for "details", the character length must be smaller than or equal to 18.' - end - - @details = details - end - - # Custom attribute writer method with validation - # @param [Object] narrative Value to be assigned - def narrative=(narrative) - if !narrative.nil? && narrative.to_s.length > 18 - fail ArgumentError, 'invalid value for "narrative", the character length must be smaller than or equal to 18.' - end - - @narrative = narrative - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["PAYBATCH", "RECBATCH"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - account == o.account && - reference == o.reference && - particulars == o.particulars && - code == o.code && - details == o.details && - narrative == o.narrative && - batch_payment_id == o.batch_payment_id && - date_string == o.date_string && - date == o.date && - amount == o.amount && - payments == o.payments && - type == o.type && - status == o.status && - total_amount == o.total_amount && - updated_date_utc == o.updated_date_utc && - is_reconciled == o.is_reconciled - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [account, reference, particulars, code, details, narrative, batch_payment_id, date_string, date, amount, payments, type, status, total_amount, updated_date_utc, is_reconciled].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/batch_payment_details.rb b/lib/xero-ruby/models/accounting/batch_payment_details.rb deleted file mode 100644 index 4798f946..00000000 --- a/lib/xero-ruby/models/accounting/batch_payment_details.rb +++ /dev/null @@ -1,290 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - # Bank details for use on a batch payment stored with each contact - class BatchPaymentDetails - # Bank account number for use with Batch Payments - attr_accessor :bank_account_number - - # Name of bank for use with Batch Payments - attr_accessor :bank_account_name - - # (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 - attr_accessor :details - - # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - attr_accessor :code - - # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. - attr_accessor :reference - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bank_account_number' => :'BankAccountNumber', - :'bank_account_name' => :'BankAccountName', - :'details' => :'Details', - :'code' => :'Code', - :'reference' => :'Reference' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bank_account_number' => :'String', - :'bank_account_name' => :'String', - :'details' => :'String', - :'code' => :'String', - :'reference' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BatchPaymentDetails` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BatchPaymentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bank_account_number') - self.bank_account_number = attributes[:'bank_account_number'] - end - - if attributes.key?(:'bank_account_name') - self.bank_account_name = attributes[:'bank_account_name'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@details.nil? && @details.to_s.length > 18 - invalid_properties.push('invalid value for "details", the character length must be smaller than or equal to 18.') - end - - if !@code.nil? && @code.to_s.length > 12 - invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 12.') - end - - if !@reference.nil? && @reference.to_s.length > 12 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 12.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@details.nil? && @details.to_s.length > 18 - return false if !@code.nil? && @code.to_s.length > 12 - return false if !@reference.nil? && @reference.to_s.length > 12 - true - end - - # Custom attribute writer method with validation - # @param [Object] details Value to be assigned - def details=(details) - if !details.nil? && details.to_s.length > 18 - fail ArgumentError, 'invalid value for "details", the character length must be smaller than or equal to 18.' - end - - @details = details - end - - # Custom attribute writer method with validation - # @param [Object] code Value to be assigned - def code=(code) - if !code.nil? && code.to_s.length > 12 - fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 12.' - end - - @code = code - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if !reference.nil? && reference.to_s.length > 12 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 12.' - end - - @reference = reference - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bank_account_number == o.bank_account_number && - bank_account_name == o.bank_account_name && - details == o.details && - code == o.code && - reference == o.reference - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bank_account_number, bank_account_name, details, code, reference].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/batch_payments.rb b/lib/xero-ruby/models/accounting/batch_payments.rb deleted file mode 100644 index 54144a2a..00000000 --- a/lib/xero-ruby/models/accounting/batch_payments.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BatchPayments - attr_accessor :batch_payments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'batch_payments' => :'BatchPayments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'batch_payments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BatchPayments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BatchPayments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'batch_payments') - if (value = attributes[:'batch_payments']).is_a?(Array) - self.batch_payments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - batch_payments == o.batch_payments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [batch_payments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/bill.rb b/lib/xero-ruby/models/accounting/bill.rb deleted file mode 100644 index 497dfc90..00000000 --- a/lib/xero-ruby/models/accounting/bill.rb +++ /dev/null @@ -1,213 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Bill - # Day of Month (0-31) - attr_accessor :day - - attr_accessor :type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'day' => :'Day', - :'type' => :'Type' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'day' => :'Integer', - :'type' => :'PaymentTermType' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Bill` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Bill`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'day') - self.day = attributes[:'day'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - day == o.day && - type == o.type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [day, type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/branding_theme.rb b/lib/xero-ruby/models/accounting/branding_theme.rb deleted file mode 100644 index c5afb4c7..00000000 --- a/lib/xero-ruby/models/accounting/branding_theme.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BrandingTheme - # Xero identifier - attr_accessor :branding_theme_id - - # Name of branding theme - attr_accessor :name - - # The location of the image file used as the logo on this branding theme - attr_accessor :logo_url - - # Always INVOICE - attr_accessor :type - - # Integer – ranked order of branding theme. The default branding theme has a value of 0 - attr_accessor :sort_order - - # UTC timestamp of creation date of branding theme - attr_accessor :created_date_utc - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'branding_theme_id' => :'BrandingThemeID', - :'name' => :'Name', - :'logo_url' => :'LogoUrl', - :'type' => :'Type', - :'sort_order' => :'SortOrder', - :'created_date_utc' => :'CreatedDateUTC' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'branding_theme_id' => :'String', - :'name' => :'String', - :'logo_url' => :'String', - :'type' => :'String', - :'sort_order' => :'Integer', - :'created_date_utc' => :'DateTime' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BrandingTheme` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BrandingTheme`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'branding_theme_id') - self.branding_theme_id = attributes[:'branding_theme_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'logo_url') - self.logo_url = attributes[:'logo_url'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'sort_order') - self.sort_order = attributes[:'sort_order'] - end - - if attributes.key?(:'created_date_utc') - self.created_date_utc = attributes[:'created_date_utc'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["INVOICE"]) - return false unless type_validator.valid?(@type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["INVOICE"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - branding_theme_id == o.branding_theme_id && - name == o.name && - logo_url == o.logo_url && - type == o.type && - sort_order == o.sort_order && - created_date_utc == o.created_date_utc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [branding_theme_id, name, logo_url, type, sort_order, created_date_utc].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/branding_themes.rb b/lib/xero-ruby/models/accounting/branding_themes.rb deleted file mode 100644 index 41ff2a06..00000000 --- a/lib/xero-ruby/models/accounting/branding_themes.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class BrandingThemes - attr_accessor :branding_themes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'branding_themes' => :'BrandingThemes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'branding_themes' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BrandingThemes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BrandingThemes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'branding_themes') - if (value = attributes[:'branding_themes']).is_a?(Array) - self.branding_themes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - branding_themes == o.branding_themes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [branding_themes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/cis_org_setting.rb b/lib/xero-ruby/models/accounting/cis_org_setting.rb deleted file mode 100644 index 90008d4d..00000000 --- a/lib/xero-ruby/models/accounting/cis_org_setting.rb +++ /dev/null @@ -1,224 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class CISOrgSetting - # true or false - Boolean that describes if the organisation is a CIS Contractor - attr_accessor :cis_contractor_enabled - - # true or false - Boolean that describes if the organisation is a CIS SubContractor - attr_accessor :cis_sub_contractor_enabled - - # CIS Deduction rate for the organisation - attr_accessor :rate - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'cis_contractor_enabled' => :'CISContractorEnabled', - :'cis_sub_contractor_enabled' => :'CISSubContractorEnabled', - :'rate' => :'Rate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'cis_contractor_enabled' => :'Boolean', - :'cis_sub_contractor_enabled' => :'Boolean', - :'rate' => :'Integer' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CISOrgSetting` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CISOrgSetting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'cis_contractor_enabled') - self.cis_contractor_enabled = attributes[:'cis_contractor_enabled'] - end - - if attributes.key?(:'cis_sub_contractor_enabled') - self.cis_sub_contractor_enabled = attributes[:'cis_sub_contractor_enabled'] - end - - if attributes.key?(:'rate') - self.rate = attributes[:'rate'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - cis_contractor_enabled == o.cis_contractor_enabled && - cis_sub_contractor_enabled == o.cis_sub_contractor_enabled && - rate == o.rate - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [cis_contractor_enabled, cis_sub_contractor_enabled, rate].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/cis_setting.rb b/lib/xero-ruby/models/accounting/cis_setting.rb deleted file mode 100644 index 2bbf486b..00000000 --- a/lib/xero-ruby/models/accounting/cis_setting.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class CISSetting - # Boolean that describes if the contact is a CIS Subcontractor - attr_accessor :cis_enabled - - # CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned - attr_accessor :rate - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'cis_enabled' => :'CISEnabled', - :'rate' => :'Rate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'cis_enabled' => :'Boolean', - :'rate' => :'Integer' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CISSetting` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CISSetting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'cis_enabled') - self.cis_enabled = attributes[:'cis_enabled'] - end - - if attributes.key?(:'rate') - self.rate = attributes[:'rate'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - cis_enabled == o.cis_enabled && - rate == o.rate - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [cis_enabled, rate].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/cis_settings.rb b/lib/xero-ruby/models/accounting/cis_settings.rb deleted file mode 100644 index 764803eb..00000000 --- a/lib/xero-ruby/models/accounting/cis_settings.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class CISSettings - attr_accessor :cis_settings - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'cis_settings' => :'CISSettings' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'cis_settings' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CISSettings` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CISSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'cis_settings') - if (value = attributes[:'cis_settings']).is_a?(Array) - self.cis_settings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - cis_settings == o.cis_settings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [cis_settings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/contact.rb b/lib/xero-ruby/models/accounting/contact.rb deleted file mode 100644 index f06b92ce..00000000 --- a/lib/xero-ruby/models/accounting/contact.rb +++ /dev/null @@ -1,736 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Contact - # Xero identifier - attr_accessor :contact_id - - # This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. - attr_accessor :contact_number - - # A user defined account number. This can be updated via the API and the Xero UI (max length = 50) - attr_accessor :account_number - - # Current status of a contact – see contact status types - attr_accessor :contact_status - - # Full name of contact/organisation (max length = 255) - attr_accessor :name - - # First name of contact person (max length = 255) - attr_accessor :first_name - - # Last name of contact person (max length = 255) - attr_accessor :last_name - - # Email address of contact person (umlauts not supported) (max length = 255) - attr_accessor :email_address - - # Skype user name of contact - attr_accessor :skype_user_name - - # See contact persons - attr_accessor :contact_persons - - # Bank account number of contact - attr_accessor :bank_account_details - - # Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) - attr_accessor :tax_number - - # The tax type from TaxRates - attr_accessor :accounts_receivable_tax_type - - # The tax type from TaxRates - attr_accessor :accounts_payable_tax_type - - # Store certain address types for a contact – see address types - attr_accessor :addresses - - # Store certain phone types for a contact – see phone types - attr_accessor :phones - - # true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. - attr_accessor :is_supplier - - # true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. - attr_accessor :is_customer - - attr_accessor :default_currency - - # Store XeroNetworkKey for contacts. - attr_accessor :xero_network_key - - # The default sales account code for contacts - attr_accessor :sales_default_account_code - - # The default purchases account code for contacts - attr_accessor :purchases_default_account_code - - # The default sales tracking categories for contacts - attr_accessor :sales_tracking_categories - - # The default purchases tracking categories for contacts - attr_accessor :purchases_tracking_categories - - # The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories - attr_accessor :tracking_category_name - - # The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories - attr_accessor :tracking_category_option - - attr_accessor :payment_terms - - # UTC timestamp of last update to contact - attr_accessor :updated_date_utc - - # Displays which contact groups a contact is included in - attr_accessor :contact_groups - - # Website address for contact (read only) - attr_accessor :website - - attr_accessor :branding_theme - - attr_accessor :batch_payments - - # The default discount rate for the contact (read only) - attr_accessor :discount - - attr_accessor :balances - - # Displays array of attachments from the API - attr_accessor :attachments - - # A boolean to indicate if a contact has an attachment - attr_accessor :has_attachments - - # Displays validation errors returned from the API - attr_accessor :validation_errors - - # A boolean to indicate if a contact has an validation errors - attr_accessor :has_validation_errors - - # Status of object - attr_accessor :status_attribute_string - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'contact_id' => :'ContactID', - :'contact_number' => :'ContactNumber', - :'account_number' => :'AccountNumber', - :'contact_status' => :'ContactStatus', - :'name' => :'Name', - :'first_name' => :'FirstName', - :'last_name' => :'LastName', - :'email_address' => :'EmailAddress', - :'skype_user_name' => :'SkypeUserName', - :'contact_persons' => :'ContactPersons', - :'bank_account_details' => :'BankAccountDetails', - :'tax_number' => :'TaxNumber', - :'accounts_receivable_tax_type' => :'AccountsReceivableTaxType', - :'accounts_payable_tax_type' => :'AccountsPayableTaxType', - :'addresses' => :'Addresses', - :'phones' => :'Phones', - :'is_supplier' => :'IsSupplier', - :'is_customer' => :'IsCustomer', - :'default_currency' => :'DefaultCurrency', - :'xero_network_key' => :'XeroNetworkKey', - :'sales_default_account_code' => :'SalesDefaultAccountCode', - :'purchases_default_account_code' => :'PurchasesDefaultAccountCode', - :'sales_tracking_categories' => :'SalesTrackingCategories', - :'purchases_tracking_categories' => :'PurchasesTrackingCategories', - :'tracking_category_name' => :'TrackingCategoryName', - :'tracking_category_option' => :'TrackingCategoryOption', - :'payment_terms' => :'PaymentTerms', - :'updated_date_utc' => :'UpdatedDateUTC', - :'contact_groups' => :'ContactGroups', - :'website' => :'Website', - :'branding_theme' => :'BrandingTheme', - :'batch_payments' => :'BatchPayments', - :'discount' => :'Discount', - :'balances' => :'Balances', - :'attachments' => :'Attachments', - :'has_attachments' => :'HasAttachments', - :'validation_errors' => :'ValidationErrors', - :'has_validation_errors' => :'HasValidationErrors', - :'status_attribute_string' => :'StatusAttributeString' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'contact_id' => :'String', - :'contact_number' => :'String', - :'account_number' => :'String', - :'contact_status' => :'String', - :'name' => :'String', - :'first_name' => :'String', - :'last_name' => :'String', - :'email_address' => :'String', - :'skype_user_name' => :'String', - :'contact_persons' => :'Array', - :'bank_account_details' => :'String', - :'tax_number' => :'String', - :'accounts_receivable_tax_type' => :'String', - :'accounts_payable_tax_type' => :'String', - :'addresses' => :'Array
', - :'phones' => :'Array', - :'is_supplier' => :'Boolean', - :'is_customer' => :'Boolean', - :'default_currency' => :'CurrencyCode', - :'xero_network_key' => :'String', - :'sales_default_account_code' => :'String', - :'purchases_default_account_code' => :'String', - :'sales_tracking_categories' => :'Array', - :'purchases_tracking_categories' => :'Array', - :'tracking_category_name' => :'String', - :'tracking_category_option' => :'String', - :'payment_terms' => :'PaymentTerm', - :'updated_date_utc' => :'DateTime', - :'contact_groups' => :'Array', - :'website' => :'String', - :'branding_theme' => :'BrandingTheme', - :'batch_payments' => :'BatchPaymentDetails', - :'discount' => :'Float', - :'balances' => :'Balances', - :'attachments' => :'Array', - :'has_attachments' => :'Boolean', - :'validation_errors' => :'Array', - :'has_validation_errors' => :'Boolean', - :'status_attribute_string' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Contact` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Contact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'contact_id') - self.contact_id = attributes[:'contact_id'] - end - - if attributes.key?(:'contact_number') - self.contact_number = attributes[:'contact_number'] - end - - if attributes.key?(:'account_number') - self.account_number = attributes[:'account_number'] - end - - if attributes.key?(:'contact_status') - self.contact_status = attributes[:'contact_status'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'skype_user_name') - self.skype_user_name = attributes[:'skype_user_name'] - end - - if attributes.key?(:'contact_persons') - if (value = attributes[:'contact_persons']).is_a?(Array) - self.contact_persons = value - end - end - - if attributes.key?(:'bank_account_details') - self.bank_account_details = attributes[:'bank_account_details'] - end - - if attributes.key?(:'tax_number') - self.tax_number = attributes[:'tax_number'] - end - - if attributes.key?(:'accounts_receivable_tax_type') - self.accounts_receivable_tax_type = attributes[:'accounts_receivable_tax_type'] - end - - if attributes.key?(:'accounts_payable_tax_type') - self.accounts_payable_tax_type = attributes[:'accounts_payable_tax_type'] - end - - if attributes.key?(:'addresses') - if (value = attributes[:'addresses']).is_a?(Array) - self.addresses = value - end - end - - if attributes.key?(:'phones') - if (value = attributes[:'phones']).is_a?(Array) - self.phones = value - end - end - - if attributes.key?(:'is_supplier') - self.is_supplier = attributes[:'is_supplier'] - end - - if attributes.key?(:'is_customer') - self.is_customer = attributes[:'is_customer'] - end - - if attributes.key?(:'default_currency') - self.default_currency = attributes[:'default_currency'] - end - - if attributes.key?(:'xero_network_key') - self.xero_network_key = attributes[:'xero_network_key'] - end - - if attributes.key?(:'sales_default_account_code') - self.sales_default_account_code = attributes[:'sales_default_account_code'] - end - - if attributes.key?(:'purchases_default_account_code') - self.purchases_default_account_code = attributes[:'purchases_default_account_code'] - end - - if attributes.key?(:'sales_tracking_categories') - if (value = attributes[:'sales_tracking_categories']).is_a?(Array) - self.sales_tracking_categories = value - end - end - - if attributes.key?(:'purchases_tracking_categories') - if (value = attributes[:'purchases_tracking_categories']).is_a?(Array) - self.purchases_tracking_categories = value - end - end - - if attributes.key?(:'tracking_category_name') - self.tracking_category_name = attributes[:'tracking_category_name'] - end - - if attributes.key?(:'tracking_category_option') - self.tracking_category_option = attributes[:'tracking_category_option'] - end - - if attributes.key?(:'payment_terms') - self.payment_terms = attributes[:'payment_terms'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'contact_groups') - if (value = attributes[:'contact_groups']).is_a?(Array) - self.contact_groups = value - end - end - - if attributes.key?(:'website') - self.website = attributes[:'website'] - end - - if attributes.key?(:'branding_theme') - self.branding_theme = attributes[:'branding_theme'] - end - - if attributes.key?(:'batch_payments') - self.batch_payments = attributes[:'batch_payments'] - end - - if attributes.key?(:'discount') - self.discount = attributes[:'discount'] - end - - if attributes.key?(:'balances') - self.balances = attributes[:'balances'] - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - - if attributes.key?(:'has_validation_errors') - self.has_validation_errors = attributes[:'has_validation_errors'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@contact_number.nil? && @contact_number.to_s.length > 50 - invalid_properties.push('invalid value for "contact_number", the character length must be smaller than or equal to 50.') - end - - if !@account_number.nil? && @account_number.to_s.length > 50 - invalid_properties.push('invalid value for "account_number", the character length must be smaller than or equal to 50.') - end - - if !@name.nil? && @name.to_s.length > 255 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') - end - - if !@first_name.nil? && @first_name.to_s.length > 255 - invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.') - end - - if !@last_name.nil? && @last_name.to_s.length > 255 - invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.') - end - - if !@email_address.nil? && @email_address.to_s.length > 255 - invalid_properties.push('invalid value for "email_address", the character length must be smaller than or equal to 255.') - end - - if !@tax_number.nil? && @tax_number.to_s.length > 50 - invalid_properties.push('invalid value for "tax_number", the character length must be smaller than or equal to 50.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@contact_number.nil? && @contact_number.to_s.length > 50 - return false if !@account_number.nil? && @account_number.to_s.length > 50 - contact_status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) - return false unless contact_status_validator.valid?(@contact_status) - return false if !@name.nil? && @name.to_s.length > 255 - return false if !@first_name.nil? && @first_name.to_s.length > 255 - return false if !@last_name.nil? && @last_name.to_s.length > 255 - return false if !@email_address.nil? && @email_address.to_s.length > 255 - return false if !@tax_number.nil? && @tax_number.to_s.length > 50 - true - end - - # Custom attribute writer method with validation - # @param [Object] contact_number Value to be assigned - def contact_number=(contact_number) - if !contact_number.nil? && contact_number.to_s.length > 50 - fail ArgumentError, 'invalid value for "contact_number", the character length must be smaller than or equal to 50.' - end - - @contact_number = contact_number - end - - # Custom attribute writer method with validation - # @param [Object] account_number Value to be assigned - def account_number=(account_number) - if !account_number.nil? && account_number.to_s.length > 50 - fail ArgumentError, 'invalid value for "account_number", the character length must be smaller than or equal to 50.' - end - - @account_number = account_number - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] contact_status Object to be assigned - def contact_status=(contact_status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) - unless validator.valid?(contact_status) - fail ArgumentError, "invalid value for \"contact_status\", must be one of #{validator.allowable_values}." - end - @contact_status = contact_status - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if !name.nil? && name.to_s.length > 255 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' - end - - @name = name - end - - # Custom attribute writer method with validation - # @param [Object] first_name Value to be assigned - def first_name=(first_name) - if !first_name.nil? && first_name.to_s.length > 255 - fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 255.' - end - - @first_name = first_name - end - - # Custom attribute writer method with validation - # @param [Object] last_name Value to be assigned - def last_name=(last_name) - if !last_name.nil? && last_name.to_s.length > 255 - fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 255.' - end - - @last_name = last_name - end - - # Custom attribute writer method with validation - # @param [Object] email_address Value to be assigned - def email_address=(email_address) - if !email_address.nil? && email_address.to_s.length > 255 - fail ArgumentError, 'invalid value for "email_address", the character length must be smaller than or equal to 255.' - end - - @email_address = email_address - end - - # Custom attribute writer method with validation - # @param [Object] tax_number Value to be assigned - def tax_number=(tax_number) - if !tax_number.nil? && tax_number.to_s.length > 50 - fail ArgumentError, 'invalid value for "tax_number", the character length must be smaller than or equal to 50.' - end - - @tax_number = tax_number - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - contact_id == o.contact_id && - contact_number == o.contact_number && - account_number == o.account_number && - contact_status == o.contact_status && - name == o.name && - first_name == o.first_name && - last_name == o.last_name && - email_address == o.email_address && - skype_user_name == o.skype_user_name && - contact_persons == o.contact_persons && - bank_account_details == o.bank_account_details && - tax_number == o.tax_number && - accounts_receivable_tax_type == o.accounts_receivable_tax_type && - accounts_payable_tax_type == o.accounts_payable_tax_type && - addresses == o.addresses && - phones == o.phones && - is_supplier == o.is_supplier && - is_customer == o.is_customer && - default_currency == o.default_currency && - xero_network_key == o.xero_network_key && - sales_default_account_code == o.sales_default_account_code && - purchases_default_account_code == o.purchases_default_account_code && - sales_tracking_categories == o.sales_tracking_categories && - purchases_tracking_categories == o.purchases_tracking_categories && - tracking_category_name == o.tracking_category_name && - tracking_category_option == o.tracking_category_option && - payment_terms == o.payment_terms && - updated_date_utc == o.updated_date_utc && - contact_groups == o.contact_groups && - website == o.website && - branding_theme == o.branding_theme && - batch_payments == o.batch_payments && - discount == o.discount && - balances == o.balances && - attachments == o.attachments && - has_attachments == o.has_attachments && - validation_errors == o.validation_errors && - has_validation_errors == o.has_validation_errors && - status_attribute_string == o.status_attribute_string - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [contact_id, contact_number, account_number, contact_status, name, first_name, last_name, email_address, skype_user_name, contact_persons, bank_account_details, tax_number, accounts_receivable_tax_type, accounts_payable_tax_type, addresses, phones, is_supplier, is_customer, default_currency, xero_network_key, sales_default_account_code, purchases_default_account_code, sales_tracking_categories, purchases_tracking_categories, tracking_category_name, tracking_category_option, payment_terms, updated_date_utc, contact_groups, website, branding_theme, batch_payments, discount, balances, attachments, has_attachments, validation_errors, has_validation_errors, status_attribute_string].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/contact_group.rb b/lib/xero-ruby/models/accounting/contact_group.rb deleted file mode 100644 index 2d4a47cd..00000000 --- a/lib/xero-ruby/models/accounting/contact_group.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ContactGroup - # The Name of the contact group. Required when creating a new contact group - attr_accessor :name - - # The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. - attr_accessor :status - - # The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 - attr_accessor :contact_group_id - - # The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. - attr_accessor :contacts - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'status' => :'Status', - :'contact_group_id' => :'ContactGroupID', - :'contacts' => :'Contacts' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'status' => :'String', - :'contact_group_id' => :'String', - :'contacts' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ContactGroup` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ContactGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'contact_group_id') - self.contact_group_id = attributes[:'contact_group_id'] - end - - if attributes.key?(:'contacts') - if (value = attributes[:'contacts']).is_a?(Array) - self.contacts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - status == o.status && - contact_group_id == o.contact_group_id && - contacts == o.contacts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, status, contact_group_id, contacts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/contact_groups.rb b/lib/xero-ruby/models/accounting/contact_groups.rb deleted file mode 100644 index 164cc161..00000000 --- a/lib/xero-ruby/models/accounting/contact_groups.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ContactGroups - attr_accessor :contact_groups - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'contact_groups' => :'ContactGroups' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'contact_groups' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ContactGroups` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ContactGroups`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'contact_groups') - if (value = attributes[:'contact_groups']).is_a?(Array) - self.contact_groups = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - contact_groups == o.contact_groups - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [contact_groups].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/contact_person.rb b/lib/xero-ruby/models/accounting/contact_person.rb deleted file mode 100644 index 32e7d216..00000000 --- a/lib/xero-ruby/models/accounting/contact_person.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ContactPerson - # First name of person - attr_accessor :first_name - - # Last name of person - attr_accessor :last_name - - # Email address of person - attr_accessor :email_address - - # boolean to indicate whether contact should be included on emails with invoices etc. - attr_accessor :include_in_emails - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'first_name' => :'FirstName', - :'last_name' => :'LastName', - :'email_address' => :'EmailAddress', - :'include_in_emails' => :'IncludeInEmails' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'first_name' => :'String', - :'last_name' => :'String', - :'email_address' => :'String', - :'include_in_emails' => :'Boolean' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ContactPerson` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ContactPerson`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'include_in_emails') - self.include_in_emails = attributes[:'include_in_emails'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - first_name == o.first_name && - last_name == o.last_name && - email_address == o.email_address && - include_in_emails == o.include_in_emails - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [first_name, last_name, email_address, include_in_emails].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/contacts.rb b/lib/xero-ruby/models/accounting/contacts.rb deleted file mode 100644 index ba182ae5..00000000 --- a/lib/xero-ruby/models/accounting/contacts.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Contacts - attr_accessor :contacts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'contacts' => :'Contacts' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'contacts' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Contacts` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Contacts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'contacts') - if (value = attributes[:'contacts']).is_a?(Array) - self.contacts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - contacts == o.contacts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [contacts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/country_code.rb b/lib/xero-ruby/models/accounting/country_code.rb deleted file mode 100644 index cc141c70..00000000 --- a/lib/xero-ruby/models/accounting/country_code.rb +++ /dev/null @@ -1,275 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class CountryCode - AD = "AD".freeze - AE = "AE".freeze - AF = "AF".freeze - AG = "AG".freeze - AI = "AI".freeze - AL = "AL".freeze - AM = "AM".freeze - AN = "AN".freeze - AO = "AO".freeze - AQ = "AQ".freeze - AR = "AR".freeze - AS = "AS".freeze - AT = "AT".freeze - AU = "AU".freeze - AW = "AW".freeze - AZ = "AZ".freeze - BA = "BA".freeze - BB = "BB".freeze - BD = "BD".freeze - BE = "BE".freeze - BF = "BF".freeze - BG = "BG".freeze - BH = "BH".freeze - BI = "BI".freeze - BJ = "BJ".freeze - BL = "BL".freeze - BM = "BM".freeze - BN = "BN".freeze - BO = "BO".freeze - BR = "BR".freeze - BS = "BS".freeze - BT = "BT".freeze - BW = "BW".freeze - BY = "BY".freeze - BZ = "BZ".freeze - CA = "CA".freeze - CC = "CC".freeze - CD = "CD".freeze - CF = "CF".freeze - CG = "CG".freeze - CH = "CH".freeze - CI = "CI".freeze - CK = "CK".freeze - CL = "CL".freeze - CM = "CM".freeze - CN = "CN".freeze - CO = "CO".freeze - CR = "CR".freeze - CU = "CU".freeze - CV = "CV".freeze - CW = "CW".freeze - CX = "CX".freeze - CY = "CY".freeze - CZ = "CZ".freeze - DE = "DE".freeze - DJ = "DJ".freeze - DK = "DK".freeze - DM = "DM".freeze - DO = "DO".freeze - DZ = "DZ".freeze - EC = "EC".freeze - EE = "EE".freeze - EG = "EG".freeze - EH = "EH".freeze - ER = "ER".freeze - ES = "ES".freeze - ET = "ET".freeze - FI = "FI".freeze - FJ = "FJ".freeze - FK = "FK".freeze - FM = "FM".freeze - FO = "FO".freeze - FR = "FR".freeze - GA = "GA".freeze - GB = "GB".freeze - GD = "GD".freeze - GE = "GE".freeze - GG = "GG".freeze - GH = "GH".freeze - GI = "GI".freeze - GL = "GL".freeze - GM = "GM".freeze - GN = "GN".freeze - GQ = "GQ".freeze - GR = "GR".freeze - GT = "GT".freeze - GU = "GU".freeze - GW = "GW".freeze - GY = "GY".freeze - HK = "HK".freeze - HN = "HN".freeze - HR = "HR".freeze - HT = "HT".freeze - HU = "HU".freeze - ID = "ID".freeze - IE = "IE".freeze - IL = "IL".freeze - IM = "IM".freeze - IN = "IN".freeze - IO = "IO".freeze - IQ = "IQ".freeze - IR = "IR".freeze - IS = "IS".freeze - IT = "IT".freeze - JE = "JE".freeze - JM = "JM".freeze - JO = "JO".freeze - JP = "JP".freeze - KE = "KE".freeze - KG = "KG".freeze - KH = "KH".freeze - KI = "KI".freeze - KM = "KM".freeze - KN = "KN".freeze - KP = "KP".freeze - KR = "KR".freeze - KW = "KW".freeze - KY = "KY".freeze - KZ = "KZ".freeze - LA = "LA".freeze - LB = "LB".freeze - LC = "LC".freeze - LI = "LI".freeze - LK = "LK".freeze - LR = "LR".freeze - LS = "LS".freeze - LT = "LT".freeze - LU = "LU".freeze - LV = "LV".freeze - LY = "LY".freeze - MA = "MA".freeze - MC = "MC".freeze - MD = "MD".freeze - ME = "ME".freeze - MF = "MF".freeze - MG = "MG".freeze - MH = "MH".freeze - MK = "MK".freeze - ML = "ML".freeze - MM = "MM".freeze - MN = "MN".freeze - MO = "MO".freeze - MP = "MP".freeze - MR = "MR".freeze - MS = "MS".freeze - MT = "MT".freeze - MU = "MU".freeze - MV = "MV".freeze - MW = "MW".freeze - MX = "MX".freeze - MY = "MY".freeze - MZ = "MZ".freeze - NA = "NA".freeze - NC = "NC".freeze - NE = "NE".freeze - NG = "NG".freeze - NI = "NI".freeze - NL = "NL".freeze - NO = "NO".freeze - NP = "NP".freeze - NR = "NR".freeze - NU = "NU".freeze - NZ = "NZ".freeze - OM = "OM".freeze - PA = "PA".freeze - PE = "PE".freeze - PF = "PF".freeze - PG = "PG".freeze - PH = "PH".freeze - PK = "PK".freeze - PL = "PL".freeze - PM = "PM".freeze - PN = "PN".freeze - PR = "PR".freeze - PS = "PS".freeze - PT = "PT".freeze - PW = "PW".freeze - PY = "PY".freeze - QA = "QA".freeze - RE = "RE".freeze - RO = "RO".freeze - RS = "RS".freeze - RU = "RU".freeze - RW = "RW".freeze - SA = "SA".freeze - SB = "SB".freeze - SC = "SC".freeze - SD = "SD".freeze - SE = "SE".freeze - SG = "SG".freeze - SH = "SH".freeze - SI = "SI".freeze - SJ = "SJ".freeze - SK = "SK".freeze - SL = "SL".freeze - SM = "SM".freeze - SN = "SN".freeze - SO = "SO".freeze - SR = "SR".freeze - SS = "SS".freeze - ST = "ST".freeze - SV = "SV".freeze - SX = "SX".freeze - SY = "SY".freeze - SZ = "SZ".freeze - TC = "TC".freeze - TD = "TD".freeze - TG = "TG".freeze - TH = "TH".freeze - TJ = "TJ".freeze - TK = "TK".freeze - TL = "TL".freeze - TM = "TM".freeze - TN = "TN".freeze - TO = "TO".freeze - TR = "TR".freeze - TT = "TT".freeze - TV = "TV".freeze - TW = "TW".freeze - TZ = "TZ".freeze - UA = "UA".freeze - UG = "UG".freeze - US = "US".freeze - UY = "UY".freeze - UZ = "UZ".freeze - VA = "VA".freeze - VC = "VC".freeze - VE = "VE".freeze - VG = "VG".freeze - VI = "VI".freeze - VN = "VN".freeze - VU = "VU".freeze - WF = "WF".freeze - WS = "WS".freeze - XK = "XK".freeze - YE = "YE".freeze - YT = "YT".freeze - ZA = "ZA".freeze - ZM = "ZM".freeze - ZW = "ZW".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = CountryCode.constants.select { |c| CountryCode::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #CountryCode" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/credit_note.rb b/lib/xero-ruby/models/accounting/credit_note.rb deleted file mode 100644 index 9ffd0d92..00000000 --- a/lib/xero-ruby/models/accounting/credit_note.rb +++ /dev/null @@ -1,507 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class CreditNote - # See Credit Note Types - attr_accessor :type - - attr_accessor :contact - - # The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - attr_accessor :date - - # See Credit Note Status Codes - attr_accessor :status - - attr_accessor :line_amount_types - - # See Invoice Line Items - attr_accessor :line_items - - # The subtotal of the credit note excluding taxes - attr_accessor :sub_total - - # The total tax on the credit note - attr_accessor :total_tax - - # The total of the Credit Note(subtotal + total tax) - attr_accessor :total - - # UTC timestamp of last update to the credit note - attr_accessor :updated_date_utc - - attr_accessor :currency_code - - # Date when credit note was fully paid(UTC format) - attr_accessor :fully_paid_on_date - - # Xero generated unique identifier - attr_accessor :credit_note_id - - # ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) - attr_accessor :credit_note_number - - # ACCRECCREDIT only – additional reference number - attr_accessor :reference - - # boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) - attr_accessor :sent_to_contact - - # The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used - attr_accessor :currency_rate - - # The remaining credit balance on the Credit Note - attr_accessor :remaining_credit - - # See Allocations - attr_accessor :allocations - - # The amount of applied to an invoice - attr_accessor :applied_amount - - # See Payments - attr_accessor :payments - - # See BrandingThemes - attr_accessor :branding_theme_id - - # A string to indicate if a invoice status - attr_accessor :status_attribute_string - - # boolean to indicate if a credit note has an attachment - attr_accessor :has_attachments - - # A boolean to indicate if a credit note has an validation errors - attr_accessor :has_errors - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'Type', - :'contact' => :'Contact', - :'date' => :'Date', - :'status' => :'Status', - :'line_amount_types' => :'LineAmountTypes', - :'line_items' => :'LineItems', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'updated_date_utc' => :'UpdatedDateUTC', - :'currency_code' => :'CurrencyCode', - :'fully_paid_on_date' => :'FullyPaidOnDate', - :'credit_note_id' => :'CreditNoteID', - :'credit_note_number' => :'CreditNoteNumber', - :'reference' => :'Reference', - :'sent_to_contact' => :'SentToContact', - :'currency_rate' => :'CurrencyRate', - :'remaining_credit' => :'RemainingCredit', - :'allocations' => :'Allocations', - :'applied_amount' => :'AppliedAmount', - :'payments' => :'Payments', - :'branding_theme_id' => :'BrandingThemeID', - :'status_attribute_string' => :'StatusAttributeString', - :'has_attachments' => :'HasAttachments', - :'has_errors' => :'HasErrors', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'contact' => :'Contact', - :'date' => :'Date', - :'status' => :'String', - :'line_amount_types' => :'LineAmountTypes', - :'line_items' => :'Array', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'updated_date_utc' => :'DateTime', - :'currency_code' => :'CurrencyCode', - :'fully_paid_on_date' => :'Date', - :'credit_note_id' => :'String', - :'credit_note_number' => :'String', - :'reference' => :'String', - :'sent_to_contact' => :'Boolean', - :'currency_rate' => :'Float', - :'remaining_credit' => :'Float', - :'allocations' => :'Array', - :'applied_amount' => :'Float', - :'payments' => :'Array', - :'branding_theme_id' => :'String', - :'status_attribute_string' => :'String', - :'has_attachments' => :'Boolean', - :'has_errors' => :'Boolean', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CreditNote` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CreditNote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'fully_paid_on_date') - self.fully_paid_on_date = attributes[:'fully_paid_on_date'] - end - - if attributes.key?(:'credit_note_id') - self.credit_note_id = attributes[:'credit_note_id'] - end - - if attributes.key?(:'credit_note_number') - self.credit_note_number = attributes[:'credit_note_number'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'sent_to_contact') - self.sent_to_contact = attributes[:'sent_to_contact'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'remaining_credit') - self.remaining_credit = attributes[:'remaining_credit'] - end - - if attributes.key?(:'allocations') - if (value = attributes[:'allocations']).is_a?(Array) - self.allocations = value - end - end - - if attributes.key?(:'applied_amount') - self.applied_amount = attributes[:'applied_amount'] - end - - if attributes.key?(:'payments') - if (value = attributes[:'payments']).is_a?(Array) - self.payments = value - end - end - - if attributes.key?(:'branding_theme_id') - self.branding_theme_id = attributes[:'branding_theme_id'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'has_errors') - self.has_errors = attributes[:'has_errors'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["ACCPAYCREDIT", "ACCRECCREDIT"]) - return false unless type_validator.valid?(@type) - status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["ACCPAYCREDIT", "ACCRECCREDIT"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - contact == o.contact && - date == o.date && - status == o.status && - line_amount_types == o.line_amount_types && - line_items == o.line_items && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - updated_date_utc == o.updated_date_utc && - currency_code == o.currency_code && - fully_paid_on_date == o.fully_paid_on_date && - credit_note_id == o.credit_note_id && - credit_note_number == o.credit_note_number && - reference == o.reference && - sent_to_contact == o.sent_to_contact && - currency_rate == o.currency_rate && - remaining_credit == o.remaining_credit && - allocations == o.allocations && - applied_amount == o.applied_amount && - payments == o.payments && - branding_theme_id == o.branding_theme_id && - status_attribute_string == o.status_attribute_string && - has_attachments == o.has_attachments && - has_errors == o.has_errors && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/credit_notes.rb b/lib/xero-ruby/models/accounting/credit_notes.rb deleted file mode 100644 index 69b96c2f..00000000 --- a/lib/xero-ruby/models/accounting/credit_notes.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class CreditNotes - attr_accessor :credit_notes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'credit_notes' => :'CreditNotes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'credit_notes' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CreditNotes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CreditNotes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'credit_notes') - if (value = attributes[:'credit_notes']).is_a?(Array) - self.credit_notes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - credit_notes == o.credit_notes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [credit_notes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/currencies.rb b/lib/xero-ruby/models/accounting/currencies.rb deleted file mode 100644 index 2cc1a5ea..00000000 --- a/lib/xero-ruby/models/accounting/currencies.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Currencies - attr_accessor :currencies - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'currencies' => :'Currencies' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'currencies' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Currencies` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Currencies`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'currencies') - if (value = attributes[:'currencies']).is_a?(Array) - self.currencies = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - currencies == o.currencies - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [currencies].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/currency.rb b/lib/xero-ruby/models/accounting/currency.rb deleted file mode 100644 index d1cfcce1..00000000 --- a/lib/xero-ruby/models/accounting/currency.rb +++ /dev/null @@ -1,213 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Currency - attr_accessor :code - - # Name of Currency - attr_accessor :description - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'Code', - :'description' => :'Description' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'CurrencyCode', - :'description' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Currency` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Currency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/currency_code.rb b/lib/xero-ruby/models/accounting/currency_code.rb deleted file mode 100644 index 38742ca7..00000000 --- a/lib/xero-ruby/models/accounting/currency_code.rb +++ /dev/null @@ -1,199 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class CurrencyCode - AED = "AED".freeze - AFN = "AFN".freeze - ALL = "ALL".freeze - AMD = "AMD".freeze - ANG = "ANG".freeze - AOA = "AOA".freeze - ARS = "ARS".freeze - AUD = "AUD".freeze - AWG = "AWG".freeze - AZN = "AZN".freeze - BAM = "BAM".freeze - BBD = "BBD".freeze - BDT = "BDT".freeze - BGN = "BGN".freeze - BHD = "BHD".freeze - BIF = "BIF".freeze - BMD = "BMD".freeze - BND = "BND".freeze - BOB = "BOB".freeze - BRL = "BRL".freeze - BSD = "BSD".freeze - BTN = "BTN".freeze - BWP = "BWP".freeze - BYN = "BYN".freeze - BZD = "BZD".freeze - CAD = "CAD".freeze - CDF = "CDF".freeze - CHF = "CHF".freeze - CLP = "CLP".freeze - CNY = "CNY".freeze - COP = "COP".freeze - CRC = "CRC".freeze - CUC = "CUC".freeze - CUP = "CUP".freeze - CVE = "CVE".freeze - CZK = "CZK".freeze - DJF = "DJF".freeze - DKK = "DKK".freeze - DOP = "DOP".freeze - DZD = "DZD".freeze - EGP = "EGP".freeze - ERN = "ERN".freeze - ETB = "ETB".freeze - EUR = "EUR".freeze - FJD = "FJD".freeze - FKP = "FKP".freeze - GBP = "GBP".freeze - GEL = "GEL".freeze - GGP = "GGP".freeze - GHS = "GHS".freeze - GIP = "GIP".freeze - GMD = "GMD".freeze - GNF = "GNF".freeze - GTQ = "GTQ".freeze - GYD = "GYD".freeze - HKD = "HKD".freeze - HNL = "HNL".freeze - HRK = "HRK".freeze - HTG = "HTG".freeze - HUF = "HUF".freeze - IDR = "IDR".freeze - ILS = "ILS".freeze - IMP = "IMP".freeze - INR = "INR".freeze - IQD = "IQD".freeze - IRR = "IRR".freeze - ISK = "ISK".freeze - JEP = "JEP".freeze - JMD = "JMD".freeze - JOD = "JOD".freeze - JPY = "JPY".freeze - KES = "KES".freeze - KGS = "KGS".freeze - KHR = "KHR".freeze - KMF = "KMF".freeze - KPW = "KPW".freeze - KRW = "KRW".freeze - KWD = "KWD".freeze - KYD = "KYD".freeze - KZT = "KZT".freeze - LAK = "LAK".freeze - LBP = "LBP".freeze - LKR = "LKR".freeze - LRD = "LRD".freeze - LSL = "LSL".freeze - LYD = "LYD".freeze - MAD = "MAD".freeze - MDL = "MDL".freeze - MGA = "MGA".freeze - MKD = "MKD".freeze - MMK = "MMK".freeze - MNT = "MNT".freeze - MOP = "MOP".freeze - MRU = "MRU".freeze - MUR = "MUR".freeze - MVR = "MVR".freeze - MWK = "MWK".freeze - MXN = "MXN".freeze - MYR = "MYR".freeze - MZN = "MZN".freeze - NAD = "NAD".freeze - NGN = "NGN".freeze - NIO = "NIO".freeze - NOK = "NOK".freeze - NPR = "NPR".freeze - NZD = "NZD".freeze - OMR = "OMR".freeze - PAB = "PAB".freeze - PEN = "PEN".freeze - PGK = "PGK".freeze - PHP = "PHP".freeze - PKR = "PKR".freeze - PLN = "PLN".freeze - PYG = "PYG".freeze - QAR = "QAR".freeze - RON = "RON".freeze - RSD = "RSD".freeze - RUB = "RUB".freeze - RWF = "RWF".freeze - SAR = "SAR".freeze - SBD = "SBD".freeze - SCR = "SCR".freeze - SDG = "SDG".freeze - SEK = "SEK".freeze - SGD = "SGD".freeze - SHP = "SHP".freeze - SLL = "SLL".freeze - SOS = "SOS".freeze - SPL = "SPL".freeze - SRD = "SRD".freeze - STN = "STN".freeze - SVC = "SVC".freeze - SYP = "SYP".freeze - SZL = "SZL".freeze - THB = "THB".freeze - TJS = "TJS".freeze - TMT = "TMT".freeze - TND = "TND".freeze - TOP = "TOP".freeze - _TRY = "TRY".freeze - TTD = "TTD".freeze - TVD = "TVD".freeze - TWD = "TWD".freeze - TZS = "TZS".freeze - UAH = "UAH".freeze - UGX = "UGX".freeze - USD = "USD".freeze - UYU = "UYU".freeze - UZS = "UZS".freeze - VEF = "VEF".freeze - VND = "VND".freeze - VUV = "VUV".freeze - WST = "WST".freeze - XAF = "XAF".freeze - XCD = "XCD".freeze - XDR = "XDR".freeze - XOF = "XOF".freeze - XPF = "XPF".freeze - YER = "YER".freeze - ZAR = "ZAR".freeze - ZMW = "ZMW".freeze - ZMK = "ZMK".freeze - ZWD = "ZWD".freeze - _EMPTY = "".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = CurrencyCode.constants.select { |c| CurrencyCode::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #CurrencyCode" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/element.rb b/lib/xero-ruby/models/accounting/element.rb deleted file mode 100644 index b693a966..00000000 --- a/lib/xero-ruby/models/accounting/element.rb +++ /dev/null @@ -1,270 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Element - # Array of Validation Error message - attr_accessor :validation_errors - - # Unique ID for batch payment object with validation error - attr_accessor :batch_payment_id - - attr_accessor :bank_transaction_id - - attr_accessor :credit_note_id - - attr_accessor :contact_id - - attr_accessor :invoice_id - - attr_accessor :item_id - - attr_accessor :purchase_order_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'validation_errors' => :'ValidationErrors', - :'batch_payment_id' => :'BatchPaymentID', - :'bank_transaction_id' => :'BankTransactionID', - :'credit_note_id' => :'CreditNoteID', - :'contact_id' => :'ContactID', - :'invoice_id' => :'InvoiceID', - :'item_id' => :'ItemID', - :'purchase_order_id' => :'PurchaseOrderID' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'validation_errors' => :'Array', - :'batch_payment_id' => :'String', - :'bank_transaction_id' => :'String', - :'credit_note_id' => :'String', - :'contact_id' => :'String', - :'invoice_id' => :'String', - :'item_id' => :'String', - :'purchase_order_id' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Element` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Element`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - - if attributes.key?(:'batch_payment_id') - self.batch_payment_id = attributes[:'batch_payment_id'] - end - - if attributes.key?(:'bank_transaction_id') - self.bank_transaction_id = attributes[:'bank_transaction_id'] - end - - if attributes.key?(:'credit_note_id') - self.credit_note_id = attributes[:'credit_note_id'] - end - - if attributes.key?(:'contact_id') - self.contact_id = attributes[:'contact_id'] - end - - if attributes.key?(:'invoice_id') - self.invoice_id = attributes[:'invoice_id'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'purchase_order_id') - self.purchase_order_id = attributes[:'purchase_order_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - validation_errors == o.validation_errors && - batch_payment_id == o.batch_payment_id && - bank_transaction_id == o.bank_transaction_id && - credit_note_id == o.credit_note_id && - contact_id == o.contact_id && - invoice_id == o.invoice_id && - item_id == o.item_id && - purchase_order_id == o.purchase_order_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [validation_errors, batch_payment_id, bank_transaction_id, credit_note_id, contact_id, invoice_id, item_id, purchase_order_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/employee.rb b/lib/xero-ruby/models/accounting/employee.rb deleted file mode 100644 index b5ca9937..00000000 --- a/lib/xero-ruby/models/accounting/employee.rb +++ /dev/null @@ -1,338 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Employee - # The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - attr_accessor :employee_id - - # Current status of an employee – see contact status types - attr_accessor :status - - # First name of an employee (max length = 255) - attr_accessor :first_name - - # Last name of an employee (max length = 255) - attr_accessor :last_name - - attr_accessor :external_link - - attr_accessor :updated_date_utc - - # A string to indicate if a invoice status - attr_accessor :status_attribute_string - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employee_id' => :'EmployeeID', - :'status' => :'Status', - :'first_name' => :'FirstName', - :'last_name' => :'LastName', - :'external_link' => :'ExternalLink', - :'updated_date_utc' => :'UpdatedDateUTC', - :'status_attribute_string' => :'StatusAttributeString', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'employee_id' => :'String', - :'status' => :'String', - :'first_name' => :'String', - :'last_name' => :'String', - :'external_link' => :'ExternalLink', - :'updated_date_utc' => :'DateTime', - :'status_attribute_string' => :'String', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Employee` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Employee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employee_id') - self.employee_id = attributes[:'employee_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'external_link') - self.external_link = attributes[:'external_link'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@first_name.nil? && @first_name.to_s.length > 255 - invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.') - end - - if !@last_name.nil? && @last_name.to_s.length > 255 - invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) - return false unless status_validator.valid?(@status) - return false if !@first_name.nil? && @first_name.to_s.length > 255 - return false if !@last_name.nil? && @last_name.to_s.length > 255 - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method with validation - # @param [Object] first_name Value to be assigned - def first_name=(first_name) - if !first_name.nil? && first_name.to_s.length > 255 - fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 255.' - end - - @first_name = first_name - end - - # Custom attribute writer method with validation - # @param [Object] last_name Value to be assigned - def last_name=(last_name) - if !last_name.nil? && last_name.to_s.length > 255 - fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 255.' - end - - @last_name = last_name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employee_id == o.employee_id && - status == o.status && - first_name == o.first_name && - last_name == o.last_name && - external_link == o.external_link && - updated_date_utc == o.updated_date_utc && - status_attribute_string == o.status_attribute_string && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employee_id, status, first_name, last_name, external_link, updated_date_utc, status_attribute_string, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/employees.rb b/lib/xero-ruby/models/accounting/employees.rb deleted file mode 100644 index fdae6962..00000000 --- a/lib/xero-ruby/models/accounting/employees.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Employees - attr_accessor :employees - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'employees' => :'Employees' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'employees' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Employees` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Employees`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'employees') - if (value = attributes[:'employees']).is_a?(Array) - self.employees = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - employees == o.employees - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [employees].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/error.rb b/lib/xero-ruby/models/accounting/error.rb deleted file mode 100644 index bab0b99f..00000000 --- a/lib/xero-ruby/models/accounting/error.rb +++ /dev/null @@ -1,236 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Error - # Exception number - attr_accessor :error_number - - # Exception type - attr_accessor :type - - # Exception message - attr_accessor :message - - # Array of Elements of validation Errors - attr_accessor :elements - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'error_number' => :'ErrorNumber', - :'type' => :'Type', - :'message' => :'Message', - :'elements' => :'Elements' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'error_number' => :'Integer', - :'type' => :'String', - :'message' => :'String', - :'elements' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_number') - self.error_number = attributes[:'error_number'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - - if attributes.key?(:'elements') - if (value = attributes[:'elements']).is_a?(Array) - self.elements = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_number == o.error_number && - type == o.type && - message == o.message && - elements == o.elements - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [error_number, type, message, elements].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/expense_claim.rb b/lib/xero-ruby/models/accounting/expense_claim.rb deleted file mode 100644 index 14539bf0..00000000 --- a/lib/xero-ruby/models/accounting/expense_claim.rb +++ /dev/null @@ -1,350 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ExpenseClaim - # Xero generated unique identifier for an expense claim - attr_accessor :expense_claim_id - - # Current status of an expense claim – see status types - attr_accessor :status - - # See Payments - attr_accessor :payments - - attr_accessor :user - - attr_accessor :receipts - - # Last modified date UTC format - attr_accessor :updated_date_utc - - # The total of an expense claim being paid - attr_accessor :total - - # The amount due to be paid for an expense claim - attr_accessor :amount_due - - # The amount still to pay for an expense claim - attr_accessor :amount_paid - - # The date when the expense claim is due to be paid YYYY-MM-DD - attr_accessor :payment_due_date - - # The date the expense claim will be reported in Xero YYYY-MM-DD - attr_accessor :reporting_date - - # The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 - attr_accessor :receipt_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'expense_claim_id' => :'ExpenseClaimID', - :'status' => :'Status', - :'payments' => :'Payments', - :'user' => :'User', - :'receipts' => :'Receipts', - :'updated_date_utc' => :'UpdatedDateUTC', - :'total' => :'Total', - :'amount_due' => :'AmountDue', - :'amount_paid' => :'AmountPaid', - :'payment_due_date' => :'PaymentDueDate', - :'reporting_date' => :'ReportingDate', - :'receipt_id' => :'ReceiptID' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'expense_claim_id' => :'String', - :'status' => :'String', - :'payments' => :'Array', - :'user' => :'User', - :'receipts' => :'Array', - :'updated_date_utc' => :'DateTime', - :'total' => :'Float', - :'amount_due' => :'Float', - :'amount_paid' => :'Float', - :'payment_due_date' => :'Date', - :'reporting_date' => :'Date', - :'receipt_id' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ExpenseClaim` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ExpenseClaim`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'expense_claim_id') - self.expense_claim_id = attributes[:'expense_claim_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'payments') - if (value = attributes[:'payments']).is_a?(Array) - self.payments = value - end - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'receipts') - if (value = attributes[:'receipts']).is_a?(Array) - self.receipts = value - end - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'amount_due') - self.amount_due = attributes[:'amount_due'] - end - - if attributes.key?(:'amount_paid') - self.amount_paid = attributes[:'amount_paid'] - end - - if attributes.key?(:'payment_due_date') - self.payment_due_date = attributes[:'payment_due_date'] - end - - if attributes.key?(:'reporting_date') - self.reporting_date = attributes[:'reporting_date'] - end - - if attributes.key?(:'receipt_id') - self.receipt_id = attributes[:'receipt_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["SUBMITTED", "AUTHORISED", "PAID", "VOIDED", "DELETED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["SUBMITTED", "AUTHORISED", "PAID", "VOIDED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - expense_claim_id == o.expense_claim_id && - status == o.status && - payments == o.payments && - user == o.user && - receipts == o.receipts && - updated_date_utc == o.updated_date_utc && - total == o.total && - amount_due == o.amount_due && - amount_paid == o.amount_paid && - payment_due_date == o.payment_due_date && - reporting_date == o.reporting_date && - receipt_id == o.receipt_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [expense_claim_id, status, payments, user, receipts, updated_date_utc, total, amount_due, amount_paid, payment_due_date, reporting_date, receipt_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/expense_claims.rb b/lib/xero-ruby/models/accounting/expense_claims.rb deleted file mode 100644 index 3ebcf984..00000000 --- a/lib/xero-ruby/models/accounting/expense_claims.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ExpenseClaims - attr_accessor :expense_claims - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'expense_claims' => :'ExpenseClaims' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'expense_claims' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ExpenseClaims` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ExpenseClaims`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'expense_claims') - if (value = attributes[:'expense_claims']).is_a?(Array) - self.expense_claims = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - expense_claims == o.expense_claims - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [expense_claims].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/external_link.rb b/lib/xero-ruby/models/accounting/external_link.rb deleted file mode 100644 index 47e61786..00000000 --- a/lib/xero-ruby/models/accounting/external_link.rb +++ /dev/null @@ -1,257 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ExternalLink - # See External link types - attr_accessor :link_type - - # URL for service e.g. http://twitter.com/xeroapi - attr_accessor :url - - attr_accessor :description - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'link_type' => :'LinkType', - :'url' => :'Url', - :'description' => :'Description' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'link_type' => :'String', - :'url' => :'String', - :'description' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ExternalLink` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ExternalLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'link_type') - self.link_type = attributes[:'link_type'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - link_type_validator = EnumAttributeValidator.new('String', ["Facebook", "GooglePlus", "LinkedIn", "Twitter", "Website"]) - return false unless link_type_validator.valid?(@link_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] link_type Object to be assigned - def link_type=(link_type) - validator = EnumAttributeValidator.new('String', ["Facebook", "GooglePlus", "LinkedIn", "Twitter", "Website"]) - unless validator.valid?(link_type) - fail ArgumentError, "invalid value for \"link_type\", must be one of #{validator.allowable_values}." - end - @link_type = link_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - link_type == o.link_type && - url == o.url && - description == o.description - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [link_type, url, description].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/history_record.rb b/lib/xero-ruby/models/accounting/history_record.rb deleted file mode 100644 index 7465b2ec..00000000 --- a/lib/xero-ruby/models/accounting/history_record.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class HistoryRecord - # details - attr_accessor :details - - # Name of branding theme - attr_accessor :changes - - # has a value of 0 - attr_accessor :user - - # UTC timestamp of creation date of branding theme - attr_accessor :date_utc - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'details' => :'Details', - :'changes' => :'Changes', - :'user' => :'User', - :'date_utc' => :'DateUTC' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'details' => :'String', - :'changes' => :'String', - :'user' => :'String', - :'date_utc' => :'DateTime' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::HistoryRecord` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::HistoryRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'changes') - self.changes = attributes[:'changes'] - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'date_utc') - self.date_utc = attributes[:'date_utc'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - details == o.details && - changes == o.changes && - user == o.user && - date_utc == o.date_utc - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [details, changes, user, date_utc].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/history_records.rb b/lib/xero-ruby/models/accounting/history_records.rb deleted file mode 100644 index a0b07358..00000000 --- a/lib/xero-ruby/models/accounting/history_records.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class HistoryRecords - attr_accessor :history_records - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'history_records' => :'HistoryRecords' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'history_records' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::HistoryRecords` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::HistoryRecords`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'history_records') - if (value = attributes[:'history_records']).is_a?(Array) - self.history_records = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - history_records == o.history_records - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [history_records].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/invoice.rb b/lib/xero-ruby/models/accounting/invoice.rb deleted file mode 100644 index 94925fdd..00000000 --- a/lib/xero-ruby/models/accounting/invoice.rb +++ /dev/null @@ -1,665 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Invoice - # See Invoice Types - attr_accessor :type - - attr_accessor :contact - - # See LineItems - attr_accessor :line_items - - # Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - attr_accessor :date - - # Date invoice is due – YYYY-MM-DD - attr_accessor :due_date - - attr_accessor :line_amount_types - - # ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) - attr_accessor :invoice_number - - # ACCREC only – additional reference number (max length = 255) - attr_accessor :reference - - # See BrandingThemes - attr_accessor :branding_theme_id - - # URL link to a source document – shown as “Go to [appName]” in the Xero app - attr_accessor :url - - attr_accessor :currency_code - - # The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) - attr_accessor :currency_rate - - # See Invoice Status Codes - attr_accessor :status - - # Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved - attr_accessor :sent_to_contact - - # Shown on sales invoices (Accounts Receivable) when this has been set - attr_accessor :expected_payment_date - - # Shown on bills (Accounts Payable) when this has been set - attr_accessor :planned_payment_date - - # CIS deduction for UK contractors - attr_accessor :cis_deduction - - # Total of invoice excluding taxes - attr_accessor :sub_total - - # Total tax on invoice - attr_accessor :total_tax - - # Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts - attr_accessor :total - - # Total of discounts applied on the invoice line items - attr_accessor :total_discount - - # Xero generated unique identifier for invoice - attr_accessor :invoice_id - - # boolean to indicate if an invoice has an attachment - attr_accessor :has_attachments - - # boolean to indicate if an invoice has a discount - attr_accessor :is_discounted - - # See Payments - attr_accessor :payments - - # See Prepayments - attr_accessor :prepayments - - # See Overpayments - attr_accessor :overpayments - - # Amount remaining to be paid on invoice - attr_accessor :amount_due - - # Sum of payments received for invoice - attr_accessor :amount_paid - - # The date the invoice was fully paid. Only returned on fully paid invoices - attr_accessor :fully_paid_on_date - - # Sum of all credit notes, over-payments and pre-payments applied to invoice - attr_accessor :amount_credited - - # Last modified date UTC format - attr_accessor :updated_date_utc - - # Details of credit notes that have been applied to an invoice - attr_accessor :credit_notes - - # Displays array of attachments from the API - attr_accessor :attachments - - # A boolean to indicate if a invoice has an validation errors - attr_accessor :has_errors - - # A string to indicate if a invoice status - attr_accessor :status_attribute_string - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - # Displays array of warning messages from the API - attr_accessor :warnings - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'Type', - :'contact' => :'Contact', - :'line_items' => :'LineItems', - :'date' => :'Date', - :'due_date' => :'DueDate', - :'line_amount_types' => :'LineAmountTypes', - :'invoice_number' => :'InvoiceNumber', - :'reference' => :'Reference', - :'branding_theme_id' => :'BrandingThemeID', - :'url' => :'Url', - :'currency_code' => :'CurrencyCode', - :'currency_rate' => :'CurrencyRate', - :'status' => :'Status', - :'sent_to_contact' => :'SentToContact', - :'expected_payment_date' => :'ExpectedPaymentDate', - :'planned_payment_date' => :'PlannedPaymentDate', - :'cis_deduction' => :'CISDeduction', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'total_discount' => :'TotalDiscount', - :'invoice_id' => :'InvoiceID', - :'has_attachments' => :'HasAttachments', - :'is_discounted' => :'IsDiscounted', - :'payments' => :'Payments', - :'prepayments' => :'Prepayments', - :'overpayments' => :'Overpayments', - :'amount_due' => :'AmountDue', - :'amount_paid' => :'AmountPaid', - :'fully_paid_on_date' => :'FullyPaidOnDate', - :'amount_credited' => :'AmountCredited', - :'updated_date_utc' => :'UpdatedDateUTC', - :'credit_notes' => :'CreditNotes', - :'attachments' => :'Attachments', - :'has_errors' => :'HasErrors', - :'status_attribute_string' => :'StatusAttributeString', - :'validation_errors' => :'ValidationErrors', - :'warnings' => :'Warnings' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'contact' => :'Contact', - :'line_items' => :'Array', - :'date' => :'Date', - :'due_date' => :'Date', - :'line_amount_types' => :'LineAmountTypes', - :'invoice_number' => :'String', - :'reference' => :'String', - :'branding_theme_id' => :'String', - :'url' => :'String', - :'currency_code' => :'CurrencyCode', - :'currency_rate' => :'Float', - :'status' => :'String', - :'sent_to_contact' => :'Boolean', - :'expected_payment_date' => :'Date', - :'planned_payment_date' => :'Date', - :'cis_deduction' => :'Float', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'total_discount' => :'Float', - :'invoice_id' => :'String', - :'has_attachments' => :'Boolean', - :'is_discounted' => :'Boolean', - :'payments' => :'Array', - :'prepayments' => :'Array', - :'overpayments' => :'Array', - :'amount_due' => :'Float', - :'amount_paid' => :'Float', - :'fully_paid_on_date' => :'Date', - :'amount_credited' => :'Float', - :'updated_date_utc' => :'DateTime', - :'credit_notes' => :'Array', - :'attachments' => :'Array', - :'has_errors' => :'Boolean', - :'status_attribute_string' => :'String', - :'validation_errors' => :'Array', - :'warnings' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Invoice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Invoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'due_date') - self.due_date = attributes[:'due_date'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'invoice_number') - self.invoice_number = attributes[:'invoice_number'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'branding_theme_id') - self.branding_theme_id = attributes[:'branding_theme_id'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'sent_to_contact') - self.sent_to_contact = attributes[:'sent_to_contact'] - end - - if attributes.key?(:'expected_payment_date') - self.expected_payment_date = attributes[:'expected_payment_date'] - end - - if attributes.key?(:'planned_payment_date') - self.planned_payment_date = attributes[:'planned_payment_date'] - end - - if attributes.key?(:'cis_deduction') - self.cis_deduction = attributes[:'cis_deduction'] - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'total_discount') - self.total_discount = attributes[:'total_discount'] - end - - if attributes.key?(:'invoice_id') - self.invoice_id = attributes[:'invoice_id'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'is_discounted') - self.is_discounted = attributes[:'is_discounted'] - end - - if attributes.key?(:'payments') - if (value = attributes[:'payments']).is_a?(Array) - self.payments = value - end - end - - if attributes.key?(:'prepayments') - if (value = attributes[:'prepayments']).is_a?(Array) - self.prepayments = value - end - end - - if attributes.key?(:'overpayments') - if (value = attributes[:'overpayments']).is_a?(Array) - self.overpayments = value - end - end - - if attributes.key?(:'amount_due') - self.amount_due = attributes[:'amount_due'] - end - - if attributes.key?(:'amount_paid') - self.amount_paid = attributes[:'amount_paid'] - end - - if attributes.key?(:'fully_paid_on_date') - self.fully_paid_on_date = attributes[:'fully_paid_on_date'] - end - - if attributes.key?(:'amount_credited') - self.amount_credited = attributes[:'amount_credited'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'credit_notes') - if (value = attributes[:'credit_notes']).is_a?(Array) - self.credit_notes = value - end - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - - if attributes.key?(:'has_errors') - self.has_errors = attributes[:'has_errors'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@invoice_number.nil? && @invoice_number.to_s.length > 255 - invalid_properties.push('invalid value for "invoice_number", the character length must be smaller than or equal to 255.') - end - - if !@reference.nil? && @reference.to_s.length > 255 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 255.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCPAYCREDIT", "APOVERPAYMENT", "APPREPAYMENT", "ACCREC", "ACCRECCREDIT", "AROVERPAYMENT", "ARPREPAYMENT"]) - return false unless type_validator.valid?(@type) - return false if !@invoice_number.nil? && @invoice_number.to_s.length > 255 - return false if !@reference.nil? && @reference.to_s.length > 255 - status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCPAYCREDIT", "APOVERPAYMENT", "APPREPAYMENT", "ACCREC", "ACCRECCREDIT", "AROVERPAYMENT", "ARPREPAYMENT"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method with validation - # @param [Object] invoice_number Value to be assigned - def invoice_number=(invoice_number) - if !invoice_number.nil? && invoice_number.to_s.length > 255 - fail ArgumentError, 'invalid value for "invoice_number", the character length must be smaller than or equal to 255.' - end - - @invoice_number = invoice_number - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if !reference.nil? && reference.to_s.length > 255 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 255.' - end - - @reference = reference - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - contact == o.contact && - line_items == o.line_items && - date == o.date && - due_date == o.due_date && - line_amount_types == o.line_amount_types && - invoice_number == o.invoice_number && - reference == o.reference && - branding_theme_id == o.branding_theme_id && - url == o.url && - currency_code == o.currency_code && - currency_rate == o.currency_rate && - status == o.status && - sent_to_contact == o.sent_to_contact && - expected_payment_date == o.expected_payment_date && - planned_payment_date == o.planned_payment_date && - cis_deduction == o.cis_deduction && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - total_discount == o.total_discount && - invoice_id == o.invoice_id && - has_attachments == o.has_attachments && - is_discounted == o.is_discounted && - payments == o.payments && - prepayments == o.prepayments && - overpayments == o.overpayments && - amount_due == o.amount_due && - amount_paid == o.amount_paid && - fully_paid_on_date == o.fully_paid_on_date && - amount_credited == o.amount_credited && - updated_date_utc == o.updated_date_utc && - credit_notes == o.credit_notes && - attachments == o.attachments && - has_errors == o.has_errors && - status_attribute_string == o.status_attribute_string && - validation_errors == o.validation_errors && - warnings == o.warnings - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, contact, line_items, date, due_date, line_amount_types, invoice_number, reference, branding_theme_id, url, currency_code, currency_rate, status, sent_to_contact, expected_payment_date, planned_payment_date, cis_deduction, sub_total, total_tax, total, total_discount, invoice_id, has_attachments, is_discounted, payments, prepayments, overpayments, amount_due, amount_paid, fully_paid_on_date, amount_credited, updated_date_utc, credit_notes, attachments, has_errors, status_attribute_string, validation_errors, warnings].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/invoice_reminder.rb b/lib/xero-ruby/models/accounting/invoice_reminder.rb deleted file mode 100644 index e7d95d1c..00000000 --- a/lib/xero-ruby/models/accounting/invoice_reminder.rb +++ /dev/null @@ -1,204 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class InvoiceReminder - # setting for on or off - attr_accessor :enabled - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'enabled' => :'Enabled' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'enabled' => :'Boolean' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::InvoiceReminder` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::InvoiceReminder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'enabled') - self.enabled = attributes[:'enabled'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - enabled == o.enabled - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [enabled].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/invoice_reminders.rb b/lib/xero-ruby/models/accounting/invoice_reminders.rb deleted file mode 100644 index 200cdf51..00000000 --- a/lib/xero-ruby/models/accounting/invoice_reminders.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class InvoiceReminders - attr_accessor :invoice_reminders - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoice_reminders' => :'InvoiceReminders' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoice_reminders' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::InvoiceReminders` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::InvoiceReminders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoice_reminders') - if (value = attributes[:'invoice_reminders']).is_a?(Array) - self.invoice_reminders = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoice_reminders == o.invoice_reminders - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoice_reminders].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/invoices.rb b/lib/xero-ruby/models/accounting/invoices.rb deleted file mode 100644 index cc4ee93c..00000000 --- a/lib/xero-ruby/models/accounting/invoices.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Invoices - attr_accessor :invoices - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoices' => :'Invoices' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoices' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Invoices` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Invoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoices') - if (value = attributes[:'invoices']).is_a?(Array) - self.invoices = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoices == o.invoices - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoices].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/item.rb b/lib/xero-ruby/models/accounting/item.rb deleted file mode 100644 index 58b3c660..00000000 --- a/lib/xero-ruby/models/accounting/item.rb +++ /dev/null @@ -1,423 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Item - # User defined item code (max length = 30) - attr_accessor :code - - # The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item - attr_accessor :inventory_asset_account_code - - # The name of the item (max length = 50) - attr_accessor :name - - # Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. - attr_accessor :is_sold - - # Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. - attr_accessor :is_purchased - - # The sales description of the item (max length = 4000) - attr_accessor :description - - # The purchase description of the item (max length = 4000) - attr_accessor :purchase_description - - attr_accessor :purchase_details - - attr_accessor :sales_details - - # True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. - attr_accessor :is_tracked_as_inventory - - # The value of the item on hand. Calculated using average cost accounting. - attr_accessor :total_cost_pool - - # The quantity of the item on hand - attr_accessor :quantity_on_hand - - # Last modified date in UTC format - attr_accessor :updated_date_utc - - # The Xero identifier for an Item - attr_accessor :item_id - - # Status of object - attr_accessor :status_attribute_string - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'code' => :'Code', - :'inventory_asset_account_code' => :'InventoryAssetAccountCode', - :'name' => :'Name', - :'is_sold' => :'IsSold', - :'is_purchased' => :'IsPurchased', - :'description' => :'Description', - :'purchase_description' => :'PurchaseDescription', - :'purchase_details' => :'PurchaseDetails', - :'sales_details' => :'SalesDetails', - :'is_tracked_as_inventory' => :'IsTrackedAsInventory', - :'total_cost_pool' => :'TotalCostPool', - :'quantity_on_hand' => :'QuantityOnHand', - :'updated_date_utc' => :'UpdatedDateUTC', - :'item_id' => :'ItemID', - :'status_attribute_string' => :'StatusAttributeString', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'code' => :'String', - :'inventory_asset_account_code' => :'String', - :'name' => :'String', - :'is_sold' => :'Boolean', - :'is_purchased' => :'Boolean', - :'description' => :'String', - :'purchase_description' => :'String', - :'purchase_details' => :'Purchase', - :'sales_details' => :'Purchase', - :'is_tracked_as_inventory' => :'Boolean', - :'total_cost_pool' => :'Float', - :'quantity_on_hand' => :'Float', - :'updated_date_utc' => :'DateTime', - :'item_id' => :'String', - :'status_attribute_string' => :'String', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Item` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'inventory_asset_account_code') - self.inventory_asset_account_code = attributes[:'inventory_asset_account_code'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'is_sold') - self.is_sold = attributes[:'is_sold'] - end - - if attributes.key?(:'is_purchased') - self.is_purchased = attributes[:'is_purchased'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'purchase_description') - self.purchase_description = attributes[:'purchase_description'] - end - - if attributes.key?(:'purchase_details') - self.purchase_details = attributes[:'purchase_details'] - end - - if attributes.key?(:'sales_details') - self.sales_details = attributes[:'sales_details'] - end - - if attributes.key?(:'is_tracked_as_inventory') - self.is_tracked_as_inventory = attributes[:'is_tracked_as_inventory'] - end - - if attributes.key?(:'total_cost_pool') - self.total_cost_pool = attributes[:'total_cost_pool'] - end - - if attributes.key?(:'quantity_on_hand') - self.quantity_on_hand = attributes[:'quantity_on_hand'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'item_id') - self.item_id = attributes[:'item_id'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @code.nil? - invalid_properties.push('invalid value for "code", code cannot be nil.') - end - - if @code.to_s.length > 30 - invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 30.') - end - - if !@name.nil? && @name.to_s.length > 50 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.') - end - - if !@description.nil? && @description.to_s.length > 4000 - invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 4000.') - end - - if !@purchase_description.nil? && @purchase_description.to_s.length > 4000 - invalid_properties.push('invalid value for "purchase_description", the character length must be smaller than or equal to 4000.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @code.nil? - return false if @code.to_s.length > 30 - return false if !@name.nil? && @name.to_s.length > 50 - return false if !@description.nil? && @description.to_s.length > 4000 - return false if !@purchase_description.nil? && @purchase_description.to_s.length > 4000 - true - end - - # Custom attribute writer method with validation - # @param [Object] code Value to be assigned - def code=(code) - if code.nil? - fail ArgumentError, 'code cannot be nil' - end - - if code.to_s.length > 30 - fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 30.' - end - - @code = code - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if !name.nil? && name.to_s.length > 50 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.' - end - - @name = name - end - - # Custom attribute writer method with validation - # @param [Object] description Value to be assigned - def description=(description) - if !description.nil? && description.to_s.length > 4000 - fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4000.' - end - - @description = description - end - - # Custom attribute writer method with validation - # @param [Object] purchase_description Value to be assigned - def purchase_description=(purchase_description) - if !purchase_description.nil? && purchase_description.to_s.length > 4000 - fail ArgumentError, 'invalid value for "purchase_description", the character length must be smaller than or equal to 4000.' - end - - @purchase_description = purchase_description - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - code == o.code && - inventory_asset_account_code == o.inventory_asset_account_code && - name == o.name && - is_sold == o.is_sold && - is_purchased == o.is_purchased && - description == o.description && - purchase_description == o.purchase_description && - purchase_details == o.purchase_details && - sales_details == o.sales_details && - is_tracked_as_inventory == o.is_tracked_as_inventory && - total_cost_pool == o.total_cost_pool && - quantity_on_hand == o.quantity_on_hand && - updated_date_utc == o.updated_date_utc && - item_id == o.item_id && - status_attribute_string == o.status_attribute_string && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [code, inventory_asset_account_code, name, is_sold, is_purchased, description, purchase_description, purchase_details, sales_details, is_tracked_as_inventory, total_cost_pool, quantity_on_hand, updated_date_utc, item_id, status_attribute_string, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/items.rb b/lib/xero-ruby/models/accounting/items.rb deleted file mode 100644 index c3629e26..00000000 --- a/lib/xero-ruby/models/accounting/items.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Items - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'items' => :'Items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'items' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Items` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Items`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/journal.rb b/lib/xero-ruby/models/accounting/journal.rb deleted file mode 100644 index 6f04470a..00000000 --- a/lib/xero-ruby/models/accounting/journal.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Journal - # Xero identifier - attr_accessor :journal_id - - # Date the journal was posted - attr_accessor :journal_date - - # Xero generated journal number - attr_accessor :journal_number - - # Created date UTC format - attr_accessor :created_date_utc - - # reference field for additional indetifying information - attr_accessor :reference - - # The identifier for the source transaction (e.g. InvoiceID) - attr_accessor :source_id - - # The journal source type. The type of transaction that created the journal - attr_accessor :source_type - - # See JournalLines - attr_accessor :journal_lines - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'journal_id' => :'JournalID', - :'journal_date' => :'JournalDate', - :'journal_number' => :'JournalNumber', - :'created_date_utc' => :'CreatedDateUTC', - :'reference' => :'Reference', - :'source_id' => :'SourceID', - :'source_type' => :'SourceType', - :'journal_lines' => :'JournalLines' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'journal_id' => :'String', - :'journal_date' => :'Date', - :'journal_number' => :'Integer', - :'created_date_utc' => :'DateTime', - :'reference' => :'String', - :'source_id' => :'String', - :'source_type' => :'String', - :'journal_lines' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Journal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Journal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'journal_id') - self.journal_id = attributes[:'journal_id'] - end - - if attributes.key?(:'journal_date') - self.journal_date = attributes[:'journal_date'] - end - - if attributes.key?(:'journal_number') - self.journal_number = attributes[:'journal_number'] - end - - if attributes.key?(:'created_date_utc') - self.created_date_utc = attributes[:'created_date_utc'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'source_id') - self.source_id = attributes[:'source_id'] - end - - if attributes.key?(:'source_type') - self.source_type = attributes[:'source_type'] - end - - if attributes.key?(:'journal_lines') - if (value = attributes[:'journal_lines']).is_a?(Array) - self.journal_lines = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - source_type_validator = EnumAttributeValidator.new('String', ["ACCREC", "ACCPAY", "ACCRECCREDIT", "ACCPAYCREDIT", "ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "CASHREC", "CASHPAID", "TRANSFER", "ARPREPAYMENT", "APPREPAYMENT", "AROVERPAYMENT", "APOVERPAYMENT", "EXPCLAIM", "EXPPAYMENT", "MANJOURNAL", "PAYSLIP", "WAGEPAYABLE", "INTEGRATEDPAYROLLPE", "INTEGRATEDPAYROLLPT", "EXTERNALSPENDMONEY", "INTEGRATEDPAYROLLPTPAYMENT", "INTEGRATEDPAYROLLCN"]) - return false unless source_type_validator.valid?(@source_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] source_type Object to be assigned - def source_type=(source_type) - validator = EnumAttributeValidator.new('String', ["ACCREC", "ACCPAY", "ACCRECCREDIT", "ACCPAYCREDIT", "ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "CASHREC", "CASHPAID", "TRANSFER", "ARPREPAYMENT", "APPREPAYMENT", "AROVERPAYMENT", "APOVERPAYMENT", "EXPCLAIM", "EXPPAYMENT", "MANJOURNAL", "PAYSLIP", "WAGEPAYABLE", "INTEGRATEDPAYROLLPE", "INTEGRATEDPAYROLLPT", "EXTERNALSPENDMONEY", "INTEGRATEDPAYROLLPTPAYMENT", "INTEGRATEDPAYROLLCN"]) - unless validator.valid?(source_type) - fail ArgumentError, "invalid value for \"source_type\", must be one of #{validator.allowable_values}." - end - @source_type = source_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - journal_id == o.journal_id && - journal_date == o.journal_date && - journal_number == o.journal_number && - created_date_utc == o.created_date_utc && - reference == o.reference && - source_id == o.source_id && - source_type == o.source_type && - journal_lines == o.journal_lines - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [journal_id, journal_date, journal_number, created_date_utc, reference, source_id, source_type, journal_lines].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/journal_line.rb b/lib/xero-ruby/models/accounting/journal_line.rb deleted file mode 100644 index ec32b466..00000000 --- a/lib/xero-ruby/models/accounting/journal_line.rb +++ /dev/null @@ -1,315 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class JournalLine - # Xero identifier for Journal - attr_accessor :journal_line_id - - # See Accounts - attr_accessor :account_id - - # See Accounts - attr_accessor :account_code - - attr_accessor :account_type - - # See AccountCodes - attr_accessor :account_name - - # The description from the source transaction line item. Only returned if populated. - attr_accessor :description - - # Net amount of journal line. This will be a positive value for a debit and negative for a credit - attr_accessor :net_amount - - # Gross amount of journal line (NetAmount + TaxAmount). - attr_accessor :gross_amount - - # Total tax on a journal line - attr_accessor :tax_amount - - # The tax type from TaxRates - attr_accessor :tax_type - - # see TaxRates - attr_accessor :tax_name - - # Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements. - attr_accessor :tracking_categories - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'journal_line_id' => :'JournalLineID', - :'account_id' => :'AccountID', - :'account_code' => :'AccountCode', - :'account_type' => :'AccountType', - :'account_name' => :'AccountName', - :'description' => :'Description', - :'net_amount' => :'NetAmount', - :'gross_amount' => :'GrossAmount', - :'tax_amount' => :'TaxAmount', - :'tax_type' => :'TaxType', - :'tax_name' => :'TaxName', - :'tracking_categories' => :'TrackingCategories' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'journal_line_id' => :'String', - :'account_id' => :'String', - :'account_code' => :'String', - :'account_type' => :'AccountType', - :'account_name' => :'String', - :'description' => :'String', - :'net_amount' => :'Float', - :'gross_amount' => :'Float', - :'tax_amount' => :'Float', - :'tax_type' => :'String', - :'tax_name' => :'String', - :'tracking_categories' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::JournalLine` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::JournalLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'journal_line_id') - self.journal_line_id = attributes[:'journal_line_id'] - end - - if attributes.key?(:'account_id') - self.account_id = attributes[:'account_id'] - end - - if attributes.key?(:'account_code') - self.account_code = attributes[:'account_code'] - end - - if attributes.key?(:'account_type') - self.account_type = attributes[:'account_type'] - end - - if attributes.key?(:'account_name') - self.account_name = attributes[:'account_name'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'net_amount') - self.net_amount = attributes[:'net_amount'] - end - - if attributes.key?(:'gross_amount') - self.gross_amount = attributes[:'gross_amount'] - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - - if attributes.key?(:'tax_name') - self.tax_name = attributes[:'tax_name'] - end - - if attributes.key?(:'tracking_categories') - if (value = attributes[:'tracking_categories']).is_a?(Array) - self.tracking_categories = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - journal_line_id == o.journal_line_id && - account_id == o.account_id && - account_code == o.account_code && - account_type == o.account_type && - account_name == o.account_name && - description == o.description && - net_amount == o.net_amount && - gross_amount == o.gross_amount && - tax_amount == o.tax_amount && - tax_type == o.tax_type && - tax_name == o.tax_name && - tracking_categories == o.tracking_categories - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [journal_line_id, account_id, account_code, account_type, account_name, description, net_amount, gross_amount, tax_amount, tax_type, tax_name, tracking_categories].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/journals.rb b/lib/xero-ruby/models/accounting/journals.rb deleted file mode 100644 index 5db857c3..00000000 --- a/lib/xero-ruby/models/accounting/journals.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Journals - attr_accessor :journals - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'journals' => :'Journals' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'journals' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Journals` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Journals`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'journals') - if (value = attributes[:'journals']).is_a?(Array) - self.journals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - journals == o.journals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [journals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/line_amount_types.rb b/lib/xero-ruby/models/accounting/line_amount_types.rb deleted file mode 100644 index 326670a3..00000000 --- a/lib/xero-ruby/models/accounting/line_amount_types.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class LineAmountTypes - EXCLUSIVE = "Exclusive".freeze - INCLUSIVE = "Inclusive".freeze - NO_TAX = "NoTax".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = LineAmountTypes.constants.select { |c| LineAmountTypes::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #LineAmountTypes" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/line_item.rb b/lib/xero-ruby/models/accounting/line_item.rb deleted file mode 100644 index 0a21912a..00000000 --- a/lib/xero-ruby/models/accounting/line_item.rb +++ /dev/null @@ -1,326 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class LineItem - # LineItem unique ID - attr_accessor :line_item_id - - # Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character - attr_accessor :description - - # LineItem Quantity - attr_accessor :quantity - - # LineItem Unit Amount - attr_accessor :unit_amount - - # See Items - attr_accessor :item_code - - # See Accounts - attr_accessor :account_code - - # The tax type from TaxRates - attr_accessor :tax_type - - # The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. - attr_accessor :tax_amount - - # If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) - attr_accessor :line_amount - - # Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 elements. - attr_accessor :tracking - - # Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts - attr_accessor :discount_rate - - # Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. - attr_accessor :discount_amount - - # The Xero identifier for a Repeating Invoice - attr_accessor :repeating_invoice_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'line_item_id' => :'LineItemID', - :'description' => :'Description', - :'quantity' => :'Quantity', - :'unit_amount' => :'UnitAmount', - :'item_code' => :'ItemCode', - :'account_code' => :'AccountCode', - :'tax_type' => :'TaxType', - :'tax_amount' => :'TaxAmount', - :'line_amount' => :'LineAmount', - :'tracking' => :'Tracking', - :'discount_rate' => :'DiscountRate', - :'discount_amount' => :'DiscountAmount', - :'repeating_invoice_id' => :'RepeatingInvoiceID' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'line_item_id' => :'String', - :'description' => :'String', - :'quantity' => :'Float', - :'unit_amount' => :'Float', - :'item_code' => :'String', - :'account_code' => :'String', - :'tax_type' => :'String', - :'tax_amount' => :'Float', - :'line_amount' => :'Float', - :'tracking' => :'Array', - :'discount_rate' => :'Float', - :'discount_amount' => :'Float', - :'repeating_invoice_id' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LineItem` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LineItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'line_item_id') - self.line_item_id = attributes[:'line_item_id'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'quantity') - self.quantity = attributes[:'quantity'] - end - - if attributes.key?(:'unit_amount') - self.unit_amount = attributes[:'unit_amount'] - end - - if attributes.key?(:'item_code') - self.item_code = attributes[:'item_code'] - end - - if attributes.key?(:'account_code') - self.account_code = attributes[:'account_code'] - end - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'line_amount') - self.line_amount = attributes[:'line_amount'] - end - - if attributes.key?(:'tracking') - if (value = attributes[:'tracking']).is_a?(Array) - self.tracking = value - end - end - - if attributes.key?(:'discount_rate') - self.discount_rate = attributes[:'discount_rate'] - end - - if attributes.key?(:'discount_amount') - self.discount_amount = attributes[:'discount_amount'] - end - - if attributes.key?(:'repeating_invoice_id') - self.repeating_invoice_id = attributes[:'repeating_invoice_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - line_item_id == o.line_item_id && - description == o.description && - quantity == o.quantity && - unit_amount == o.unit_amount && - item_code == o.item_code && - account_code == o.account_code && - tax_type == o.tax_type && - tax_amount == o.tax_amount && - line_amount == o.line_amount && - tracking == o.tracking && - discount_rate == o.discount_rate && - discount_amount == o.discount_amount && - repeating_invoice_id == o.repeating_invoice_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [line_item_id, description, quantity, unit_amount, item_code, account_code, tax_type, tax_amount, line_amount, tracking, discount_rate, discount_amount, repeating_invoice_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/line_item_tracking.rb b/lib/xero-ruby/models/accounting/line_item_tracking.rb deleted file mode 100644 index c761b408..00000000 --- a/lib/xero-ruby/models/accounting/line_item_tracking.rb +++ /dev/null @@ -1,249 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class LineItemTracking - # The Xero identifier for a tracking category - attr_accessor :tracking_category_id - - # The Xero identifier for a tracking category option - attr_accessor :tracking_option_id - - # The name of the tracking category - attr_accessor :name - - # See Tracking Options - attr_accessor :option - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tracking_category_id' => :'TrackingCategoryID', - :'tracking_option_id' => :'TrackingOptionID', - :'name' => :'Name', - :'option' => :'Option' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tracking_category_id' => :'String', - :'tracking_option_id' => :'String', - :'name' => :'String', - :'option' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LineItemTracking` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LineItemTracking`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tracking_category_id') - self.tracking_category_id = attributes[:'tracking_category_id'] - end - - if attributes.key?(:'tracking_option_id') - self.tracking_option_id = attributes[:'tracking_option_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'option') - self.option = attributes[:'option'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@name.nil? && @name.to_s.length > 100 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@name.nil? && @name.to_s.length > 100 - true - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if !name.nil? && name.to_s.length > 100 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' - end - - @name = name - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tracking_category_id == o.tracking_category_id && - tracking_option_id == o.tracking_option_id && - name == o.name && - option == o.option - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tracking_category_id, tracking_option_id, name, option].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/linked_transaction.rb b/lib/xero-ruby/models/accounting/linked_transaction.rb deleted file mode 100644 index 84ec1f5b..00000000 --- a/lib/xero-ruby/models/accounting/linked_transaction.rb +++ /dev/null @@ -1,364 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class LinkedTransaction - # Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice - attr_accessor :source_transaction_id - - # The line item identifier from the source transaction. - attr_accessor :source_line_item_id - - # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - attr_accessor :contact_id - - # Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice - attr_accessor :target_transaction_id - - # The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. - attr_accessor :target_line_item_id - - # The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 - attr_accessor :linked_transaction_id - - # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. - attr_accessor :status - - # This will always be BILLABLEEXPENSE. More types may be added in future. - attr_accessor :type - - # The last modified date in UTC format - attr_accessor :updated_date_utc - - # The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. - attr_accessor :source_transaction_type_code - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'source_transaction_id' => :'SourceTransactionID', - :'source_line_item_id' => :'SourceLineItemID', - :'contact_id' => :'ContactID', - :'target_transaction_id' => :'TargetTransactionID', - :'target_line_item_id' => :'TargetLineItemID', - :'linked_transaction_id' => :'LinkedTransactionID', - :'status' => :'Status', - :'type' => :'Type', - :'updated_date_utc' => :'UpdatedDateUTC', - :'source_transaction_type_code' => :'SourceTransactionTypeCode', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'source_transaction_id' => :'String', - :'source_line_item_id' => :'String', - :'contact_id' => :'String', - :'target_transaction_id' => :'String', - :'target_line_item_id' => :'String', - :'linked_transaction_id' => :'String', - :'status' => :'String', - :'type' => :'String', - :'updated_date_utc' => :'DateTime', - :'source_transaction_type_code' => :'String', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LinkedTransaction` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LinkedTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'source_transaction_id') - self.source_transaction_id = attributes[:'source_transaction_id'] - end - - if attributes.key?(:'source_line_item_id') - self.source_line_item_id = attributes[:'source_line_item_id'] - end - - if attributes.key?(:'contact_id') - self.contact_id = attributes[:'contact_id'] - end - - if attributes.key?(:'target_transaction_id') - self.target_transaction_id = attributes[:'target_transaction_id'] - end - - if attributes.key?(:'target_line_item_id') - self.target_line_item_id = attributes[:'target_line_item_id'] - end - - if attributes.key?(:'linked_transaction_id') - self.linked_transaction_id = attributes[:'linked_transaction_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'source_transaction_type_code') - self.source_transaction_type_code = attributes[:'source_transaction_type_code'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["APPROVED", "DRAFT", "ONDRAFT", "BILLED", "VOIDED"]) - return false unless status_validator.valid?(@status) - type_validator = EnumAttributeValidator.new('String', ["BILLABLEEXPENSE"]) - return false unless type_validator.valid?(@type) - source_transaction_type_code_validator = EnumAttributeValidator.new('String', ["ACCPAY", "SPEND"]) - return false unless source_transaction_type_code_validator.valid?(@source_transaction_type_code) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["APPROVED", "DRAFT", "ONDRAFT", "BILLED", "VOIDED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["BILLABLEEXPENSE"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] source_transaction_type_code Object to be assigned - def source_transaction_type_code=(source_transaction_type_code) - validator = EnumAttributeValidator.new('String', ["ACCPAY", "SPEND"]) - unless validator.valid?(source_transaction_type_code) - fail ArgumentError, "invalid value for \"source_transaction_type_code\", must be one of #{validator.allowable_values}." - end - @source_transaction_type_code = source_transaction_type_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - source_transaction_id == o.source_transaction_id && - source_line_item_id == o.source_line_item_id && - contact_id == o.contact_id && - target_transaction_id == o.target_transaction_id && - target_line_item_id == o.target_line_item_id && - linked_transaction_id == o.linked_transaction_id && - status == o.status && - type == o.type && - updated_date_utc == o.updated_date_utc && - source_transaction_type_code == o.source_transaction_type_code && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [source_transaction_id, source_line_item_id, contact_id, target_transaction_id, target_line_item_id, linked_transaction_id, status, type, updated_date_utc, source_transaction_type_code, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/linked_transactions.rb b/lib/xero-ruby/models/accounting/linked_transactions.rb deleted file mode 100644 index 9cfb4a43..00000000 --- a/lib/xero-ruby/models/accounting/linked_transactions.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class LinkedTransactions - attr_accessor :linked_transactions - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'linked_transactions' => :'LinkedTransactions' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'linked_transactions' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LinkedTransactions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LinkedTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'linked_transactions') - if (value = attributes[:'linked_transactions']).is_a?(Array) - self.linked_transactions = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - linked_transactions == o.linked_transactions - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [linked_transactions].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/manual_journal.rb b/lib/xero-ruby/models/accounting/manual_journal.rb deleted file mode 100644 index 911dcc1f..00000000 --- a/lib/xero-ruby/models/accounting/manual_journal.rb +++ /dev/null @@ -1,382 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ManualJournal - # Description of journal being posted - attr_accessor :narration - - # See JournalLines - attr_accessor :journal_lines - - # Date journal was posted – YYYY-MM-DD - attr_accessor :date - - attr_accessor :line_amount_types - - # See Manual Journal Status Codes - attr_accessor :status - - # Url link to a source document – shown as “Go to [appName]” in the Xero app - attr_accessor :url - - # Boolean – default is true if not specified - attr_accessor :show_on_cash_basis_reports - - # Boolean to indicate if a manual journal has an attachment - attr_accessor :has_attachments - - # Last modified date UTC format - attr_accessor :updated_date_utc - - # The Xero identifier for a Manual Journal - attr_accessor :manual_journal_id - - # A string to indicate if a invoice status - attr_accessor :status_attribute_string - - # Displays array of warning messages from the API - attr_accessor :warnings - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - # Displays array of attachments from the API - attr_accessor :attachments - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'narration' => :'Narration', - :'journal_lines' => :'JournalLines', - :'date' => :'Date', - :'line_amount_types' => :'LineAmountTypes', - :'status' => :'Status', - :'url' => :'Url', - :'show_on_cash_basis_reports' => :'ShowOnCashBasisReports', - :'has_attachments' => :'HasAttachments', - :'updated_date_utc' => :'UpdatedDateUTC', - :'manual_journal_id' => :'ManualJournalID', - :'status_attribute_string' => :'StatusAttributeString', - :'warnings' => :'Warnings', - :'validation_errors' => :'ValidationErrors', - :'attachments' => :'Attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'narration' => :'String', - :'journal_lines' => :'Array', - :'date' => :'Date', - :'line_amount_types' => :'LineAmountTypes', - :'status' => :'String', - :'url' => :'String', - :'show_on_cash_basis_reports' => :'Boolean', - :'has_attachments' => :'Boolean', - :'updated_date_utc' => :'DateTime', - :'manual_journal_id' => :'String', - :'status_attribute_string' => :'String', - :'warnings' => :'Array', - :'validation_errors' => :'Array', - :'attachments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ManualJournal` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ManualJournal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'narration') - self.narration = attributes[:'narration'] - end - - if attributes.key?(:'journal_lines') - if (value = attributes[:'journal_lines']).is_a?(Array) - self.journal_lines = value - end - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'show_on_cash_basis_reports') - self.show_on_cash_basis_reports = attributes[:'show_on_cash_basis_reports'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'manual_journal_id') - self.manual_journal_id = attributes[:'manual_journal_id'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @narration.nil? - invalid_properties.push('invalid value for "narration", narration cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @narration.nil? - status_validator = EnumAttributeValidator.new('String', ["DRAFT", "POSTED", "DELETED", "VOIDED", "ARCHIVED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["DRAFT", "POSTED", "DELETED", "VOIDED", "ARCHIVED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - narration == o.narration && - journal_lines == o.journal_lines && - date == o.date && - line_amount_types == o.line_amount_types && - status == o.status && - url == o.url && - show_on_cash_basis_reports == o.show_on_cash_basis_reports && - has_attachments == o.has_attachments && - updated_date_utc == o.updated_date_utc && - manual_journal_id == o.manual_journal_id && - status_attribute_string == o.status_attribute_string && - warnings == o.warnings && - validation_errors == o.validation_errors && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [narration, journal_lines, date, line_amount_types, status, url, show_on_cash_basis_reports, has_attachments, updated_date_utc, manual_journal_id, status_attribute_string, warnings, validation_errors, attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/manual_journal_line.rb b/lib/xero-ruby/models/accounting/manual_journal_line.rb deleted file mode 100644 index 98ec2128..00000000 --- a/lib/xero-ruby/models/accounting/manual_journal_line.rb +++ /dev/null @@ -1,266 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ManualJournalLine - # total for line. Debits are positive, credits are negative value - attr_accessor :line_amount - - # See Accounts - attr_accessor :account_code - - # Description for journal line - attr_accessor :description - - # The tax type from TaxRates - attr_accessor :tax_type - - # Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements. - attr_accessor :tracking - - # The calculated tax amount based on the TaxType and LineAmount - attr_accessor :tax_amount - - # is the line blank - attr_accessor :is_blank - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'line_amount' => :'LineAmount', - :'account_code' => :'AccountCode', - :'description' => :'Description', - :'tax_type' => :'TaxType', - :'tracking' => :'Tracking', - :'tax_amount' => :'TaxAmount', - :'is_blank' => :'IsBlank' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'line_amount' => :'Float', - :'account_code' => :'String', - :'description' => :'String', - :'tax_type' => :'String', - :'tracking' => :'Array', - :'tax_amount' => :'Float', - :'is_blank' => :'Boolean' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ManualJournalLine` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ManualJournalLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'line_amount') - self.line_amount = attributes[:'line_amount'] - end - - if attributes.key?(:'account_code') - self.account_code = attributes[:'account_code'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - - if attributes.key?(:'tracking') - if (value = attributes[:'tracking']).is_a?(Array) - self.tracking = value - end - end - - if attributes.key?(:'tax_amount') - self.tax_amount = attributes[:'tax_amount'] - end - - if attributes.key?(:'is_blank') - self.is_blank = attributes[:'is_blank'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - line_amount == o.line_amount && - account_code == o.account_code && - description == o.description && - tax_type == o.tax_type && - tracking == o.tracking && - tax_amount == o.tax_amount && - is_blank == o.is_blank - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [line_amount, account_code, description, tax_type, tracking, tax_amount, is_blank].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/manual_journals.rb b/lib/xero-ruby/models/accounting/manual_journals.rb deleted file mode 100644 index ad8cf84d..00000000 --- a/lib/xero-ruby/models/accounting/manual_journals.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ManualJournals - attr_accessor :manual_journals - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'manual_journals' => :'ManualJournals' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'manual_journals' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ManualJournals` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ManualJournals`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'manual_journals') - if (value = attributes[:'manual_journals']).is_a?(Array) - self.manual_journals = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - manual_journals == o.manual_journals - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [manual_journals].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/online_invoice.rb b/lib/xero-ruby/models/accounting/online_invoice.rb deleted file mode 100644 index 6d61ef5d..00000000 --- a/lib/xero-ruby/models/accounting/online_invoice.rb +++ /dev/null @@ -1,204 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class OnlineInvoice - # the URL to an online invoice - attr_accessor :online_invoice_url - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'online_invoice_url' => :'OnlineInvoiceUrl' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'online_invoice_url' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::OnlineInvoice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::OnlineInvoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'online_invoice_url') - self.online_invoice_url = attributes[:'online_invoice_url'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - online_invoice_url == o.online_invoice_url - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [online_invoice_url].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/online_invoices.rb b/lib/xero-ruby/models/accounting/online_invoices.rb deleted file mode 100644 index 78165c40..00000000 --- a/lib/xero-ruby/models/accounting/online_invoices.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class OnlineInvoices - attr_accessor :online_invoices - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'online_invoices' => :'OnlineInvoices' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'online_invoices' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::OnlineInvoices` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::OnlineInvoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'online_invoices') - if (value = attributes[:'online_invoices']).is_a?(Array) - self.online_invoices = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - online_invoices == o.online_invoices - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [online_invoices].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb deleted file mode 100644 index c9ff663a..00000000 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ /dev/null @@ -1,622 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Organisation - # Unique Xero identifier - attr_accessor :organisation_id - - # Display a unique key used for Xero-to-Xero transactions - attr_accessor :api_key - - # Display name of organisation shown in Xero - attr_accessor :name - - # Organisation name shown on Reports - attr_accessor :legal_name - - # Boolean to describe if organisation is registered with a local tax authority i.e. true, false - attr_accessor :pays_tax - - # See Version Types - attr_accessor :version - - # Organisation Type - attr_accessor :organisation_type - - attr_accessor :base_currency - - attr_accessor :country_code - - # Boolean to describe if organisation is a demo company. - attr_accessor :is_demo_company - - # Will be set to ACTIVE if you can connect to organisation via the Xero API - attr_accessor :organisation_status - - # Shows for New Zealand, Australian and UK organisations - attr_accessor :registration_number - - # Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). - attr_accessor :tax_number - - # Calendar day e.g. 0-31 - attr_accessor :financial_year_end_day - - # Calendar Month e.g. 1-12 - attr_accessor :financial_year_end_month - - # The accounting basis used for tax returns. See Sales Tax Basis - attr_accessor :sales_tax_basis - - # The frequency with which tax returns are processed. See Sales Tax Period - attr_accessor :sales_tax_period - - # The default for LineAmountTypes on sales transactions - attr_accessor :default_sales_tax - - # The default for LineAmountTypes on purchase transactions - attr_accessor :default_purchases_tax - - # Shown if set. See lock dates - attr_accessor :period_lock_date - - # Shown if set. See lock dates - attr_accessor :end_of_year_lock_date - - # Timestamp when the organisation was created in Xero - attr_accessor :created_date_utc - - attr_accessor :timezone - - # Organisation Type - attr_accessor :organisation_entity_type - - # A unique identifier for the organisation. Potential uses. - attr_accessor :short_code - - # Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) - attr_accessor :_class - - # BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) - attr_accessor :edition - - # Description of business type as defined in Organisation settings - attr_accessor :line_of_business - - # Address details for organisation – see Addresses - attr_accessor :addresses - - # Phones details for organisation – see Phones - attr_accessor :phones - - # Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below - attr_accessor :external_links - - attr_accessor :payment_terms - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organisation_id' => :'OrganisationID', - :'api_key' => :'APIKey', - :'name' => :'Name', - :'legal_name' => :'LegalName', - :'pays_tax' => :'PaysTax', - :'version' => :'Version', - :'organisation_type' => :'OrganisationType', - :'base_currency' => :'BaseCurrency', - :'country_code' => :'CountryCode', - :'is_demo_company' => :'IsDemoCompany', - :'organisation_status' => :'OrganisationStatus', - :'registration_number' => :'RegistrationNumber', - :'tax_number' => :'TaxNumber', - :'financial_year_end_day' => :'FinancialYearEndDay', - :'financial_year_end_month' => :'FinancialYearEndMonth', - :'sales_tax_basis' => :'SalesTaxBasis', - :'sales_tax_period' => :'SalesTaxPeriod', - :'default_sales_tax' => :'DefaultSalesTax', - :'default_purchases_tax' => :'DefaultPurchasesTax', - :'period_lock_date' => :'PeriodLockDate', - :'end_of_year_lock_date' => :'EndOfYearLockDate', - :'created_date_utc' => :'CreatedDateUTC', - :'timezone' => :'Timezone', - :'organisation_entity_type' => :'OrganisationEntityType', - :'short_code' => :'ShortCode', - :'_class' => :'Class', - :'edition' => :'Edition', - :'line_of_business' => :'LineOfBusiness', - :'addresses' => :'Addresses', - :'phones' => :'Phones', - :'external_links' => :'ExternalLinks', - :'payment_terms' => :'PaymentTerms' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'organisation_id' => :'String', - :'api_key' => :'String', - :'name' => :'String', - :'legal_name' => :'String', - :'pays_tax' => :'Boolean', - :'version' => :'String', - :'organisation_type' => :'String', - :'base_currency' => :'CurrencyCode', - :'country_code' => :'CountryCode', - :'is_demo_company' => :'Boolean', - :'organisation_status' => :'String', - :'registration_number' => :'String', - :'tax_number' => :'String', - :'financial_year_end_day' => :'Integer', - :'financial_year_end_month' => :'Integer', - :'sales_tax_basis' => :'String', - :'sales_tax_period' => :'String', - :'default_sales_tax' => :'String', - :'default_purchases_tax' => :'String', - :'period_lock_date' => :'Date', - :'end_of_year_lock_date' => :'Date', - :'created_date_utc' => :'DateTime', - :'timezone' => :'TimeZone', - :'organisation_entity_type' => :'String', - :'short_code' => :'String', - :'_class' => :'String', - :'edition' => :'String', - :'line_of_business' => :'String', - :'addresses' => :'Array
', - :'phones' => :'Array', - :'external_links' => :'Array', - :'payment_terms' => :'PaymentTerm' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Organisation` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Organisation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organisation_id') - self.organisation_id = attributes[:'organisation_id'] - end - - if attributes.key?(:'api_key') - self.api_key = attributes[:'api_key'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'legal_name') - self.legal_name = attributes[:'legal_name'] - end - - if attributes.key?(:'pays_tax') - self.pays_tax = attributes[:'pays_tax'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end - - if attributes.key?(:'organisation_type') - self.organisation_type = attributes[:'organisation_type'] - end - - if attributes.key?(:'base_currency') - self.base_currency = attributes[:'base_currency'] - end - - if attributes.key?(:'country_code') - self.country_code = attributes[:'country_code'] - end - - if attributes.key?(:'is_demo_company') - self.is_demo_company = attributes[:'is_demo_company'] - end - - if attributes.key?(:'organisation_status') - self.organisation_status = attributes[:'organisation_status'] - end - - if attributes.key?(:'registration_number') - self.registration_number = attributes[:'registration_number'] - end - - if attributes.key?(:'tax_number') - self.tax_number = attributes[:'tax_number'] - end - - if attributes.key?(:'financial_year_end_day') - self.financial_year_end_day = attributes[:'financial_year_end_day'] - end - - if attributes.key?(:'financial_year_end_month') - self.financial_year_end_month = attributes[:'financial_year_end_month'] - end - - if attributes.key?(:'sales_tax_basis') - self.sales_tax_basis = attributes[:'sales_tax_basis'] - end - - if attributes.key?(:'sales_tax_period') - self.sales_tax_period = attributes[:'sales_tax_period'] - end - - if attributes.key?(:'default_sales_tax') - self.default_sales_tax = attributes[:'default_sales_tax'] - end - - if attributes.key?(:'default_purchases_tax') - self.default_purchases_tax = attributes[:'default_purchases_tax'] - end - - if attributes.key?(:'period_lock_date') - self.period_lock_date = attributes[:'period_lock_date'] - end - - if attributes.key?(:'end_of_year_lock_date') - self.end_of_year_lock_date = attributes[:'end_of_year_lock_date'] - end - - if attributes.key?(:'created_date_utc') - self.created_date_utc = attributes[:'created_date_utc'] - end - - if attributes.key?(:'timezone') - self.timezone = attributes[:'timezone'] - end - - if attributes.key?(:'organisation_entity_type') - self.organisation_entity_type = attributes[:'organisation_entity_type'] - end - - if attributes.key?(:'short_code') - self.short_code = attributes[:'short_code'] - end - - if attributes.key?(:'_class') - self._class = attributes[:'_class'] - end - - if attributes.key?(:'edition') - self.edition = attributes[:'edition'] - end - - if attributes.key?(:'line_of_business') - self.line_of_business = attributes[:'line_of_business'] - end - - if attributes.key?(:'addresses') - if (value = attributes[:'addresses']).is_a?(Array) - self.addresses = value - end - end - - if attributes.key?(:'phones') - if (value = attributes[:'phones']).is_a?(Array) - self.phones = value - end - end - - if attributes.key?(:'external_links') - if (value = attributes[:'external_links']).is_a?(Array) - self.external_links = value - end - end - - if attributes.key?(:'payment_terms') - self.payment_terms = attributes[:'payment_terms'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - version_validator = EnumAttributeValidator.new('String', ["AU", "NZ", "GLOBAL", "UK", "US", "AUONRAMP", "NZONRAMP", "GLOBALONRAMP", "UKONRAMP", "USONRAMP"]) - return false unless version_validator.valid?(@version) - organisation_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) - return false unless organisation_type_validator.valid?(@organisation_type) - sales_tax_basis_validator = EnumAttributeValidator.new('String', ["PAYMENTS", "INVOICE", "NONE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS"]) - return false unless sales_tax_basis_validator.valid?(@sales_tax_basis) - sales_tax_period_validator = EnumAttributeValidator.new('String', ["MONTHLY", "QUARTERLY1", "QUARTERLY2", "QUARTERLY3", "ANNUALLY", "ONEMONTHS", "TWOMONTHS", "SIXMONTHS", "1MONTHLY", "2MONTHLY", "3MONTHLY", "6MONTHLY", "QUARTERLY", "YEARLY", "NONE"]) - return false unless sales_tax_period_validator.valid?(@sales_tax_period) - organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) - return false unless organisation_entity_type_validator.valid?(@organisation_entity_type) - _class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK"]) - return false unless _class_validator.valid?(@_class) - edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"]) - return false unless edition_validator.valid?(@edition) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] version Object to be assigned - def version=(version) - validator = EnumAttributeValidator.new('String', ["AU", "NZ", "GLOBAL", "UK", "US", "AUONRAMP", "NZONRAMP", "GLOBALONRAMP", "UKONRAMP", "USONRAMP"]) - unless validator.valid?(version) - fail ArgumentError, "invalid value for \"version\", must be one of #{validator.allowable_values}." - end - @version = version - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] organisation_type Object to be assigned - def organisation_type=(organisation_type) - validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) - unless validator.valid?(organisation_type) - fail ArgumentError, "invalid value for \"organisation_type\", must be one of #{validator.allowable_values}." - end - @organisation_type = organisation_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] sales_tax_basis Object to be assigned - def sales_tax_basis=(sales_tax_basis) - validator = EnumAttributeValidator.new('String', ["PAYMENTS", "INVOICE", "NONE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS"]) - unless validator.valid?(sales_tax_basis) - fail ArgumentError, "invalid value for \"sales_tax_basis\", must be one of #{validator.allowable_values}." - end - @sales_tax_basis = sales_tax_basis - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] sales_tax_period Object to be assigned - def sales_tax_period=(sales_tax_period) - validator = EnumAttributeValidator.new('String', ["MONTHLY", "QUARTERLY1", "QUARTERLY2", "QUARTERLY3", "ANNUALLY", "ONEMONTHS", "TWOMONTHS", "SIXMONTHS", "1MONTHLY", "2MONTHLY", "3MONTHLY", "6MONTHLY", "QUARTERLY", "YEARLY", "NONE"]) - unless validator.valid?(sales_tax_period) - fail ArgumentError, "invalid value for \"sales_tax_period\", must be one of #{validator.allowable_values}." - end - @sales_tax_period = sales_tax_period - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] organisation_entity_type Object to be assigned - def organisation_entity_type=(organisation_entity_type) - validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) - unless validator.valid?(organisation_entity_type) - fail ArgumentError, "invalid value for \"organisation_entity_type\", must be one of #{validator.allowable_values}." - end - @organisation_entity_type = organisation_entity_type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] _class Object to be assigned - def _class=(_class) - validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK"]) - unless validator.valid?(_class) - fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}." - end - @_class = _class - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] edition Object to be assigned - def edition=(edition) - validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"]) - unless validator.valid?(edition) - fail ArgumentError, "invalid value for \"edition\", must be one of #{validator.allowable_values}." - end - @edition = edition - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organisation_id == o.organisation_id && - api_key == o.api_key && - name == o.name && - legal_name == o.legal_name && - pays_tax == o.pays_tax && - version == o.version && - organisation_type == o.organisation_type && - base_currency == o.base_currency && - country_code == o.country_code && - is_demo_company == o.is_demo_company && - organisation_status == o.organisation_status && - registration_number == o.registration_number && - tax_number == o.tax_number && - financial_year_end_day == o.financial_year_end_day && - financial_year_end_month == o.financial_year_end_month && - sales_tax_basis == o.sales_tax_basis && - sales_tax_period == o.sales_tax_period && - default_sales_tax == o.default_sales_tax && - default_purchases_tax == o.default_purchases_tax && - period_lock_date == o.period_lock_date && - end_of_year_lock_date == o.end_of_year_lock_date && - created_date_utc == o.created_date_utc && - timezone == o.timezone && - organisation_entity_type == o.organisation_entity_type && - short_code == o.short_code && - _class == o._class && - edition == o.edition && - line_of_business == o.line_of_business && - addresses == o.addresses && - phones == o.phones && - external_links == o.external_links && - payment_terms == o.payment_terms - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organisation_id, api_key, name, legal_name, pays_tax, version, organisation_type, base_currency, country_code, is_demo_company, organisation_status, registration_number, tax_number, financial_year_end_day, financial_year_end_month, sales_tax_basis, sales_tax_period, default_sales_tax, default_purchases_tax, period_lock_date, end_of_year_lock_date, created_date_utc, timezone, organisation_entity_type, short_code, _class, edition, line_of_business, addresses, phones, external_links, payment_terms].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/organisations.rb b/lib/xero-ruby/models/accounting/organisations.rb deleted file mode 100644 index 7aab57a2..00000000 --- a/lib/xero-ruby/models/accounting/organisations.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Organisations - attr_accessor :organisations - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'organisations' => :'Organisations' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'organisations' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Organisations` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Organisations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'organisations') - if (value = attributes[:'organisations']).is_a?(Array) - self.organisations = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - organisations == o.organisations - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [organisations].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/overpayment.rb b/lib/xero-ruby/models/accounting/overpayment.rb deleted file mode 100644 index 7d4ba929..00000000 --- a/lib/xero-ruby/models/accounting/overpayment.rb +++ /dev/null @@ -1,437 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Overpayment - # See Overpayment Types - attr_accessor :type - - attr_accessor :contact - - # The date the overpayment is created YYYY-MM-DD - attr_accessor :date - - # See Overpayment Status Codes - attr_accessor :status - - attr_accessor :line_amount_types - - # See Overpayment Line Items - attr_accessor :line_items - - # The subtotal of the overpayment excluding taxes - attr_accessor :sub_total - - # The total tax on the overpayment - attr_accessor :total_tax - - # The total of the overpayment (subtotal + total tax) - attr_accessor :total - - # UTC timestamp of last update to the overpayment - attr_accessor :updated_date_utc - - attr_accessor :currency_code - - # Xero generated unique identifier - attr_accessor :overpayment_id - - # The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used - attr_accessor :currency_rate - - # The remaining credit balance on the overpayment - attr_accessor :remaining_credit - - # See Allocations - attr_accessor :allocations - - # The amount of applied to an invoice - attr_accessor :applied_amount - - # See Payments - attr_accessor :payments - - # boolean to indicate if a overpayment has an attachment - attr_accessor :has_attachments - - # See Attachments - attr_accessor :attachments - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'Type', - :'contact' => :'Contact', - :'date' => :'Date', - :'status' => :'Status', - :'line_amount_types' => :'LineAmountTypes', - :'line_items' => :'LineItems', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'updated_date_utc' => :'UpdatedDateUTC', - :'currency_code' => :'CurrencyCode', - :'overpayment_id' => :'OverpaymentID', - :'currency_rate' => :'CurrencyRate', - :'remaining_credit' => :'RemainingCredit', - :'allocations' => :'Allocations', - :'applied_amount' => :'AppliedAmount', - :'payments' => :'Payments', - :'has_attachments' => :'HasAttachments', - :'attachments' => :'Attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'contact' => :'Contact', - :'date' => :'Date', - :'status' => :'String', - :'line_amount_types' => :'LineAmountTypes', - :'line_items' => :'Array', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'updated_date_utc' => :'DateTime', - :'currency_code' => :'CurrencyCode', - :'overpayment_id' => :'String', - :'currency_rate' => :'Float', - :'remaining_credit' => :'Float', - :'allocations' => :'Array', - :'applied_amount' => :'Float', - :'payments' => :'Array', - :'has_attachments' => :'Boolean', - :'attachments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Overpayment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Overpayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'overpayment_id') - self.overpayment_id = attributes[:'overpayment_id'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'remaining_credit') - self.remaining_credit = attributes[:'remaining_credit'] - end - - if attributes.key?(:'allocations') - if (value = attributes[:'allocations']).is_a?(Array) - self.allocations = value - end - end - - if attributes.key?(:'applied_amount') - self.applied_amount = attributes[:'applied_amount'] - end - - if attributes.key?(:'payments') - if (value = attributes[:'payments']).is_a?(Array) - self.payments = value - end - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["RECEIVE-OVERPAYMENT", "SPEND-OVERPAYMENT", "AROVERPAYMENT"]) - return false unless type_validator.valid?(@type) - status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["RECEIVE-OVERPAYMENT", "SPEND-OVERPAYMENT", "AROVERPAYMENT"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - contact == o.contact && - date == o.date && - status == o.status && - line_amount_types == o.line_amount_types && - line_items == o.line_items && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - updated_date_utc == o.updated_date_utc && - currency_code == o.currency_code && - overpayment_id == o.overpayment_id && - currency_rate == o.currency_rate && - remaining_credit == o.remaining_credit && - allocations == o.allocations && - applied_amount == o.applied_amount && - payments == o.payments && - has_attachments == o.has_attachments && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [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 - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/overpayments.rb b/lib/xero-ruby/models/accounting/overpayments.rb deleted file mode 100644 index 8af96d9e..00000000 --- a/lib/xero-ruby/models/accounting/overpayments.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Overpayments - attr_accessor :overpayments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'overpayments' => :'Overpayments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'overpayments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Overpayments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Overpayments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'overpayments') - if (value = attributes[:'overpayments']).is_a?(Array) - self.overpayments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - overpayments == o.overpayments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [overpayments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/payment.rb b/lib/xero-ruby/models/accounting/payment.rb deleted file mode 100644 index ae7fb809..00000000 --- a/lib/xero-ruby/models/accounting/payment.rb +++ /dev/null @@ -1,477 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Payment - attr_accessor :invoice - - attr_accessor :credit_note - - attr_accessor :prepayment - - attr_accessor :overpayment - - # Number of invoice or credit note you are applying payment to e.g.INV-4003 - attr_accessor :invoice_number - - # Number of invoice or credit note you are applying payment to e.g. INV-4003 - attr_accessor :credit_note_number - - attr_accessor :account - - # Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) - attr_accessor :code - - # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 - attr_accessor :date - - # Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 - attr_accessor :currency_rate - - # The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 - attr_accessor :amount - - # An optional description for the payment e.g. Direct Debit - attr_accessor :reference - - # An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET - attr_accessor :is_reconciled - - # The status of the payment. - attr_accessor :status - - # See Payment Types. - attr_accessor :payment_type - - # UTC timestamp of last update to the payment - attr_accessor :updated_date_utc - - # The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - attr_accessor :payment_id - - # The suppliers bank account number the payment is being made to - attr_accessor :bank_account_number - - # The suppliers bank account number the payment is being made to - attr_accessor :particulars - - # The information to appear on the supplier's bank account - attr_accessor :details - - # A boolean to indicate if a contact has an validation errors - attr_accessor :has_account - - # A boolean to indicate if a contact has an validation errors - attr_accessor :has_validation_errors - - # A string to indicate if a invoice status - attr_accessor :status_attribute_string - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'invoice' => :'Invoice', - :'credit_note' => :'CreditNote', - :'prepayment' => :'Prepayment', - :'overpayment' => :'Overpayment', - :'invoice_number' => :'InvoiceNumber', - :'credit_note_number' => :'CreditNoteNumber', - :'account' => :'Account', - :'code' => :'Code', - :'date' => :'Date', - :'currency_rate' => :'CurrencyRate', - :'amount' => :'Amount', - :'reference' => :'Reference', - :'is_reconciled' => :'IsReconciled', - :'status' => :'Status', - :'payment_type' => :'PaymentType', - :'updated_date_utc' => :'UpdatedDateUTC', - :'payment_id' => :'PaymentID', - :'bank_account_number' => :'BankAccountNumber', - :'particulars' => :'Particulars', - :'details' => :'Details', - :'has_account' => :'HasAccount', - :'has_validation_errors' => :'HasValidationErrors', - :'status_attribute_string' => :'StatusAttributeString', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'invoice' => :'Invoice', - :'credit_note' => :'CreditNote', - :'prepayment' => :'Prepayment', - :'overpayment' => :'Overpayment', - :'invoice_number' => :'String', - :'credit_note_number' => :'String', - :'account' => :'Account', - :'code' => :'String', - :'date' => :'Date', - :'currency_rate' => :'Float', - :'amount' => :'Float', - :'reference' => :'String', - :'is_reconciled' => :'Boolean', - :'status' => :'String', - :'payment_type' => :'String', - :'updated_date_utc' => :'DateTime', - :'payment_id' => :'String', - :'bank_account_number' => :'String', - :'particulars' => :'String', - :'details' => :'String', - :'has_account' => :'Boolean', - :'has_validation_errors' => :'Boolean', - :'status_attribute_string' => :'String', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Payment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Payment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'invoice') - self.invoice = attributes[:'invoice'] - end - - if attributes.key?(:'credit_note') - self.credit_note = attributes[:'credit_note'] - end - - if attributes.key?(:'prepayment') - self.prepayment = attributes[:'prepayment'] - end - - if attributes.key?(:'overpayment') - self.overpayment = attributes[:'overpayment'] - end - - if attributes.key?(:'invoice_number') - self.invoice_number = attributes[:'invoice_number'] - end - - if attributes.key?(:'credit_note_number') - self.credit_note_number = attributes[:'credit_note_number'] - end - - if attributes.key?(:'account') - self.account = attributes[:'account'] - end - - if attributes.key?(:'code') - self.code = attributes[:'code'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'amount') - self.amount = attributes[:'amount'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'is_reconciled') - self.is_reconciled = attributes[:'is_reconciled'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'payment_type') - self.payment_type = attributes[:'payment_type'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'payment_id') - self.payment_id = attributes[:'payment_id'] - end - - if attributes.key?(:'bank_account_number') - self.bank_account_number = attributes[:'bank_account_number'] - end - - if attributes.key?(:'particulars') - self.particulars = attributes[:'particulars'] - end - - if attributes.key?(:'details') - self.details = attributes[:'details'] - end - - if attributes.key?(:'has_account') - self.has_account = attributes[:'has_account'] - end - - if attributes.key?(:'has_validation_errors') - self.has_validation_errors = attributes[:'has_validation_errors'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) - return false unless status_validator.valid?(@status) - payment_type_validator = EnumAttributeValidator.new('String', ["ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "AROVERPAYMENTPAYMENT", "ARPREPAYMENTPAYMENT", "APPREPAYMENTPAYMENT", "APOVERPAYMENTPAYMENT"]) - return false unless payment_type_validator.valid?(@payment_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] payment_type Object to be assigned - def payment_type=(payment_type) - validator = EnumAttributeValidator.new('String', ["ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "AROVERPAYMENTPAYMENT", "ARPREPAYMENTPAYMENT", "APPREPAYMENTPAYMENT", "APOVERPAYMENTPAYMENT"]) - unless validator.valid?(payment_type) - fail ArgumentError, "invalid value for \"payment_type\", must be one of #{validator.allowable_values}." - end - @payment_type = payment_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - invoice == o.invoice && - credit_note == o.credit_note && - prepayment == o.prepayment && - overpayment == o.overpayment && - invoice_number == o.invoice_number && - credit_note_number == o.credit_note_number && - account == o.account && - code == o.code && - date == o.date && - currency_rate == o.currency_rate && - amount == o.amount && - reference == o.reference && - is_reconciled == o.is_reconciled && - status == o.status && - payment_type == o.payment_type && - updated_date_utc == o.updated_date_utc && - payment_id == o.payment_id && - bank_account_number == o.bank_account_number && - particulars == o.particulars && - details == o.details && - has_account == o.has_account && - has_validation_errors == o.has_validation_errors && - status_attribute_string == o.status_attribute_string && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, account, code, date, currency_rate, amount, reference, is_reconciled, status, payment_type, updated_date_utc, payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/payment_delete.rb b/lib/xero-ruby/models/accounting/payment_delete.rb deleted file mode 100644 index 394332fa..00000000 --- a/lib/xero-ruby/models/accounting/payment_delete.rb +++ /dev/null @@ -1,211 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class PaymentDelete - # The status of the payment. - attr_accessor :status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'Status' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentDelete` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentDelete`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - else - self.status = 'DELETED' - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @status.nil? - invalid_properties.push('invalid value for "status", status cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @status.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/payment_service.rb b/lib/xero-ruby/models/accounting/payment_service.rb deleted file mode 100644 index 0b114841..00000000 --- a/lib/xero-ruby/models/accounting/payment_service.rb +++ /dev/null @@ -1,256 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class PaymentService - # Xero identifier - attr_accessor :payment_service_id - - # Name of payment service - attr_accessor :payment_service_name - - # The custom payment URL - attr_accessor :payment_service_url - - # The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card - attr_accessor :pay_now_text - - # This will always be CUSTOM for payment services created via the API. - attr_accessor :payment_service_type - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_service_id' => :'PaymentServiceID', - :'payment_service_name' => :'PaymentServiceName', - :'payment_service_url' => :'PaymentServiceUrl', - :'pay_now_text' => :'PayNowText', - :'payment_service_type' => :'PaymentServiceType', - :'validation_errors' => :'ValidationErrors' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_service_id' => :'String', - :'payment_service_name' => :'String', - :'payment_service_url' => :'String', - :'pay_now_text' => :'String', - :'payment_service_type' => :'String', - :'validation_errors' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentService` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentService`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_service_id') - self.payment_service_id = attributes[:'payment_service_id'] - end - - if attributes.key?(:'payment_service_name') - self.payment_service_name = attributes[:'payment_service_name'] - end - - if attributes.key?(:'payment_service_url') - self.payment_service_url = attributes[:'payment_service_url'] - end - - if attributes.key?(:'pay_now_text') - self.pay_now_text = attributes[:'pay_now_text'] - end - - if attributes.key?(:'payment_service_type') - self.payment_service_type = attributes[:'payment_service_type'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_service_id == o.payment_service_id && - payment_service_name == o.payment_service_name && - payment_service_url == o.payment_service_url && - pay_now_text == o.pay_now_text && - payment_service_type == o.payment_service_type && - validation_errors == o.validation_errors - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_service_id, payment_service_name, payment_service_url, pay_now_text, payment_service_type, validation_errors].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/payment_services.rb b/lib/xero-ruby/models/accounting/payment_services.rb deleted file mode 100644 index 6d11412e..00000000 --- a/lib/xero-ruby/models/accounting/payment_services.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class PaymentServices - attr_accessor :payment_services - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payment_services' => :'PaymentServices' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payment_services' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentServices` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentServices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payment_services') - if (value = attributes[:'payment_services']).is_a?(Array) - self.payment_services = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payment_services == o.payment_services - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payment_services].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/payment_term.rb b/lib/xero-ruby/models/accounting/payment_term.rb deleted file mode 100644 index 1314ebba..00000000 --- a/lib/xero-ruby/models/accounting/payment_term.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class PaymentTerm - attr_accessor :bills - - attr_accessor :sales - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'bills' => :'Bills', - :'sales' => :'Sales' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'bills' => :'Bill', - :'sales' => :'Bill' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentTerm` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentTerm`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'bills') - self.bills = attributes[:'bills'] - end - - if attributes.key?(:'sales') - self.sales = attributes[:'sales'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - bills == o.bills && - sales == o.sales - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [bills, sales].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/payment_term_type.rb b/lib/xero-ruby/models/accounting/payment_term_type.rb deleted file mode 100644 index 53d319ce..00000000 --- a/lib/xero-ruby/models/accounting/payment_term_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class PaymentTermType - DAYSAFTERBILLDATE = "DAYSAFTERBILLDATE".freeze - DAYSAFTERBILLMONTH = "DAYSAFTERBILLMONTH".freeze - OFCURRENTMONTH = "OFCURRENTMONTH".freeze - OFFOLLOWINGMONTH = "OFFOLLOWINGMONTH".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = PaymentTermType.constants.select { |c| PaymentTermType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #PaymentTermType" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/payments.rb b/lib/xero-ruby/models/accounting/payments.rb deleted file mode 100644 index 09821200..00000000 --- a/lib/xero-ruby/models/accounting/payments.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Payments - attr_accessor :payments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'payments' => :'Payments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'payments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Payments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Payments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'payments') - if (value = attributes[:'payments']).is_a?(Array) - self.payments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - payments == o.payments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [payments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/phone.rb b/lib/xero-ruby/models/accounting/phone.rb deleted file mode 100644 index 87f18653..00000000 --- a/lib/xero-ruby/models/accounting/phone.rb +++ /dev/null @@ -1,312 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Phone - attr_accessor :phone_type - - # max length = 50 - attr_accessor :phone_number - - # max length = 10 - attr_accessor :phone_area_code - - # max length = 20 - attr_accessor :phone_country_code - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'phone_type' => :'PhoneType', - :'phone_number' => :'PhoneNumber', - :'phone_area_code' => :'PhoneAreaCode', - :'phone_country_code' => :'PhoneCountryCode' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'phone_type' => :'String', - :'phone_number' => :'String', - :'phone_area_code' => :'String', - :'phone_country_code' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Phone` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Phone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'phone_type') - self.phone_type = attributes[:'phone_type'] - end - - if attributes.key?(:'phone_number') - self.phone_number = attributes[:'phone_number'] - end - - if attributes.key?(:'phone_area_code') - self.phone_area_code = attributes[:'phone_area_code'] - end - - if attributes.key?(:'phone_country_code') - self.phone_country_code = attributes[:'phone_country_code'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@phone_number.nil? && @phone_number.to_s.length > 50 - invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 50.') - end - - if !@phone_area_code.nil? && @phone_area_code.to_s.length > 10 - invalid_properties.push('invalid value for "phone_area_code", the character length must be smaller than or equal to 10.') - end - - if !@phone_country_code.nil? && @phone_country_code.to_s.length > 20 - invalid_properties.push('invalid value for "phone_country_code", the character length must be smaller than or equal to 20.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - phone_type_validator = EnumAttributeValidator.new('String', ["DEFAULT", "DDI", "MOBILE", "FAX", "OFFICE"]) - return false unless phone_type_validator.valid?(@phone_type) - return false if !@phone_number.nil? && @phone_number.to_s.length > 50 - return false if !@phone_area_code.nil? && @phone_area_code.to_s.length > 10 - return false if !@phone_country_code.nil? && @phone_country_code.to_s.length > 20 - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] phone_type Object to be assigned - def phone_type=(phone_type) - validator = EnumAttributeValidator.new('String', ["DEFAULT", "DDI", "MOBILE", "FAX", "OFFICE"]) - unless validator.valid?(phone_type) - fail ArgumentError, "invalid value for \"phone_type\", must be one of #{validator.allowable_values}." - end - @phone_type = phone_type - end - - # Custom attribute writer method with validation - # @param [Object] phone_number Value to be assigned - def phone_number=(phone_number) - if !phone_number.nil? && phone_number.to_s.length > 50 - fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 50.' - end - - @phone_number = phone_number - end - - # Custom attribute writer method with validation - # @param [Object] phone_area_code Value to be assigned - def phone_area_code=(phone_area_code) - if !phone_area_code.nil? && phone_area_code.to_s.length > 10 - fail ArgumentError, 'invalid value for "phone_area_code", the character length must be smaller than or equal to 10.' - end - - @phone_area_code = phone_area_code - end - - # Custom attribute writer method with validation - # @param [Object] phone_country_code Value to be assigned - def phone_country_code=(phone_country_code) - if !phone_country_code.nil? && phone_country_code.to_s.length > 20 - fail ArgumentError, 'invalid value for "phone_country_code", the character length must be smaller than or equal to 20.' - end - - @phone_country_code = phone_country_code - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - phone_type == o.phone_type && - phone_number == o.phone_number && - phone_area_code == o.phone_area_code && - phone_country_code == o.phone_country_code - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [phone_type, phone_number, phone_area_code, phone_country_code].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/prepayment.rb b/lib/xero-ruby/models/accounting/prepayment.rb deleted file mode 100644 index 5dfb0143..00000000 --- a/lib/xero-ruby/models/accounting/prepayment.rb +++ /dev/null @@ -1,435 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Prepayment - # See Prepayment Types - attr_accessor :type - - attr_accessor :contact - - # The date the prepayment is created YYYY-MM-DD - attr_accessor :date - - # See Prepayment Status Codes - attr_accessor :status - - attr_accessor :line_amount_types - - # See Prepayment Line Items - attr_accessor :line_items - - # The subtotal of the prepayment excluding taxes - attr_accessor :sub_total - - # The total tax on the prepayment - attr_accessor :total_tax - - # The total of the prepayment(subtotal + total tax) - attr_accessor :total - - # Returns Invoice number field. Reference field isn't available. - attr_accessor :reference - - # UTC timestamp of last update to the prepayment - attr_accessor :updated_date_utc - - attr_accessor :currency_code - - # Xero generated unique identifier - attr_accessor :prepayment_id - - # The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used - attr_accessor :currency_rate - - # The remaining credit balance on the prepayment - attr_accessor :remaining_credit - - # See Allocations - attr_accessor :allocations - - # The amount of applied to an invoice - attr_accessor :applied_amount - - # boolean to indicate if a prepayment has an attachment - attr_accessor :has_attachments - - # See Attachments - attr_accessor :attachments - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'Type', - :'contact' => :'Contact', - :'date' => :'Date', - :'status' => :'Status', - :'line_amount_types' => :'LineAmountTypes', - :'line_items' => :'LineItems', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'reference' => :'Reference', - :'updated_date_utc' => :'UpdatedDateUTC', - :'currency_code' => :'CurrencyCode', - :'prepayment_id' => :'PrepaymentID', - :'currency_rate' => :'CurrencyRate', - :'remaining_credit' => :'RemainingCredit', - :'allocations' => :'Allocations', - :'applied_amount' => :'AppliedAmount', - :'has_attachments' => :'HasAttachments', - :'attachments' => :'Attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'contact' => :'Contact', - :'date' => :'Date', - :'status' => :'String', - :'line_amount_types' => :'LineAmountTypes', - :'line_items' => :'Array', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'reference' => :'String', - :'updated_date_utc' => :'DateTime', - :'currency_code' => :'CurrencyCode', - :'prepayment_id' => :'String', - :'currency_rate' => :'Float', - :'remaining_credit' => :'Float', - :'allocations' => :'Array', - :'applied_amount' => :'Float', - :'has_attachments' => :'Boolean', - :'attachments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Prepayment` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Prepayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'prepayment_id') - self.prepayment_id = attributes[:'prepayment_id'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'remaining_credit') - self.remaining_credit = attributes[:'remaining_credit'] - end - - if attributes.key?(:'allocations') - if (value = attributes[:'allocations']).is_a?(Array) - self.allocations = value - end - end - - if attributes.key?(:'applied_amount') - self.applied_amount = attributes[:'applied_amount'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["RECEIVE-PREPAYMENT", "SPEND-PREPAYMENT", "ARPREPAYMENT", "APPREPAYMENT"]) - return false unless type_validator.valid?(@type) - status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["RECEIVE-PREPAYMENT", "SPEND-PREPAYMENT", "ARPREPAYMENT", "APPREPAYMENT"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - contact == o.contact && - date == o.date && - status == o.status && - line_amount_types == o.line_amount_types && - line_items == o.line_items && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - reference == o.reference && - updated_date_utc == o.updated_date_utc && - currency_code == o.currency_code && - prepayment_id == o.prepayment_id && - currency_rate == o.currency_rate && - remaining_credit == o.remaining_credit && - allocations == o.allocations && - applied_amount == o.applied_amount && - has_attachments == o.has_attachments && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [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, applied_amount, has_attachments, attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/prepayments.rb b/lib/xero-ruby/models/accounting/prepayments.rb deleted file mode 100644 index 518ca013..00000000 --- a/lib/xero-ruby/models/accounting/prepayments.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Prepayments - attr_accessor :prepayments - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'prepayments' => :'Prepayments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'prepayments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Prepayments` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Prepayments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'prepayments') - if (value = attributes[:'prepayments']).is_a?(Array) - self.prepayments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - prepayments == o.prepayments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [prepayments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/purchase.rb b/lib/xero-ruby/models/accounting/purchase.rb deleted file mode 100644 index 866881fd..00000000 --- a/lib/xero-ruby/models/accounting/purchase.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Purchase - # Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. - attr_accessor :unit_price - - # Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items - attr_accessor :account_code - - # Cost of goods sold account. Only applicable to the purchase details of tracked items. - attr_accessor :cogs_account_code - - # The tax type from TaxRates - attr_accessor :tax_type - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'unit_price' => :'UnitPrice', - :'account_code' => :'AccountCode', - :'cogs_account_code' => :'COGSAccountCode', - :'tax_type' => :'TaxType' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'unit_price' => :'Float', - :'account_code' => :'String', - :'cogs_account_code' => :'String', - :'tax_type' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Purchase` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Purchase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'unit_price') - self.unit_price = attributes[:'unit_price'] - end - - if attributes.key?(:'account_code') - self.account_code = attributes[:'account_code'] - end - - if attributes.key?(:'cogs_account_code') - self.cogs_account_code = attributes[:'cogs_account_code'] - end - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - unit_price == o.unit_price && - account_code == o.account_code && - cogs_account_code == o.cogs_account_code && - tax_type == o.tax_type - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [unit_price, account_code, cogs_account_code, tax_type].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/purchase_order.rb b/lib/xero-ruby/models/accounting/purchase_order.rb deleted file mode 100644 index 9471cb05..00000000 --- a/lib/xero-ruby/models/accounting/purchase_order.rb +++ /dev/null @@ -1,515 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class PurchaseOrder - attr_accessor :contact - - # See LineItems - attr_accessor :line_items - - # Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation - attr_accessor :date - - # Date the goods are to be delivered – YYYY-MM-DD - attr_accessor :delivery_date - - attr_accessor :line_amount_types - - # Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) - attr_accessor :purchase_order_number - - # Additional reference number - attr_accessor :reference - - # See BrandingThemes - attr_accessor :branding_theme_id - - attr_accessor :currency_code - - # See Purchase Order Status Codes - attr_accessor :status - - # Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed - attr_accessor :sent_to_contact - - # The address the goods are to be delivered to - attr_accessor :delivery_address - - # The person that the delivery is going to - attr_accessor :attention_to - - # The phone number for the person accepting the delivery - attr_accessor :telephone - - # A free text feild for instructions (500 characters max) - attr_accessor :delivery_instructions - - # The date the goods are expected to arrive. - attr_accessor :expected_arrival_date - - # Xero generated unique identifier for purchase order - attr_accessor :purchase_order_id - - # The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. - attr_accessor :currency_rate - - # Total of purchase order excluding taxes - attr_accessor :sub_total - - # Total tax on purchase order - attr_accessor :total_tax - - # Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) - attr_accessor :total - - # Total of discounts applied on the purchase order line items - attr_accessor :total_discount - - # boolean to indicate if a purchase order has an attachment - attr_accessor :has_attachments - - # Last modified date UTC format - attr_accessor :updated_date_utc - - # A string to indicate if a invoice status - attr_accessor :status_attribute_string - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - # Displays array of warning messages from the API - attr_accessor :warnings - - # Displays array of attachments from the API - attr_accessor :attachments - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'contact' => :'Contact', - :'line_items' => :'LineItems', - :'date' => :'Date', - :'delivery_date' => :'DeliveryDate', - :'line_amount_types' => :'LineAmountTypes', - :'purchase_order_number' => :'PurchaseOrderNumber', - :'reference' => :'Reference', - :'branding_theme_id' => :'BrandingThemeID', - :'currency_code' => :'CurrencyCode', - :'status' => :'Status', - :'sent_to_contact' => :'SentToContact', - :'delivery_address' => :'DeliveryAddress', - :'attention_to' => :'AttentionTo', - :'telephone' => :'Telephone', - :'delivery_instructions' => :'DeliveryInstructions', - :'expected_arrival_date' => :'ExpectedArrivalDate', - :'purchase_order_id' => :'PurchaseOrderID', - :'currency_rate' => :'CurrencyRate', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'total_discount' => :'TotalDiscount', - :'has_attachments' => :'HasAttachments', - :'updated_date_utc' => :'UpdatedDateUTC', - :'status_attribute_string' => :'StatusAttributeString', - :'validation_errors' => :'ValidationErrors', - :'warnings' => :'Warnings', - :'attachments' => :'Attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'contact' => :'Contact', - :'line_items' => :'Array', - :'date' => :'Date', - :'delivery_date' => :'Date', - :'line_amount_types' => :'LineAmountTypes', - :'purchase_order_number' => :'String', - :'reference' => :'String', - :'branding_theme_id' => :'String', - :'currency_code' => :'CurrencyCode', - :'status' => :'String', - :'sent_to_contact' => :'Boolean', - :'delivery_address' => :'String', - :'attention_to' => :'String', - :'telephone' => :'String', - :'delivery_instructions' => :'String', - :'expected_arrival_date' => :'Date', - :'purchase_order_id' => :'String', - :'currency_rate' => :'Float', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'total_discount' => :'Float', - :'has_attachments' => :'Boolean', - :'updated_date_utc' => :'DateTime', - :'status_attribute_string' => :'String', - :'validation_errors' => :'Array', - :'warnings' => :'Array', - :'attachments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PurchaseOrder` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PurchaseOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'delivery_date') - self.delivery_date = attributes[:'delivery_date'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'purchase_order_number') - self.purchase_order_number = attributes[:'purchase_order_number'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'branding_theme_id') - self.branding_theme_id = attributes[:'branding_theme_id'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'sent_to_contact') - self.sent_to_contact = attributes[:'sent_to_contact'] - end - - if attributes.key?(:'delivery_address') - self.delivery_address = attributes[:'delivery_address'] - end - - if attributes.key?(:'attention_to') - self.attention_to = attributes[:'attention_to'] - end - - if attributes.key?(:'telephone') - self.telephone = attributes[:'telephone'] - end - - if attributes.key?(:'delivery_instructions') - self.delivery_instructions = attributes[:'delivery_instructions'] - end - - if attributes.key?(:'expected_arrival_date') - self.expected_arrival_date = attributes[:'expected_arrival_date'] - end - - if attributes.key?(:'purchase_order_id') - self.purchase_order_id = attributes[:'purchase_order_id'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'total_discount') - self.total_discount = attributes[:'total_discount'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'status_attribute_string') - self.status_attribute_string = attributes[:'status_attribute_string'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "BILLED", "DELETED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "BILLED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - contact == o.contact && - line_items == o.line_items && - date == o.date && - delivery_date == o.delivery_date && - line_amount_types == o.line_amount_types && - purchase_order_number == o.purchase_order_number && - reference == o.reference && - branding_theme_id == o.branding_theme_id && - currency_code == o.currency_code && - status == o.status && - sent_to_contact == o.sent_to_contact && - delivery_address == o.delivery_address && - attention_to == o.attention_to && - telephone == o.telephone && - delivery_instructions == o.delivery_instructions && - expected_arrival_date == o.expected_arrival_date && - purchase_order_id == o.purchase_order_id && - currency_rate == o.currency_rate && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - total_discount == o.total_discount && - has_attachments == o.has_attachments && - updated_date_utc == o.updated_date_utc && - status_attribute_string == o.status_attribute_string && - validation_errors == o.validation_errors && - warnings == o.warnings && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [contact, line_items, date, delivery_date, line_amount_types, purchase_order_number, reference, branding_theme_id, currency_code, status, sent_to_contact, delivery_address, attention_to, telephone, delivery_instructions, expected_arrival_date, purchase_order_id, currency_rate, sub_total, total_tax, total, total_discount, has_attachments, updated_date_utc, status_attribute_string, validation_errors, warnings, attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/purchase_orders.rb b/lib/xero-ruby/models/accounting/purchase_orders.rb deleted file mode 100644 index 79f9587b..00000000 --- a/lib/xero-ruby/models/accounting/purchase_orders.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class PurchaseOrders - attr_accessor :purchase_orders - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'purchase_orders' => :'PurchaseOrders' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'purchase_orders' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PurchaseOrders` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PurchaseOrders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'purchase_orders') - if (value = attributes[:'purchase_orders']).is_a?(Array) - self.purchase_orders = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - purchase_orders == o.purchase_orders - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [purchase_orders].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/quote.rb b/lib/xero-ruby/models/accounting/quote.rb deleted file mode 100644 index 4e3256be..00000000 --- a/lib/xero-ruby/models/accounting/quote.rb +++ /dev/null @@ -1,487 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Quote - # QuoteID GUID is automatically generated and is returned after create or GET. - attr_accessor :quote_id - - # Unique alpha numeric code identifying a quote (Max Length = 255) - attr_accessor :quote_number - - # Additional reference number - attr_accessor :reference - - # Terms of the quote - attr_accessor :terms - - attr_accessor :contact - - # See LineItems - attr_accessor :line_items - - # Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation - attr_accessor :date - - # Date the quote was issued (YYYY-MM-DD) - attr_accessor :date_string - - # Date the quote expires – YYYY-MM-DD. - attr_accessor :expiry_date - - # Date the quote expires – YYYY-MM-DD. - attr_accessor :expiry_date_string - - attr_accessor :status - - attr_accessor :currency_code - - # The currency rate for a multicurrency quote - attr_accessor :currency_rate - - # Total of quote excluding taxes. - attr_accessor :sub_total - - # Total tax on quote - attr_accessor :total_tax - - # Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts - attr_accessor :total - - # Total of discounts applied on the quote line items - attr_accessor :total_discount - - # Title text for the quote - attr_accessor :title - - # Summary text for the quote - attr_accessor :summary - - # See BrandingThemes - attr_accessor :branding_theme_id - - # Last modified date UTC format - attr_accessor :updated_date_utc - - attr_accessor :line_amount_types - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'quote_id' => :'QuoteID', - :'quote_number' => :'QuoteNumber', - :'reference' => :'Reference', - :'terms' => :'Terms', - :'contact' => :'Contact', - :'line_items' => :'LineItems', - :'date' => :'Date', - :'date_string' => :'DateString', - :'expiry_date' => :'ExpiryDate', - :'expiry_date_string' => :'ExpiryDateString', - :'status' => :'Status', - :'currency_code' => :'CurrencyCode', - :'currency_rate' => :'CurrencyRate', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'total_discount' => :'TotalDiscount', - :'title' => :'Title', - :'summary' => :'Summary', - :'branding_theme_id' => :'BrandingThemeID', - :'updated_date_utc' => :'UpdatedDateUTC', - :'line_amount_types' => :'LineAmountTypes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'quote_id' => :'String', - :'quote_number' => :'String', - :'reference' => :'String', - :'terms' => :'String', - :'contact' => :'Contact', - :'line_items' => :'Array', - :'date' => :'Date', - :'date_string' => :'String', - :'expiry_date' => :'Date', - :'expiry_date_string' => :'String', - :'status' => :'QuoteStatusCodes', - :'currency_code' => :'CurrencyCode', - :'currency_rate' => :'Float', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'total_discount' => :'Float', - :'title' => :'String', - :'summary' => :'String', - :'branding_theme_id' => :'String', - :'updated_date_utc' => :'DateTime', - :'line_amount_types' => :'QuoteLineAmountTypes' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Quote` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Quote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'quote_id') - self.quote_id = attributes[:'quote_id'] - end - - if attributes.key?(:'quote_number') - self.quote_number = attributes[:'quote_number'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'terms') - self.terms = attributes[:'terms'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'date_string') - self.date_string = attributes[:'date_string'] - end - - if attributes.key?(:'expiry_date') - self.expiry_date = attributes[:'expiry_date'] - end - - if attributes.key?(:'expiry_date_string') - self.expiry_date_string = attributes[:'expiry_date_string'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'currency_rate') - self.currency_rate = attributes[:'currency_rate'] - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'total_discount') - self.total_discount = attributes[:'total_discount'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'summary') - self.summary = attributes[:'summary'] - end - - if attributes.key?(:'branding_theme_id') - self.branding_theme_id = attributes[:'branding_theme_id'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@quote_number.nil? && @quote_number.to_s.length > 255 - invalid_properties.push('invalid value for "quote_number", the character length must be smaller than or equal to 255.') - end - - if !@reference.nil? && @reference.to_s.length > 4000 - invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 4000.') - end - - if !@terms.nil? && @terms.to_s.length > 4000 - invalid_properties.push('invalid value for "terms", the character length must be smaller than or equal to 4000.') - end - - if !@title.nil? && @title.to_s.length > 100 - invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 100.') - end - - if !@summary.nil? && @summary.to_s.length > 3000 - invalid_properties.push('invalid value for "summary", the character length must be smaller than or equal to 3000.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@quote_number.nil? && @quote_number.to_s.length > 255 - return false if !@reference.nil? && @reference.to_s.length > 4000 - return false if !@terms.nil? && @terms.to_s.length > 4000 - return false if !@title.nil? && @title.to_s.length > 100 - return false if !@summary.nil? && @summary.to_s.length > 3000 - true - end - - # Custom attribute writer method with validation - # @param [Object] quote_number Value to be assigned - def quote_number=(quote_number) - if !quote_number.nil? && quote_number.to_s.length > 255 - fail ArgumentError, 'invalid value for "quote_number", the character length must be smaller than or equal to 255.' - end - - @quote_number = quote_number - end - - # Custom attribute writer method with validation - # @param [Object] reference Value to be assigned - def reference=(reference) - if !reference.nil? && reference.to_s.length > 4000 - fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 4000.' - end - - @reference = reference - end - - # Custom attribute writer method with validation - # @param [Object] terms Value to be assigned - def terms=(terms) - if !terms.nil? && terms.to_s.length > 4000 - fail ArgumentError, 'invalid value for "terms", the character length must be smaller than or equal to 4000.' - end - - @terms = terms - end - - # Custom attribute writer method with validation - # @param [Object] title Value to be assigned - def title=(title) - if !title.nil? && title.to_s.length > 100 - fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 100.' - end - - @title = title - end - - # Custom attribute writer method with validation - # @param [Object] summary Value to be assigned - def summary=(summary) - if !summary.nil? && summary.to_s.length > 3000 - fail ArgumentError, 'invalid value for "summary", the character length must be smaller than or equal to 3000.' - end - - @summary = summary - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - quote_id == o.quote_id && - quote_number == o.quote_number && - reference == o.reference && - terms == o.terms && - contact == o.contact && - line_items == o.line_items && - date == o.date && - date_string == o.date_string && - expiry_date == o.expiry_date && - expiry_date_string == o.expiry_date_string && - status == o.status && - currency_code == o.currency_code && - currency_rate == o.currency_rate && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - total_discount == o.total_discount && - title == o.title && - summary == o.summary && - branding_theme_id == o.branding_theme_id && - updated_date_utc == o.updated_date_utc && - line_amount_types == o.line_amount_types - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [quote_id, quote_number, reference, terms, contact, line_items, date, date_string, expiry_date, expiry_date_string, status, currency_code, currency_rate, sub_total, total_tax, total, total_discount, title, summary, branding_theme_id, updated_date_utc, line_amount_types].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb deleted file mode 100644 index 2e0f8cfa..00000000 --- a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class QuoteLineAmountTypes - EXCLUSIVE = "EXCLUSIVE".freeze - INCLUSIVE = "INCLUSIVE".freeze - NOTAX = "NOTAX".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = QuoteLineAmountTypes.constants.select { |c| QuoteLineAmountTypes::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #QuoteLineAmountTypes" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/quote_status_codes.rb b/lib/xero-ruby/models/accounting/quote_status_codes.rb deleted file mode 100644 index d1b877b0..00000000 --- a/lib/xero-ruby/models/accounting/quote_status_codes.rb +++ /dev/null @@ -1,40 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class QuoteStatusCodes - DRAFT = "DRAFT".freeze - SENT = "SENT".freeze - DECLINED = "DECLINED".freeze - ACCEPTED = "ACCEPTED".freeze - INVOICED = "INVOICED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = QuoteStatusCodes.constants.select { |c| QuoteStatusCodes::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #QuoteStatusCodes" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/quotes.rb b/lib/xero-ruby/models/accounting/quotes.rb deleted file mode 100644 index 9f03458a..00000000 --- a/lib/xero-ruby/models/accounting/quotes.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Quotes - attr_accessor :quotes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'quotes' => :'Quotes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'quotes' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Quotes` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Quotes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'quotes') - if (value = attributes[:'quotes']).is_a?(Array) - self.quotes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - quotes == o.quotes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [quotes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/receipt.rb b/lib/xero-ruby/models/accounting/receipt.rb deleted file mode 100644 index e6082824..00000000 --- a/lib/xero-ruby/models/accounting/receipt.rb +++ /dev/null @@ -1,414 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Receipt - # Date of receipt – YYYY-MM-DD - attr_accessor :date - - attr_accessor :contact - - attr_accessor :line_items - - attr_accessor :user - - # Additional reference number - attr_accessor :reference - - attr_accessor :line_amount_types - - # Total of receipt excluding taxes - attr_accessor :sub_total - - # Total tax on receipt - attr_accessor :total_tax - - # Total of receipt tax inclusive (i.e. SubTotal + TotalTax) - attr_accessor :total - - # Xero generated unique identifier for receipt - attr_accessor :receipt_id - - # Current status of receipt – see status types - attr_accessor :status - - # Xero generated sequence number for receipt in current claim for a given user - attr_accessor :receipt_number - - # Last modified date UTC format - attr_accessor :updated_date_utc - - # boolean to indicate if a receipt has an attachment - attr_accessor :has_attachments - - # URL link to a source document – shown as “Go to [appName]” in the Xero app - attr_accessor :url - - # Displays array of validation error messages from the API - attr_accessor :validation_errors - - # Displays array of warning messages from the API - attr_accessor :warnings - - # Displays array of attachments from the API - attr_accessor :attachments - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'date' => :'Date', - :'contact' => :'Contact', - :'line_items' => :'LineItems', - :'user' => :'User', - :'reference' => :'Reference', - :'line_amount_types' => :'LineAmountTypes', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'receipt_id' => :'ReceiptID', - :'status' => :'Status', - :'receipt_number' => :'ReceiptNumber', - :'updated_date_utc' => :'UpdatedDateUTC', - :'has_attachments' => :'HasAttachments', - :'url' => :'Url', - :'validation_errors' => :'ValidationErrors', - :'warnings' => :'Warnings', - :'attachments' => :'Attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'date' => :'Date', - :'contact' => :'Contact', - :'line_items' => :'Array', - :'user' => :'User', - :'reference' => :'String', - :'line_amount_types' => :'LineAmountTypes', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'receipt_id' => :'String', - :'status' => :'String', - :'receipt_number' => :'String', - :'updated_date_utc' => :'DateTime', - :'has_attachments' => :'Boolean', - :'url' => :'String', - :'validation_errors' => :'Array', - :'warnings' => :'Array', - :'attachments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Receipt` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Receipt`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'date') - self.date = attributes[:'date'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'user') - self.user = attributes[:'user'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'receipt_id') - self.receipt_id = attributes[:'receipt_id'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'receipt_number') - self.receipt_number = attributes[:'receipt_number'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'url') - self.url = attributes[:'url'] - end - - if attributes.key?(:'validation_errors') - if (value = attributes[:'validation_errors']).is_a?(Array) - self.validation_errors = value - end - end - - if attributes.key?(:'warnings') - if (value = attributes[:'warnings']).is_a?(Array) - self.warnings = value - end - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED", "VOIDED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED", "VOIDED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - date == o.date && - contact == o.contact && - line_items == o.line_items && - user == o.user && - reference == o.reference && - line_amount_types == o.line_amount_types && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - receipt_id == o.receipt_id && - status == o.status && - receipt_number == o.receipt_number && - updated_date_utc == o.updated_date_utc && - has_attachments == o.has_attachments && - url == o.url && - validation_errors == o.validation_errors && - warnings == o.warnings && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [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 - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/receipts.rb b/lib/xero-ruby/models/accounting/receipts.rb deleted file mode 100644 index caaf1b5b..00000000 --- a/lib/xero-ruby/models/accounting/receipts.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Receipts - attr_accessor :receipts - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'receipts' => :'Receipts' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'receipts' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Receipts` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Receipts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'receipts') - if (value = attributes[:'receipts']).is_a?(Array) - self.receipts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - receipts == o.receipts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [receipts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/repeating_invoice.rb b/lib/xero-ruby/models/accounting/repeating_invoice.rb deleted file mode 100644 index caed71db..00000000 --- a/lib/xero-ruby/models/accounting/repeating_invoice.rb +++ /dev/null @@ -1,402 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class RepeatingInvoice - # See Invoice Types - attr_accessor :type - - attr_accessor :contact - - attr_accessor :schedule - - # See LineItems - attr_accessor :line_items - - attr_accessor :line_amount_types - - # ACCREC only – additional reference number - attr_accessor :reference - - # See BrandingThemes - attr_accessor :branding_theme_id - - attr_accessor :currency_code - - # One of the following - DRAFT or AUTHORISED – See Invoice Status Codes - attr_accessor :status - - # Total of invoice excluding taxes - attr_accessor :sub_total - - # Total tax on invoice - attr_accessor :total_tax - - # Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) - attr_accessor :total - - # Xero generated unique identifier for repeating invoice template - attr_accessor :repeating_invoice_id - - # Xero generated unique identifier for repeating invoice template - attr_accessor :id - - # boolean to indicate if an invoice has an attachment - attr_accessor :has_attachments - - # Displays array of attachments from the API - attr_accessor :attachments - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'type' => :'Type', - :'contact' => :'Contact', - :'schedule' => :'Schedule', - :'line_items' => :'LineItems', - :'line_amount_types' => :'LineAmountTypes', - :'reference' => :'Reference', - :'branding_theme_id' => :'BrandingThemeID', - :'currency_code' => :'CurrencyCode', - :'status' => :'Status', - :'sub_total' => :'SubTotal', - :'total_tax' => :'TotalTax', - :'total' => :'Total', - :'repeating_invoice_id' => :'RepeatingInvoiceID', - :'id' => :'ID', - :'has_attachments' => :'HasAttachments', - :'attachments' => :'Attachments' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'type' => :'String', - :'contact' => :'Contact', - :'schedule' => :'Schedule', - :'line_items' => :'Array', - :'line_amount_types' => :'LineAmountTypes', - :'reference' => :'String', - :'branding_theme_id' => :'String', - :'currency_code' => :'CurrencyCode', - :'status' => :'String', - :'sub_total' => :'Float', - :'total_tax' => :'Float', - :'total' => :'Float', - :'repeating_invoice_id' => :'String', - :'id' => :'String', - :'has_attachments' => :'Boolean', - :'attachments' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::RepeatingInvoice` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::RepeatingInvoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'contact') - self.contact = attributes[:'contact'] - end - - if attributes.key?(:'schedule') - self.schedule = attributes[:'schedule'] - end - - if attributes.key?(:'line_items') - if (value = attributes[:'line_items']).is_a?(Array) - self.line_items = value - end - end - - if attributes.key?(:'line_amount_types') - self.line_amount_types = attributes[:'line_amount_types'] - end - - if attributes.key?(:'reference') - self.reference = attributes[:'reference'] - end - - if attributes.key?(:'branding_theme_id') - self.branding_theme_id = attributes[:'branding_theme_id'] - end - - if attributes.key?(:'currency_code') - self.currency_code = attributes[:'currency_code'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'sub_total') - self.sub_total = attributes[:'sub_total'] - end - - if attributes.key?(:'total_tax') - self.total_tax = attributes[:'total_tax'] - end - - if attributes.key?(:'total') - self.total = attributes[:'total'] - end - - if attributes.key?(:'repeating_invoice_id') - self.repeating_invoice_id = attributes[:'repeating_invoice_id'] - end - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'has_attachments') - self.has_attachments = attributes[:'has_attachments'] - else - self.has_attachments = false - end - - if attributes.key?(:'attachments') - if (value = attributes[:'attachments']).is_a?(Array) - self.attachments = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - type_validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCREC"]) - return false unless type_validator.valid?(@type) - status_validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED", "DELETED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] type Object to be assigned - def type=(type) - validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCREC"]) - unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." - end - @type = type - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - type == o.type && - contact == o.contact && - schedule == o.schedule && - line_items == o.line_items && - line_amount_types == o.line_amount_types && - reference == o.reference && - branding_theme_id == o.branding_theme_id && - currency_code == o.currency_code && - status == o.status && - sub_total == o.sub_total && - total_tax == o.total_tax && - total == o.total && - repeating_invoice_id == o.repeating_invoice_id && - id == o.id && - has_attachments == o.has_attachments && - attachments == o.attachments - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [type, contact, schedule, line_items, line_amount_types, reference, branding_theme_id, currency_code, status, sub_total, total_tax, total, repeating_invoice_id, id, has_attachments, attachments].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/repeating_invoices.rb b/lib/xero-ruby/models/accounting/repeating_invoices.rb deleted file mode 100644 index 95c26507..00000000 --- a/lib/xero-ruby/models/accounting/repeating_invoices.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class RepeatingInvoices - attr_accessor :repeating_invoices - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'repeating_invoices' => :'RepeatingInvoices' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'repeating_invoices' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::RepeatingInvoices` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::RepeatingInvoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'repeating_invoices') - if (value = attributes[:'repeating_invoices']).is_a?(Array) - self.repeating_invoices = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - repeating_invoices == o.repeating_invoices - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [repeating_invoices].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report.rb b/lib/xero-ruby/models/accounting/report.rb deleted file mode 100644 index 046f3919..00000000 --- a/lib/xero-ruby/models/accounting/report.rb +++ /dev/null @@ -1,299 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Report - # See Prepayment Types - attr_accessor :report_id - - # See Prepayment Types - attr_accessor :report_name - - # See Prepayment Types - attr_accessor :report_type - - # See Prepayment Types - attr_accessor :report_title - - # Date of report - attr_accessor :report_date - - # Updated Date - attr_accessor :updated_date_utc - - attr_accessor :contacts - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_id' => :'ReportID', - :'report_name' => :'ReportName', - :'report_type' => :'ReportType', - :'report_title' => :'ReportTitle', - :'report_date' => :'ReportDate', - :'updated_date_utc' => :'UpdatedDateUTC', - :'contacts' => :'Contacts' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_id' => :'String', - :'report_name' => :'String', - :'report_type' => :'String', - :'report_title' => :'String', - :'report_date' => :'String', - :'updated_date_utc' => :'DateTime', - :'contacts' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Report` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Report`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - - if attributes.key?(:'report_name') - self.report_name = attributes[:'report_name'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'report_title') - self.report_title = attributes[:'report_title'] - end - - if attributes.key?(:'report_date') - self.report_date = attributes[:'report_date'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'contacts') - if (value = attributes[:'contacts']).is_a?(Array) - self.contacts = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - report_type_validator = EnumAttributeValidator.new('String', ["AgedPayablesByContact"]) - return false unless report_type_validator.valid?(@report_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] report_type Object to be assigned - def report_type=(report_type) - validator = EnumAttributeValidator.new('String', ["AgedPayablesByContact"]) - unless validator.valid?(report_type) - fail ArgumentError, "invalid value for \"report_type\", must be one of #{validator.allowable_values}." - end - @report_type = report_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_id == o.report_id && - report_name == o.report_name && - report_type == o.report_type && - report_title == o.report_title && - report_date == o.report_date && - updated_date_utc == o.updated_date_utc && - contacts == o.contacts - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_id, report_name, report_type, report_title, report_date, updated_date_utc, contacts].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report_attribute.rb b/lib/xero-ruby/models/accounting/report_attribute.rb deleted file mode 100644 index 8d9e10e1..00000000 --- a/lib/xero-ruby/models/accounting/report_attribute.rb +++ /dev/null @@ -1,212 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ReportAttribute - attr_accessor :id - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'id' => :'Id', - :'value' => :'Value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'id' => :'String', - :'value' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportAttribute` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportAttribute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - id == o.id && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [id, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report_cell.rb b/lib/xero-ruby/models/accounting/report_cell.rb deleted file mode 100644 index b96e617e..00000000 --- a/lib/xero-ruby/models/accounting/report_cell.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ReportCell - attr_accessor :value - - attr_accessor :attributes - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'value' => :'Value', - :'attributes' => :'Attributes' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'value' => :'String', - :'attributes' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportCell` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportCell`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - - if attributes.key?(:'attributes') - if (value = attributes[:'attributes']).is_a?(Array) - self.attributes = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - value == o.value && - attributes == o.attributes - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [value, attributes].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report_fields.rb b/lib/xero-ruby/models/accounting/report_fields.rb deleted file mode 100644 index da17d560..00000000 --- a/lib/xero-ruby/models/accounting/report_fields.rb +++ /dev/null @@ -1,221 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ReportFields - attr_accessor :field_id - - attr_accessor :description - - attr_accessor :value - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'field_id' => :'FieldID', - :'description' => :'Description', - :'value' => :'Value' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'field_id' => :'String', - :'description' => :'String', - :'value' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportFields` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'field_id') - self.field_id = attributes[:'field_id'] - end - - if attributes.key?(:'description') - self.description = attributes[:'description'] - end - - if attributes.key?(:'value') - self.value = attributes[:'value'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - field_id == o.field_id && - description == o.description && - value == o.value - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [field_id, description, value].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report_row.rb b/lib/xero-ruby/models/accounting/report_row.rb deleted file mode 100644 index 4158e4cd..00000000 --- a/lib/xero-ruby/models/accounting/report_row.rb +++ /dev/null @@ -1,223 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ReportRow - attr_accessor :row_type - - attr_accessor :title - - attr_accessor :cells - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'row_type' => :'RowType', - :'title' => :'Title', - :'cells' => :'Cells' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'row_type' => :'RowType', - :'title' => :'String', - :'cells' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportRow` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportRow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'row_type') - self.row_type = attributes[:'row_type'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'cells') - if (value = attributes[:'cells']).is_a?(Array) - self.cells = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - row_type == o.row_type && - title == o.title && - cells == o.cells - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [row_type, title, cells].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report_rows.rb b/lib/xero-ruby/models/accounting/report_rows.rb deleted file mode 100644 index a26ce593..00000000 --- a/lib/xero-ruby/models/accounting/report_rows.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ReportRows - attr_accessor :row_type - - attr_accessor :title - - attr_accessor :cells - - attr_accessor :rows - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'row_type' => :'RowType', - :'title' => :'Title', - :'cells' => :'Cells', - :'rows' => :'Rows' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'row_type' => :'RowType', - :'title' => :'String', - :'cells' => :'Array', - :'rows' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportRows` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportRows`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'row_type') - self.row_type = attributes[:'row_type'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'cells') - if (value = attributes[:'cells']).is_a?(Array) - self.cells = value - end - end - - if attributes.key?(:'rows') - if (value = attributes[:'rows']).is_a?(Array) - self.rows = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - row_type == o.row_type && - title == o.title && - cells == o.cells && - rows == o.rows - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [row_type, title, cells, rows].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report_with_row.rb b/lib/xero-ruby/models/accounting/report_with_row.rb deleted file mode 100644 index be7fae79..00000000 --- a/lib/xero-ruby/models/accounting/report_with_row.rb +++ /dev/null @@ -1,288 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ReportWithRow - # Report id - attr_accessor :report_id - - # Name of the report - attr_accessor :report_name - - # Title of the report - attr_accessor :report_title - - # The type of report (BalanceSheet,ProfitLoss, etc) - attr_accessor :report_type - - # Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) - attr_accessor :report_titles - - # Date of report - attr_accessor :report_date - - attr_accessor :rows - - # Updated Date - attr_accessor :updated_date_utc - - attr_accessor :fields - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'report_id' => :'ReportID', - :'report_name' => :'ReportName', - :'report_title' => :'ReportTitle', - :'report_type' => :'ReportType', - :'report_titles' => :'ReportTitles', - :'report_date' => :'ReportDate', - :'rows' => :'Rows', - :'updated_date_utc' => :'UpdatedDateUTC', - :'fields' => :'Fields' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'report_id' => :'String', - :'report_name' => :'String', - :'report_title' => :'String', - :'report_type' => :'String', - :'report_titles' => :'Array', - :'report_date' => :'String', - :'rows' => :'Array', - :'updated_date_utc' => :'DateTime', - :'fields' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportWithRow` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportWithRow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'report_id') - self.report_id = attributes[:'report_id'] - end - - if attributes.key?(:'report_name') - self.report_name = attributes[:'report_name'] - end - - if attributes.key?(:'report_title') - self.report_title = attributes[:'report_title'] - end - - if attributes.key?(:'report_type') - self.report_type = attributes[:'report_type'] - end - - if attributes.key?(:'report_titles') - if (value = attributes[:'report_titles']).is_a?(Array) - self.report_titles = value - end - end - - if attributes.key?(:'report_date') - self.report_date = attributes[:'report_date'] - end - - if attributes.key?(:'rows') - if (value = attributes[:'rows']).is_a?(Array) - self.rows = value - end - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'fields') - if (value = attributes[:'fields']).is_a?(Array) - self.fields = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - report_id == o.report_id && - report_name == o.report_name && - report_title == o.report_title && - report_type == o.report_type && - report_titles == o.report_titles && - report_date == o.report_date && - rows == o.rows && - updated_date_utc == o.updated_date_utc && - fields == o.fields - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [report_id, report_name, report_title, report_type, report_titles, report_date, rows, updated_date_utc, fields].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/report_with_rows.rb b/lib/xero-ruby/models/accounting/report_with_rows.rb deleted file mode 100644 index b1174cb0..00000000 --- a/lib/xero-ruby/models/accounting/report_with_rows.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ReportWithRows - attr_accessor :reports - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reports' => :'Reports' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reports' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportWithRows` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportWithRows`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reports') - if (value = attributes[:'reports']).is_a?(Array) - self.reports = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reports == o.reports - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reports].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/reports.rb b/lib/xero-ruby/models/accounting/reports.rb deleted file mode 100644 index 97c45855..00000000 --- a/lib/xero-ruby/models/accounting/reports.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Reports - attr_accessor :reports - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'reports' => :'Reports' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'reports' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Reports` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Reports`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'reports') - if (value = attributes[:'reports']).is_a?(Array) - self.reports = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - reports == o.reports - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [reports].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/request_empty.rb b/lib/xero-ruby/models/accounting/request_empty.rb deleted file mode 100644 index 3b1800f9..00000000 --- a/lib/xero-ruby/models/accounting/request_empty.rb +++ /dev/null @@ -1,204 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class RequestEmpty - # Need at least one field to create an empty JSON payload - attr_accessor :status - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'status' => :'Status' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'status' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::RequestEmpty` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::RequestEmpty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - status == o.status - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [status].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/row_type.rb b/lib/xero-ruby/models/accounting/row_type.rb deleted file mode 100644 index a7bc9b68..00000000 --- a/lib/xero-ruby/models/accounting/row_type.rb +++ /dev/null @@ -1,39 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class RowType - HEADER = "Header".freeze - SECTION = "Section".freeze - ROW = "Row".freeze - SUMMARY_ROW = "SummaryRow".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = RowType.constants.select { |c| RowType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #RowType" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/sales_tracking_category.rb b/lib/xero-ruby/models/accounting/sales_tracking_category.rb deleted file mode 100644 index faa841b5..00000000 --- a/lib/xero-ruby/models/accounting/sales_tracking_category.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class SalesTrackingCategory - # The default sales tracking category name for contacts - attr_accessor :tracking_category_name - - # The default purchase tracking category name for contacts - attr_accessor :tracking_option_name - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tracking_category_name' => :'TrackingCategoryName', - :'tracking_option_name' => :'TrackingOptionName' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tracking_category_name' => :'String', - :'tracking_option_name' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::SalesTrackingCategory` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::SalesTrackingCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tracking_category_name') - self.tracking_category_name = attributes[:'tracking_category_name'] - end - - if attributes.key?(:'tracking_option_name') - self.tracking_option_name = attributes[:'tracking_option_name'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tracking_category_name == o.tracking_category_name && - tracking_option_name == o.tracking_option_name - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tracking_category_name, tracking_option_name].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/schedule.rb b/lib/xero-ruby/models/accounting/schedule.rb deleted file mode 100644 index 913dd2e2..00000000 --- a/lib/xero-ruby/models/accounting/schedule.rb +++ /dev/null @@ -1,310 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Schedule - # Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) - attr_accessor :period - - # One of the following - WEEKLY or MONTHLY - attr_accessor :unit - - # Integer used with due date type e.g 20 (of following month), 31 (of current month) - attr_accessor :due_date - - # the payment terms - attr_accessor :due_date_type - - # Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) - attr_accessor :start_date - - # The calendar date of the next invoice in the schedule to be generated - attr_accessor :next_scheduled_date - - # Invoice end date – only returned if the template has an end date set - attr_accessor :end_date - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'period' => :'Period', - :'unit' => :'Unit', - :'due_date' => :'DueDate', - :'due_date_type' => :'DueDateType', - :'start_date' => :'StartDate', - :'next_scheduled_date' => :'NextScheduledDate', - :'end_date' => :'EndDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'period' => :'Integer', - :'unit' => :'String', - :'due_date' => :'Integer', - :'due_date_type' => :'String', - :'start_date' => :'Date', - :'next_scheduled_date' => :'Date', - :'end_date' => :'Date' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Schedule` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Schedule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'period') - self.period = attributes[:'period'] - end - - if attributes.key?(:'unit') - self.unit = attributes[:'unit'] - end - - if attributes.key?(:'due_date') - self.due_date = attributes[:'due_date'] - end - - if attributes.key?(:'due_date_type') - self.due_date_type = attributes[:'due_date_type'] - end - - if attributes.key?(:'start_date') - self.start_date = attributes[:'start_date'] - end - - if attributes.key?(:'next_scheduled_date') - self.next_scheduled_date = attributes[:'next_scheduled_date'] - end - - if attributes.key?(:'end_date') - self.end_date = attributes[:'end_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - unit_validator = EnumAttributeValidator.new('String', ["WEEKLY", "MONTHLY"]) - return false unless unit_validator.valid?(@unit) - due_date_type_validator = EnumAttributeValidator.new('String', ["DAYSAFTERBILLDATE", "DAYSAFTERBILLMONTH", "OFCURRENTMONTH", "OFFOLLOWINGMONTH"]) - return false unless due_date_type_validator.valid?(@due_date_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] unit Object to be assigned - def unit=(unit) - validator = EnumAttributeValidator.new('String', ["WEEKLY", "MONTHLY"]) - unless validator.valid?(unit) - fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}." - end - @unit = unit - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] due_date_type Object to be assigned - def due_date_type=(due_date_type) - validator = EnumAttributeValidator.new('String', ["DAYSAFTERBILLDATE", "DAYSAFTERBILLMONTH", "OFCURRENTMONTH", "OFFOLLOWINGMONTH"]) - unless validator.valid?(due_date_type) - fail ArgumentError, "invalid value for \"due_date_type\", must be one of #{validator.allowable_values}." - end - @due_date_type = due_date_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - period == o.period && - unit == o.unit && - due_date == o.due_date && - due_date_type == o.due_date_type && - start_date == o.start_date && - next_scheduled_date == o.next_scheduled_date && - end_date == o.end_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [period, unit, due_date, due_date_type, start_date, next_scheduled_date, end_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/tax_component.rb b/lib/xero-ruby/models/accounting/tax_component.rb deleted file mode 100644 index ae5419ee..00000000 --- a/lib/xero-ruby/models/accounting/tax_component.rb +++ /dev/null @@ -1,234 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TaxComponent - # Name of Tax Component - attr_accessor :name - - # Tax Rate (up to 4dp) - attr_accessor :rate - - # Boolean to describe if Tax rate is compounded. - attr_accessor :is_compound - - # Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations - attr_accessor :is_non_recoverable - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'rate' => :'Rate', - :'is_compound' => :'IsCompound', - :'is_non_recoverable' => :'IsNonRecoverable' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'rate' => :'Float', - :'is_compound' => :'Boolean', - :'is_non_recoverable' => :'Boolean' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TaxComponent` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TaxComponent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'rate') - self.rate = attributes[:'rate'] - end - - if attributes.key?(:'is_compound') - self.is_compound = attributes[:'is_compound'] - end - - if attributes.key?(:'is_non_recoverable') - self.is_non_recoverable = attributes[:'is_non_recoverable'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - rate == o.rate && - is_compound == o.is_compound && - is_non_recoverable == o.is_non_recoverable - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, rate, is_compound, is_non_recoverable].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/tax_rate.rb b/lib/xero-ruby/models/accounting/tax_rate.rb deleted file mode 100644 index 46a67a54..00000000 --- a/lib/xero-ruby/models/accounting/tax_rate.rb +++ /dev/null @@ -1,362 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TaxRate - # Name of tax rate - attr_accessor :name - - # The tax type - attr_accessor :tax_type - - # See TaxComponents - attr_accessor :tax_components - - # See Status Codes - attr_accessor :status - - # See ReportTaxTypes - attr_accessor :report_tax_type - - # Boolean to describe if tax rate can be used for asset accounts i.e. true,false - attr_accessor :can_apply_to_assets - - # Boolean to describe if tax rate can be used for equity accounts i.e true,false - attr_accessor :can_apply_to_equity - - # Boolean to describe if tax rate can be used for expense accounts i.e. true,false - attr_accessor :can_apply_to_expenses - - # Boolean to describe if tax rate can be used for liability accounts i.e. true,false - attr_accessor :can_apply_to_liabilities - - # Boolean to describe if tax rate can be used for revenue accounts i.e. true,false - attr_accessor :can_apply_to_revenue - - # Tax Rate (decimal to 4dp) e.g 12.5000 - attr_accessor :display_tax_rate - - # Effective Tax Rate (decimal to 4dp) e.g 12.5000 - attr_accessor :effective_rate - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'name' => :'Name', - :'tax_type' => :'TaxType', - :'tax_components' => :'TaxComponents', - :'status' => :'Status', - :'report_tax_type' => :'ReportTaxType', - :'can_apply_to_assets' => :'CanApplyToAssets', - :'can_apply_to_equity' => :'CanApplyToEquity', - :'can_apply_to_expenses' => :'CanApplyToExpenses', - :'can_apply_to_liabilities' => :'CanApplyToLiabilities', - :'can_apply_to_revenue' => :'CanApplyToRevenue', - :'display_tax_rate' => :'DisplayTaxRate', - :'effective_rate' => :'EffectiveRate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'name' => :'String', - :'tax_type' => :'String', - :'tax_components' => :'Array', - :'status' => :'String', - :'report_tax_type' => :'String', - :'can_apply_to_assets' => :'Boolean', - :'can_apply_to_equity' => :'Boolean', - :'can_apply_to_expenses' => :'Boolean', - :'can_apply_to_liabilities' => :'Boolean', - :'can_apply_to_revenue' => :'Boolean', - :'display_tax_rate' => :'Float', - :'effective_rate' => :'Float' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TaxRate` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TaxRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'tax_type') - self.tax_type = attributes[:'tax_type'] - end - - if attributes.key?(:'tax_components') - if (value = attributes[:'tax_components']).is_a?(Array) - self.tax_components = value - end - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'report_tax_type') - self.report_tax_type = attributes[:'report_tax_type'] - end - - if attributes.key?(:'can_apply_to_assets') - self.can_apply_to_assets = attributes[:'can_apply_to_assets'] - end - - if attributes.key?(:'can_apply_to_equity') - self.can_apply_to_equity = attributes[:'can_apply_to_equity'] - end - - if attributes.key?(:'can_apply_to_expenses') - self.can_apply_to_expenses = attributes[:'can_apply_to_expenses'] - end - - if attributes.key?(:'can_apply_to_liabilities') - self.can_apply_to_liabilities = attributes[:'can_apply_to_liabilities'] - end - - if attributes.key?(:'can_apply_to_revenue') - self.can_apply_to_revenue = attributes[:'can_apply_to_revenue'] - end - - if attributes.key?(:'display_tax_rate') - self.display_tax_rate = attributes[:'display_tax_rate'] - end - - if attributes.key?(:'effective_rate') - self.effective_rate = attributes[:'effective_rate'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED", "ARCHIVED", "PENDING"]) - return false unless status_validator.valid?(@status) - report_tax_type_validator = EnumAttributeValidator.new('String', ["AVALARA", "BASEXCLUDED", "CAPITALSALESOUTPUT", "CAPITALEXPENSESINPUT", "ECOUTPUT", "ECOUTPUTSERVICES", "ECINPUT", "ECACQUISITIONS", "EXEMPTEXPENSES", "EXEMPTINPUT", "EXEMPTOUTPUT", "GSTONIMPORTS", "INPUT", "INPUTTAXED", "MOSSSALES", "NONE", "NONEOUTPUT", "OUTPUT", "PURCHASESINPUT", "SALESOUTPUT", "EXEMPTCAPITAL", "EXEMPTEXPORT", "CAPITALEXINPUT", "GSTONCAPIMPORTS", "GSTONCAPITALIMPORTS", "REVERSECHARGES", "PAYMENTS", "INVOICE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS", "TXCA", "SRCAS", "DSOUTPUT", "BLINPUT2", "EPINPUT", "IMINPUT2", "MEINPUT", "IGDSINPUT2", "ESN33OUTPUT", "OPINPUT", "OSOUTPUT", "TXN33INPUT", "TXESSINPUT", "TXREINPUT", "TXPETINPUT", "NRINPUT", "ES33OUTPUT", "ZERORATEDINPUT", "ZERORATEDOUTPUT", "DRCHARGESUPPLY", "DRCHARGE"]) - return false unless report_tax_type_validator.valid?(@report_tax_type) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED", "ARCHIVED", "PENDING"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] report_tax_type Object to be assigned - def report_tax_type=(report_tax_type) - validator = EnumAttributeValidator.new('String', ["AVALARA", "BASEXCLUDED", "CAPITALSALESOUTPUT", "CAPITALEXPENSESINPUT", "ECOUTPUT", "ECOUTPUTSERVICES", "ECINPUT", "ECACQUISITIONS", "EXEMPTEXPENSES", "EXEMPTINPUT", "EXEMPTOUTPUT", "GSTONIMPORTS", "INPUT", "INPUTTAXED", "MOSSSALES", "NONE", "NONEOUTPUT", "OUTPUT", "PURCHASESINPUT", "SALESOUTPUT", "EXEMPTCAPITAL", "EXEMPTEXPORT", "CAPITALEXINPUT", "GSTONCAPIMPORTS", "GSTONCAPITALIMPORTS", "REVERSECHARGES", "PAYMENTS", "INVOICE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS", "TXCA", "SRCAS", "DSOUTPUT", "BLINPUT2", "EPINPUT", "IMINPUT2", "MEINPUT", "IGDSINPUT2", "ESN33OUTPUT", "OPINPUT", "OSOUTPUT", "TXN33INPUT", "TXESSINPUT", "TXREINPUT", "TXPETINPUT", "NRINPUT", "ES33OUTPUT", "ZERORATEDINPUT", "ZERORATEDOUTPUT", "DRCHARGESUPPLY", "DRCHARGE"]) - unless validator.valid?(report_tax_type) - fail ArgumentError, "invalid value for \"report_tax_type\", must be one of #{validator.allowable_values}." - end - @report_tax_type = report_tax_type - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - name == o.name && - tax_type == o.tax_type && - tax_components == o.tax_components && - status == o.status && - report_tax_type == o.report_tax_type && - can_apply_to_assets == o.can_apply_to_assets && - can_apply_to_equity == o.can_apply_to_equity && - can_apply_to_expenses == o.can_apply_to_expenses && - can_apply_to_liabilities == o.can_apply_to_liabilities && - can_apply_to_revenue == o.can_apply_to_revenue && - display_tax_rate == o.display_tax_rate && - effective_rate == o.effective_rate - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [name, tax_type, tax_components, status, report_tax_type, can_apply_to_assets, can_apply_to_equity, can_apply_to_expenses, can_apply_to_liabilities, can_apply_to_revenue, display_tax_rate, effective_rate].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/tax_rates.rb b/lib/xero-ruby/models/accounting/tax_rates.rb deleted file mode 100644 index 62db3929..00000000 --- a/lib/xero-ruby/models/accounting/tax_rates.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TaxRates - attr_accessor :tax_rates - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tax_rates' => :'TaxRates' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tax_rates' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TaxRates` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TaxRates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tax_rates') - if (value = attributes[:'tax_rates']).is_a?(Array) - self.tax_rates = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tax_rates == o.tax_rates - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tax_rates].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/tax_type.rb b/lib/xero-ruby/models/accounting/tax_type.rb deleted file mode 100644 index ee961247..00000000 --- a/lib/xero-ruby/models/accounting/tax_type.rb +++ /dev/null @@ -1,94 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TaxType - OUTPUT = "OUTPUT".freeze - INPUT = "INPUT".freeze - CAPEXINPUT = "CAPEXINPUT".freeze - EXEMPTEXPORT = "EXEMPTEXPORT".freeze - EXEMPTEXPENSES = "EXEMPTEXPENSES".freeze - EXEMPTCAPITAL = "EXEMPTCAPITAL".freeze - EXEMPTOUTPUT = "EXEMPTOUTPUT".freeze - INPUTTAXED = "INPUTTAXED".freeze - BASEXCLUDED = "BASEXCLUDED".freeze - GSTONCAPIMPORTS = "GSTONCAPIMPORTS".freeze - GSTONIMPORTS = "GSTONIMPORTS".freeze - NONE = "NONE".freeze - INPUT2 = "INPUT2".freeze - ZERORATED = "ZERORATED".freeze - OUTPUT2 = "OUTPUT2".freeze - CAPEXINPUT2 = "CAPEXINPUT2".freeze - CAPEXOUTPUT = "CAPEXOUTPUT".freeze - CAPEXOUTPUT2 = "CAPEXOUTPUT2".freeze - CAPEXSRINPUT = "CAPEXSRINPUT".freeze - CAPEXSROUTPUT = "CAPEXSROUTPUT".freeze - ECACQUISITIONS = "ECACQUISITIONS".freeze - ECZRINPUT = "ECZRINPUT".freeze - ECZROUTPUT = "ECZROUTPUT".freeze - ECZROUTPUTSERVICES = "ECZROUTPUTSERVICES".freeze - EXEMPTINPUT = "EXEMPTINPUT".freeze - REVERSECHARGES = "REVERSECHARGES".freeze - RRINPUT = "RRINPUT".freeze - RROUTPUT = "RROUTPUT".freeze - SRINPUT = "SRINPUT".freeze - SROUTPUT = "SROUTPUT".freeze - ZERORATEDINPUT = "ZERORATEDINPUT".freeze - ZERORATEDOUTPUT = "ZERORATEDOUTPUT".freeze - BLINPUT = "BLINPUT".freeze - DSOUTPUT = "DSOUTPUT".freeze - EPINPUT = "EPINPUT".freeze - ES33_OUTPUT = "ES33OUTPUT".freeze - ESN33_OUTPUT = "ESN33OUTPUT".freeze - IGDSINPUT2 = "IGDSINPUT2".freeze - IMINPUT2 = "IMINPUT2".freeze - MEINPUT = "MEINPUT".freeze - NRINPUT = "NRINPUT".freeze - OPINPUT = "OPINPUT".freeze - OSOUTPUT = "OSOUTPUT".freeze - TXESSINPUT = "TXESSINPUT".freeze - TXN33_INPUT = "TXN33INPUT".freeze - TXPETINPUT = "TXPETINPUT".freeze - TXREINPUT = "TXREINPUT".freeze - INPUT3 = "INPUT3".freeze - INPUT4 = "INPUT4".freeze - OUTPUT3 = "OUTPUT3".freeze - OUTPUT4 = "OUTPUT4".freeze - SROUTPUT2 = "SROUTPUT2".freeze - TXCA = "TXCA".freeze - SRCAS = "SRCAS".freeze - BLINPUT2 = "BLINPUT2".freeze - DRCHARGESUPPLY20 = "DRCHARGESUPPLY20".freeze - DRCHARGE20 = "DRCHARGE20".freeze - DRCHARGESUPPLY5 = "DRCHARGESUPPLY5".freeze - DRCHARGE5 = "DRCHARGE5".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = TaxType.constants.select { |c| TaxType::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #TaxType" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb b/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb deleted file mode 100644 index e8f96945..00000000 --- a/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb +++ /dev/null @@ -1,414 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TenNinteyNineContact - # Box 1 on 1099 Form - attr_accessor :box1 - - # Box 2 on 1099 Form - attr_accessor :box2 - - # Box 3 on 1099 Form - attr_accessor :box3 - - # Box 4 on 1099 Form - attr_accessor :box4 - - # Box 5 on 1099 Form - attr_accessor :box5 - - # Box 6 on 1099 Form - attr_accessor :box6 - - # Box 7 on 1099 Form - attr_accessor :box7 - - # Box 8 on 1099 Form - attr_accessor :box8 - - # Box 9 on 1099 Form - attr_accessor :box9 - - # Box 10 on 1099 Form - attr_accessor :box10 - - # Box 11 on 1099 Form - attr_accessor :box11 - - # Box 13 on 1099 Form - attr_accessor :box13 - - # Box 14 on 1099 Form - attr_accessor :box14 - - # Contact name on 1099 Form - attr_accessor :name - - # Contact Fed Tax ID type - attr_accessor :federal_tax_id_type - - # Contact city on 1099 Form - attr_accessor :city - - # Contact zip on 1099 Form - attr_accessor :zip - - # Contact State on 1099 Form - attr_accessor :state - - # Contact email on 1099 Form - attr_accessor :email - - # Contact address on 1099 Form - attr_accessor :street_address - - # Contact tax id on 1099 Form - attr_accessor :tax_id - - # Contact contact id - attr_accessor :contact_id - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'box1' => :'Box1', - :'box2' => :'Box2', - :'box3' => :'Box3', - :'box4' => :'Box4', - :'box5' => :'Box5', - :'box6' => :'Box6', - :'box7' => :'Box7', - :'box8' => :'Box8', - :'box9' => :'Box9', - :'box10' => :'Box10', - :'box11' => :'Box11', - :'box13' => :'Box13', - :'box14' => :'Box14', - :'name' => :'Name', - :'federal_tax_id_type' => :'FederalTaxIDType', - :'city' => :'City', - :'zip' => :'Zip', - :'state' => :'State', - :'email' => :'Email', - :'street_address' => :'StreetAddress', - :'tax_id' => :'TaxID', - :'contact_id' => :'ContactId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'box1' => :'Float', - :'box2' => :'Float', - :'box3' => :'Float', - :'box4' => :'Float', - :'box5' => :'Float', - :'box6' => :'Float', - :'box7' => :'Float', - :'box8' => :'Float', - :'box9' => :'Float', - :'box10' => :'Float', - :'box11' => :'Float', - :'box13' => :'Float', - :'box14' => :'Float', - :'name' => :'String', - :'federal_tax_id_type' => :'String', - :'city' => :'String', - :'zip' => :'String', - :'state' => :'String', - :'email' => :'String', - :'street_address' => :'String', - :'tax_id' => :'String', - :'contact_id' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TenNinteyNineContact` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TenNinteyNineContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'box1') - self.box1 = attributes[:'box1'] - end - - if attributes.key?(:'box2') - self.box2 = attributes[:'box2'] - end - - if attributes.key?(:'box3') - self.box3 = attributes[:'box3'] - end - - if attributes.key?(:'box4') - self.box4 = attributes[:'box4'] - end - - if attributes.key?(:'box5') - self.box5 = attributes[:'box5'] - end - - if attributes.key?(:'box6') - self.box6 = attributes[:'box6'] - end - - if attributes.key?(:'box7') - self.box7 = attributes[:'box7'] - end - - if attributes.key?(:'box8') - self.box8 = attributes[:'box8'] - end - - if attributes.key?(:'box9') - self.box9 = attributes[:'box9'] - end - - if attributes.key?(:'box10') - self.box10 = attributes[:'box10'] - end - - if attributes.key?(:'box11') - self.box11 = attributes[:'box11'] - end - - if attributes.key?(:'box13') - self.box13 = attributes[:'box13'] - end - - if attributes.key?(:'box14') - self.box14 = attributes[:'box14'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'federal_tax_id_type') - self.federal_tax_id_type = attributes[:'federal_tax_id_type'] - end - - if attributes.key?(:'city') - self.city = attributes[:'city'] - end - - if attributes.key?(:'zip') - self.zip = attributes[:'zip'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] - end - - if attributes.key?(:'email') - self.email = attributes[:'email'] - end - - if attributes.key?(:'street_address') - self.street_address = attributes[:'street_address'] - end - - if attributes.key?(:'tax_id') - self.tax_id = attributes[:'tax_id'] - end - - if attributes.key?(:'contact_id') - self.contact_id = attributes[:'contact_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - box1 == o.box1 && - box2 == o.box2 && - box3 == o.box3 && - box4 == o.box4 && - box5 == o.box5 && - box6 == o.box6 && - box7 == o.box7 && - box8 == o.box8 && - box9 == o.box9 && - box10 == o.box10 && - box11 == o.box11 && - box13 == o.box13 && - box14 == o.box14 && - name == o.name && - federal_tax_id_type == o.federal_tax_id_type && - city == o.city && - zip == o.zip && - state == o.state && - email == o.email && - street_address == o.street_address && - tax_id == o.tax_id && - contact_id == o.contact_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11, box13, box14, name, federal_tax_id_type, city, zip, state, email, street_address, tax_id, contact_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/time_zone.rb b/lib/xero-ruby/models/accounting/time_zone.rb deleted file mode 100644 index 6f663e81..00000000 --- a/lib/xero-ruby/models/accounting/time_zone.rb +++ /dev/null @@ -1,142 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TimeZone - MOROCCOSTANDARDTIME = "MOROCCOSTANDARDTIME".freeze - UTC = "UTC".freeze - GMTSTANDARDTIME = "GMTSTANDARDTIME".freeze - GREENWICHSTANDARDTIME = "GREENWICHSTANDARDTIME".freeze - WEUROPESTANDARDTIME = "WEUROPESTANDARDTIME".freeze - CENTRALEUROPESTANDARDTIME = "CENTRALEUROPESTANDARDTIME".freeze - ROMANCESTANDARDTIME = "ROMANCESTANDARDTIME".freeze - CENTRALEUROPEANSTANDARDTIME = "CENTRALEUROPEANSTANDARDTIME".freeze - WCENTRALAFRICASTANDARDTIME = "WCENTRALAFRICASTANDARDTIME".freeze - NAMIBIASTANDARDTIME = "NAMIBIASTANDARDTIME".freeze - JORDANSTANDARDTIME = "JORDANSTANDARDTIME".freeze - GTBSTANDARDTIME = "GTBSTANDARDTIME".freeze - MIDDLEEASTSTANDARDTIME = "MIDDLEEASTSTANDARDTIME".freeze - EGYPTSTANDARDTIME = "EGYPTSTANDARDTIME".freeze - SYRIASTANDARDTIME = "SYRIASTANDARDTIME".freeze - EEUROPESTANDARDTIME = "EEUROPESTANDARDTIME".freeze - SOUTHAFRICASTANDARDTIME = "SOUTHAFRICASTANDARDTIME".freeze - FLESTANDARDTIME = "FLESTANDARDTIME".freeze - TURKEYSTANDARDTIME = "TURKEYSTANDARDTIME".freeze - ISRAELSTANDARDTIME = "ISRAELSTANDARDTIME".freeze - KALININGRADSTANDARDTIME = "KALININGRADSTANDARDTIME".freeze - LIBYASTANDARDTIME = "LIBYASTANDARDTIME".freeze - ARABICSTANDARDTIME = "ARABICSTANDARDTIME".freeze - ARABSTANDARDTIME = "ARABSTANDARDTIME".freeze - BELARUSSTANDARDTIME = "BELARUSSTANDARDTIME".freeze - RUSSIANSTANDARDTIME = "RUSSIANSTANDARDTIME".freeze - EAFRICASTANDARDTIME = "EAFRICASTANDARDTIME".freeze - IRANSTANDARDTIME = "IRANSTANDARDTIME".freeze - ARABIANSTANDARDTIME = "ARABIANSTANDARDTIME".freeze - AZERBAIJANSTANDARDTIME = "AZERBAIJANSTANDARDTIME".freeze - RUSSIATIMEZONE3 = "RUSSIATIMEZONE3".freeze - MAURITIUSSTANDARDTIME = "MAURITIUSSTANDARDTIME".freeze - GEORGIANSTANDARDTIME = "GEORGIANSTANDARDTIME".freeze - CAUCASUSSTANDARDTIME = "CAUCASUSSTANDARDTIME".freeze - AFGHANISTANSTANDARDTIME = "AFGHANISTANSTANDARDTIME".freeze - WESTASIASTANDARDTIME = "WESTASIASTANDARDTIME".freeze - EKATERINBURGSTANDARDTIME = "EKATERINBURGSTANDARDTIME".freeze - PAKISTANSTANDARDTIME = "PAKISTANSTANDARDTIME".freeze - INDIASTANDARDTIME = "INDIASTANDARDTIME".freeze - SRILANKASTANDARDTIME = "SRILANKASTANDARDTIME".freeze - NEPALSTANDARDTIME = "NEPALSTANDARDTIME".freeze - CENTRALASIASTANDARDTIME = "CENTRALASIASTANDARDTIME".freeze - BANGLADESHSTANDARDTIME = "BANGLADESHSTANDARDTIME".freeze - NCENTRALASIASTANDARDTIME = "NCENTRALASIASTANDARDTIME".freeze - MYANMARSTANDARDTIME = "MYANMARSTANDARDTIME".freeze - SEASIASTANDARDTIME = "SEASIASTANDARDTIME".freeze - NORTHASIASTANDARDTIME = "NORTHASIASTANDARDTIME".freeze - CHINASTANDARDTIME = "CHINASTANDARDTIME".freeze - NORTHASIAEASTSTANDARDTIME = "NORTHASIAEASTSTANDARDTIME".freeze - SINGAPORESTANDARDTIME = "SINGAPORESTANDARDTIME".freeze - WAUSTRALIASTANDARDTIME = "WAUSTRALIASTANDARDTIME".freeze - TAIPEISTANDARDTIME = "TAIPEISTANDARDTIME".freeze - ULAANBAATARSTANDARDTIME = "ULAANBAATARSTANDARDTIME".freeze - TOKYOSTANDARDTIME = "TOKYOSTANDARDTIME".freeze - KOREASTANDARDTIME = "KOREASTANDARDTIME".freeze - YAKUTSKSTANDARDTIME = "YAKUTSKSTANDARDTIME".freeze - CENAUSTRALIASTANDARDTIME = "CENAUSTRALIASTANDARDTIME".freeze - AUSCENTRALSTANDARDTIME = "AUSCENTRALSTANDARDTIME".freeze - EAUSTRALIASTANDARDTIME = "EAUSTRALIASTANDARDTIME".freeze - AUSEASTERNSTANDARDTIME = "AUSEASTERNSTANDARDTIME".freeze - WESTPACIFICSTANDARDTIME = "WESTPACIFICSTANDARDTIME".freeze - TASMANIASTANDARDTIME = "TASMANIASTANDARDTIME".freeze - MAGADANSTANDARDTIME = "MAGADANSTANDARDTIME".freeze - VLADIVOSTOKSTANDARDTIME = "VLADIVOSTOKSTANDARDTIME".freeze - RUSSIATIMEZONE10 = "RUSSIATIMEZONE10".freeze - CENTRALPACIFICSTANDARDTIME = "CENTRALPACIFICSTANDARDTIME".freeze - RUSSIATIMEZONE11 = "RUSSIATIMEZONE11".freeze - NEWZEALANDSTANDARDTIME = "NEWZEALANDSTANDARDTIME".freeze - UTC12 = "UTC+12".freeze - FIJISTANDARDTIME = "FIJISTANDARDTIME".freeze - KAMCHATKASTANDARDTIME = "KAMCHATKASTANDARDTIME".freeze - TONGASTANDARDTIME = "TONGASTANDARDTIME".freeze - SAMOASTANDARDTIME = "SAMOASTANDARDTIME".freeze - LINEISLANDSSTANDARDTIME = "LINEISLANDSSTANDARDTIME".freeze - AZORESSTANDARDTIME = "AZORESSTANDARDTIME".freeze - CAPEVERDESTANDARDTIME = "CAPEVERDESTANDARDTIME".freeze - UTC02 = "UTC02".freeze - MIDATLANTICSTANDARDTIME = "MIDATLANTICSTANDARDTIME".freeze - ESOUTHAMERICASTANDARDTIME = "ESOUTHAMERICASTANDARDTIME".freeze - ARGENTINASTANDARDTIME = "ARGENTINASTANDARDTIME".freeze - SAEASTERNSTANDARDTIME = "SAEASTERNSTANDARDTIME".freeze - GREENLANDSTANDARDTIME = "GREENLANDSTANDARDTIME".freeze - MONTEVIDEOSTANDARDTIME = "MONTEVIDEOSTANDARDTIME".freeze - BAHIASTANDARDTIME = "BAHIASTANDARDTIME".freeze - NEWFOUNDLANDSTANDARDTIME = "NEWFOUNDLANDSTANDARDTIME".freeze - PARAGUAYSTANDARDTIME = "PARAGUAYSTANDARDTIME".freeze - ATLANTICSTANDARDTIME = "ATLANTICSTANDARDTIME".freeze - CENTRALBRAZILIANSTANDARDTIME = "CENTRALBRAZILIANSTANDARDTIME".freeze - SAWESTERNSTANDARDTIME = "SAWESTERNSTANDARDTIME".freeze - PACIFICSASTANDARDTIME = "PACIFICSASTANDARDTIME".freeze - VENEZUELASTANDARDTIME = "VENEZUELASTANDARDTIME".freeze - SAPACIFICSTANDARDTIME = "SAPACIFICSTANDARDTIME".freeze - EASTERNSTANDARDTIME = "EASTERNSTANDARDTIME".freeze - USEASTERNSTANDARDTIME = "USEASTERNSTANDARDTIME".freeze - CENTRALAMERICASTANDARDTIME = "CENTRALAMERICASTANDARDTIME".freeze - CENTRALSTANDARDTIME = "CENTRALSTANDARDTIME".freeze - CENTRALSTANDARDTIME_MEXICO = "CENTRALSTANDARDTIME(MEXICO)".freeze - CANADACENTRALSTANDARDTIME = "CANADACENTRALSTANDARDTIME".freeze - USMOUNTAINSTANDARDTIME = "USMOUNTAINSTANDARDTIME".freeze - MOUNTAINSTANDARDTIME_MEXICO = "MOUNTAINSTANDARDTIME(MEXICO)".freeze - MOUNTAINSTANDARDTIME = "MOUNTAINSTANDARDTIME".freeze - PACIFICSTANDARDTIME_MEXICO = "PACIFICSTANDARDTIME(MEXICO)".freeze - PACIFICSTANDARDTIME = "PACIFICSTANDARDTIME".freeze - ALASKANSTANDARDTIME = "ALASKANSTANDARDTIME".freeze - HAWAIIANSTANDARDTIME = "HAWAIIANSTANDARDTIME".freeze - UTC11 = "UTC11".freeze - DATELINESTANDARDTIME = "DATELINESTANDARDTIME".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = TimeZone.constants.select { |c| TimeZone::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #TimeZone" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/accounting/tracking_categories.rb b/lib/xero-ruby/models/accounting/tracking_categories.rb deleted file mode 100644 index 82925ce4..00000000 --- a/lib/xero-ruby/models/accounting/tracking_categories.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TrackingCategories - attr_accessor :tracking_categories - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tracking_categories' => :'TrackingCategories' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tracking_categories' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingCategories` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tracking_categories') - if (value = attributes[:'tracking_categories']).is_a?(Array) - self.tracking_categories = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tracking_categories == o.tracking_categories - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tracking_categories].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/tracking_category.rb b/lib/xero-ruby/models/accounting/tracking_category.rb deleted file mode 100644 index 91e15678..00000000 --- a/lib/xero-ruby/models/accounting/tracking_category.rb +++ /dev/null @@ -1,320 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TrackingCategory - # The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - attr_accessor :tracking_category_id - - # The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f - attr_accessor :tracking_option_id - - # The name of the tracking category e.g. Department, Region (max length = 100) - attr_accessor :name - - # The option name of the tracking option e.g. East, West (max length = 100) - attr_accessor :option - - # The status of a tracking category - attr_accessor :status - - # See Tracking Options - attr_accessor :options - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tracking_category_id' => :'TrackingCategoryID', - :'tracking_option_id' => :'TrackingOptionID', - :'name' => :'Name', - :'option' => :'Option', - :'status' => :'Status', - :'options' => :'Options' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tracking_category_id' => :'String', - :'tracking_option_id' => :'String', - :'name' => :'String', - :'option' => :'String', - :'status' => :'String', - :'options' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingCategory` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tracking_category_id') - self.tracking_category_id = attributes[:'tracking_category_id'] - end - - if attributes.key?(:'tracking_option_id') - self.tracking_option_id = attributes[:'tracking_option_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'option') - self.option = attributes[:'option'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'options') - if (value = attributes[:'options']).is_a?(Array) - self.options = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@name.nil? && @name.to_s.length > 100 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') - end - - if !@option.nil? && @option.to_s.length > 100 - invalid_properties.push('invalid value for "option", the character length must be smaller than or equal to 100.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@name.nil? && @name.to_s.length > 100 - return false if !@option.nil? && @option.to_s.length > 100 - status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if !name.nil? && name.to_s.length > 100 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' - end - - @name = name - end - - # Custom attribute writer method with validation - # @param [Object] option Value to be assigned - def option=(option) - if !option.nil? && option.to_s.length > 100 - fail ArgumentError, 'invalid value for "option", the character length must be smaller than or equal to 100.' - end - - @option = option - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tracking_category_id == o.tracking_category_id && - tracking_option_id == o.tracking_option_id && - name == o.name && - option == o.option && - status == o.status && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tracking_category_id, tracking_option_id, name, option, status, options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/tracking_option.rb b/lib/xero-ruby/models/accounting/tracking_option.rb deleted file mode 100644 index 75c07523..00000000 --- a/lib/xero-ruby/models/accounting/tracking_option.rb +++ /dev/null @@ -1,283 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TrackingOption - # The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a - attr_accessor :tracking_option_id - - # The name of the tracking option e.g. Marketing, East (max length = 50) - attr_accessor :name - - # The status of a tracking option - attr_accessor :status - - # Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 - attr_accessor :tracking_category_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'tracking_option_id' => :'TrackingOptionID', - :'name' => :'Name', - :'status' => :'Status', - :'tracking_category_id' => :'TrackingCategoryID' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'tracking_option_id' => :'String', - :'name' => :'String', - :'status' => :'String', - :'tracking_category_id' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingOption` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'tracking_option_id') - self.tracking_option_id = attributes[:'tracking_option_id'] - end - - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'status') - self.status = attributes[:'status'] - end - - if attributes.key?(:'tracking_category_id') - self.tracking_category_id = attributes[:'tracking_category_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if !@name.nil? && @name.to_s.length > 50 - invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if !@name.nil? && @name.to_s.length > 50 - status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) - return false unless status_validator.valid?(@status) - true - end - - # Custom attribute writer method with validation - # @param [Object] name Value to be assigned - def name=(name) - if !name.nil? && name.to_s.length > 50 - fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.' - end - - @name = name - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] status Object to be assigned - def status=(status) - validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) - unless validator.valid?(status) - fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." - end - @status = status - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - tracking_option_id == o.tracking_option_id && - name == o.name && - status == o.status && - tracking_category_id == o.tracking_category_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [tracking_option_id, name, status, tracking_category_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/tracking_options.rb b/lib/xero-ruby/models/accounting/tracking_options.rb deleted file mode 100644 index 5319745c..00000000 --- a/lib/xero-ruby/models/accounting/tracking_options.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class TrackingOptions - attr_accessor :options - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'options' => :'Options' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'options' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingOptions` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'options') - if (value = attributes[:'options']).is_a?(Array) - self.options = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - options == o.options - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [options].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/user.rb b/lib/xero-ruby/models/accounting/user.rb deleted file mode 100644 index becb2d62..00000000 --- a/lib/xero-ruby/models/accounting/user.rb +++ /dev/null @@ -1,298 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class User - # Xero identifier - attr_accessor :user_id - - # Email address of user - attr_accessor :email_address - - # First name of user - attr_accessor :first_name - - # Last name of user - attr_accessor :last_name - - # Timestamp of last change to user - attr_accessor :updated_date_utc - - # Boolean to indicate if user is the subscriber - attr_accessor :is_subscriber - - # User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) - attr_accessor :organisation_role - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'user_id' => :'UserID', - :'email_address' => :'EmailAddress', - :'first_name' => :'FirstName', - :'last_name' => :'LastName', - :'updated_date_utc' => :'UpdatedDateUTC', - :'is_subscriber' => :'IsSubscriber', - :'organisation_role' => :'OrganisationRole' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'user_id' => :'String', - :'email_address' => :'String', - :'first_name' => :'String', - :'last_name' => :'String', - :'updated_date_utc' => :'DateTime', - :'is_subscriber' => :'Boolean', - :'organisation_role' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::User` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'user_id') - self.user_id = attributes[:'user_id'] - end - - if attributes.key?(:'email_address') - self.email_address = attributes[:'email_address'] - end - - if attributes.key?(:'first_name') - self.first_name = attributes[:'first_name'] - end - - if attributes.key?(:'last_name') - self.last_name = attributes[:'last_name'] - end - - if attributes.key?(:'updated_date_utc') - self.updated_date_utc = attributes[:'updated_date_utc'] - end - - if attributes.key?(:'is_subscriber') - self.is_subscriber = attributes[:'is_subscriber'] - end - - if attributes.key?(:'organisation_role') - self.organisation_role = attributes[:'organisation_role'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - organisation_role_validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN"]) - return false unless organisation_role_validator.valid?(@organisation_role) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] organisation_role Object to be assigned - def organisation_role=(organisation_role) - validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN"]) - unless validator.valid?(organisation_role) - fail ArgumentError, "invalid value for \"organisation_role\", must be one of #{validator.allowable_values}." - end - @organisation_role = organisation_role - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - user_id == o.user_id && - email_address == o.email_address && - first_name == o.first_name && - last_name == o.last_name && - updated_date_utc == o.updated_date_utc && - is_subscriber == o.is_subscriber && - organisation_role == o.organisation_role - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [user_id, email_address, first_name, last_name, updated_date_utc, is_subscriber, organisation_role].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/users.rb b/lib/xero-ruby/models/accounting/users.rb deleted file mode 100644 index 429a978e..00000000 --- a/lib/xero-ruby/models/accounting/users.rb +++ /dev/null @@ -1,205 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class Users - attr_accessor :users - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'users' => :'Users' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'users' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Users` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Users`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'users') - if (value = attributes[:'users']).is_a?(Array) - self.users = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - users == o.users - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [users].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/accounting/validation_error.rb b/lib/xero-ruby/models/accounting/validation_error.rb deleted file mode 100644 index 8ba1b3c3..00000000 --- a/lib/xero-ruby/models/accounting/validation_error.rb +++ /dev/null @@ -1,204 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Accounting - class ValidationError - # Validation error message - attr_accessor :message - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'message' => :'Message' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'message' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ValidationError` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ValidationError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'message') - self.message = attributes[:'message'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - message == o.message - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [message].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Accounting.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/asset.rb b/lib/xero-ruby/models/assets/asset.rb deleted file mode 100644 index 490889a7..00000000 --- a/lib/xero-ruby/models/assets/asset.rb +++ /dev/null @@ -1,346 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class Asset - # The Xero-generated Id for the asset - attr_accessor :asset_id - - # The name of the asset - attr_accessor :asset_name - - # The Xero-generated Id for the asset type - attr_accessor :asset_type_id - - # Must be unique. - attr_accessor :asset_number - - # The date the asset was purchased YYYY-MM-DD - attr_accessor :purchase_date - - # The purchase price of the asset - attr_accessor :purchase_price - - # The price the asset was disposed at - attr_accessor :disposal_price - - attr_accessor :asset_status - - # The date the asset’s warranty expires (if needed) YYYY-MM-DD - attr_accessor :warranty_expiry_date - - # The asset's serial number - attr_accessor :serial_number - - attr_accessor :book_depreciation_setting - - attr_accessor :book_depreciation_detail - - # Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. - attr_accessor :can_rollback - - # The accounting value of the asset - attr_accessor :accounting_book_value - - # Boolean to indicate whether delete is enabled - attr_accessor :is_delete_enabled_for_date - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_id' => :'assetId', - :'asset_name' => :'assetName', - :'asset_type_id' => :'assetTypeId', - :'asset_number' => :'assetNumber', - :'purchase_date' => :'purchaseDate', - :'purchase_price' => :'purchasePrice', - :'disposal_price' => :'disposalPrice', - :'asset_status' => :'assetStatus', - :'warranty_expiry_date' => :'warrantyExpiryDate', - :'serial_number' => :'serialNumber', - :'book_depreciation_setting' => :'bookDepreciationSetting', - :'book_depreciation_detail' => :'bookDepreciationDetail', - :'can_rollback' => :'canRollback', - :'accounting_book_value' => :'accountingBookValue', - :'is_delete_enabled_for_date' => :'isDeleteEnabledForDate' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_id' => :'String', - :'asset_name' => :'String', - :'asset_type_id' => :'String', - :'asset_number' => :'String', - :'purchase_date' => :'Date', - :'purchase_price' => :'Float', - :'disposal_price' => :'Float', - :'asset_status' => :'AssetStatus', - :'warranty_expiry_date' => :'String', - :'serial_number' => :'String', - :'book_depreciation_setting' => :'BookDepreciationSetting', - :'book_depreciation_detail' => :'BookDepreciationDetail', - :'can_rollback' => :'Boolean', - :'accounting_book_value' => :'Float', - :'is_delete_enabled_for_date' => :'Boolean' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Asset` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Asset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_id') - self.asset_id = attributes[:'asset_id'] - end - - if attributes.key?(:'asset_name') - self.asset_name = attributes[:'asset_name'] - end - - if attributes.key?(:'asset_type_id') - self.asset_type_id = attributes[:'asset_type_id'] - end - - if attributes.key?(:'asset_number') - self.asset_number = attributes[:'asset_number'] - end - - if attributes.key?(:'purchase_date') - self.purchase_date = attributes[:'purchase_date'] - end - - if attributes.key?(:'purchase_price') - self.purchase_price = attributes[:'purchase_price'] - end - - if attributes.key?(:'disposal_price') - self.disposal_price = attributes[:'disposal_price'] - end - - if attributes.key?(:'asset_status') - self.asset_status = attributes[:'asset_status'] - end - - if attributes.key?(:'warranty_expiry_date') - self.warranty_expiry_date = attributes[:'warranty_expiry_date'] - end - - if attributes.key?(:'serial_number') - self.serial_number = attributes[:'serial_number'] - end - - if attributes.key?(:'book_depreciation_setting') - self.book_depreciation_setting = attributes[:'book_depreciation_setting'] - end - - if attributes.key?(:'book_depreciation_detail') - self.book_depreciation_detail = attributes[:'book_depreciation_detail'] - end - - if attributes.key?(:'can_rollback') - self.can_rollback = attributes[:'can_rollback'] - end - - if attributes.key?(:'accounting_book_value') - self.accounting_book_value = attributes[:'accounting_book_value'] - end - - if attributes.key?(:'is_delete_enabled_for_date') - self.is_delete_enabled_for_date = attributes[:'is_delete_enabled_for_date'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_name.nil? - invalid_properties.push('invalid value for "asset_name", asset_name cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_name.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_id == o.asset_id && - asset_name == o.asset_name && - asset_type_id == o.asset_type_id && - asset_number == o.asset_number && - purchase_date == o.purchase_date && - purchase_price == o.purchase_price && - disposal_price == o.disposal_price && - asset_status == o.asset_status && - warranty_expiry_date == o.warranty_expiry_date && - serial_number == o.serial_number && - book_depreciation_setting == o.book_depreciation_setting && - book_depreciation_detail == o.book_depreciation_detail && - can_rollback == o.can_rollback && - accounting_book_value == o.accounting_book_value && - is_delete_enabled_for_date == o.is_delete_enabled_for_date - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_id, asset_name, asset_type_id, asset_number, purchase_date, purchase_price, disposal_price, asset_status, warranty_expiry_date, serial_number, book_depreciation_setting, book_depreciation_detail, can_rollback, accounting_book_value, is_delete_enabled_for_date].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/asset_status.rb b/lib/xero-ruby/models/assets/asset_status.rb deleted file mode 100644 index 8b7baf1b..00000000 --- a/lib/xero-ruby/models/assets/asset_status.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class AssetStatus - DRAFT = "Draft".freeze - REGISTERED = "Registered".freeze - DISPOSED = "Disposed".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = AssetStatus.constants.select { |c| AssetStatus::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #AssetStatus" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/assets/asset_status_query_param.rb b/lib/xero-ruby/models/assets/asset_status_query_param.rb deleted file mode 100644 index 6a815776..00000000 --- a/lib/xero-ruby/models/assets/asset_status_query_param.rb +++ /dev/null @@ -1,38 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class AssetStatusQueryParam - DRAFT = "DRAFT".freeze - REGISTERED = "REGISTERED".freeze - DISPOSED = "DISPOSED".freeze - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def self.build_from_hash(value) - new.build_from_hash(value) - end - - # Builds the enum from string - # @param [String] The enum value in the form of the string - # @return [String] The enum value - def build_from_hash(value) - constantValues = AssetStatusQueryParam.constants.select { |c| AssetStatusQueryParam::const_get(c) == value } - raise "Invalid ENUM value #{value} for class #AssetStatusQueryParam" if constantValues.empty? - value - end - end -end diff --git a/lib/xero-ruby/models/assets/asset_type.rb b/lib/xero-ruby/models/assets/asset_type.rb deleted file mode 100644 index bb4c309f..00000000 --- a/lib/xero-ruby/models/assets/asset_type.rb +++ /dev/null @@ -1,278 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class AssetType - # Xero generated unique identifier for asset types - attr_accessor :asset_type_id - - # The name of the asset type - attr_accessor :asset_type_name - - # The asset account for fixed assets of this type - attr_accessor :fixed_asset_account_id - - # The expense account for the depreciation of fixed assets of this type - attr_accessor :depreciation_expense_account_id - - # The account for accumulated depreciation of fixed assets of this type - attr_accessor :accumulated_depreciation_account_id - - attr_accessor :book_depreciation_setting - - # All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. - attr_accessor :locks - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_type_id' => :'assetTypeId', - :'asset_type_name' => :'assetTypeName', - :'fixed_asset_account_id' => :'fixedAssetAccountId', - :'depreciation_expense_account_id' => :'depreciationExpenseAccountId', - :'accumulated_depreciation_account_id' => :'accumulatedDepreciationAccountId', - :'book_depreciation_setting' => :'bookDepreciationSetting', - :'locks' => :'locks' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_type_id' => :'String', - :'asset_type_name' => :'String', - :'fixed_asset_account_id' => :'String', - :'depreciation_expense_account_id' => :'String', - :'accumulated_depreciation_account_id' => :'String', - :'book_depreciation_setting' => :'BookDepreciationSetting', - :'locks' => :'Integer' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::AssetType` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::AssetType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_type_id') - self.asset_type_id = attributes[:'asset_type_id'] - end - - if attributes.key?(:'asset_type_name') - self.asset_type_name = attributes[:'asset_type_name'] - end - - if attributes.key?(:'fixed_asset_account_id') - self.fixed_asset_account_id = attributes[:'fixed_asset_account_id'] - end - - if attributes.key?(:'depreciation_expense_account_id') - self.depreciation_expense_account_id = attributes[:'depreciation_expense_account_id'] - end - - if attributes.key?(:'accumulated_depreciation_account_id') - self.accumulated_depreciation_account_id = attributes[:'accumulated_depreciation_account_id'] - end - - if attributes.key?(:'book_depreciation_setting') - self.book_depreciation_setting = attributes[:'book_depreciation_setting'] - end - - if attributes.key?(:'locks') - self.locks = attributes[:'locks'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - if @asset_type_id.nil? - invalid_properties.push('invalid value for "asset_type_id", asset_type_id cannot be nil.') - end - - if @asset_type_name.nil? - invalid_properties.push('invalid value for "asset_type_name", asset_type_name cannot be nil.') - end - - if @book_depreciation_setting.nil? - invalid_properties.push('invalid value for "book_depreciation_setting", book_depreciation_setting cannot be nil.') - end - - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - return false if @asset_type_id.nil? - return false if @asset_type_name.nil? - return false if @book_depreciation_setting.nil? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_type_id == o.asset_type_id && - asset_type_name == o.asset_type_name && - fixed_asset_account_id == o.fixed_asset_account_id && - depreciation_expense_account_id == o.depreciation_expense_account_id && - accumulated_depreciation_account_id == o.accumulated_depreciation_account_id && - book_depreciation_setting == o.book_depreciation_setting && - locks == o.locks - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_type_id, asset_type_name, fixed_asset_account_id, depreciation_expense_account_id, accumulated_depreciation_account_id, book_depreciation_setting, locks].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/assets.rb b/lib/xero-ruby/models/assets/assets.rb deleted file mode 100644 index f18ec70f..00000000 --- a/lib/xero-ruby/models/assets/assets.rb +++ /dev/null @@ -1,214 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class Assets - attr_accessor :pagination - - attr_accessor :items - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'pagination' => :'pagination', - :'items' => :'items' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'pagination' => :'Pagination', - :'items' => :'Array' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Assets` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Assets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'pagination') - self.pagination = attributes[:'pagination'] - end - - if attributes.key?(:'items') - if (value = attributes[:'items']).is_a?(Array) - self.items = value - end - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - pagination == o.pagination && - items == o.items - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [pagination, items].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/book_depreciation_detail.rb b/lib/xero-ruby/models/assets/book_depreciation_detail.rb deleted file mode 100644 index db0221f7..00000000 --- a/lib/xero-ruby/models/assets/book_depreciation_detail.rb +++ /dev/null @@ -1,264 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class BookDepreciationDetail - # When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. - attr_accessor :current_capital_gain - - # When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. - attr_accessor :current_gain_loss - - # YYYY-MM-DD - attr_accessor :depreciation_start_date - - # The value of the asset you want to depreciate, if this is less than the cost of the asset. - attr_accessor :cost_limit - - # The value of the asset remaining when you've fully depreciated it. - attr_accessor :residual_value - - # All depreciation prior to the current financial year. - attr_accessor :prior_accum_depreciation_amount - - # All depreciation occurring in the current financial year. - attr_accessor :current_accum_depreciation_amount - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'current_capital_gain' => :'currentCapitalGain', - :'current_gain_loss' => :'currentGainLoss', - :'depreciation_start_date' => :'depreciationStartDate', - :'cost_limit' => :'costLimit', - :'residual_value' => :'residualValue', - :'prior_accum_depreciation_amount' => :'priorAccumDepreciationAmount', - :'current_accum_depreciation_amount' => :'currentAccumDepreciationAmount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'current_capital_gain' => :'Float', - :'current_gain_loss' => :'Float', - :'depreciation_start_date' => :'Date', - :'cost_limit' => :'Float', - :'residual_value' => :'Float', - :'prior_accum_depreciation_amount' => :'Float', - :'current_accum_depreciation_amount' => :'Float' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::BookDepreciationDetail` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::BookDepreciationDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'current_capital_gain') - self.current_capital_gain = attributes[:'current_capital_gain'] - end - - if attributes.key?(:'current_gain_loss') - self.current_gain_loss = attributes[:'current_gain_loss'] - end - - if attributes.key?(:'depreciation_start_date') - self.depreciation_start_date = attributes[:'depreciation_start_date'] - end - - if attributes.key?(:'cost_limit') - self.cost_limit = attributes[:'cost_limit'] - end - - if attributes.key?(:'residual_value') - self.residual_value = attributes[:'residual_value'] - end - - if attributes.key?(:'prior_accum_depreciation_amount') - self.prior_accum_depreciation_amount = attributes[:'prior_accum_depreciation_amount'] - end - - if attributes.key?(:'current_accum_depreciation_amount') - self.current_accum_depreciation_amount = attributes[:'current_accum_depreciation_amount'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - current_capital_gain == o.current_capital_gain && - current_gain_loss == o.current_gain_loss && - depreciation_start_date == o.depreciation_start_date && - cost_limit == o.cost_limit && - residual_value == o.residual_value && - prior_accum_depreciation_amount == o.prior_accum_depreciation_amount && - current_accum_depreciation_amount == o.current_accum_depreciation_amount - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [current_capital_gain, current_gain_loss, depreciation_start_date, cost_limit, residual_value, prior_accum_depreciation_amount, current_accum_depreciation_amount].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/book_depreciation_setting.rb b/lib/xero-ruby/models/assets/book_depreciation_setting.rb deleted file mode 100644 index ca670af8..00000000 --- a/lib/xero-ruby/models/assets/book_depreciation_setting.rb +++ /dev/null @@ -1,332 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class BookDepreciationSetting - # The method of depreciation applied to this asset. See Depreciation Methods - attr_accessor :depreciation_method - - # The method of averaging applied to this asset. See Averaging Methods - attr_accessor :averaging_method - - # The rate of depreciation (e.g. 0.05) - attr_accessor :depreciation_rate - - # Effective life of the asset in years (e.g. 5) - attr_accessor :effective_life_years - - # See Depreciation Calculation Methods - attr_accessor :depreciation_calculation_method - - # Unique Xero identifier for the depreciable object - attr_accessor :depreciable_object_id - - # The type of asset object - attr_accessor :depreciable_object_type - - # Unique Xero identifier for the effective date change - attr_accessor :book_effective_date_of_change_id - - class EnumAttributeValidator - attr_reader :datatype - attr_reader :allowable_values - - def initialize(datatype, allowable_values) - @allowable_values = allowable_values.map do |value| - case datatype.to_s - when /Integer/i - value.to_i - when /Float/i - value.to_f - else - value - end - end - end - - def valid?(value) - !value || allowable_values.include?(value) - end - end - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'depreciation_method' => :'depreciationMethod', - :'averaging_method' => :'averagingMethod', - :'depreciation_rate' => :'depreciationRate', - :'effective_life_years' => :'effectiveLifeYears', - :'depreciation_calculation_method' => :'depreciationCalculationMethod', - :'depreciable_object_id' => :'depreciableObjectId', - :'depreciable_object_type' => :'depreciableObjectType', - :'book_effective_date_of_change_id' => :'bookEffectiveDateOfChangeId' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'depreciation_method' => :'String', - :'averaging_method' => :'String', - :'depreciation_rate' => :'Float', - :'effective_life_years' => :'Integer', - :'depreciation_calculation_method' => :'String', - :'depreciable_object_id' => :'String', - :'depreciable_object_type' => :'String', - :'book_effective_date_of_change_id' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::BookDepreciationSetting` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::BookDepreciationSetting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'depreciation_method') - self.depreciation_method = attributes[:'depreciation_method'] - end - - if attributes.key?(:'averaging_method') - self.averaging_method = attributes[:'averaging_method'] - end - - if attributes.key?(:'depreciation_rate') - self.depreciation_rate = attributes[:'depreciation_rate'] - end - - if attributes.key?(:'effective_life_years') - self.effective_life_years = attributes[:'effective_life_years'] - end - - if attributes.key?(:'depreciation_calculation_method') - self.depreciation_calculation_method = attributes[:'depreciation_calculation_method'] - end - - if attributes.key?(:'depreciable_object_id') - self.depreciable_object_id = attributes[:'depreciable_object_id'] - end - - if attributes.key?(:'depreciable_object_type') - self.depreciable_object_type = attributes[:'depreciable_object_type'] - end - - if attributes.key?(:'book_effective_date_of_change_id') - self.book_effective_date_of_change_id = attributes[:'book_effective_date_of_change_id'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - depreciation_method_validator = EnumAttributeValidator.new('String', ["NoDepreciation", "StraightLine", "DiminishingValue100", "DiminishingValue150", "DiminishingValue200", "FullDepreciation"]) - return false unless depreciation_method_validator.valid?(@depreciation_method) - averaging_method_validator = EnumAttributeValidator.new('String', ["FullMonth", "ActualDays"]) - return false unless averaging_method_validator.valid?(@averaging_method) - depreciation_calculation_method_validator = EnumAttributeValidator.new('String', ["Rate", "Life", "None"]) - return false unless depreciation_calculation_method_validator.valid?(@depreciation_calculation_method) - true - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] depreciation_method Object to be assigned - def depreciation_method=(depreciation_method) - validator = EnumAttributeValidator.new('String', ["NoDepreciation", "StraightLine", "DiminishingValue100", "DiminishingValue150", "DiminishingValue200", "FullDepreciation"]) - unless validator.valid?(depreciation_method) - fail ArgumentError, "invalid value for \"depreciation_method\", must be one of #{validator.allowable_values}." - end - @depreciation_method = depreciation_method - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] averaging_method Object to be assigned - def averaging_method=(averaging_method) - validator = EnumAttributeValidator.new('String', ["FullMonth", "ActualDays"]) - unless validator.valid?(averaging_method) - fail ArgumentError, "invalid value for \"averaging_method\", must be one of #{validator.allowable_values}." - end - @averaging_method = averaging_method - end - - # Custom attribute writer method checking allowed values (enum). - # @param [Object] depreciation_calculation_method Object to be assigned - def depreciation_calculation_method=(depreciation_calculation_method) - validator = EnumAttributeValidator.new('String', ["Rate", "Life", "None"]) - unless validator.valid?(depreciation_calculation_method) - fail ArgumentError, "invalid value for \"depreciation_calculation_method\", must be one of #{validator.allowable_values}." - end - @depreciation_calculation_method = depreciation_calculation_method - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - depreciation_method == o.depreciation_method && - averaging_method == o.averaging_method && - depreciation_rate == o.depreciation_rate && - effective_life_years == o.effective_life_years && - depreciation_calculation_method == o.depreciation_calculation_method && - depreciable_object_id == o.depreciable_object_id && - depreciable_object_type == o.depreciable_object_type && - book_effective_date_of_change_id == o.book_effective_date_of_change_id - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [depreciation_method, averaging_method, depreciation_rate, effective_life_years, depreciation_calculation_method, depreciable_object_id, depreciable_object_type, book_effective_date_of_change_id].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/error.rb b/lib/xero-ruby/models/assets/error.rb deleted file mode 100644 index 6dc58ce1..00000000 --- a/lib/xero-ruby/models/assets/error.rb +++ /dev/null @@ -1,248 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class Error - # Array of elements of resource validation errors - attr_accessor :resource_validation_errors - - # Array of elements of field validation errors - attr_accessor :field_validation_errors - - # The internal type of error, not accessible externally - attr_accessor :type - - # Title of the error - attr_accessor :title - - # Detail of the error - attr_accessor :detail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_validation_errors' => :'resourceValidationErrors', - :'field_validation_errors' => :'fieldValidationErrors', - :'type' => :'type', - :'title' => :'title', - :'detail' => :'detail' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_validation_errors' => :'Array', - :'field_validation_errors' => :'Array', - :'type' => :'String', - :'title' => :'String', - :'detail' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Error` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_validation_errors') - if (value = attributes[:'resource_validation_errors']).is_a?(Array) - self.resource_validation_errors = value - end - end - - if attributes.key?(:'field_validation_errors') - if (value = attributes[:'field_validation_errors']).is_a?(Array) - self.field_validation_errors = value - end - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'detail') - self.detail = attributes[:'detail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_validation_errors == o.resource_validation_errors && - field_validation_errors == o.field_validation_errors && - type == o.type && - title == o.title && - detail == o.detail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_validation_errors, field_validation_errors, type, title, detail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/field_validation_errors_element.rb b/lib/xero-ruby/models/assets/field_validation_errors_element.rb deleted file mode 100644 index 02dfacee..00000000 --- a/lib/xero-ruby/models/assets/field_validation_errors_element.rb +++ /dev/null @@ -1,254 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class FieldValidationErrorsElement - # The field name of the erroneous field - attr_accessor :field_name - - # The provided value - attr_accessor :value_provided - - # Explaination of the field validation error - attr_accessor :localised_message - - # Internal type of the field validation error message - attr_accessor :type - - # Title of the field validation error - attr_accessor :title - - # Detail of the field validation error - attr_accessor :detail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'field_name' => :'fieldName', - :'value_provided' => :'valueProvided', - :'localised_message' => :'localisedMessage', - :'type' => :'type', - :'title' => :'title', - :'detail' => :'detail' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'field_name' => :'String', - :'value_provided' => :'String', - :'localised_message' => :'String', - :'type' => :'String', - :'title' => :'String', - :'detail' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::FieldValidationErrorsElement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::FieldValidationErrorsElement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'field_name') - self.field_name = attributes[:'field_name'] - end - - if attributes.key?(:'value_provided') - self.value_provided = attributes[:'value_provided'] - end - - if attributes.key?(:'localised_message') - self.localised_message = attributes[:'localised_message'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'detail') - self.detail = attributes[:'detail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - field_name == o.field_name && - value_provided == o.value_provided && - localised_message == o.localised_message && - type == o.type && - title == o.title && - detail == o.detail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [field_name, value_provided, localised_message, type, title, detail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/pagination.rb b/lib/xero-ruby/models/assets/pagination.rb deleted file mode 100644 index 61a0c522..00000000 --- a/lib/xero-ruby/models/assets/pagination.rb +++ /dev/null @@ -1,230 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class Pagination - attr_accessor :page - - attr_accessor :page_size - - attr_accessor :page_count - - attr_accessor :item_count - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'page' => :'page', - :'page_size' => :'pageSize', - :'page_count' => :'pageCount', - :'item_count' => :'itemCount' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'page' => :'Integer', - :'page_size' => :'Integer', - :'page_count' => :'Integer', - :'item_count' => :'Integer' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Pagination` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'page') - self.page = attributes[:'page'] - end - - if attributes.key?(:'page_size') - self.page_size = attributes[:'page_size'] - end - - if attributes.key?(:'page_count') - self.page_count = attributes[:'page_count'] - end - - if attributes.key?(:'item_count') - self.item_count = attributes[:'item_count'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - page == o.page && - page_size == o.page_size && - page_count == o.page_count && - item_count == o.item_count - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [page, page_size, page_count, item_count].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb deleted file mode 100644 index c03ae9c8..00000000 --- a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +++ /dev/null @@ -1,244 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class ResourceValidationErrorsElement - # The field name of the erroneous field - attr_accessor :resource_name - - # Explaination of the resource validation error - attr_accessor :localised_message - - # Internal type of the resource error message - attr_accessor :type - - # Title of the resource validation error - attr_accessor :title - - # Detail of the resource validation error - attr_accessor :detail - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'resource_name' => :'resourceName', - :'localised_message' => :'localisedMessage', - :'type' => :'type', - :'title' => :'title', - :'detail' => :'detail' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'resource_name' => :'String', - :'localised_message' => :'String', - :'type' => :'String', - :'title' => :'String', - :'detail' => :'String' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::ResourceValidationErrorsElement` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::ResourceValidationErrorsElement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'resource_name') - self.resource_name = attributes[:'resource_name'] - end - - if attributes.key?(:'localised_message') - self.localised_message = attributes[:'localised_message'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - - if attributes.key?(:'title') - self.title = attributes[:'title'] - end - - if attributes.key?(:'detail') - self.detail = attributes[:'detail'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - resource_name == o.resource_name && - localised_message == o.localised_message && - type == o.type && - title == o.title && - detail == o.detail - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [resource_name, localised_message, type, title, detail].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/models/assets/setting.rb b/lib/xero-ruby/models/assets/setting.rb deleted file mode 100644 index 7b9f55f9..00000000 --- a/lib/xero-ruby/models/assets/setting.rb +++ /dev/null @@ -1,274 +0,0 @@ -=begin -#Xero Assets API - -#This is the Xero Assets API - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -require 'time' -require 'date' - -module XeroRuby::Assets - class Setting - # The prefix used for fixed asset numbers (“FA-” by default) - attr_accessor :asset_number_prefix - - # The next available sequence number - attr_accessor :asset_number_sequence - - # The date depreciation calculations started on registered fixed assets in Xero - attr_accessor :asset_start_date - - # The last depreciation date - attr_accessor :last_depreciation_date - - # Default account that gains are posted to - attr_accessor :default_gain_on_disposal_account_id - - # Default account that losses are posted to - attr_accessor :default_loss_on_disposal_account_id - - # Default account that capital gains are posted to - attr_accessor :default_capital_gain_on_disposal_account_id - - # opt in for tax calculation - attr_accessor :opt_in_for_tax - - # Attribute mapping from ruby-style variable name to JSON key. - def self.attribute_map - { - :'asset_number_prefix' => :'assetNumberPrefix', - :'asset_number_sequence' => :'assetNumberSequence', - :'asset_start_date' => :'assetStartDate', - :'last_depreciation_date' => :'lastDepreciationDate', - :'default_gain_on_disposal_account_id' => :'defaultGainOnDisposalAccountId', - :'default_loss_on_disposal_account_id' => :'defaultLossOnDisposalAccountId', - :'default_capital_gain_on_disposal_account_id' => :'defaultCapitalGainOnDisposalAccountId', - :'opt_in_for_tax' => :'optInForTax' - } - end - - # Attribute type mapping. - def self.openapi_types - { - :'asset_number_prefix' => :'String', - :'asset_number_sequence' => :'String', - :'asset_start_date' => :'Date', - :'last_depreciation_date' => :'Date', - :'default_gain_on_disposal_account_id' => :'String', - :'default_loss_on_disposal_account_id' => :'String', - :'default_capital_gain_on_disposal_account_id' => :'String', - :'opt_in_for_tax' => :'Boolean' - } - end - - # Initializes the object - # @param [Hash] attributes Model attributes in the form of hash - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Setting` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Setting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'asset_number_prefix') - self.asset_number_prefix = attributes[:'asset_number_prefix'] - end - - if attributes.key?(:'asset_number_sequence') - self.asset_number_sequence = attributes[:'asset_number_sequence'] - end - - if attributes.key?(:'asset_start_date') - self.asset_start_date = attributes[:'asset_start_date'] - end - - if attributes.key?(:'last_depreciation_date') - self.last_depreciation_date = attributes[:'last_depreciation_date'] - end - - if attributes.key?(:'default_gain_on_disposal_account_id') - self.default_gain_on_disposal_account_id = attributes[:'default_gain_on_disposal_account_id'] - end - - if attributes.key?(:'default_loss_on_disposal_account_id') - self.default_loss_on_disposal_account_id = attributes[:'default_loss_on_disposal_account_id'] - end - - if attributes.key?(:'default_capital_gain_on_disposal_account_id') - self.default_capital_gain_on_disposal_account_id = attributes[:'default_capital_gain_on_disposal_account_id'] - end - - if attributes.key?(:'opt_in_for_tax') - self.opt_in_for_tax = attributes[:'opt_in_for_tax'] - end - end - - # Show invalid properties with the reasons. Usually used together with valid? - # @return Array for valid properties with the reasons - def list_invalid_properties - invalid_properties = Array.new - invalid_properties - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - def valid? - true - end - - # Checks equality by comparing each attribute. - # @param [Object] Object to be compared - def ==(o) - return true if self.equal?(o) - self.class == o.class && - asset_number_prefix == o.asset_number_prefix && - asset_number_sequence == o.asset_number_sequence && - asset_start_date == o.asset_start_date && - last_depreciation_date == o.last_depreciation_date && - default_gain_on_disposal_account_id == o.default_gain_on_disposal_account_id && - default_loss_on_disposal_account_id == o.default_loss_on_disposal_account_id && - default_capital_gain_on_disposal_account_id == o.default_capital_gain_on_disposal_account_id && - opt_in_for_tax == o.opt_in_for_tax - end - - # @see the `==` method - # @param [Object] Object to be compared - def eql?(o) - self == o - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - def hash - [asset_number_prefix, asset_number_sequence, asset_start_date, last_depreciation_date, default_gain_on_disposal_account_id, default_loss_on_disposal_account_id, default_capital_gain_on_disposal_account_id, opt_in_for_tax].hash - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def build_from_hash(attributes) - return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| - if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the attribute - # is documented as an array but the input is not - if attributes[self.class.attribute_map[key]].is_a?(Array) - self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) - end - elsif !attributes[self.class.attribute_map[key]].nil? - self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - end # or else data not found in attributes(hash), not an issue as the data can be optional - end - - self - end - - # Deserializes the data based on type - # @param string type Data type - # @param string value Value to be deserialized - # @return [Object] Deserialized data - def _deserialize(type, value) - case type.to_sym - when :DateTime - DateTime.parse(parse_date(value)) - when :Date - Date.parse(parse_date(value)) - when :String - value.to_s - when :Integer - value.to_i - when :Float - value.to_f - when :Boolean - if value.to_s =~ /\A(true|t|yes|y|1)\z/i - true - else - false - end - when :Object - # generic object (usually a Hash), return directly - value - when /\AArray<(?.+)>\z/ - inner_type = Regexp.last_match[:inner_type] - value.map { |v| _deserialize(inner_type, v) } - when /\AHash<(?.+?), (?.+)>\z/ - k_type = Regexp.last_match[:k_type] - v_type = Regexp.last_match[:v_type] - {}.tap do |hash| - value.each do |k, v| - hash[_deserialize(k_type, k)] = _deserialize(v_type, v) - end - end - else # model - XeroRuby::Assets.const_get(type).build_from_hash(value) - end - end - - # Returns the string representation of the object - # @return [String] String presentation of the object - def to_s - to_hash.to_s - end - - # to_body is an alias to to_hash (backward compatibility) - # @return [Hash] Returns the object in the form of hash - def to_body - to_hash - end - - # Returns the object in the form of hash - # @return [Hash] Returns the object in the form of hash - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - next if value.nil? - hash[param] = _to_hash(value) - end - hash - end - - # Outputs non-array value in the form of hash - # For object, use to_hash. Otherwise, just return the value - # @param [Object] value Any valid value - # @return [Hash] Returns the value in the form of hash - def _to_hash(value) - if value.is_a?(Array) - value.compact.map { |v| _to_hash(v) } - elsif value.is_a?(Hash) - {}.tap do |hash| - value.each { |k, v| hash[k] = _to_hash(v) } - end - elsif value.respond_to? :to_hash - value.to_hash - else - value - end - end - - # customized data_parser - def parse_date(datestring) - seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 - return Time.at(seconds_since_epoch).to_s - end - end -end diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb deleted file mode 100644 index 25d3a942..00000000 --- a/lib/xero-ruby/version.rb +++ /dev/null @@ -1,15 +0,0 @@ -=begin -#Accounting API - -#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - -The version of the OpenAPI document: 2.1.3 -Contact: api@xero.com -Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 - -=end - -module XeroRuby - VERSION = '0.5.0' -end From b7becf72d0cf48658d27b526eb7fc01ccd823118 Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 16:15:07 -0600 Subject: [PATCH 09/21] docker built --- Gemfile | 1 - README.md | 4 - docs/accounting/Account.md | 55 + docs/accounting/AccountType.md | 16 + docs/accounting/AccountingApi.md | 14426 ++++++++++++++ docs/accounting/Accounts.md | 17 + docs/accounting/AccountsPayable.md | 19 + docs/accounting/AccountsReceivable.md | 19 + docs/accounting/Address.md | 35 + docs/accounting/Allocation.md | 31 + docs/accounting/Allocations.md | 17 + docs/accounting/Attachment.md | 27 + docs/accounting/Attachments.md | 17 + docs/accounting/Balances.md | 19 + docs/accounting/BankTransaction.md | 59 + docs/accounting/BankTransactions.md | 17 + docs/accounting/BankTransfer.md | 37 + docs/accounting/BankTransfers.md | 17 + docs/accounting/BatchPayment.md | 47 + docs/accounting/BatchPaymentDetails.md | 25 + docs/accounting/BatchPayments.md | 17 + docs/accounting/Bill.md | 19 + docs/accounting/BrandingTheme.md | 27 + docs/accounting/BrandingThemes.md | 17 + docs/accounting/CISOrgSetting.md | 21 + docs/accounting/CISSetting.md | 19 + docs/accounting/CISSettings.md | 17 + docs/accounting/Contact.md | 93 + docs/accounting/ContactGroup.md | 23 + docs/accounting/ContactGroups.md | 17 + docs/accounting/ContactPerson.md | 23 + docs/accounting/Contacts.md | 17 + docs/accounting/CountryCode.md | 16 + docs/accounting/CreditNote.md | 67 + docs/accounting/CreditNotes.md | 17 + docs/accounting/Currencies.md | 17 + docs/accounting/Currency.md | 19 + docs/accounting/CurrencyCode.md | 16 + docs/accounting/Element.md | 31 + docs/accounting/Employee.md | 31 + docs/accounting/Employees.md | 17 + docs/accounting/Error.md | 23 + docs/accounting/ExpenseClaim.md | 39 + docs/accounting/ExpenseClaims.md | 17 + docs/accounting/ExternalLink.md | 21 + docs/accounting/HistoryRecord.md | 23 + docs/accounting/HistoryRecords.md | 17 + docs/accounting/Invoice.md | 91 + docs/accounting/InvoiceReminder.md | 17 + docs/accounting/InvoiceReminders.md | 17 + docs/accounting/Invoices.md | 17 + docs/accounting/Item.md | 47 + docs/accounting/Items.md | 17 + docs/accounting/Journal.md | 31 + docs/accounting/JournalLine.md | 39 + docs/accounting/Journals.md | 17 + docs/accounting/LineAmountTypes.md | 16 + docs/accounting/LineItem.md | 41 + docs/accounting/LineItemTracking.md | 23 + docs/accounting/LinkedTransaction.md | 37 + docs/accounting/LinkedTransactions.md | 17 + docs/accounting/ManualJournal.md | 43 + docs/accounting/ManualJournalLine.md | 29 + docs/accounting/ManualJournals.md | 17 + docs/accounting/OnlineInvoice.md | 17 + docs/accounting/OnlineInvoices.md | 17 + docs/accounting/Organisation.md | 81 + docs/accounting/Organisations.md | 17 + docs/accounting/Overpayment.md | 53 + docs/accounting/Overpayments.md | 17 + docs/accounting/Payment.md | 63 + docs/accounting/PaymentDelete.md | 17 + docs/accounting/PaymentService.md | 27 + docs/accounting/PaymentServices.md | 17 + docs/accounting/PaymentTerm.md | 19 + docs/accounting/PaymentTermType.md | 16 + docs/accounting/Payments.md | 17 + docs/accounting/Phone.md | 23 + docs/accounting/Prepayment.md | 53 + docs/accounting/Prepayments.md | 17 + docs/accounting/Purchase.md | 23 + docs/accounting/PurchaseOrder.md | 71 + docs/accounting/PurchaseOrders.md | 17 + docs/accounting/Quote.md | 63 + docs/accounting/QuoteLineAmountTypes.md | 16 + docs/accounting/QuoteStatusCodes.md | 16 + docs/accounting/Quotes.md | 17 + docs/accounting/Receipt.md | 51 + docs/accounting/Receipts.md | 17 + docs/accounting/RepeatingInvoice.md | 47 + docs/accounting/RepeatingInvoices.md | 17 + docs/accounting/Report.md | 29 + docs/accounting/ReportAttribute.md | 19 + docs/accounting/ReportCell.md | 19 + docs/accounting/ReportFields.md | 21 + docs/accounting/ReportRow.md | 21 + docs/accounting/ReportRows.md | 23 + docs/accounting/ReportWithRow.md | 33 + docs/accounting/ReportWithRows.md | 17 + docs/accounting/Reports.md | 17 + docs/accounting/RequestEmpty.md | 17 + docs/accounting/RowType.md | 16 + docs/accounting/SalesTrackingCategory.md | 19 + docs/accounting/Schedule.md | 29 + docs/accounting/TaxComponent.md | 23 + docs/accounting/TaxRate.md | 39 + docs/accounting/TaxRates.md | 17 + docs/accounting/TaxType.md | 16 + docs/accounting/TenNinteyNineContact.md | 59 + docs/accounting/TimeZone.md | 16 + docs/accounting/TrackingCategories.md | 17 + docs/accounting/TrackingCategory.md | 27 + docs/accounting/TrackingOption.md | 23 + docs/accounting/TrackingOptions.md | 17 + docs/accounting/User.md | 29 + docs/accounting/Users.md | 17 + docs/accounting/ValidationError.md | 17 + docs/assets/Asset.md | 45 + docs/assets/AssetApi.md | 414 + docs/assets/AssetStatus.md | 16 + docs/assets/AssetStatusQueryParam.md | 16 + docs/assets/AssetType.md | 29 + docs/assets/Assets.md | 19 + docs/assets/BookDepreciationDetail.md | 29 + docs/assets/BookDepreciationSetting.md | 31 + docs/assets/Error.md | 25 + docs/assets/FieldValidationErrorsElement.md | 27 + docs/assets/Pagination.md | 23 + .../assets/ResourceValidationErrorsElement.md | 25 + docs/assets/Setting.md | 31 + lib/xero-ruby.rb | 174 + lib/xero-ruby/api/accounting_api.rb | 15675 ++++++++++++++++ lib/xero-ruby/api/asset_api.rb | 452 + lib/xero-ruby/api_client.rb | 488 + lib/xero-ruby/api_error.rb | 57 + lib/xero-ruby/configuration.rb | 259 + lib/xero-ruby/models/accounting/account.rb | 496 + .../models/accounting/account_type.rb | 57 + lib/xero-ruby/models/accounting/accounts.rb | 205 + .../models/accounting/accounts_payable.rb | 212 + .../models/accounting/accounts_receivable.rb | 212 + lib/xero-ruby/models/accounting/address.rb | 463 + lib/xero-ruby/models/accounting/allocation.rb | 287 + .../models/accounting/allocations.rb | 205 + lib/xero-ruby/models/accounting/attachment.rb | 254 + .../models/accounting/attachments.rb | 205 + lib/xero-ruby/models/accounting/balances.rb | 213 + .../models/accounting/bank_transaction.rb | 482 + .../models/accounting/bank_transactions.rb | 205 + .../models/accounting/bank_transfer.rb | 321 + .../models/accounting/bank_transfers.rb | 205 + .../models/accounting/batch_payment.rb | 475 + .../accounting/batch_payment_details.rb | 290 + .../models/accounting/batch_payments.rb | 205 + lib/xero-ruby/models/accounting/bill.rb | 213 + .../models/accounting/branding_theme.rb | 288 + .../models/accounting/branding_themes.rb | 205 + .../models/accounting/cis_org_setting.rb | 224 + .../models/accounting/cis_setting.rb | 214 + .../models/accounting/cis_settings.rb | 205 + lib/xero-ruby/models/accounting/contact.rb | 738 + .../models/accounting/contact_group.rb | 270 + .../models/accounting/contact_groups.rb | 205 + .../models/accounting/contact_person.rb | 234 + lib/xero-ruby/models/accounting/contacts.rb | 205 + .../models/accounting/country_code.rb | 275 + .../models/accounting/credit_note.rb | 509 + .../models/accounting/credit_notes.rb | 205 + lib/xero-ruby/models/accounting/currencies.rb | 205 + lib/xero-ruby/models/accounting/currency.rb | 213 + .../models/accounting/currency_code.rb | 199 + lib/xero-ruby/models/accounting/element.rb | 270 + lib/xero-ruby/models/accounting/employee.rb | 338 + lib/xero-ruby/models/accounting/employees.rb | 205 + lib/xero-ruby/models/accounting/error.rb | 236 + .../models/accounting/expense_claim.rb | 350 + .../models/accounting/expense_claims.rb | 205 + .../models/accounting/external_link.rb | 257 + .../models/accounting/history_record.rb | 234 + .../models/accounting/history_records.rb | 205 + lib/xero-ruby/models/accounting/invoice.rb | 667 + .../models/accounting/invoice_reminder.rb | 204 + .../models/accounting/invoice_reminders.rb | 205 + lib/xero-ruby/models/accounting/invoices.rb | 205 + lib/xero-ruby/models/accounting/item.rb | 423 + lib/xero-ruby/models/accounting/items.rb | 205 + lib/xero-ruby/models/accounting/journal.rb | 310 + .../models/accounting/journal_line.rb | 315 + lib/xero-ruby/models/accounting/journals.rb | 205 + .../models/accounting/line_amount_types.rb | 38 + lib/xero-ruby/models/accounting/line_item.rb | 326 + .../models/accounting/line_item_tracking.rb | 249 + .../models/accounting/linked_transaction.rb | 364 + .../models/accounting/linked_transactions.rb | 205 + .../models/accounting/manual_journal.rb | 382 + .../models/accounting/manual_journal_line.rb | 266 + .../models/accounting/manual_journals.rb | 205 + .../models/accounting/online_invoice.rb | 204 + .../models/accounting/online_invoices.rb | 205 + .../models/accounting/organisation.rb | 632 + .../models/accounting/organisations.rb | 205 + .../models/accounting/overpayment.rb | 437 + .../models/accounting/overpayments.rb | 205 + lib/xero-ruby/models/accounting/payment.rb | 481 + .../models/accounting/payment_delete.rb | 211 + .../models/accounting/payment_service.rb | 256 + .../models/accounting/payment_services.rb | 205 + .../models/accounting/payment_term.rb | 212 + .../models/accounting/payment_term_type.rb | 39 + lib/xero-ruby/models/accounting/payments.rb | 205 + lib/xero-ruby/models/accounting/phone.rb | 312 + lib/xero-ruby/models/accounting/prepayment.rb | 435 + .../models/accounting/prepayments.rb | 205 + lib/xero-ruby/models/accounting/purchase.rb | 234 + .../models/accounting/purchase_order.rb | 515 + .../models/accounting/purchase_orders.rb | 205 + lib/xero-ruby/models/accounting/quote.rb | 509 + .../accounting/quote_line_amount_types.rb | 38 + .../models/accounting/quote_status_codes.rb | 40 + lib/xero-ruby/models/accounting/quotes.rb | 205 + lib/xero-ruby/models/accounting/receipt.rb | 414 + lib/xero-ruby/models/accounting/receipts.rb | 205 + .../models/accounting/repeating_invoice.rb | 402 + .../models/accounting/repeating_invoices.rb | 205 + lib/xero-ruby/models/accounting/report.rb | 299 + .../models/accounting/report_attribute.rb | 212 + .../models/accounting/report_cell.rb | 214 + .../models/accounting/report_fields.rb | 221 + lib/xero-ruby/models/accounting/report_row.rb | 223 + .../models/accounting/report_rows.rb | 234 + .../models/accounting/report_with_row.rb | 288 + .../models/accounting/report_with_rows.rb | 205 + lib/xero-ruby/models/accounting/reports.rb | 205 + .../models/accounting/request_empty.rb | 204 + lib/xero-ruby/models/accounting/row_type.rb | 39 + .../accounting/sales_tracking_category.rb | 214 + lib/xero-ruby/models/accounting/schedule.rb | 310 + .../models/accounting/tax_component.rb | 234 + lib/xero-ruby/models/accounting/tax_rate.rb | 362 + lib/xero-ruby/models/accounting/tax_rates.rb | 205 + lib/xero-ruby/models/accounting/tax_type.rb | 94 + .../accounting/ten_nintey_nine_contact.rb | 414 + lib/xero-ruby/models/accounting/time_zone.rb | 142 + .../models/accounting/tracking_categories.rb | 205 + .../models/accounting/tracking_category.rb | 320 + .../models/accounting/tracking_option.rb | 283 + .../models/accounting/tracking_options.rb | 205 + lib/xero-ruby/models/accounting/user.rb | 298 + lib/xero-ruby/models/accounting/users.rb | 205 + .../models/accounting/validation_error.rb | 204 + lib/xero-ruby/models/assets/asset.rb | 346 + lib/xero-ruby/models/assets/asset_status.rb | 38 + .../models/assets/asset_status_query_param.rb | 38 + lib/xero-ruby/models/assets/asset_type.rb | 278 + lib/xero-ruby/models/assets/assets.rb | 214 + .../models/assets/book_depreciation_detail.rb | 264 + .../assets/book_depreciation_setting.rb | 332 + lib/xero-ruby/models/assets/error.rb | 248 + .../assets/field_validation_errors_element.rb | 254 + lib/xero-ruby/models/assets/pagination.rb | 230 + .../resource_validation_errors_element.rb | 244 + lib/xero-ruby/models/assets/setting.rb | 274 + lib/xero-ruby/version.rb | 15 + xero-ruby.gemspec | 4 +- 264 files changed, 68265 insertions(+), 7 deletions(-) create mode 100644 docs/accounting/Account.md create mode 100644 docs/accounting/AccountType.md create mode 100644 docs/accounting/AccountingApi.md create mode 100644 docs/accounting/Accounts.md create mode 100644 docs/accounting/AccountsPayable.md create mode 100644 docs/accounting/AccountsReceivable.md create mode 100644 docs/accounting/Address.md create mode 100644 docs/accounting/Allocation.md create mode 100644 docs/accounting/Allocations.md create mode 100644 docs/accounting/Attachment.md create mode 100644 docs/accounting/Attachments.md create mode 100644 docs/accounting/Balances.md create mode 100644 docs/accounting/BankTransaction.md create mode 100644 docs/accounting/BankTransactions.md create mode 100644 docs/accounting/BankTransfer.md create mode 100644 docs/accounting/BankTransfers.md create mode 100644 docs/accounting/BatchPayment.md create mode 100644 docs/accounting/BatchPaymentDetails.md create mode 100644 docs/accounting/BatchPayments.md create mode 100644 docs/accounting/Bill.md create mode 100644 docs/accounting/BrandingTheme.md create mode 100644 docs/accounting/BrandingThemes.md create mode 100644 docs/accounting/CISOrgSetting.md create mode 100644 docs/accounting/CISSetting.md create mode 100644 docs/accounting/CISSettings.md create mode 100644 docs/accounting/Contact.md create mode 100644 docs/accounting/ContactGroup.md create mode 100644 docs/accounting/ContactGroups.md create mode 100644 docs/accounting/ContactPerson.md create mode 100644 docs/accounting/Contacts.md create mode 100644 docs/accounting/CountryCode.md create mode 100644 docs/accounting/CreditNote.md create mode 100644 docs/accounting/CreditNotes.md create mode 100644 docs/accounting/Currencies.md create mode 100644 docs/accounting/Currency.md create mode 100644 docs/accounting/CurrencyCode.md create mode 100644 docs/accounting/Element.md create mode 100644 docs/accounting/Employee.md create mode 100644 docs/accounting/Employees.md create mode 100644 docs/accounting/Error.md create mode 100644 docs/accounting/ExpenseClaim.md create mode 100644 docs/accounting/ExpenseClaims.md create mode 100644 docs/accounting/ExternalLink.md create mode 100644 docs/accounting/HistoryRecord.md create mode 100644 docs/accounting/HistoryRecords.md create mode 100644 docs/accounting/Invoice.md create mode 100644 docs/accounting/InvoiceReminder.md create mode 100644 docs/accounting/InvoiceReminders.md create mode 100644 docs/accounting/Invoices.md create mode 100644 docs/accounting/Item.md create mode 100644 docs/accounting/Items.md create mode 100644 docs/accounting/Journal.md create mode 100644 docs/accounting/JournalLine.md create mode 100644 docs/accounting/Journals.md create mode 100644 docs/accounting/LineAmountTypes.md create mode 100644 docs/accounting/LineItem.md create mode 100644 docs/accounting/LineItemTracking.md create mode 100644 docs/accounting/LinkedTransaction.md create mode 100644 docs/accounting/LinkedTransactions.md create mode 100644 docs/accounting/ManualJournal.md create mode 100644 docs/accounting/ManualJournalLine.md create mode 100644 docs/accounting/ManualJournals.md create mode 100644 docs/accounting/OnlineInvoice.md create mode 100644 docs/accounting/OnlineInvoices.md create mode 100644 docs/accounting/Organisation.md create mode 100644 docs/accounting/Organisations.md create mode 100644 docs/accounting/Overpayment.md create mode 100644 docs/accounting/Overpayments.md create mode 100644 docs/accounting/Payment.md create mode 100644 docs/accounting/PaymentDelete.md create mode 100644 docs/accounting/PaymentService.md create mode 100644 docs/accounting/PaymentServices.md create mode 100644 docs/accounting/PaymentTerm.md create mode 100644 docs/accounting/PaymentTermType.md create mode 100644 docs/accounting/Payments.md create mode 100644 docs/accounting/Phone.md create mode 100644 docs/accounting/Prepayment.md create mode 100644 docs/accounting/Prepayments.md create mode 100644 docs/accounting/Purchase.md create mode 100644 docs/accounting/PurchaseOrder.md create mode 100644 docs/accounting/PurchaseOrders.md create mode 100644 docs/accounting/Quote.md create mode 100644 docs/accounting/QuoteLineAmountTypes.md create mode 100644 docs/accounting/QuoteStatusCodes.md create mode 100644 docs/accounting/Quotes.md create mode 100644 docs/accounting/Receipt.md create mode 100644 docs/accounting/Receipts.md create mode 100644 docs/accounting/RepeatingInvoice.md create mode 100644 docs/accounting/RepeatingInvoices.md create mode 100644 docs/accounting/Report.md create mode 100644 docs/accounting/ReportAttribute.md create mode 100644 docs/accounting/ReportCell.md create mode 100644 docs/accounting/ReportFields.md create mode 100644 docs/accounting/ReportRow.md create mode 100644 docs/accounting/ReportRows.md create mode 100644 docs/accounting/ReportWithRow.md create mode 100644 docs/accounting/ReportWithRows.md create mode 100644 docs/accounting/Reports.md create mode 100644 docs/accounting/RequestEmpty.md create mode 100644 docs/accounting/RowType.md create mode 100644 docs/accounting/SalesTrackingCategory.md create mode 100644 docs/accounting/Schedule.md create mode 100644 docs/accounting/TaxComponent.md create mode 100644 docs/accounting/TaxRate.md create mode 100644 docs/accounting/TaxRates.md create mode 100644 docs/accounting/TaxType.md create mode 100644 docs/accounting/TenNinteyNineContact.md create mode 100644 docs/accounting/TimeZone.md create mode 100644 docs/accounting/TrackingCategories.md create mode 100644 docs/accounting/TrackingCategory.md create mode 100644 docs/accounting/TrackingOption.md create mode 100644 docs/accounting/TrackingOptions.md create mode 100644 docs/accounting/User.md create mode 100644 docs/accounting/Users.md create mode 100644 docs/accounting/ValidationError.md create mode 100644 docs/assets/Asset.md create mode 100644 docs/assets/AssetApi.md create mode 100644 docs/assets/AssetStatus.md create mode 100644 docs/assets/AssetStatusQueryParam.md create mode 100644 docs/assets/AssetType.md create mode 100644 docs/assets/Assets.md create mode 100644 docs/assets/BookDepreciationDetail.md create mode 100644 docs/assets/BookDepreciationSetting.md create mode 100644 docs/assets/Error.md create mode 100644 docs/assets/FieldValidationErrorsElement.md create mode 100644 docs/assets/Pagination.md create mode 100644 docs/assets/ResourceValidationErrorsElement.md create mode 100644 docs/assets/Setting.md create mode 100644 lib/xero-ruby.rb create mode 100644 lib/xero-ruby/api/accounting_api.rb create mode 100644 lib/xero-ruby/api/asset_api.rb create mode 100644 lib/xero-ruby/api_client.rb create mode 100644 lib/xero-ruby/api_error.rb create mode 100644 lib/xero-ruby/configuration.rb create mode 100644 lib/xero-ruby/models/accounting/account.rb create mode 100644 lib/xero-ruby/models/accounting/account_type.rb create mode 100644 lib/xero-ruby/models/accounting/accounts.rb create mode 100644 lib/xero-ruby/models/accounting/accounts_payable.rb create mode 100644 lib/xero-ruby/models/accounting/accounts_receivable.rb create mode 100644 lib/xero-ruby/models/accounting/address.rb create mode 100644 lib/xero-ruby/models/accounting/allocation.rb create mode 100644 lib/xero-ruby/models/accounting/allocations.rb create mode 100644 lib/xero-ruby/models/accounting/attachment.rb create mode 100644 lib/xero-ruby/models/accounting/attachments.rb create mode 100644 lib/xero-ruby/models/accounting/balances.rb create mode 100644 lib/xero-ruby/models/accounting/bank_transaction.rb create mode 100644 lib/xero-ruby/models/accounting/bank_transactions.rb create mode 100644 lib/xero-ruby/models/accounting/bank_transfer.rb create mode 100644 lib/xero-ruby/models/accounting/bank_transfers.rb create mode 100644 lib/xero-ruby/models/accounting/batch_payment.rb create mode 100644 lib/xero-ruby/models/accounting/batch_payment_details.rb create mode 100644 lib/xero-ruby/models/accounting/batch_payments.rb create mode 100644 lib/xero-ruby/models/accounting/bill.rb create mode 100644 lib/xero-ruby/models/accounting/branding_theme.rb create mode 100644 lib/xero-ruby/models/accounting/branding_themes.rb create mode 100644 lib/xero-ruby/models/accounting/cis_org_setting.rb create mode 100644 lib/xero-ruby/models/accounting/cis_setting.rb create mode 100644 lib/xero-ruby/models/accounting/cis_settings.rb create mode 100644 lib/xero-ruby/models/accounting/contact.rb create mode 100644 lib/xero-ruby/models/accounting/contact_group.rb create mode 100644 lib/xero-ruby/models/accounting/contact_groups.rb create mode 100644 lib/xero-ruby/models/accounting/contact_person.rb create mode 100644 lib/xero-ruby/models/accounting/contacts.rb create mode 100644 lib/xero-ruby/models/accounting/country_code.rb create mode 100644 lib/xero-ruby/models/accounting/credit_note.rb create mode 100644 lib/xero-ruby/models/accounting/credit_notes.rb create mode 100644 lib/xero-ruby/models/accounting/currencies.rb create mode 100644 lib/xero-ruby/models/accounting/currency.rb create mode 100644 lib/xero-ruby/models/accounting/currency_code.rb create mode 100644 lib/xero-ruby/models/accounting/element.rb create mode 100644 lib/xero-ruby/models/accounting/employee.rb create mode 100644 lib/xero-ruby/models/accounting/employees.rb create mode 100644 lib/xero-ruby/models/accounting/error.rb create mode 100644 lib/xero-ruby/models/accounting/expense_claim.rb create mode 100644 lib/xero-ruby/models/accounting/expense_claims.rb create mode 100644 lib/xero-ruby/models/accounting/external_link.rb create mode 100644 lib/xero-ruby/models/accounting/history_record.rb create mode 100644 lib/xero-ruby/models/accounting/history_records.rb create mode 100644 lib/xero-ruby/models/accounting/invoice.rb create mode 100644 lib/xero-ruby/models/accounting/invoice_reminder.rb create mode 100644 lib/xero-ruby/models/accounting/invoice_reminders.rb create mode 100644 lib/xero-ruby/models/accounting/invoices.rb create mode 100644 lib/xero-ruby/models/accounting/item.rb create mode 100644 lib/xero-ruby/models/accounting/items.rb create mode 100644 lib/xero-ruby/models/accounting/journal.rb create mode 100644 lib/xero-ruby/models/accounting/journal_line.rb create mode 100644 lib/xero-ruby/models/accounting/journals.rb create mode 100644 lib/xero-ruby/models/accounting/line_amount_types.rb create mode 100644 lib/xero-ruby/models/accounting/line_item.rb create mode 100644 lib/xero-ruby/models/accounting/line_item_tracking.rb create mode 100644 lib/xero-ruby/models/accounting/linked_transaction.rb create mode 100644 lib/xero-ruby/models/accounting/linked_transactions.rb create mode 100644 lib/xero-ruby/models/accounting/manual_journal.rb create mode 100644 lib/xero-ruby/models/accounting/manual_journal_line.rb create mode 100644 lib/xero-ruby/models/accounting/manual_journals.rb create mode 100644 lib/xero-ruby/models/accounting/online_invoice.rb create mode 100644 lib/xero-ruby/models/accounting/online_invoices.rb create mode 100644 lib/xero-ruby/models/accounting/organisation.rb create mode 100644 lib/xero-ruby/models/accounting/organisations.rb create mode 100644 lib/xero-ruby/models/accounting/overpayment.rb create mode 100644 lib/xero-ruby/models/accounting/overpayments.rb create mode 100644 lib/xero-ruby/models/accounting/payment.rb create mode 100644 lib/xero-ruby/models/accounting/payment_delete.rb create mode 100644 lib/xero-ruby/models/accounting/payment_service.rb create mode 100644 lib/xero-ruby/models/accounting/payment_services.rb create mode 100644 lib/xero-ruby/models/accounting/payment_term.rb create mode 100644 lib/xero-ruby/models/accounting/payment_term_type.rb create mode 100644 lib/xero-ruby/models/accounting/payments.rb create mode 100644 lib/xero-ruby/models/accounting/phone.rb create mode 100644 lib/xero-ruby/models/accounting/prepayment.rb create mode 100644 lib/xero-ruby/models/accounting/prepayments.rb create mode 100644 lib/xero-ruby/models/accounting/purchase.rb create mode 100644 lib/xero-ruby/models/accounting/purchase_order.rb create mode 100644 lib/xero-ruby/models/accounting/purchase_orders.rb create mode 100644 lib/xero-ruby/models/accounting/quote.rb create mode 100644 lib/xero-ruby/models/accounting/quote_line_amount_types.rb create mode 100644 lib/xero-ruby/models/accounting/quote_status_codes.rb create mode 100644 lib/xero-ruby/models/accounting/quotes.rb create mode 100644 lib/xero-ruby/models/accounting/receipt.rb create mode 100644 lib/xero-ruby/models/accounting/receipts.rb create mode 100644 lib/xero-ruby/models/accounting/repeating_invoice.rb create mode 100644 lib/xero-ruby/models/accounting/repeating_invoices.rb create mode 100644 lib/xero-ruby/models/accounting/report.rb create mode 100644 lib/xero-ruby/models/accounting/report_attribute.rb create mode 100644 lib/xero-ruby/models/accounting/report_cell.rb create mode 100644 lib/xero-ruby/models/accounting/report_fields.rb create mode 100644 lib/xero-ruby/models/accounting/report_row.rb create mode 100644 lib/xero-ruby/models/accounting/report_rows.rb create mode 100644 lib/xero-ruby/models/accounting/report_with_row.rb create mode 100644 lib/xero-ruby/models/accounting/report_with_rows.rb create mode 100644 lib/xero-ruby/models/accounting/reports.rb create mode 100644 lib/xero-ruby/models/accounting/request_empty.rb create mode 100644 lib/xero-ruby/models/accounting/row_type.rb create mode 100644 lib/xero-ruby/models/accounting/sales_tracking_category.rb create mode 100644 lib/xero-ruby/models/accounting/schedule.rb create mode 100644 lib/xero-ruby/models/accounting/tax_component.rb create mode 100644 lib/xero-ruby/models/accounting/tax_rate.rb create mode 100644 lib/xero-ruby/models/accounting/tax_rates.rb create mode 100644 lib/xero-ruby/models/accounting/tax_type.rb create mode 100644 lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb create mode 100644 lib/xero-ruby/models/accounting/time_zone.rb create mode 100644 lib/xero-ruby/models/accounting/tracking_categories.rb create mode 100644 lib/xero-ruby/models/accounting/tracking_category.rb create mode 100644 lib/xero-ruby/models/accounting/tracking_option.rb create mode 100644 lib/xero-ruby/models/accounting/tracking_options.rb create mode 100644 lib/xero-ruby/models/accounting/user.rb create mode 100644 lib/xero-ruby/models/accounting/users.rb create mode 100644 lib/xero-ruby/models/accounting/validation_error.rb create mode 100644 lib/xero-ruby/models/assets/asset.rb create mode 100644 lib/xero-ruby/models/assets/asset_status.rb create mode 100644 lib/xero-ruby/models/assets/asset_status_query_param.rb create mode 100644 lib/xero-ruby/models/assets/asset_type.rb create mode 100644 lib/xero-ruby/models/assets/assets.rb create mode 100644 lib/xero-ruby/models/assets/book_depreciation_detail.rb create mode 100644 lib/xero-ruby/models/assets/book_depreciation_setting.rb create mode 100644 lib/xero-ruby/models/assets/error.rb create mode 100644 lib/xero-ruby/models/assets/field_validation_errors_element.rb create mode 100644 lib/xero-ruby/models/assets/pagination.rb create mode 100644 lib/xero-ruby/models/assets/resource_validation_errors_element.rb create mode 100644 lib/xero-ruby/models/assets/setting.rb create mode 100644 lib/xero-ruby/version.rb diff --git a/Gemfile b/Gemfile index 3f0115d2..577f058f 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rspec' gem 'rake', '~> 12.3.3' gem 'pry-byebug' gem 'rubocop', '~> 0.66.0' diff --git a/README.md b/README.md index cc04618c..f9463c32 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,3 @@ The best resource to understanding how to best leverage this SDK is to clone dow ## Models * [Accounting Models Docs](/docs/accounting/) * [Asset Models Docs](/docs/assets/) - - -## Testing -* `rspec spec/` \ No newline at end of file diff --git a/docs/accounting/Account.md b/docs/accounting/Account.md new file mode 100644 index 00000000..2acad17d --- /dev/null +++ b/docs/accounting/Account.md @@ -0,0 +1,55 @@ +# XeroRuby::Accounting::Account + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) | [optional] +**name** | **String** | Name of account (max length = 150) | [optional] +**account_id** | **String** | The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] +**type** | [**AccountType**](AccountType.md) | | [optional] +**bank_account_number** | **String** | For bank accounts only (Account Type BANK) | [optional] +**status** | **String** | Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes | [optional] +**description** | **String** | Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) | [optional] +**bank_account_type** | **String** | For bank accounts only. See Bank Account types | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**tax_type** | **String** | The tax type from TaxRates | [optional] +**enable_payments_to_account** | **Boolean** | Boolean – describes whether account can have payments applied to it | [optional] +**show_in_expense_claims** | **Boolean** | Boolean – describes whether account code is available for use with expense claims | [optional] +**_class** | **String** | See Account Class Types | [optional] +**system_account** | **String** | If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. | [optional] +**reporting_code** | **String** | Shown if set | [optional] +**reporting_code_name** | **String** | Shown if set | [optional] +**has_attachments** | **Boolean** | boolean to indicate if an account has an attachment (read only) | [optional] [default to false] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**add_to_watchlist** | **Boolean** | Boolean – describes whether the account is shown in the watchlist widget on the dashboard | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Account.new(code: 4400, + name: Food Sales, + account_id: 00000000-0000-0000-0000-000000000000, + type: null, + bank_account_number: null, + status: null, + description: null, + bank_account_type: null, + currency_code: null, + tax_type: null, + enable_payments_to_account: null, + show_in_expense_claims: null, + _class: null, + system_account: null, + reporting_code: null, + reporting_code_name: null, + has_attachments: false, + updated_date_utc: null, + add_to_watchlist: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/AccountType.md b/docs/accounting/AccountType.md new file mode 100644 index 00000000..2bfebddc --- /dev/null +++ b/docs/accounting/AccountType.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::AccountType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::AccountType.new() +``` + + diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md new file mode 100644 index 00000000..e182cad5 --- /dev/null +++ b/docs/accounting/AccountingApi.md @@ -0,0 +1,14426 @@ +# XeroRuby::Accounting::AccountingApi + +All URIs are relative to *https://api.xero.com/api.xro/2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_account**](AccountingApi.md#create_account) | **PUT** /Accounts | Allows you to create a new chart of accounts +[**create_account_attachment_by_file_name**](AccountingApi.md#create_account_attachment_by_file_name) | **PUT** /Accounts/{AccountID}/Attachments/{FileName} | Allows you to create Attachment on Account +[**create_bank_transaction_attachment_by_file_name**](AccountingApi.md#create_bank_transaction_attachment_by_file_name) | **PUT** /BankTransactions/{BankTransactionID}/Attachments/{FileName} | Allows you to createa an Attachment on BankTransaction by Filename +[**create_bank_transaction_history_record**](AccountingApi.md#create_bank_transaction_history_record) | **PUT** /BankTransactions/{BankTransactionID}/History | Allows you to create history record for a bank transactions +[**create_bank_transactions**](AccountingApi.md#create_bank_transactions) | **PUT** /BankTransactions | Allows you to create one or more spend or receive money transaction +[**create_bank_transfer**](AccountingApi.md#create_bank_transfer) | **PUT** /BankTransfers | Allows you to create a bank transfers +[**create_bank_transfer_attachment_by_file_name**](AccountingApi.md#create_bank_transfer_attachment_by_file_name) | **PUT** /BankTransfers/{BankTransferID}/Attachments/{FileName} | +[**create_bank_transfer_history_record**](AccountingApi.md#create_bank_transfer_history_record) | **PUT** /BankTransfers/{BankTransferID}/History | +[**create_batch_payment**](AccountingApi.md#create_batch_payment) | **PUT** /BatchPayments | Create one or many BatchPayments for invoices +[**create_batch_payment_history_record**](AccountingApi.md#create_batch_payment_history_record) | **PUT** /BatchPayments/{BatchPaymentID}/History | Allows you to create a history record for a Batch Payment +[**create_branding_theme_payment_services**](AccountingApi.md#create_branding_theme_payment_services) | **POST** /BrandingThemes/{BrandingThemeID}/PaymentServices | Allow for the creation of new custom payment service for specified Branding Theme +[**create_contact_attachment_by_file_name**](AccountingApi.md#create_contact_attachment_by_file_name) | **PUT** /Contacts/{ContactID}/Attachments/{FileName} | +[**create_contact_group**](AccountingApi.md#create_contact_group) | **PUT** /ContactGroups | Allows you to create a contact group +[**create_contact_group_contacts**](AccountingApi.md#create_contact_group_contacts) | **PUT** /ContactGroups/{ContactGroupID}/Contacts | Allows you to add Contacts to a Contact Group +[**create_contact_history**](AccountingApi.md#create_contact_history) | **PUT** /Contacts/{ContactID}/History | Allows you to retrieve a history records of an Contact +[**create_contacts**](AccountingApi.md#create_contacts) | **PUT** /Contacts | Allows you to create a multiple contacts (bulk) in a Xero organisation +[**create_credit_note_allocation**](AccountingApi.md#create_credit_note_allocation) | **PUT** /CreditNotes/{CreditNoteID}/Allocations | Allows you to create Allocation on CreditNote +[**create_credit_note_attachment_by_file_name**](AccountingApi.md#create_credit_note_attachment_by_file_name) | **PUT** /CreditNotes/{CreditNoteID}/Attachments/{FileName} | Allows you to create Attachments on CreditNote by file name +[**create_credit_note_history**](AccountingApi.md#create_credit_note_history) | **PUT** /CreditNotes/{CreditNoteID}/History | Allows you to retrieve a history records of an CreditNote +[**create_credit_notes**](AccountingApi.md#create_credit_notes) | **PUT** /CreditNotes | Allows you to create a credit note +[**create_currency**](AccountingApi.md#create_currency) | **PUT** /Currencies | +[**create_employees**](AccountingApi.md#create_employees) | **PUT** /Employees | Allows you to create new employees used in Xero payrun +[**create_expense_claim_history**](AccountingApi.md#create_expense_claim_history) | **PUT** /ExpenseClaims/{ExpenseClaimID}/History | Allows you to create a history records of an ExpenseClaim +[**create_expense_claims**](AccountingApi.md#create_expense_claims) | **PUT** /ExpenseClaims | Allows you to retrieve expense claims +[**create_invoice_attachment_by_file_name**](AccountingApi.md#create_invoice_attachment_by_file_name) | **PUT** /Invoices/{InvoiceID}/Attachments/{FileName} | Allows you to create an Attachment on invoices or purchase bills by it's filename +[**create_invoice_history**](AccountingApi.md#create_invoice_history) | **PUT** /Invoices/{InvoiceID}/History | Allows you to retrieve a history records of an invoice +[**create_invoices**](AccountingApi.md#create_invoices) | **PUT** /Invoices | Allows you to create one or more sales invoices or purchase bills +[**create_item_history**](AccountingApi.md#create_item_history) | **PUT** /Items/{ItemID}/History | Allows you to create a history record for items +[**create_items**](AccountingApi.md#create_items) | **PUT** /Items | Allows you to create one or more items +[**create_linked_transaction**](AccountingApi.md#create_linked_transaction) | **PUT** /LinkedTransactions | Allows you to create linked transactions (billable expenses) +[**create_manual_journal_attachment_by_file_name**](AccountingApi.md#create_manual_journal_attachment_by_file_name) | **PUT** /ManualJournals/{ManualJournalID}/Attachments/{FileName} | Allows you to create a specified Attachment on ManualJournal by file name +[**create_manual_journals**](AccountingApi.md#create_manual_journals) | **PUT** /ManualJournals | Allows you to create one or more manual journals +[**create_overpayment_allocations**](AccountingApi.md#create_overpayment_allocations) | **PUT** /Overpayments/{OverpaymentID}/Allocations | Allows you to create a single allocation for an overpayment +[**create_overpayment_history**](AccountingApi.md#create_overpayment_history) | **PUT** /Overpayments/{OverpaymentID}/History | Allows you to create history records of an Overpayment +[**create_payment**](AccountingApi.md#create_payment) | **POST** /Payments | Allows you to create a single payment for invoices or credit notes +[**create_payment_history**](AccountingApi.md#create_payment_history) | **PUT** /Payments/{PaymentID}/History | Allows you to create a history record for a payment +[**create_payment_service**](AccountingApi.md#create_payment_service) | **PUT** /PaymentServices | Allows you to create payment services +[**create_payments**](AccountingApi.md#create_payments) | **PUT** /Payments | Allows you to create multiple payments for invoices or credit notes +[**create_prepayment_allocations**](AccountingApi.md#create_prepayment_allocations) | **PUT** /Prepayments/{PrepaymentID}/Allocations | Allows you to create an Allocation for prepayments +[**create_prepayment_history**](AccountingApi.md#create_prepayment_history) | **PUT** /Prepayments/{PrepaymentID}/History | Allows you to create a history record for an Prepayment +[**create_purchase_order_history**](AccountingApi.md#create_purchase_order_history) | **PUT** /PurchaseOrders/{PurchaseOrderID}/History | Allows you to create HistoryRecord for purchase orders +[**create_purchase_orders**](AccountingApi.md#create_purchase_orders) | **PUT** /PurchaseOrders | Allows you to create one or more purchase orders +[**create_quote_attachment_by_file_name**](AccountingApi.md#create_quote_attachment_by_file_name) | **PUT** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to create Attachment on Quote +[**create_quote_history**](AccountingApi.md#create_quote_history) | **PUT** /Quotes/{QuoteID}/History | Allows you to retrieve a history records of an quote +[**create_quotes**](AccountingApi.md#create_quotes) | **PUT** /Quotes | Allows you to create one or more quotes +[**create_receipt**](AccountingApi.md#create_receipt) | **PUT** /Receipts | Allows you to create draft expense claim receipts for any user +[**create_receipt_attachment_by_file_name**](AccountingApi.md#create_receipt_attachment_by_file_name) | **PUT** /Receipts/{ReceiptID}/Attachments/{FileName} | Allows you to create Attachment on expense claim receipts by file name +[**create_receipt_history**](AccountingApi.md#create_receipt_history) | **PUT** /Receipts/{ReceiptID}/History | Allows you to retrieve a history records of an Receipt +[**create_repeating_invoice_attachment_by_file_name**](AccountingApi.md#create_repeating_invoice_attachment_by_file_name) | **PUT** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} | Allows you to create attachment on repeating invoices by file name +[**create_repeating_invoice_history**](AccountingApi.md#create_repeating_invoice_history) | **PUT** /RepeatingInvoices/{RepeatingInvoiceID}/History | Allows you to create history for a repeating invoice +[**create_tax_rates**](AccountingApi.md#create_tax_rates) | **PUT** /TaxRates | Allows you to create one or more Tax Rates +[**create_tracking_category**](AccountingApi.md#create_tracking_category) | **PUT** /TrackingCategories | Allows you to create tracking categories +[**create_tracking_options**](AccountingApi.md#create_tracking_options) | **PUT** /TrackingCategories/{TrackingCategoryID}/Options | Allows you to create options for a specified tracking category +[**delete_account**](AccountingApi.md#delete_account) | **DELETE** /Accounts/{AccountID} | Allows you to delete a chart of accounts +[**delete_contact_group_contact**](AccountingApi.md#delete_contact_group_contact) | **DELETE** /ContactGroups/{ContactGroupID}/Contacts/{ContactID} | Allows you to delete a specific Contact from a Contact Group +[**delete_contact_group_contacts**](AccountingApi.md#delete_contact_group_contacts) | **DELETE** /ContactGroups/{ContactGroupID}/Contacts | Allows you to delete all Contacts from a Contact Group +[**delete_item**](AccountingApi.md#delete_item) | **DELETE** /Items/{ItemID} | Allows you to delete a specified item +[**delete_linked_transaction**](AccountingApi.md#delete_linked_transaction) | **DELETE** /LinkedTransactions/{LinkedTransactionID} | Allows you to delete a specified linked transactions (billable expenses) +[**delete_payment**](AccountingApi.md#delete_payment) | **POST** /Payments/{PaymentID} | Allows you to update a specified payment for invoices and credit notes +[**delete_tracking_category**](AccountingApi.md#delete_tracking_category) | **DELETE** /TrackingCategories/{TrackingCategoryID} | Allows you to delete tracking categories +[**delete_tracking_options**](AccountingApi.md#delete_tracking_options) | **DELETE** /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} | Allows you to delete a specified option for a specified tracking category +[**email_invoice**](AccountingApi.md#email_invoice) | **POST** /Invoices/{InvoiceID}/Email | Allows you to email a copy of invoice to related Contact +[**get_account**](AccountingApi.md#get_account) | **GET** /Accounts/{AccountID} | Allows you to retrieve a single chart of accounts +[**get_account_attachment_by_file_name**](AccountingApi.md#get_account_attachment_by_file_name) | **GET** /Accounts/{AccountID}/Attachments/{FileName} | Allows you to retrieve Attachment on Account by Filename +[**get_account_attachment_by_id**](AccountingApi.md#get_account_attachment_by_id) | **GET** /Accounts/{AccountID}/Attachments/{AttachmentID} | Allows you to retrieve specific Attachment on Account +[**get_account_attachments**](AccountingApi.md#get_account_attachments) | **GET** /Accounts/{AccountID}/Attachments | Allows you to retrieve Attachments for accounts +[**get_accounts**](AccountingApi.md#get_accounts) | **GET** /Accounts | Allows you to retrieve the full chart of accounts +[**get_bank_transaction**](AccountingApi.md#get_bank_transaction) | **GET** /BankTransactions/{BankTransactionID} | Allows you to retrieve a single spend or receive money transaction +[**get_bank_transaction_attachment_by_file_name**](AccountingApi.md#get_bank_transaction_attachment_by_file_name) | **GET** /BankTransactions/{BankTransactionID}/Attachments/{FileName} | Allows you to retrieve Attachments on BankTransaction by Filename +[**get_bank_transaction_attachment_by_id**](AccountingApi.md#get_bank_transaction_attachment_by_id) | **GET** /BankTransactions/{BankTransactionID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on a specific BankTransaction +[**get_bank_transaction_attachments**](AccountingApi.md#get_bank_transaction_attachments) | **GET** /BankTransactions/{BankTransactionID}/Attachments | Allows you to retrieve any attachments to bank transactions +[**get_bank_transactions**](AccountingApi.md#get_bank_transactions) | **GET** /BankTransactions | Allows you to retrieve any spend or receive money transactions +[**get_bank_transactions_history**](AccountingApi.md#get_bank_transactions_history) | **GET** /BankTransactions/{BankTransactionID}/History | Allows you to retrieve history from a bank transactions +[**get_bank_transfer**](AccountingApi.md#get_bank_transfer) | **GET** /BankTransfers/{BankTransferID} | Allows you to retrieve any bank transfers +[**get_bank_transfer_attachment_by_file_name**](AccountingApi.md#get_bank_transfer_attachment_by_file_name) | **GET** /BankTransfers/{BankTransferID}/Attachments/{FileName} | Allows you to retrieve Attachments on BankTransfer by file name +[**get_bank_transfer_attachment_by_id**](AccountingApi.md#get_bank_transfer_attachment_by_id) | **GET** /BankTransfers/{BankTransferID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on BankTransfer +[**get_bank_transfer_attachments**](AccountingApi.md#get_bank_transfer_attachments) | **GET** /BankTransfers/{BankTransferID}/Attachments | Allows you to retrieve Attachments from bank transfers +[**get_bank_transfer_history**](AccountingApi.md#get_bank_transfer_history) | **GET** /BankTransfers/{BankTransferID}/History | Allows you to retrieve history from a bank transfers +[**get_bank_transfers**](AccountingApi.md#get_bank_transfers) | **GET** /BankTransfers | Allows you to retrieve all bank transfers +[**get_batch_payment_history**](AccountingApi.md#get_batch_payment_history) | **GET** /BatchPayments/{BatchPaymentID}/History | Allows you to retrieve history from a Batch Payment +[**get_batch_payments**](AccountingApi.md#get_batch_payments) | **GET** /BatchPayments | Retrieve either one or many BatchPayments for invoices +[**get_branding_theme**](AccountingApi.md#get_branding_theme) | **GET** /BrandingThemes/{BrandingThemeID} | Allows you to retrieve a specific BrandingThemes +[**get_branding_theme_payment_services**](AccountingApi.md#get_branding_theme_payment_services) | **GET** /BrandingThemes/{BrandingThemeID}/PaymentServices | Allows you to retrieve the Payment services for a Branding Theme +[**get_branding_themes**](AccountingApi.md#get_branding_themes) | **GET** /BrandingThemes | Allows you to retrieve all the BrandingThemes +[**get_contact**](AccountingApi.md#get_contact) | **GET** /Contacts/{ContactID} | Allows you to retrieve a single contacts in a Xero organisation +[**get_contact_attachment_by_file_name**](AccountingApi.md#get_contact_attachment_by_file_name) | **GET** /Contacts/{ContactID}/Attachments/{FileName} | Allows you to retrieve Attachments on Contacts by file name +[**get_contact_attachment_by_id**](AccountingApi.md#get_contact_attachment_by_id) | **GET** /Contacts/{ContactID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on Contacts +[**get_contact_attachments**](AccountingApi.md#get_contact_attachments) | **GET** /Contacts/{ContactID}/Attachments | Allows you to retrieve, add and update contacts in a Xero organisation +[**get_contact_by_contact_number**](AccountingApi.md#get_contact_by_contact_number) | **GET** /Contacts/{ContactNumber} | Allows you to retrieve a single contact by Contact Number in a Xero organisation +[**get_contact_cis_settings**](AccountingApi.md#get_contact_cis_settings) | **GET** /Contacts/{ContactID}/CISSettings | Allows you to retrieve CISSettings for a contact in a Xero organisation +[**get_contact_group**](AccountingApi.md#get_contact_group) | **GET** /ContactGroups/{ContactGroupID} | Allows you to retrieve a unique Contact Group by ID +[**get_contact_groups**](AccountingApi.md#get_contact_groups) | **GET** /ContactGroups | Allows you to retrieve the ContactID and Name of all the contacts in a contact group +[**get_contact_history**](AccountingApi.md#get_contact_history) | **GET** /Contacts/{ContactID}/History | Allows you to retrieve a history records of an Contact +[**get_contacts**](AccountingApi.md#get_contacts) | **GET** /Contacts | Allows you to retrieve all contacts in a Xero organisation +[**get_credit_note**](AccountingApi.md#get_credit_note) | **GET** /CreditNotes/{CreditNoteID} | Allows you to retrieve a specific credit note +[**get_credit_note_as_pdf**](AccountingApi.md#get_credit_note_as_pdf) | **GET** /CreditNotes/{CreditNoteID}/pdf | Allows you to retrieve Credit Note as PDF files +[**get_credit_note_attachment_by_file_name**](AccountingApi.md#get_credit_note_attachment_by_file_name) | **GET** /CreditNotes/{CreditNoteID}/Attachments/{FileName} | Allows you to retrieve Attachments on CreditNote by file name +[**get_credit_note_attachment_by_id**](AccountingApi.md#get_credit_note_attachment_by_id) | **GET** /CreditNotes/{CreditNoteID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on CreditNote +[**get_credit_note_attachments**](AccountingApi.md#get_credit_note_attachments) | **GET** /CreditNotes/{CreditNoteID}/Attachments | Allows you to retrieve Attachments for credit notes +[**get_credit_note_history**](AccountingApi.md#get_credit_note_history) | **GET** /CreditNotes/{CreditNoteID}/History | Allows you to retrieve a history records of an CreditNote +[**get_credit_notes**](AccountingApi.md#get_credit_notes) | **GET** /CreditNotes | Allows you to retrieve any credit notes +[**get_currencies**](AccountingApi.md#get_currencies) | **GET** /Currencies | Allows you to retrieve currencies for your organisation +[**get_employee**](AccountingApi.md#get_employee) | **GET** /Employees/{EmployeeID} | Allows you to retrieve a specific employee used in Xero payrun +[**get_employees**](AccountingApi.md#get_employees) | **GET** /Employees | Allows you to retrieve employees used in Xero payrun +[**get_expense_claim**](AccountingApi.md#get_expense_claim) | **GET** /ExpenseClaims/{ExpenseClaimID} | Allows you to retrieve a specified expense claim +[**get_expense_claim_history**](AccountingApi.md#get_expense_claim_history) | **GET** /ExpenseClaims/{ExpenseClaimID}/History | Allows you to retrieve a history records of an ExpenseClaim +[**get_expense_claims**](AccountingApi.md#get_expense_claims) | **GET** /ExpenseClaims | Allows you to retrieve expense claims +[**get_invoice**](AccountingApi.md#get_invoice) | **GET** /Invoices/{InvoiceID} | Allows you to retrieve a specified sales invoice or purchase bill +[**get_invoice_as_pdf**](AccountingApi.md#get_invoice_as_pdf) | **GET** /Invoices/{InvoiceID}/pdf | Allows you to retrieve invoices or purchase bills as PDF files +[**get_invoice_attachment_by_file_name**](AccountingApi.md#get_invoice_attachment_by_file_name) | **GET** /Invoices/{InvoiceID}/Attachments/{FileName} | Allows you to retrieve Attachment on invoices or purchase bills by it's filename +[**get_invoice_attachment_by_id**](AccountingApi.md#get_invoice_attachment_by_id) | **GET** /Invoices/{InvoiceID}/Attachments/{AttachmentID} | Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID +[**get_invoice_attachments**](AccountingApi.md#get_invoice_attachments) | **GET** /Invoices/{InvoiceID}/Attachments | Allows you to retrieve Attachments on invoices or purchase bills +[**get_invoice_history**](AccountingApi.md#get_invoice_history) | **GET** /Invoices/{InvoiceID}/History | Allows you to retrieve a history records of an invoice +[**get_invoice_reminders**](AccountingApi.md#get_invoice_reminders) | **GET** /InvoiceReminders/Settings | Allows you to retrieve invoice reminder settings +[**get_invoices**](AccountingApi.md#get_invoices) | **GET** /Invoices | Allows you to retrieve any sales invoices or purchase bills +[**get_item**](AccountingApi.md#get_item) | **GET** /Items/{ItemID} | Allows you to retrieve a specified item +[**get_item_history**](AccountingApi.md#get_item_history) | **GET** /Items/{ItemID}/History | Allows you to retrieve history for items +[**get_items**](AccountingApi.md#get_items) | **GET** /Items | Allows you to retrieve any items +[**get_journal**](AccountingApi.md#get_journal) | **GET** /Journals/{JournalID} | Allows you to retrieve a specified journals. +[**get_journals**](AccountingApi.md#get_journals) | **GET** /Journals | Allows you to retrieve any journals. +[**get_linked_transaction**](AccountingApi.md#get_linked_transaction) | **GET** /LinkedTransactions/{LinkedTransactionID} | Allows you to retrieve a specified linked transactions (billable expenses) +[**get_linked_transactions**](AccountingApi.md#get_linked_transactions) | **GET** /LinkedTransactions | Retrieve linked transactions (billable expenses) +[**get_manual_journal**](AccountingApi.md#get_manual_journal) | **GET** /ManualJournals/{ManualJournalID} | Allows you to retrieve a specified manual journals +[**get_manual_journal_attachment_by_file_name**](AccountingApi.md#get_manual_journal_attachment_by_file_name) | **GET** /ManualJournals/{ManualJournalID}/Attachments/{FileName} | Allows you to retrieve specified Attachment on ManualJournal by file name +[**get_manual_journal_attachment_by_id**](AccountingApi.md#get_manual_journal_attachment_by_id) | **GET** /ManualJournals/{ManualJournalID}/Attachments/{AttachmentID} | Allows you to retrieve specified Attachment on ManualJournals +[**get_manual_journal_attachments**](AccountingApi.md#get_manual_journal_attachments) | **GET** /ManualJournals/{ManualJournalID}/Attachments | Allows you to retrieve Attachment for manual journals +[**get_manual_journals**](AccountingApi.md#get_manual_journals) | **GET** /ManualJournals | Allows you to retrieve any manual journals +[**get_online_invoice**](AccountingApi.md#get_online_invoice) | **GET** /Invoices/{InvoiceID}/OnlineInvoice | Allows you to retrieve a URL to an online invoice +[**get_organisation_cis_settings**](AccountingApi.md#get_organisation_cis_settings) | **GET** /Organisation/{OrganisationID}/CISSettings | Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. +[**get_organisations**](AccountingApi.md#get_organisations) | **GET** /Organisation | Allows you to retrieve Organisation details +[**get_overpayment**](AccountingApi.md#get_overpayment) | **GET** /Overpayments/{OverpaymentID} | Allows you to retrieve a specified overpayments +[**get_overpayment_history**](AccountingApi.md#get_overpayment_history) | **GET** /Overpayments/{OverpaymentID}/History | Allows you to retrieve a history records of an Overpayment +[**get_overpayments**](AccountingApi.md#get_overpayments) | **GET** /Overpayments | Allows you to retrieve overpayments +[**get_payment**](AccountingApi.md#get_payment) | **GET** /Payments/{PaymentID} | Allows you to retrieve a specified payment for invoices and credit notes +[**get_payment_history**](AccountingApi.md#get_payment_history) | **GET** /Payments/{PaymentID}/History | Allows you to retrieve history records of a payment +[**get_payment_services**](AccountingApi.md#get_payment_services) | **GET** /PaymentServices | Allows you to retrieve payment services +[**get_payments**](AccountingApi.md#get_payments) | **GET** /Payments | Allows you to retrieve payments for invoices and credit notes +[**get_prepayment**](AccountingApi.md#get_prepayment) | **GET** /Prepayments/{PrepaymentID} | Allows you to retrieve a specified prepayments +[**get_prepayment_history**](AccountingApi.md#get_prepayment_history) | **GET** /Prepayments/{PrepaymentID}/History | Allows you to retrieve a history records of an Prepayment +[**get_prepayments**](AccountingApi.md#get_prepayments) | **GET** /Prepayments | Allows you to retrieve prepayments +[**get_purchase_order**](AccountingApi.md#get_purchase_order) | **GET** /PurchaseOrders/{PurchaseOrderID} | Allows you to retrieve a specified purchase orders +[**get_purchase_order_as_pdf**](AccountingApi.md#get_purchase_order_as_pdf) | **GET** /PurchaseOrders/{PurchaseOrderID}/pdf | Allows you to retrieve purchase orders as PDF files +[**get_purchase_order_by_number**](AccountingApi.md#get_purchase_order_by_number) | **GET** /PurchaseOrders/{PurchaseOrderNumber} | Allows you to retrieve a specified purchase orders +[**get_purchase_order_history**](AccountingApi.md#get_purchase_order_history) | **GET** /PurchaseOrders/{PurchaseOrderID}/History | Allows you to retrieve history for PurchaseOrder +[**get_purchase_orders**](AccountingApi.md#get_purchase_orders) | **GET** /PurchaseOrders | Allows you to retrieve purchase orders +[**get_quote**](AccountingApi.md#get_quote) | **GET** /Quotes/{QuoteID} | Allows you to retrieve a specified quote +[**get_quote_as_pdf**](AccountingApi.md#get_quote_as_pdf) | **GET** /Quotes/{QuotesID}/pdf | Allows you to retrieve quotes as PDF files +[**get_quote_attachment_by_file_name**](AccountingApi.md#get_quote_attachment_by_file_name) | **GET** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to retrieve Attachment on Quote by Filename +[**get_quote_attachment_by_id**](AccountingApi.md#get_quote_attachment_by_id) | **GET** /Quotes/{QuoteID}/Attachments/{AttachmentID} | Allows you to retrieve specific Attachment on Quote +[**get_quote_attachments**](AccountingApi.md#get_quote_attachments) | **GET** /Quotes/{QuoteID}/Attachments | Allows you to retrieve Attachments for Quotes +[**get_quote_history**](AccountingApi.md#get_quote_history) | **GET** /Quotes/{QuoteID}/History | Allows you to retrieve a history records of an quote +[**get_quotes**](AccountingApi.md#get_quotes) | **GET** /Quotes | Allows you to retrieve any sales quotes +[**get_receipt**](AccountingApi.md#get_receipt) | **GET** /Receipts/{ReceiptID} | Allows you to retrieve a specified draft expense claim receipts +[**get_receipt_attachment_by_file_name**](AccountingApi.md#get_receipt_attachment_by_file_name) | **GET** /Receipts/{ReceiptID}/Attachments/{FileName} | Allows you to retrieve Attachments on expense claim receipts by file name +[**get_receipt_attachment_by_id**](AccountingApi.md#get_receipt_attachment_by_id) | **GET** /Receipts/{ReceiptID}/Attachments/{AttachmentID} | Allows you to retrieve Attachments on expense claim receipts by ID +[**get_receipt_attachments**](AccountingApi.md#get_receipt_attachments) | **GET** /Receipts/{ReceiptID}/Attachments | Allows you to retrieve Attachments for expense claim receipts +[**get_receipt_history**](AccountingApi.md#get_receipt_history) | **GET** /Receipts/{ReceiptID}/History | Allows you to retrieve a history records of an Receipt +[**get_receipts**](AccountingApi.md#get_receipts) | **GET** /Receipts | Allows you to retrieve draft expense claim receipts for any user +[**get_repeating_invoice**](AccountingApi.md#get_repeating_invoice) | **GET** /RepeatingInvoices/{RepeatingInvoiceID} | Allows you to retrieve a specified repeating invoice +[**get_repeating_invoice_attachment_by_file_name**](AccountingApi.md#get_repeating_invoice_attachment_by_file_name) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} | Allows you to retrieve specified attachment on repeating invoices by file name +[**get_repeating_invoice_attachment_by_id**](AccountingApi.md#get_repeating_invoice_attachment_by_id) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID} | Allows you to retrieve a specified Attachments on repeating invoices +[**get_repeating_invoice_attachments**](AccountingApi.md#get_repeating_invoice_attachments) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments | Allows you to retrieve Attachments on repeating invoice +[**get_repeating_invoice_history**](AccountingApi.md#get_repeating_invoice_history) | **GET** /RepeatingInvoices/{RepeatingInvoiceID}/History | Allows you to retrieve history for a repeating invoice +[**get_repeating_invoices**](AccountingApi.md#get_repeating_invoices) | **GET** /RepeatingInvoices | Allows you to retrieve any repeating invoices +[**get_report_aged_payables_by_contact**](AccountingApi.md#get_report_aged_payables_by_contact) | **GET** /Reports/AgedPayablesByContact | Allows you to retrieve report for AgedPayablesByContact +[**get_report_aged_receivables_by_contact**](AccountingApi.md#get_report_aged_receivables_by_contact) | **GET** /Reports/AgedReceivablesByContact | Allows you to retrieve report for AgedReceivablesByContact +[**get_report_ba_sor_gst**](AccountingApi.md#get_report_ba_sor_gst) | **GET** /Reports/{ReportID} | Allows you to retrieve report for BAS only valid for AU orgs +[**get_report_ba_sor_gst_list**](AccountingApi.md#get_report_ba_sor_gst_list) | **GET** /Reports | Allows you to retrieve report for BAS only valid for AU orgs +[**get_report_balance_sheet**](AccountingApi.md#get_report_balance_sheet) | **GET** /Reports/BalanceSheet | Allows you to retrieve report for BalanceSheet +[**get_report_bank_summary**](AccountingApi.md#get_report_bank_summary) | **GET** /Reports/BankSummary | Allows you to retrieve report for BankSummary +[**get_report_budget_summary**](AccountingApi.md#get_report_budget_summary) | **GET** /Reports/BudgetSummary | Allows you to retrieve report for Budget Summary +[**get_report_executive_summary**](AccountingApi.md#get_report_executive_summary) | **GET** /Reports/ExecutiveSummary | Allows you to retrieve report for ExecutiveSummary +[**get_report_profit_and_loss**](AccountingApi.md#get_report_profit_and_loss) | **GET** /Reports/ProfitAndLoss | Allows you to retrieve report for ProfitAndLoss +[**get_report_ten_ninety_nine**](AccountingApi.md#get_report_ten_ninety_nine) | **GET** /Reports/TenNinetyNine | Allows you to retrieve report for TenNinetyNine +[**get_report_trial_balance**](AccountingApi.md#get_report_trial_balance) | **GET** /Reports/TrialBalance | Allows you to retrieve report for TrialBalance +[**get_tax_rates**](AccountingApi.md#get_tax_rates) | **GET** /TaxRates | Allows you to retrieve Tax Rates +[**get_tracking_categories**](AccountingApi.md#get_tracking_categories) | **GET** /TrackingCategories | Allows you to retrieve tracking categories and options +[**get_tracking_category**](AccountingApi.md#get_tracking_category) | **GET** /TrackingCategories/{TrackingCategoryID} | Allows you to retrieve tracking categories and options for specified category +[**get_user**](AccountingApi.md#get_user) | **GET** /Users/{UserID} | Allows you to retrieve a specified user +[**get_users**](AccountingApi.md#get_users) | **GET** /Users | Allows you to retrieve users +[**update_account**](AccountingApi.md#update_account) | **POST** /Accounts/{AccountID} | Allows you to update a chart of accounts +[**update_account_attachment_by_file_name**](AccountingApi.md#update_account_attachment_by_file_name) | **POST** /Accounts/{AccountID}/Attachments/{FileName} | Allows you to update Attachment on Account by Filename +[**update_bank_transaction**](AccountingApi.md#update_bank_transaction) | **POST** /BankTransactions/{BankTransactionID} | Allows you to update a single spend or receive money transaction +[**update_bank_transaction_attachment_by_file_name**](AccountingApi.md#update_bank_transaction_attachment_by_file_name) | **POST** /BankTransactions/{BankTransactionID}/Attachments/{FileName} | Allows you to update an Attachment on BankTransaction by Filename +[**update_bank_transfer_attachment_by_file_name**](AccountingApi.md#update_bank_transfer_attachment_by_file_name) | **POST** /BankTransfers/{BankTransferID}/Attachments/{FileName} | +[**update_contact**](AccountingApi.md#update_contact) | **POST** /Contacts/{ContactID} | +[**update_contact_attachment_by_file_name**](AccountingApi.md#update_contact_attachment_by_file_name) | **POST** /Contacts/{ContactID}/Attachments/{FileName} | +[**update_contact_group**](AccountingApi.md#update_contact_group) | **POST** /ContactGroups/{ContactGroupID} | Allows you to update a Contact Group +[**update_credit_note**](AccountingApi.md#update_credit_note) | **POST** /CreditNotes/{CreditNoteID} | Allows you to update a specific credit note +[**update_credit_note_attachment_by_file_name**](AccountingApi.md#update_credit_note_attachment_by_file_name) | **POST** /CreditNotes/{CreditNoteID}/Attachments/{FileName} | Allows you to update Attachments on CreditNote by file name +[**update_expense_claim**](AccountingApi.md#update_expense_claim) | **POST** /ExpenseClaims/{ExpenseClaimID} | Allows you to update specified expense claims +[**update_invoice**](AccountingApi.md#update_invoice) | **POST** /Invoices/{InvoiceID} | Allows you to update a specified sales invoices or purchase bills +[**update_invoice_attachment_by_file_name**](AccountingApi.md#update_invoice_attachment_by_file_name) | **POST** /Invoices/{InvoiceID}/Attachments/{FileName} | Allows you to update Attachment on invoices or purchase bills by it's filename +[**update_item**](AccountingApi.md#update_item) | **POST** /Items/{ItemID} | Allows you to update a specified item +[**update_linked_transaction**](AccountingApi.md#update_linked_transaction) | **POST** /LinkedTransactions/{LinkedTransactionID} | Allows you to update a specified linked transactions (billable expenses) +[**update_manual_journal**](AccountingApi.md#update_manual_journal) | **POST** /ManualJournals/{ManualJournalID} | Allows you to update a specified manual journal +[**update_manual_journal_attachment_by_file_name**](AccountingApi.md#update_manual_journal_attachment_by_file_name) | **POST** /ManualJournals/{ManualJournalID}/Attachments/{FileName} | Allows you to update a specified Attachment on ManualJournal by file name +[**update_or_create_bank_transactions**](AccountingApi.md#update_or_create_bank_transactions) | **POST** /BankTransactions | Allows you to update or create one or more spend or receive money transaction +[**update_or_create_contacts**](AccountingApi.md#update_or_create_contacts) | **POST** /Contacts | Allows you to update OR create one or more contacts in a Xero organisation +[**update_or_create_credit_notes**](AccountingApi.md#update_or_create_credit_notes) | **POST** /CreditNotes | Allows you to update OR create one or more credit notes +[**update_or_create_employees**](AccountingApi.md#update_or_create_employees) | **POST** /Employees | Allows you to create a single new employees used in Xero payrun +[**update_or_create_invoices**](AccountingApi.md#update_or_create_invoices) | **POST** /Invoices | Allows you to update OR create one or more sales invoices or purchase bills +[**update_or_create_items**](AccountingApi.md#update_or_create_items) | **POST** /Items | Allows you to update or create one or more items +[**update_or_create_manual_journals**](AccountingApi.md#update_or_create_manual_journals) | **POST** /ManualJournals | Allows you to create a single manual journal +[**update_or_create_purchase_orders**](AccountingApi.md#update_or_create_purchase_orders) | **POST** /PurchaseOrders | Allows you to update or create one or more purchase orders +[**update_or_create_quotes**](AccountingApi.md#update_or_create_quotes) | **POST** /Quotes | Allows you to update OR create one or more quotes +[**update_purchase_order**](AccountingApi.md#update_purchase_order) | **POST** /PurchaseOrders/{PurchaseOrderID} | Allows you to update a specified purchase order +[**update_quote**](AccountingApi.md#update_quote) | **POST** /Quotes/{QuoteID} | Allows you to update a specified quote +[**update_quote_attachment_by_file_name**](AccountingApi.md#update_quote_attachment_by_file_name) | **POST** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to update Attachment on Quote by Filename +[**update_receipt**](AccountingApi.md#update_receipt) | **POST** /Receipts/{ReceiptID} | Allows you to retrieve a specified draft expense claim receipts +[**update_receipt_attachment_by_file_name**](AccountingApi.md#update_receipt_attachment_by_file_name) | **POST** /Receipts/{ReceiptID}/Attachments/{FileName} | Allows you to update Attachment on expense claim receipts by file name +[**update_repeating_invoice_attachment_by_file_name**](AccountingApi.md#update_repeating_invoice_attachment_by_file_name) | **POST** /RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName} | Allows you to update specified attachment on repeating invoices by file name +[**update_tax_rate**](AccountingApi.md#update_tax_rate) | **POST** /TaxRates | Allows you to update Tax Rates +[**update_tracking_category**](AccountingApi.md#update_tracking_category) | **POST** /TrackingCategories/{TrackingCategoryID} | Allows you to update tracking categories +[**update_tracking_options**](AccountingApi.md#update_tracking_options) | **POST** /TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID} | Allows you to update options for a specified tracking category + + + +## create_account + +> Accounts create_account(xero_tenant_id, account) + +Allows you to create a new chart of accounts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" } # Account | Account object in body of request + +begin + #Allows you to create a new chart of accounts + result = api_instance.create_account(xero_tenant_id, account) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_account: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account** | [**Account**](Account.md)| Account object in body of request | + +### Return type + +[**Accounts**](Accounts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_account_attachment_by_file_name + +> Attachments create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) + +Allows you to create Attachment on Account + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object +file_name = 'xero-dev.jpg' # String | Name of the attachment +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to create Attachment on Account + result = api_instance.create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_account_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for Account object | + **file_name** | **String**| Name of the attachment | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_bank_transaction_attachment_by_file_name + +> Attachments create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) + +Allows you to createa an Attachment on BankTransaction by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +file_name = 'xero-dev.jpg' # String | The name of the file being attached +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to createa an Attachment on BankTransaction by Filename + result = api_instance.create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_bank_transaction_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + **file_name** | **String**| The name of the file being attached | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_bank_transaction_history_record + +> HistoryRecords create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) + +Allows you to create history record for a bank transactions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create history record for a bank transactions + result = api_instance.create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_bank_transaction_history_record: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_bank_transactions + +> BankTransactions create_bank_transactions(xero_tenant_id, bank_transactions, opts) + +Allows you to create one or more spend or receive money transaction + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | BankTransactions with an array of BankTransaction objects in body of request +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to create one or more spend or receive money transaction + result = api_instance.create_bank_transactions(xero_tenant_id, bank_transactions, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_bank_transactions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transactions** | [**BankTransactions**](BankTransactions.md)| BankTransactions with an array of BankTransaction objects in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**BankTransactions**](BankTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_bank_transfer + +> BankTransfers create_bank_transfer(xero_tenant_id, bank_transfers) + +Allows you to create a bank transfers + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] } # BankTransfers | BankTransfers with array of BankTransfer objects in request body + +begin + #Allows you to create a bank transfers + result = api_instance.create_bank_transfer(xero_tenant_id, bank_transfers) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_bank_transfer: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfers** | [**BankTransfers**](BankTransfers.md)| BankTransfers with array of BankTransfer objects in request body | + +### Return type + +[**BankTransfers**](BankTransfers.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_bank_transfer_attachment_by_file_name + +> Attachments create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) + + + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer +body = 'body_example' # String | Byte array of file in body of request + +begin + result = api_instance.create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_bank_transfer_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + **file_name** | **String**| The name of the file being attached to a Bank Transfer | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_bank_transfer_history_record + +> HistoryRecords create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) + + + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + result = api_instance.create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_bank_transfer_history_record: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_batch_payment + +> BatchPayments create_batch_payment(xero_tenant_id, batch_payments, opts) + +Create one or many BatchPayments for invoices + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +batch_payments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] } # BatchPayments | BatchPayments with an array of Payments in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Create one or many BatchPayments for invoices + result = api_instance.create_batch_payment(xero_tenant_id, batch_payments, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_batch_payment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **batch_payments** | [**BatchPayments**](BatchPayments.md)| BatchPayments with an array of Payments in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**BatchPayments**](BatchPayments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_batch_payment_history_record + +> HistoryRecords create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) + +Allows you to create a history record for a Batch Payment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create a history record for a Batch Payment + result = api_instance.create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_batch_payment_history_record: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **batch_payment_id** | [**String**](.md)| Unique identifier for BatchPayment | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_branding_theme_payment_services + +> PaymentServices create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) + +Allow for the creation of new custom payment service for specified Branding Theme + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme +payment_service = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" } # PaymentService | PaymentService object in body of request + +begin + #Allow for the creation of new custom payment service for specified Branding Theme + result = api_instance.create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_branding_theme_payment_services: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **branding_theme_id** | [**String**](.md)| Unique identifier for a Branding Theme | + **payment_service** | [**PaymentService**](PaymentService.md)| PaymentService object in body of request | + +### Return type + +[**PaymentServices**](PaymentServices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_contact_attachment_by_file_name + +> Attachments create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) + + + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +file_name = 'xero-dev.jpg' # String | Name for the file you are attaching +body = 'body_example' # String | Byte array of file in body of request + +begin + result = api_instance.create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_contact_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **file_name** | **String**| Name for the file you are attaching | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_contact_group + +> ContactGroups create_contact_group(xero_tenant_id, contact_groups) + +Allows you to create a contact group + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_groups = { contactGroups:[ { name:"VIPs" } ] } # ContactGroups | ContactGroups with an array of names in request body + +begin + #Allows you to create a contact group + result = api_instance.create_contact_group(xero_tenant_id, contact_groups) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_contact_group: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_groups** | [**ContactGroups**](ContactGroups.md)| ContactGroups with an array of names in request body | + +### Return type + +[**ContactGroups**](ContactGroups.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_contact_group_contacts + +> Contacts create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts) + +Allows you to add Contacts to a Contact Group + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group +contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] } # Contacts | Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request + +begin + #Allows you to add Contacts to a Contact Group + result = api_instance.create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_contact_group_contacts: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | + **contacts** | [**Contacts**](Contacts.md)| Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request | + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_contact_history + +> HistoryRecords create_contact_history(xero_tenant_id, contact_id, history_records) + +Allows you to retrieve a history records of an Contact + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to retrieve a history records of an Contact + result = api_instance.create_contact_history(xero_tenant_id, contact_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_contact_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_contacts + +> Contacts create_contacts(xero_tenant_id, contacts, opts) + +Allows you to create a multiple contacts (bulk) in a Xero organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | Contacts with an array of Contact objects to create in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create a multiple contacts (bulk) in a Xero organisation + result = api_instance.create_contacts(xero_tenant_id, contacts, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_contacts: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contacts** | [**Contacts**](Contacts.md)| Contacts with an array of Contact objects to create in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_credit_note_allocation + +> Allocations create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations) + +Allows you to create Allocation on CreditNote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] } # Allocations | Allocations with array of Allocation object in body of request. + +begin + #Allows you to create Allocation on CreditNote + result = api_instance.create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_credit_note_allocation: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **allocations** | [**Allocations**](Allocations.md)| Allocations with array of Allocation object in body of request. | + +### Return type + +[**Allocations**](Allocations.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_credit_note_attachment_by_file_name + +> Attachments create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts) + +Allows you to create Attachments on CreditNote by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note +body = 'body_example' # String | Byte array of file in body of request +opts = { + include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice +} + +begin + #Allows you to create Attachments on CreditNote by file name + result = api_instance.create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_credit_note_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **file_name** | **String**| Name of the file you are attaching to Credit Note | + **body** | **String**| Byte array of file in body of request | + **include_online** | **Boolean**| Allows an attachment to be seen by the end customer within their online invoice | [optional] [default to false] + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_credit_note_history + +> HistoryRecords create_credit_note_history(xero_tenant_id, credit_note_id, history_records) + +Allows you to retrieve a history records of an CreditNote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to retrieve a history records of an CreditNote + result = api_instance.create_credit_note_history(xero_tenant_id, credit_note_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_credit_note_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_credit_notes + +> CreditNotes create_credit_notes(xero_tenant_id, credit_notes, opts) + +Allows you to create a credit note + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_notes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | Credit Notes with array of CreditNote object in body of request +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to create a credit note + result = api_instance.create_credit_notes(xero_tenant_id, credit_notes, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_credit_notes: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_notes** | [**CreditNotes**](CreditNotes.md)| Credit Notes with array of CreditNote object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**CreditNotes**](CreditNotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_currency + +> Currencies create_currency(xero_tenant_id, currency) + + + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +currency = { code: CurrencyCode.USD, description:"United States Dollar" } # Currency | Currency obejct in the body of request + +begin + result = api_instance.create_currency(xero_tenant_id, currency) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_currency: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **currency** | [**Currency**](Currency.md)| Currency obejct in the body of request | + +### Return type + +[**Currencies**](Currencies.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_employees + +> Employees create_employees(xero_tenant_id, employees, opts) + +Allows you to create new employees used in Xero payrun + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | Employees with array of Employee object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create new employees used in Xero payrun + result = api_instance.create_employees(xero_tenant_id, employees, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_employees: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employees** | [**Employees**](Employees.md)| Employees with array of Employee object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_expense_claim_history + +> HistoryRecords create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) + +Allows you to create a history records of an ExpenseClaim + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create a history records of an ExpenseClaim + result = api_instance.create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_expense_claim_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_expense_claims + +> ExpenseClaims create_expense_claims(xero_tenant_id, expense_claims) + +Allows you to retrieve expense claims + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +expense_claims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] } # ExpenseClaims | ExpenseClaims with array of ExpenseClaim object in body of request + +begin + #Allows you to retrieve expense claims + result = api_instance.create_expense_claims(xero_tenant_id, expense_claims) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_expense_claims: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **expense_claims** | [**ExpenseClaims**](ExpenseClaims.md)| ExpenseClaims with array of ExpenseClaim object in body of request | + +### Return type + +[**ExpenseClaims**](ExpenseClaims.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_invoice_attachment_by_file_name + +> Attachments create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts) + +Allows you to create an Attachment on invoices or purchase bills by it's filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +file_name = 'xero-dev.jpg' # String | Name of the file you are attaching +body = 'body_example' # String | Byte array of file in body of request +opts = { + include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice +} + +begin + #Allows you to create an Attachment on invoices or purchase bills by it's filename + result = api_instance.create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_invoice_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **file_name** | **String**| Name of the file you are attaching | + **body** | **String**| Byte array of file in body of request | + **include_online** | **Boolean**| Allows an attachment to be seen by the end customer within their online invoice | [optional] [default to false] + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_invoice_history + +> HistoryRecords create_invoice_history(xero_tenant_id, invoice_id, history_records) + +Allows you to retrieve a history records of an invoice + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to retrieve a history records of an invoice + result = api_instance.create_invoice_history(xero_tenant_id, invoice_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_invoice_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_invoices + +> Invoices create_invoices(xero_tenant_id, invoices, opts) + +Allows you to create one or more sales invoices or purchase bills + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] } # Invoices | Invoices with an array of invoice objects in body of request +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to create one or more sales invoices or purchase bills + result = api_instance.create_invoices(xero_tenant_id, invoices, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_invoices: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoices** | [**Invoices**](Invoices.md)| Invoices with an array of invoice objects in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Invoices**](Invoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_item_history + +> HistoryRecords create_item_history(xero_tenant_id, item_id, history_records) + +Allows you to create a history record for items + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create a history record for items + result = api_instance.create_item_history(xero_tenant_id, item_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_item_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **item_id** | [**String**](.md)| Unique identifier for an Item | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_items + +> Items create_items(xero_tenant_id, items, opts) + +Allows you to create one or more items + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] } # Items | Items with an array of Item objects in body of request +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to create one or more items + result = api_instance.create_items(xero_tenant_id, items, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_items: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **items** | [**Items**](Items.md)| Items with an array of Item objects in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Items**](Items.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_linked_transaction + +> LinkedTransactions create_linked_transaction(xero_tenant_id, linked_transaction) + +Allows you to create linked transactions (billable expenses) + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +linked_transaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"} # LinkedTransaction | LinkedTransaction object in body of request + +begin + #Allows you to create linked transactions (billable expenses) + result = api_instance.create_linked_transaction(xero_tenant_id, linked_transaction) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_linked_transaction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **linked_transaction** | [**LinkedTransaction**](LinkedTransaction.md)| LinkedTransaction object in body of request | + +### Return type + +[**LinkedTransactions**](LinkedTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_manual_journal_attachment_by_file_name + +> Attachments create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) + +Allows you to create a specified Attachment on ManualJournal by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to create a specified Attachment on ManualJournal by file name + result = api_instance.create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_manual_journal_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | + **file_name** | **String**| The name of the file being attached to a ManualJournal | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_manual_journals + +> ManualJournals create_manual_journals(xero_tenant_id, manual_journals, opts) + +Allows you to create one or more manual journals + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | ManualJournals array with ManualJournal object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create one or more manual journals + result = api_instance.create_manual_journals(xero_tenant_id, manual_journals, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_manual_journals: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journals** | [**ManualJournals**](ManualJournals.md)| ManualJournals array with ManualJournal object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**ManualJournals**](ManualJournals.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_overpayment_allocations + +> Allocations create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts) + +Allows you to create a single allocation for an overpayment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment +allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] } # Allocations | Allocations array with Allocation object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create a single allocation for an overpayment + result = api_instance.create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_overpayment_allocations: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | + **allocations** | [**Allocations**](Allocations.md)| Allocations array with Allocation object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Allocations**](Allocations.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_overpayment_history + +> HistoryRecords create_overpayment_history(xero_tenant_id, overpayment_id, history_records) + +Allows you to create history records of an Overpayment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create history records of an Overpayment + result = api_instance.create_overpayment_history(xero_tenant_id, overpayment_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_overpayment_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_payment + +> Payments create_payment(xero_tenant_id, payment) + +Allows you to create a single payment for invoices or credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } # Payment | Request body with a single Payment object + +begin + #Allows you to create a single payment for invoices or credit notes + result = api_instance.create_payment(xero_tenant_id, payment) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_payment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payment** | [**Payment**](Payment.md)| Request body with a single Payment object | + +### Return type + +[**Payments**](Payments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_payment_history + +> HistoryRecords create_payment_history(xero_tenant_id, payment_id, history_records) + +Allows you to create a history record for a payment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create a history record for a payment + result = api_instance.create_payment_history(xero_tenant_id, payment_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_payment_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payment_id** | [**String**](.md)| Unique identifier for a Payment | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_payment_service + +> PaymentServices create_payment_service(xero_tenant_id, payment_services) + +Allows you to create payment services + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +payment_services = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] } # PaymentServices | PaymentServices array with PaymentService object in body of request + +begin + #Allows you to create payment services + result = api_instance.create_payment_service(xero_tenant_id, payment_services) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_payment_service: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payment_services** | [**PaymentServices**](PaymentServices.md)| PaymentServices array with PaymentService object in body of request | + +### Return type + +[**PaymentServices**](PaymentServices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_payments + +> Payments create_payments(xero_tenant_id, payments, opts) + +Allows you to create multiple payments for invoices or credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] } # Payments | Payments array with Payment object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create multiple payments for invoices or credit notes + result = api_instance.create_payments(xero_tenant_id, payments, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_payments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payments** | [**Payments**](Payments.md)| Payments array with Payment object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Payments**](Payments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_prepayment_allocations + +> Allocations create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts) + +Allows you to create an Allocation for prepayments + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Prepayment +allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] } # Allocations | Allocations with an array of Allocation object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create an Allocation for prepayments + result = api_instance.create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_prepayment_allocations: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **prepayment_id** | [**String**](.md)| Unique identifier for Prepayment | + **allocations** | [**Allocations**](Allocations.md)| Allocations with an array of Allocation object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Allocations**](Allocations.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_prepayment_history + +> HistoryRecords create_prepayment_history(xero_tenant_id, prepayment_id, history_records) + +Allows you to create a history record for an Prepayment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create a history record for an Prepayment + result = api_instance.create_prepayment_history(xero_tenant_id, prepayment_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_prepayment_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **prepayment_id** | [**String**](.md)| Unique identifier for a PrePayment | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_purchase_order_history + +> HistoryRecords create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) + +Allows you to create HistoryRecord for purchase orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create HistoryRecord for purchase orders + result = api_instance.create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_purchase_order_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_purchase_orders + +> PurchaseOrders create_purchase_orders(xero_tenant_id, purchase_orders, opts) + +Allows you to create one or more purchase orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_orders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | PurchaseOrders with an array of PurchaseOrder object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create one or more purchase orders + result = api_instance.create_purchase_orders(xero_tenant_id, purchase_orders, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_purchase_orders: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| PurchaseOrders with an array of PurchaseOrder object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**PurchaseOrders**](PurchaseOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_quote_attachment_by_file_name + +> Attachments create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) + +Allows you to create Attachment on Quote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object +file_name = 'xero-dev.jpg' # String | Name of the attachment +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to create Attachment on Quote + result = api_instance.create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_quote_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for Quote object | + **file_name** | **String**| Name of the attachment | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_quote_history + +> HistoryRecords create_quote_history(xero_tenant_id, quote_id, history_records) + +Allows you to retrieve a history records of an quote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to retrieve a history records of an quote + result = api_instance.create_quote_history(xero_tenant_id, quote_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_quote_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for an Quote | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_quotes + +> Quotes create_quotes(xero_tenant_id, quotes, opts) + +Allows you to create one or more quotes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | Quotes with an array of Quote object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create one or more quotes + result = api_instance.create_quotes(xero_tenant_id, quotes, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_quotes: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quotes** | [**Quotes**](Quotes.md)| Quotes with an array of Quote object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Quotes**](Quotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_receipt + +> Receipts create_receipt(xero_tenant_id, receipts, opts) + +Allows you to create draft expense claim receipts for any user + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] } # Receipts | Receipts with an array of Receipt object in body of request +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to create draft expense claim receipts for any user + result = api_instance.create_receipt(xero_tenant_id, receipts, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_receipt: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipts** | [**Receipts**](Receipts.md)| Receipts with an array of Receipt object in body of request | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Receipts**](Receipts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_receipt_attachment_by_file_name + +> Attachments create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) + +Allows you to create Attachment on expense claim receipts by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to create Attachment on expense claim receipts by file name + result = api_instance.create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_receipt_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + **file_name** | **String**| The name of the file being attached to the Receipt | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_receipt_history + +> HistoryRecords create_receipt_history(xero_tenant_id, receipt_id, history_records) + +Allows you to retrieve a history records of an Receipt + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to retrieve a history records of an Receipt + result = api_instance.create_receipt_history(xero_tenant_id, receipt_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_receipt_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_repeating_invoice_attachment_by_file_name + +> Attachments create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) + +Allows you to create attachment on repeating invoices by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to create attachment on repeating invoices by file name + result = api_instance.create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_repeating_invoice_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + **file_name** | **String**| The name of the file being attached to a Repeating Invoice | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## create_repeating_invoice_history + +> HistoryRecords create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) + +Allows you to create history for a repeating invoice + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request + +begin + #Allows you to create history for a repeating invoice + result = api_instance.create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_repeating_invoice_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + **history_records** | [**HistoryRecords**](HistoryRecords.md)| HistoryRecords containing an array of HistoryRecord objects in body of request | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_tax_rates + +> TaxRates create_tax_rates(xero_tenant_id, tax_rates) + +Allows you to create one or more Tax Rates + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tax_rates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] } # TaxRates | TaxRates array with TaxRate object in body of request + +begin + #Allows you to create one or more Tax Rates + result = api_instance.create_tax_rates(xero_tenant_id, tax_rates) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_tax_rates: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tax_rates** | [**TaxRates**](TaxRates.md)| TaxRates array with TaxRate object in body of request | + +### Return type + +[**TaxRates**](TaxRates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_tracking_category + +> TrackingCategories create_tracking_category(xero_tenant_id, tracking_category) + +Allows you to create tracking categories + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tracking_category = { name:"FooBar" } # TrackingCategory | TrackingCategory object in body of request + +begin + #Allows you to create tracking categories + result = api_instance.create_tracking_category(xero_tenant_id, tracking_category) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_tracking_category: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tracking_category** | [**TrackingCategory**](TrackingCategory.md)| TrackingCategory object in body of request | + +### Return type + +[**TrackingCategories**](TrackingCategories.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_tracking_options + +> TrackingOptions create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option) + +Allows you to create options for a specified tracking category + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory +tracking_option = { name:"Bar" } # TrackingOption | TrackingOption object in body of request + +begin + #Allows you to create options for a specified tracking category + result = api_instance.create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->create_tracking_options: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | + **tracking_option** | [**TrackingOption**](TrackingOption.md)| TrackingOption object in body of request | + +### Return type + +[**TrackingOptions**](TrackingOptions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_account + +> Accounts delete_account(xero_tenant_id, account_id) + +Allows you to delete a chart of accounts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object + +begin + #Allows you to delete a chart of accounts + result = api_instance.delete_account(xero_tenant_id, account_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_account: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for retrieving single object | + +### Return type + +[**Accounts**](Accounts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_contact_group_contact + +> delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) + +Allows you to delete a specific Contact from a Contact Group + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact + +begin + #Allows you to delete a specific Contact from a Contact Group + api_instance.delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_contact_group_contact: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_contact_group_contacts + +> delete_contact_group_contacts(xero_tenant_id, contact_group_id) + +Allows you to delete all Contacts from a Contact Group + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group + +begin + #Allows you to delete all Contacts from a Contact Group + api_instance.delete_contact_group_contacts(xero_tenant_id, contact_group_id) +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_contact_group_contacts: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## delete_item + +> delete_item(xero_tenant_id, item_id) + +Allows you to delete a specified item + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item + +begin + #Allows you to delete a specified item + api_instance.delete_item(xero_tenant_id, item_id) +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_item: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **item_id** | [**String**](.md)| Unique identifier for an Item | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_linked_transaction + +> delete_linked_transaction(xero_tenant_id, linked_transaction_id) + +Allows you to delete a specified linked transactions (billable expenses) + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction + +begin + #Allows you to delete a specified linked transactions (billable expenses) + api_instance.delete_linked_transaction(xero_tenant_id, linked_transaction_id) +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_linked_transaction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **linked_transaction_id** | [**String**](.md)| Unique identifier for a LinkedTransaction | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_payment + +> Payments delete_payment(xero_tenant_id, payment_id, payment_delete) + +Allows you to update a specified payment for invoices and credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment +payment_delete = { status:"DELETED" } # PaymentDelete | + +begin + #Allows you to update a specified payment for invoices and credit notes + result = api_instance.delete_payment(xero_tenant_id, payment_id, payment_delete) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_payment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payment_id** | [**String**](.md)| Unique identifier for a Payment | + **payment_delete** | [**PaymentDelete**](PaymentDelete.md)| | + +### Return type + +[**Payments**](Payments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_tracking_category + +> TrackingCategories delete_tracking_category(xero_tenant_id, tracking_category_id) + +Allows you to delete tracking categories + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory + +begin + #Allows you to delete tracking categories + result = api_instance.delete_tracking_category(xero_tenant_id, tracking_category_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_tracking_category: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | + +### Return type + +[**TrackingCategories**](TrackingCategories.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## delete_tracking_options + +> TrackingOptions delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id) + +Allows you to delete a specified option for a specified tracking category + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory +tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option + +begin + #Allows you to delete a specified option for a specified tracking category + result = api_instance.delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->delete_tracking_options: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | + **tracking_option_id** | [**String**](.md)| Unique identifier for a Tracking Option | + +### Return type + +[**TrackingOptions**](TrackingOptions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## email_invoice + +> email_invoice(xero_tenant_id, invoice_id, request_empty) + +Allows you to email a copy of invoice to related Contact + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +request_empty = {} # RequestEmpty | + +begin + #Allows you to email a copy of invoice to related Contact + api_instance.email_invoice(xero_tenant_id, invoice_id, request_empty) +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->email_invoice: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **request_empty** | [**RequestEmpty**](RequestEmpty.md)| | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_account + +> Accounts get_account(xero_tenant_id, account_id) + +Allows you to retrieve a single chart of accounts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object + +begin + #Allows you to retrieve a single chart of accounts + result = api_instance.get_account(xero_tenant_id, account_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_account: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for retrieving single object | + +### Return type + +[**Accounts**](Accounts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_account_attachment_by_file_name + +> File get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type) + +Allows you to retrieve Attachment on Account by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object +file_name = 'xero-dev.jpg' # String | Name of the attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachment on Account by Filename + result = api_instance.get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_account_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for Account object | + **file_name** | **String**| Name of the attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_account_attachment_by_id + +> File get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type) + +Allows you to retrieve specific Attachment on Account + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve specific Attachment on Account + result = api_instance.get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_account_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for Account object | + **attachment_id** | [**String**](.md)| Unique identifier for Attachment object | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_account_attachments + +> Attachments get_account_attachments(xero_tenant_id, account_id) + +Allows you to retrieve Attachments for accounts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object + +begin + #Allows you to retrieve Attachments for accounts + result = api_instance.get_account_attachments(xero_tenant_id, account_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_account_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for Account object | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_accounts + +> Accounts get_accounts(xero_tenant_id, opts) + +Allows you to retrieve the full chart of accounts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Account.StatusEnum.ACTIVE + '\" AND Type==\"' + Account.BankAccountTypeEnum.BANK + '\"', # String | Filter by an any element + order: 'Name ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve the full chart of accounts + result = api_instance.get_accounts(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_accounts: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**Accounts**](Accounts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transaction + +> BankTransactions get_bank_transaction(xero_tenant_id, bank_transaction_id, opts) + +Allows you to retrieve a single spend or receive money transaction + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve a single spend or receive money transaction + result = api_instance.get_bank_transaction(xero_tenant_id, bank_transaction_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transaction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**BankTransactions**](BankTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transaction_attachment_by_file_name + +> File get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type) + +Allows you to retrieve Attachments on BankTransaction by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +file_name = 'xero-dev.jpg' # String | The name of the file being attached +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on BankTransaction by Filename + result = api_instance.get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + **file_name** | **String**| The name of the file being attached | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_bank_transaction_attachment_by_id + +> File get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type) + +Allows you to retrieve Attachments on a specific BankTransaction + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on a specific BankTransaction + result = api_instance.get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + **attachment_id** | [**String**](.md)| Xero generated unique identifier for an attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_bank_transaction_attachments + +> Attachments get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id) + +Allows you to retrieve any attachments to bank transactions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction + +begin + #Allows you to retrieve any attachments to bank transactions + result = api_instance.get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transaction_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transactions + +> BankTransactions get_bank_transactions(xero_tenant_id, opts) + +Allows you to retrieve any spend or receive money transactions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + BankTransaction.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Type ASC', # String | Order by an any element + page: 1, # Integer | Up to 100 bank transactions will be returned in a single API call with line items details + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve any spend or receive money transactions + result = api_instance.get_bank_transactions(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transactions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| Up to 100 bank transactions will be returned in a single API call with line items details | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**BankTransactions**](BankTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transactions_history + +> HistoryRecords get_bank_transactions_history(xero_tenant_id, bank_transaction_id) + +Allows you to retrieve history from a bank transactions + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction + +begin + #Allows you to retrieve history from a bank transactions + result = api_instance.get_bank_transactions_history(xero_tenant_id, bank_transaction_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transactions_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transfer + +> BankTransfers get_bank_transfer(xero_tenant_id, bank_transfer_id) + +Allows you to retrieve any bank transfers + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer + +begin + #Allows you to retrieve any bank transfers + result = api_instance.get_bank_transfer(xero_tenant_id, bank_transfer_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transfer: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + +### Return type + +[**BankTransfers**](BankTransfers.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transfer_attachment_by_file_name + +> File get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type) + +Allows you to retrieve Attachments on BankTransfer by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on BankTransfer by file name + result = api_instance.get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + **file_name** | **String**| The name of the file being attached to a Bank Transfer | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_bank_transfer_attachment_by_id + +> File get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type) + +Allows you to retrieve Attachments on BankTransfer + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an Attachment to a bank transfer +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on BankTransfer + result = api_instance.get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + **attachment_id** | [**String**](.md)| Xero generated unique identifier for an Attachment to a bank transfer | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_bank_transfer_attachments + +> Attachments get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id) + +Allows you to retrieve Attachments from bank transfers + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer + +begin + #Allows you to retrieve Attachments from bank transfers + result = api_instance.get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transfer_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transfer_history + +> HistoryRecords get_bank_transfer_history(xero_tenant_id, bank_transfer_id) + +Allows you to retrieve history from a bank transfers + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer + +begin + #Allows you to retrieve history from a bank transfers + result = api_instance.get_bank_transfer_history(xero_tenant_id, bank_transfer_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transfer_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_bank_transfers + +> BankTransfers get_bank_transfers(xero_tenant_id, opts) + +Allows you to retrieve all bank transfers + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + BankTransfer.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Amount ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve all bank transfers + result = api_instance.get_bank_transfers(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_bank_transfers: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**BankTransfers**](BankTransfers.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_batch_payment_history + +> HistoryRecords get_batch_payment_history(xero_tenant_id, batch_payment_id) + +Allows you to retrieve history from a Batch Payment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment + +begin + #Allows you to retrieve history from a Batch Payment + result = api_instance.get_batch_payment_history(xero_tenant_id, batch_payment_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_batch_payment_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **batch_payment_id** | [**String**](.md)| Unique identifier for BatchPayment | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_batch_payments + +> BatchPayments get_batch_payments(xero_tenant_id, opts) + +Retrieve either one or many BatchPayments for invoices + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + BatchPayment.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Date ASC' # String | Order by an any element +} + +begin + #Retrieve either one or many BatchPayments for invoices + result = api_instance.get_batch_payments(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_batch_payments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**BatchPayments**](BatchPayments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_branding_theme + +> BrandingThemes get_branding_theme(xero_tenant_id, branding_theme_id) + +Allows you to retrieve a specific BrandingThemes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme + +begin + #Allows you to retrieve a specific BrandingThemes + result = api_instance.get_branding_theme(xero_tenant_id, branding_theme_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_branding_theme: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **branding_theme_id** | [**String**](.md)| Unique identifier for a Branding Theme | + +### Return type + +[**BrandingThemes**](BrandingThemes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_branding_theme_payment_services + +> PaymentServices get_branding_theme_payment_services(xero_tenant_id, branding_theme_id) + +Allows you to retrieve the Payment services for a Branding Theme + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme + +begin + #Allows you to retrieve the Payment services for a Branding Theme + result = api_instance.get_branding_theme_payment_services(xero_tenant_id, branding_theme_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_branding_theme_payment_services: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **branding_theme_id** | [**String**](.md)| Unique identifier for a Branding Theme | + +### Return type + +[**PaymentServices**](PaymentServices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_branding_themes + +> BrandingThemes get_branding_themes(xero_tenant_id) + +Allows you to retrieve all the BrandingThemes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant + +begin + #Allows you to retrieve all the BrandingThemes + result = api_instance.get_branding_themes(xero_tenant_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_branding_themes: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**BrandingThemes**](BrandingThemes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contact + +> Contacts get_contact(xero_tenant_id, contact_id) + +Allows you to retrieve a single contacts in a Xero organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact + +begin + #Allows you to retrieve a single contacts in a Xero organisation + result = api_instance.get_contact(xero_tenant_id, contact_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contact_attachment_by_file_name + +> File get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type) + +Allows you to retrieve Attachments on Contacts by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +file_name = 'xero-dev.jpg' # String | Name for the file you are attaching +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on Contacts by file name + result = api_instance.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **file_name** | **String**| Name for the file you are attaching | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_contact_attachment_by_id + +> File get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type) + +Allows you to retrieve Attachments on Contacts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on Contacts + result = api_instance.get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_contact_attachments + +> Attachments get_contact_attachments(xero_tenant_id, contact_id) + +Allows you to retrieve, add and update contacts in a Xero organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact + +begin + #Allows you to retrieve, add and update contacts in a Xero organisation + result = api_instance.get_contact_attachments(xero_tenant_id, contact_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contact_by_contact_number + +> Contacts get_contact_by_contact_number(xero_tenant_id, contact_number) + +Allows you to retrieve a single contact by Contact Number in a Xero organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_number = 'SB2' # String | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). + +begin + #Allows you to retrieve a single contact by Contact Number in a Xero organisation + result = api_instance.get_contact_by_contact_number(xero_tenant_id, contact_number) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_by_contact_number: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_number** | **String**| This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). | + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contact_cis_settings + +> CISSettings get_contact_cis_settings(xero_tenant_id, contact_id) + +Allows you to retrieve CISSettings for a contact in a Xero organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact + +begin + #Allows you to retrieve CISSettings for a contact in a Xero organisation + result = api_instance.get_contact_cis_settings(xero_tenant_id, contact_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_cis_settings: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + +### Return type + +[**CISSettings**](CISSettings.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contact_group + +> ContactGroups get_contact_group(xero_tenant_id, contact_group_id) + +Allows you to retrieve a unique Contact Group by ID + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group + +begin + #Allows you to retrieve a unique Contact Group by ID + result = api_instance.get_contact_group(xero_tenant_id, contact_group_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_group: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | + +### Return type + +[**ContactGroups**](ContactGroups.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contact_groups + +> ContactGroups get_contact_groups(xero_tenant_id, opts) + +Allows you to retrieve the ContactID and Name of all the contacts in a contact group + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + where: 'Status==\"' + ContactGroup.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Name ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve the ContactID and Name of all the contacts in a contact group + result = api_instance.get_contact_groups(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_groups: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**ContactGroups**](ContactGroups.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contact_history + +> HistoryRecords get_contact_history(xero_tenant_id, contact_id) + +Allows you to retrieve a history records of an Contact + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact + +begin + #Allows you to retrieve a history records of an Contact + result = api_instance.get_contact_history(xero_tenant_id, contact_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contact_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_contacts + +> Contacts get_contacts(xero_tenant_id, opts) + +Allows you to retrieve all contacts in a Xero organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Contact.ContactStatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Name ASC', # String | Order by an any element + i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + page: 1, # Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call. + include_archived: true # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response +} + +begin + #Allows you to retrieve all contacts in a Xero organisation + result = api_instance.get_contacts(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_contacts: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **i_ds** | [**Array<String>**](String.md)| Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. | [optional] + **page** | **Integer**| e.g. page=1 - Up to 100 contacts will be returned in a single API call. | [optional] + **include_archived** | **Boolean**| e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response | [optional] + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_credit_note + +> CreditNotes get_credit_note(xero_tenant_id, credit_note_id, opts) + +Allows you to retrieve a specific credit note + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve a specific credit note + result = api_instance.get_credit_note(xero_tenant_id, credit_note_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_credit_note: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**CreditNotes**](CreditNotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_credit_note_as_pdf + +> File get_credit_note_as_pdf(xero_tenant_id, credit_note_id) + +Allows you to retrieve Credit Note as PDF files + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note + +begin + #Allows you to retrieve Credit Note as PDF files + result = api_instance.get_credit_note_as_pdf(xero_tenant_id, credit_note_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_credit_note_as_pdf: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf + + +## get_credit_note_attachment_by_file_name + +> File get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type) + +Allows you to retrieve Attachments on CreditNote by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on CreditNote by file name + result = api_instance.get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_credit_note_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **file_name** | **String**| Name of the file you are attaching to Credit Note | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_credit_note_attachment_by_id + +> File get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type) + +Allows you to retrieve Attachments on CreditNote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on CreditNote + result = api_instance.get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_credit_note_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_credit_note_attachments + +> Attachments get_credit_note_attachments(xero_tenant_id, credit_note_id) + +Allows you to retrieve Attachments for credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note + +begin + #Allows you to retrieve Attachments for credit notes + result = api_instance.get_credit_note_attachments(xero_tenant_id, credit_note_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_credit_note_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_credit_note_history + +> HistoryRecords get_credit_note_history(xero_tenant_id, credit_note_id) + +Allows you to retrieve a history records of an CreditNote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note + +begin + #Allows you to retrieve a history records of an CreditNote + result = api_instance.get_credit_note_history(xero_tenant_id, credit_note_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_credit_note_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_credit_notes + +> CreditNotes get_credit_notes(xero_tenant_id, opts) + +Allows you to retrieve any credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + CreditNote.StatusEnum.DRAFT + '\"', # String | Filter by an any element + order: 'CreditNoteNumber ASC', # String | Order by an any element + page: 1, # Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve any credit notes + result = api_instance.get_credit_notes(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_credit_notes: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**CreditNotes**](CreditNotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_currencies + +> Currencies get_currencies(xero_tenant_id, opts) + +Allows you to retrieve currencies for your organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + where: 'Status==\"' + Currency.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Code ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve currencies for your organisation + result = api_instance.get_currencies(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_currencies: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**Currencies**](Currencies.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employee + +> Employees get_employee(xero_tenant_id, employee_id) + +Allows you to retrieve a specific employee used in Xero payrun + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +employee_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Employee + +begin + #Allows you to retrieve a specific employee used in Xero payrun + result = api_instance.get_employee(xero_tenant_id, employee_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_employee: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employee_id** | [**String**](.md)| Unique identifier for a Employee | + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_employees + +> Employees get_employees(xero_tenant_id, opts) + +Allows you to retrieve employees used in Xero payrun + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Employee.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve employees used in Xero payrun + result = api_instance.get_employees(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_employees: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_expense_claim + +> ExpenseClaims get_expense_claim(xero_tenant_id, expense_claim_id) + +Allows you to retrieve a specified expense claim + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim + +begin + #Allows you to retrieve a specified expense claim + result = api_instance.get_expense_claim(xero_tenant_id, expense_claim_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_expense_claim: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | + +### Return type + +[**ExpenseClaims**](ExpenseClaims.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_expense_claim_history + +> HistoryRecords get_expense_claim_history(xero_tenant_id, expense_claim_id) + +Allows you to retrieve a history records of an ExpenseClaim + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim + +begin + #Allows you to retrieve a history records of an ExpenseClaim + result = api_instance.get_expense_claim_history(xero_tenant_id, expense_claim_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_expense_claim_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_expense_claims + +> ExpenseClaims get_expense_claims(xero_tenant_id, opts) + +Allows you to retrieve expense claims + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + ExpenseClaim.StatusEnum.SUBMITTED + '\"', # String | Filter by an any element + order: 'Status ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve expense claims + result = api_instance.get_expense_claims(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_expense_claims: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**ExpenseClaims**](ExpenseClaims.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_invoice + +> Invoices get_invoice(xero_tenant_id, invoice_id, opts) + +Allows you to retrieve a specified sales invoice or purchase bill + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve a specified sales invoice or purchase bill + result = api_instance.get_invoice(xero_tenant_id, invoice_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoice: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Invoices**](Invoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_invoice_as_pdf + +> File get_invoice_as_pdf(xero_tenant_id, invoice_id) + +Allows you to retrieve invoices or purchase bills as PDF files + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice + +begin + #Allows you to retrieve invoices or purchase bills as PDF files + result = api_instance.get_invoice_as_pdf(xero_tenant_id, invoice_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoice_as_pdf: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf + + +## get_invoice_attachment_by_file_name + +> File get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type) + +Allows you to retrieve Attachment on invoices or purchase bills by it's filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +file_name = 'xero-dev.jpg' # String | Name of the file you are attaching +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachment on invoices or purchase bills by it's filename + result = api_instance.get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoice_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **file_name** | **String**| Name of the file you are attaching | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_invoice_attachment_by_id + +> File get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type) + +Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID + result = api_instance.get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoice_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **attachment_id** | [**String**](.md)| Unique identifier for an Attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_invoice_attachments + +> Attachments get_invoice_attachments(xero_tenant_id, invoice_id) + +Allows you to retrieve Attachments on invoices or purchase bills + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice + +begin + #Allows you to retrieve Attachments on invoices or purchase bills + result = api_instance.get_invoice_attachments(xero_tenant_id, invoice_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoice_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_invoice_history + +> HistoryRecords get_invoice_history(xero_tenant_id, invoice_id) + +Allows you to retrieve a history records of an invoice + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice + +begin + #Allows you to retrieve a history records of an invoice + result = api_instance.get_invoice_history(xero_tenant_id, invoice_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoice_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_invoice_reminders + +> InvoiceReminders get_invoice_reminders(xero_tenant_id) + +Allows you to retrieve invoice reminder settings + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant + +begin + #Allows you to retrieve invoice reminder settings + result = api_instance.get_invoice_reminders(xero_tenant_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoice_reminders: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**InvoiceReminders**](InvoiceReminders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_invoices + +> Invoices get_invoices(xero_tenant_id, opts) + +Allows you to retrieve any sales invoices or purchase bills + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Invoice.StatusEnum.DRAFT + '\"', # String | Filter by an any element + order: 'InvoiceNumber ASC', # String | Order by an any element + i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma-separated list of InvoicesIDs. + invoice_numbers: ['null'], # Array | Filter by a comma-separated list of InvoiceNumbers. + contact_i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma-separated list of ContactIDs. + statuses: ['null'], # Array | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + page: 1, # Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice + include_archived: true, # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + created_by_my_app: false, # Boolean | When set to true you'll only retrieve Invoices created by your app + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve any sales invoices or purchase bills + result = api_instance.get_invoices(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_invoices: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **i_ds** | [**Array<String>**](String.md)| Filter by a comma-separated list of InvoicesIDs. | [optional] + **invoice_numbers** | [**Array<String>**](String.md)| Filter by a comma-separated list of InvoiceNumbers. | [optional] + **contact_i_ds** | [**Array<String>**](String.md)| Filter by a comma-separated list of ContactIDs. | [optional] + **statuses** | [**Array<String>**](String.md)| Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice | [optional] + **include_archived** | **Boolean**| e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response | [optional] + **created_by_my_app** | **Boolean**| When set to true you'll only retrieve Invoices created by your app | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Invoices**](Invoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_item + +> Items get_item(xero_tenant_id, item_id, opts) + +Allows you to retrieve a specified item + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve a specified item + result = api_instance.get_item(xero_tenant_id, item_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_item: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **item_id** | [**String**](.md)| Unique identifier for an Item | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Items**](Items.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_item_history + +> HistoryRecords get_item_history(xero_tenant_id, item_id) + +Allows you to retrieve history for items + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item + +begin + #Allows you to retrieve history for items + result = api_instance.get_item_history(xero_tenant_id, item_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_item_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **item_id** | [**String**](.md)| Unique identifier for an Item | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_items + +> Items get_items(xero_tenant_id, opts) + +Allows you to retrieve any items + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'IsSold==true', # String | Filter by an any element + order: 'Code ASC', # String | Order by an any element + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve any items + result = api_instance.get_items(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_items: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Items**](Items.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_journal + +> Journals get_journal(xero_tenant_id, journal_id) + +Allows you to retrieve a specified journals. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Journal + +begin + #Allows you to retrieve a specified journals. + result = api_instance.get_journal(xero_tenant_id, journal_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_journal: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **journal_id** | [**String**](.md)| Unique identifier for a Journal | + +### Return type + +[**Journals**](Journals.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_journals + +> Journals get_journals(xero_tenant_id, opts) + +Allows you to retrieve any journals. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + offset: 10, # Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + payments_only: true # Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. +} + +begin + #Allows you to retrieve any journals. + result = api_instance.get_journals(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_journals: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **offset** | **Integer**| Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned | [optional] + **payments_only** | **Boolean**| Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. | [optional] + +### Return type + +[**Journals**](Journals.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_linked_transaction + +> LinkedTransactions get_linked_transaction(xero_tenant_id, linked_transaction_id) + +Allows you to retrieve a specified linked transactions (billable expenses) + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction + +begin + #Allows you to retrieve a specified linked transactions (billable expenses) + result = api_instance.get_linked_transaction(xero_tenant_id, linked_transaction_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_linked_transaction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **linked_transaction_id** | [**String**](.md)| Unique identifier for a LinkedTransaction | + +### Return type + +[**LinkedTransactions**](LinkedTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_linked_transactions + +> LinkedTransactions get_linked_transactions(xero_tenant_id, opts) + +Retrieve linked transactions (billable expenses) + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + page: 1, # Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + linked_transaction_id: '00000000-0000-0000-000-000000000000', # String | The Xero identifier for an Linked Transaction + source_transaction_id: '00000000-0000-0000-000-000000000000', # String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + contact_id: '00000000-0000-0000-000-000000000000', # String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + status: 'APPROVED', # String | Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status + target_transaction_id: '00000000-0000-0000-000-000000000000' # String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice +} + +begin + #Retrieve linked transactions (billable expenses) + result = api_instance.get_linked_transactions(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_linked_transactions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. | [optional] + **linked_transaction_id** | **String**| The Xero identifier for an Linked Transaction | [optional] + **source_transaction_id** | **String**| Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice | [optional] + **contact_id** | **String**| Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. | [optional] + **status** | **String**| Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status | [optional] + **target_transaction_id** | **String**| Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice | [optional] + +### Return type + +[**LinkedTransactions**](LinkedTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_manual_journal + +> ManualJournals get_manual_journal(xero_tenant_id, manual_journal_id) + +Allows you to retrieve a specified manual journals + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal + +begin + #Allows you to retrieve a specified manual journals + result = api_instance.get_manual_journal(xero_tenant_id, manual_journal_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_manual_journal: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | + +### Return type + +[**ManualJournals**](ManualJournals.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_manual_journal_attachment_by_file_name + +> File get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type) + +Allows you to retrieve specified Attachment on ManualJournal by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve specified Attachment on ManualJournal by file name + result = api_instance.get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | + **file_name** | **String**| The name of the file being attached to a ManualJournal | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_manual_journal_attachment_by_id + +> File get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type) + +Allows you to retrieve specified Attachment on ManualJournals + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve specified Attachment on ManualJournals + result = api_instance.get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | + **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_manual_journal_attachments + +> Attachments get_manual_journal_attachments(xero_tenant_id, manual_journal_id) + +Allows you to retrieve Attachment for manual journals + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal + +begin + #Allows you to retrieve Attachment for manual journals + result = api_instance.get_manual_journal_attachments(xero_tenant_id, manual_journal_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_manual_journal_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_manual_journals + +> ManualJournals get_manual_journals(xero_tenant_id, opts) + +Allows you to retrieve any manual journals + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + ManualJournal.StatusEnum.DRAFT + '\"', # String | Filter by an any element + order: 'Date ASC', # String | Order by an any element + page: 1 # Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment +} + +begin + #Allows you to retrieve any manual journals + result = api_instance.get_manual_journals(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_manual_journals: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment | [optional] + +### Return type + +[**ManualJournals**](ManualJournals.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_online_invoice + +> OnlineInvoices get_online_invoice(xero_tenant_id, invoice_id) + +Allows you to retrieve a URL to an online invoice + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice + +begin + #Allows you to retrieve a URL to an online invoice + result = api_instance.get_online_invoice(xero_tenant_id, invoice_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_online_invoice: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + +### Return type + +[**OnlineInvoices**](OnlineInvoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_organisation_cis_settings + +> CISOrgSetting get_organisation_cis_settings(xero_tenant_id, organisation_id) + +Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +organisation_id = '00000000-0000-0000-000-000000000000' # String | The unique Xero identifier for an organisation + +begin + #Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + result = api_instance.get_organisation_cis_settings(xero_tenant_id, organisation_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_organisation_cis_settings: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **organisation_id** | [**String**](.md)| The unique Xero identifier for an organisation | + +### Return type + +[**CISOrgSetting**](CISOrgSetting.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_organisations + +> Organisations get_organisations(xero_tenant_id) + +Allows you to retrieve Organisation details + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant + +begin + #Allows you to retrieve Organisation details + result = api_instance.get_organisations(xero_tenant_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_organisations: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**Organisations**](Organisations.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_overpayment + +> Overpayments get_overpayment(xero_tenant_id, overpayment_id) + +Allows you to retrieve a specified overpayments + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment + +begin + #Allows you to retrieve a specified overpayments + result = api_instance.get_overpayment(xero_tenant_id, overpayment_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_overpayment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | + +### Return type + +[**Overpayments**](Overpayments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_overpayment_history + +> HistoryRecords get_overpayment_history(xero_tenant_id, overpayment_id) + +Allows you to retrieve a history records of an Overpayment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment + +begin + #Allows you to retrieve a history records of an Overpayment + result = api_instance.get_overpayment_history(xero_tenant_id, overpayment_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_overpayment_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **overpayment_id** | [**String**](.md)| Unique identifier for a Overpayment | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_overpayments + +> Overpayments get_overpayments(xero_tenant_id, opts) + +Allows you to retrieve overpayments + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Overpayment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element + order: 'RemainingCredit ASC', # String | Order by an any element + page: 1, # Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve overpayments + result = api_instance.get_overpayments(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_overpayments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Overpayments**](Overpayments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_payment + +> Payments get_payment(xero_tenant_id, payment_id) + +Allows you to retrieve a specified payment for invoices and credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment + +begin + #Allows you to retrieve a specified payment for invoices and credit notes + result = api_instance.get_payment(xero_tenant_id, payment_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_payment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payment_id** | [**String**](.md)| Unique identifier for a Payment | + +### Return type + +[**Payments**](Payments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_payment_history + +> HistoryRecords get_payment_history(xero_tenant_id, payment_id) + +Allows you to retrieve history records of a payment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment + +begin + #Allows you to retrieve history records of a payment + result = api_instance.get_payment_history(xero_tenant_id, payment_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_payment_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **payment_id** | [**String**](.md)| Unique identifier for a Payment | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_payment_services + +> PaymentServices get_payment_services(xero_tenant_id) + +Allows you to retrieve payment services + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant + +begin + #Allows you to retrieve payment services + result = api_instance.get_payment_services(xero_tenant_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_payment_services: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**PaymentServices**](PaymentServices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_payments + +> Payments get_payments(xero_tenant_id, opts) + +Allows you to retrieve payments for invoices and credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Payment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element + order: 'Amount ASC', # String | Order by an any element + page: 1 # Integer | Up to 100 payments will be returned in a single API call +} + +begin + #Allows you to retrieve payments for invoices and credit notes + result = api_instance.get_payments(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_payments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| Up to 100 payments will be returned in a single API call | [optional] + +### Return type + +[**Payments**](Payments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_prepayment + +> Prepayments get_prepayment(xero_tenant_id, prepayment_id) + +Allows you to retrieve a specified prepayments + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment + +begin + #Allows you to retrieve a specified prepayments + result = api_instance.get_prepayment(xero_tenant_id, prepayment_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_prepayment: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **prepayment_id** | [**String**](.md)| Unique identifier for a PrePayment | + +### Return type + +[**Prepayments**](Prepayments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_prepayment_history + +> HistoryRecords get_prepayment_history(xero_tenant_id, prepayment_id) + +Allows you to retrieve a history records of an Prepayment + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment + +begin + #Allows you to retrieve a history records of an Prepayment + result = api_instance.get_prepayment_history(xero_tenant_id, prepayment_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_prepayment_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **prepayment_id** | [**String**](.md)| Unique identifier for a PrePayment | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_prepayments + +> Prepayments get_prepayments(xero_tenant_id, opts) + +Allows you to retrieve prepayments + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Prepayment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element + order: 'Reference ASC', # String | Order by an any element + page: 1, # Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve prepayments + result = api_instance.get_prepayments(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_prepayments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Prepayments**](Prepayments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_purchase_order + +> PurchaseOrders get_purchase_order(xero_tenant_id, purchase_order_id) + +Allows you to retrieve a specified purchase orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder + +begin + #Allows you to retrieve a specified purchase orders + result = api_instance.get_purchase_order(xero_tenant_id, purchase_order_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_purchase_order: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | + +### Return type + +[**PurchaseOrders**](PurchaseOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_purchase_order_as_pdf + +> File get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) + +Allows you to retrieve purchase orders as PDF files + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Order + +begin + #Allows you to retrieve purchase orders as PDF files + result = api_instance.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_purchase_order_as_pdf: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for an Purchase Order | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf + + +## get_purchase_order_by_number + +> PurchaseOrders get_purchase_order_by_number(xero_tenant_id, purchase_order_number) + +Allows you to retrieve a specified purchase orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_number = 'PO1234' # String | Unique identifier for a PurchaseOrder + +begin + #Allows you to retrieve a specified purchase orders + result = api_instance.get_purchase_order_by_number(xero_tenant_id, purchase_order_number) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_purchase_order_by_number: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_number** | **String**| Unique identifier for a PurchaseOrder | + +### Return type + +[**PurchaseOrders**](PurchaseOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_purchase_order_history + +> HistoryRecords get_purchase_order_history(xero_tenant_id, purchase_order_id) + +Allows you to retrieve history for PurchaseOrder + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder + +begin + #Allows you to retrieve history for PurchaseOrder + result = api_instance.get_purchase_order_history(xero_tenant_id, purchase_order_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_purchase_order_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_purchase_orders + +> PurchaseOrders get_purchase_orders(xero_tenant_id, opts) + +Allows you to retrieve purchase orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + status: 'SUBMITTED', # String | Filter by purchase order status + date_from: '2019-12-01', # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + date_to: '2019-12-31', # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + order: 'PurchaseOrderNumber ASC', # String | Order by an any element + page: 1 # Integer | To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. +} + +begin + #Allows you to retrieve purchase orders + result = api_instance.get_purchase_orders(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_purchase_orders: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **status** | **String**| Filter by purchase order status | [optional] + **date_from** | **String**| Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 | [optional] + **date_to** | **String**| Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 | [optional] + **order** | **String**| Order by an any element | [optional] + **page** | **Integer**| To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. | [optional] + +### Return type + +[**PurchaseOrders**](PurchaseOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_quote + +> Quotes get_quote(xero_tenant_id, quote_id) + +Allows you to retrieve a specified quote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote + +begin + #Allows you to retrieve a specified quote + result = api_instance.get_quote(xero_tenant_id, quote_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_quote: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for an Quote | + +### Return type + +[**Quotes**](Quotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_quote_as_pdf + +> File get_quote_as_pdf(xero_tenant_id, quote_id) + +Allows you to retrieve quotes as PDF files + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote + +begin + #Allows you to retrieve quotes as PDF files + result = api_instance.get_quote_as_pdf(xero_tenant_id, quote_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_quote_as_pdf: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for an Quote | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/pdf + + +## get_quote_attachment_by_file_name + +> File get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type) + +Allows you to retrieve Attachment on Quote by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object +file_name = 'xero-dev.jpg' # String | Name of the attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachment on Quote by Filename + result = api_instance.get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_quote_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for Quote object | + **file_name** | **String**| Name of the attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_quote_attachment_by_id + +> File get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type) + +Allows you to retrieve specific Attachment on Quote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve specific Attachment on Quote + result = api_instance.get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_quote_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for Quote object | + **attachment_id** | [**String**](.md)| Unique identifier for Attachment object | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_quote_attachments + +> Attachments get_quote_attachments(xero_tenant_id, quote_id) + +Allows you to retrieve Attachments for Quotes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object + +begin + #Allows you to retrieve Attachments for Quotes + result = api_instance.get_quote_attachments(xero_tenant_id, quote_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_quote_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for Quote object | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_quote_history + +> HistoryRecords get_quote_history(xero_tenant_id, quote_id) + +Allows you to retrieve a history records of an quote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote + +begin + #Allows you to retrieve a history records of an quote + result = api_instance.get_quote_history(xero_tenant_id, quote_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_quote_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for an Quote | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_quotes + +> Quotes get_quotes(xero_tenant_id, opts) + +Allows you to retrieve any sales quotes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + date_from: Date.parse('2013-10-20'), # Date | Filter for quotes after a particular date + date_to: Date.parse('2013-10-20'), # Date | Filter for quotes before a particular date + expiry_date_from: Date.parse('2013-10-20'), # Date | Filter for quotes expiring after a particular date + expiry_date_to: Date.parse('2013-10-20'), # Date | Filter for quotes before a particular date + contact_id: '00000000-0000-0000-000-000000000000', # String | Filter for quotes belonging to a particular contact + status: 'status_example', # String | Filter for quotes of a particular Status + page: 1, # Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote + order: 'ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve any sales quotes + result = api_instance.get_quotes(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_quotes: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **date_from** | **Date**| Filter for quotes after a particular date | [optional] + **date_to** | **Date**| Filter for quotes before a particular date | [optional] + **expiry_date_from** | **Date**| Filter for quotes expiring after a particular date | [optional] + **expiry_date_to** | **Date**| Filter for quotes before a particular date | [optional] + **contact_id** | [**String**](.md)| Filter for quotes belonging to a particular contact | [optional] + **status** | **String**| Filter for quotes of a particular Status | [optional] + **page** | **Integer**| e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**Quotes**](Quotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_receipt + +> Receipts get_receipt(xero_tenant_id, receipt_id, opts) + +Allows you to retrieve a specified draft expense claim receipts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve a specified draft expense claim receipts + result = api_instance.get_receipt(xero_tenant_id, receipt_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_receipt: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Receipts**](Receipts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_receipt_attachment_by_file_name + +> File get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type) + +Allows you to retrieve Attachments on expense claim receipts by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on expense claim receipts by file name + result = api_instance.get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_receipt_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + **file_name** | **String**| The name of the file being attached to the Receipt | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_receipt_attachment_by_id + +> File get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type) + +Allows you to retrieve Attachments on expense claim receipts by ID + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve Attachments on expense claim receipts by ID + result = api_instance.get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_receipt_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_receipt_attachments + +> Attachments get_receipt_attachments(xero_tenant_id, receipt_id) + +Allows you to retrieve Attachments for expense claim receipts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt + +begin + #Allows you to retrieve Attachments for expense claim receipts + result = api_instance.get_receipt_attachments(xero_tenant_id, receipt_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_receipt_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_receipt_history + +> HistoryRecords get_receipt_history(xero_tenant_id, receipt_id) + +Allows you to retrieve a history records of an Receipt + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt + +begin + #Allows you to retrieve a history records of an Receipt + result = api_instance.get_receipt_history(xero_tenant_id, receipt_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_receipt_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_receipts + +> Receipts get_receipts(xero_tenant_id, opts) + +Allows you to retrieve draft expense claim receipts for any user + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'Status==\"' + Receipt.StatusEnum.DRAFT + '\"', # String | Filter by an any element + order: 'ReceiptNumber ASC', # String | Order by an any element + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve draft expense claim receipts for any user + result = api_instance.get_receipts(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_receipts: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Receipts**](Receipts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_repeating_invoice + +> RepeatingInvoices get_repeating_invoice(xero_tenant_id, repeating_invoice_id) + +Allows you to retrieve a specified repeating invoice + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice + +begin + #Allows you to retrieve a specified repeating invoice + result = api_instance.get_repeating_invoice(xero_tenant_id, repeating_invoice_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_repeating_invoice: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + +### Return type + +[**RepeatingInvoices**](RepeatingInvoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_repeating_invoice_attachment_by_file_name + +> File get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type) + +Allows you to retrieve specified attachment on repeating invoices by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve specified attachment on repeating invoices by file name + result = api_instance.get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + **file_name** | **String**| The name of the file being attached to a Repeating Invoice | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_repeating_invoice_attachment_by_id + +> File get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type) + +Allows you to retrieve a specified Attachments on repeating invoices + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + +begin + #Allows you to retrieve a specified Attachments on repeating invoices + result = api_instance.get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + **attachment_id** | [**String**](.md)| Unique identifier for a Attachment | + **content_type** | **String**| The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf | + +### Return type + +**File** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/octet-stream + + +## get_repeating_invoice_attachments + +> Attachments get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id) + +Allows you to retrieve Attachments on repeating invoice + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice + +begin + #Allows you to retrieve Attachments on repeating invoice + result = api_instance.get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_repeating_invoice_attachments: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_repeating_invoice_history + +> HistoryRecords get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id) + +Allows you to retrieve history for a repeating invoice + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice + +begin + #Allows you to retrieve history for a repeating invoice + result = api_instance.get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_repeating_invoice_history: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + +### Return type + +[**HistoryRecords**](HistoryRecords.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_repeating_invoices + +> RepeatingInvoices get_repeating_invoices(xero_tenant_id, opts) + +Allows you to retrieve any repeating invoices + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + where: 'Status==\"' + RepeatingInvoice.StatusEnum.DRAFT + '\"', # String | Filter by an any element + order: 'Total ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve any repeating invoices + result = api_instance.get_repeating_invoices(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_repeating_invoices: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**RepeatingInvoices**](RepeatingInvoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_aged_payables_by_contact + +> ReportWithRows get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts) + +Allows you to retrieve report for AgedPayablesByContact + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +opts = { + date: Date.parse('2013-10-20'), # Date | The date of the Aged Payables By Contact report + from_date: Date.parse('2013-10-20'), # Date | The from date of the Aged Payables By Contact report + to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Payables By Contact report +} + +begin + #Allows you to retrieve report for AgedPayablesByContact + result = api_instance.get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_aged_payables_by_contact: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **date** | **Date**| The date of the Aged Payables By Contact report | [optional] + **from_date** | **Date**| The from date of the Aged Payables By Contact report | [optional] + **to_date** | **Date**| The to date of the Aged Payables By Contact report | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_aged_receivables_by_contact + +> ReportWithRows get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts) + +Allows you to retrieve report for AgedReceivablesByContact + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +opts = { + date: Date.parse('2013-10-20'), # Date | The date of the Aged Receivables By Contact report + from_date: Date.parse('2013-10-20'), # Date | The from date of the Aged Receivables By Contact report + to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Receivables By Contact report +} + +begin + #Allows you to retrieve report for AgedReceivablesByContact + result = api_instance.get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_aged_receivables_by_contact: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **date** | **Date**| The date of the Aged Receivables By Contact report | [optional] + **from_date** | **Date**| The from date of the Aged Receivables By Contact report | [optional] + **to_date** | **Date**| The to date of the Aged Receivables By Contact report | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_ba_sor_gst + +> ReportWithRows get_report_ba_sor_gst(xero_tenant_id, report_id) + +Allows you to retrieve report for BAS only valid for AU orgs + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +report_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Report + +begin + #Allows you to retrieve report for BAS only valid for AU orgs + result = api_instance.get_report_ba_sor_gst(xero_tenant_id, report_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_ba_sor_gst: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **report_id** | **String**| Unique identifier for a Report | + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_ba_sor_gst_list + +> ReportWithRows get_report_ba_sor_gst_list(xero_tenant_id) + +Allows you to retrieve report for BAS only valid for AU orgs + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant + +begin + #Allows you to retrieve report for BAS only valid for AU orgs + result = api_instance.get_report_ba_sor_gst_list(xero_tenant_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_ba_sor_gst_list: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_balance_sheet + +> ReportWithRows get_report_balance_sheet(xero_tenant_id, opts) + +Allows you to retrieve report for BalanceSheet + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + date: '2019-11-01', # String | The date of the Balance Sheet report + periods: 3, # Integer | The number of periods for the Balance Sheet report + timeframe: 'MONTH', # String | The period size to compare to (MONTH, QUARTER, YEAR) + tracking_option_id1: '00000000-0000-0000-000-000000000000', # String | The tracking option 1 for the Balance Sheet report + tracking_option_id2: '00000000-0000-0000-000-000000000000', # String | The tracking option 2 for the Balance Sheet report + standard_layout: true, # Boolean | The standard layout boolean for the Balance Sheet report + payments_only: false # Boolean | return a cash basis for the Balance Sheet report +} + +begin + #Allows you to retrieve report for BalanceSheet + result = api_instance.get_report_balance_sheet(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_balance_sheet: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **date** | **String**| The date of the Balance Sheet report | [optional] + **periods** | **Integer**| The number of periods for the Balance Sheet report | [optional] + **timeframe** | **String**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] + **tracking_option_id1** | **String**| The tracking option 1 for the Balance Sheet report | [optional] + **tracking_option_id2** | **String**| The tracking option 2 for the Balance Sheet report | [optional] + **standard_layout** | **Boolean**| The standard layout boolean for the Balance Sheet report | [optional] + **payments_only** | **Boolean**| return a cash basis for the Balance Sheet report | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_bank_summary + +> ReportWithRows get_report_bank_summary(xero_tenant_id, opts) + +Allows you to retrieve report for BankSummary + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + from_date: Date.parse('2019-11-01'), # Date | The from date for the Bank Summary report e.g. 2018-03-31 + to_date: Date.parse('2019-11-30') # Date | The to date for the Bank Summary report e.g. 2018-03-31 +} + +begin + #Allows you to retrieve report for BankSummary + result = api_instance.get_report_bank_summary(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_bank_summary: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **from_date** | **Date**| The from date for the Bank Summary report e.g. 2018-03-31 | [optional] + **to_date** | **Date**| The to date for the Bank Summary report e.g. 2018-03-31 | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_budget_summary + +> ReportWithRows get_report_budget_summary(xero_tenant_id, opts) + +Allows you to retrieve report for Budget Summary + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + date: Date.parse('2019-03-31'), # Date | The date for the Bank Summary report e.g. 2018-03-31 + period: 2, # Integer | The number of periods to compare (integer between 1 and 12) + timeframe: 3 # Integer | The period size to compare to (1=month, 3=quarter, 12=year) +} + +begin + #Allows you to retrieve report for Budget Summary + result = api_instance.get_report_budget_summary(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_budget_summary: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **date** | **Date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] + **period** | **Integer**| The number of periods to compare (integer between 1 and 12) | [optional] + **timeframe** | **Integer**| The period size to compare to (1=month, 3=quarter, 12=year) | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_executive_summary + +> ReportWithRows get_report_executive_summary(xero_tenant_id, opts) + +Allows you to retrieve report for ExecutiveSummary + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + date: Date.parse('2019-03-31') # Date | The date for the Bank Summary report e.g. 2018-03-31 +} + +begin + #Allows you to retrieve report for ExecutiveSummary + result = api_instance.get_report_executive_summary(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_executive_summary: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **date** | **Date**| The date for the Bank Summary report e.g. 2018-03-31 | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_profit_and_loss + +> ReportWithRows get_report_profit_and_loss(xero_tenant_id, opts) + +Allows you to retrieve report for ProfitAndLoss + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + from_date: Date.parse('2019-03-01'), # Date | The from date for the ProfitAndLoss report e.g. 2018-03-31 + to_date: Date.parse('2019-03-31'), # Date | The to date for the ProfitAndLoss report e.g. 2018-03-31 + periods: 3, # Integer | The number of periods to compare (integer between 1 and 12) + timeframe: 'MONTH', # String | The period size to compare to (MONTH, QUARTER, YEAR) + tracking_category_id: '00000000-0000-0000-000-000000000000', # String | The trackingCategory 1 for the ProfitAndLoss report + tracking_category_id2: '00000000-0000-0000-000-000000000000', # String | The trackingCategory 2 for the ProfitAndLoss report + tracking_option_id: '00000000-0000-0000-000-000000000000', # String | The tracking option 1 for the ProfitAndLoss report + tracking_option_id2: '00000000-0000-0000-000-000000000000', # String | The tracking option 2 for the ProfitAndLoss report + standard_layout: true, # Boolean | Return the standard layout for the ProfitAndLoss report + payments_only: false # Boolean | Return cash only basis for the ProfitAndLoss report +} + +begin + #Allows you to retrieve report for ProfitAndLoss + result = api_instance.get_report_profit_and_loss(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_profit_and_loss: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **from_date** | **Date**| The from date for the ProfitAndLoss report e.g. 2018-03-31 | [optional] + **to_date** | **Date**| The to date for the ProfitAndLoss report e.g. 2018-03-31 | [optional] + **periods** | **Integer**| The number of periods to compare (integer between 1 and 12) | [optional] + **timeframe** | **String**| The period size to compare to (MONTH, QUARTER, YEAR) | [optional] + **tracking_category_id** | **String**| The trackingCategory 1 for the ProfitAndLoss report | [optional] + **tracking_category_id2** | **String**| The trackingCategory 2 for the ProfitAndLoss report | [optional] + **tracking_option_id** | **String**| The tracking option 1 for the ProfitAndLoss report | [optional] + **tracking_option_id2** | **String**| The tracking option 2 for the ProfitAndLoss report | [optional] + **standard_layout** | **Boolean**| Return the standard layout for the ProfitAndLoss report | [optional] + **payments_only** | **Boolean**| Return cash only basis for the ProfitAndLoss report | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_ten_ninety_nine + +> Reports get_report_ten_ninety_nine(xero_tenant_id, opts) + +Allows you to retrieve report for TenNinetyNine + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + report_year: '2019' # String | The year of the 1099 report +} + +begin + #Allows you to retrieve report for TenNinetyNine + result = api_instance.get_report_ten_ninety_nine(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_ten_ninety_nine: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **report_year** | **String**| The year of the 1099 report | [optional] + +### Return type + +[**Reports**](Reports.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_report_trial_balance + +> ReportWithRows get_report_trial_balance(xero_tenant_id, opts) + +Allows you to retrieve report for TrialBalance + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + date: Date.parse('2019-10-31'), # Date | The date for the Trial Balance report e.g. 2018-03-31 + payments_only: true # Boolean | Return cash only basis for the Trial Balance report +} + +begin + #Allows you to retrieve report for TrialBalance + result = api_instance.get_report_trial_balance(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_report_trial_balance: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **date** | **Date**| The date for the Trial Balance report e.g. 2018-03-31 | [optional] + **payments_only** | **Boolean**| Return cash only basis for the Trial Balance report | [optional] + +### Return type + +[**ReportWithRows**](ReportWithRows.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_tax_rates + +> TaxRates get_tax_rates(xero_tenant_id, opts) + +Allows you to retrieve Tax Rates + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + where: 'Status==\"' + TaxRate.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Name ASC', # String | Order by an any element + tax_type: 'INPUT' # String | Filter by tax type +} + +begin + #Allows you to retrieve Tax Rates + result = api_instance.get_tax_rates(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_tax_rates: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **tax_type** | **String**| Filter by tax type | [optional] + +### Return type + +[**TaxRates**](TaxRates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_tracking_categories + +> TrackingCategories get_tracking_categories(xero_tenant_id, opts) + +Allows you to retrieve tracking categories and options + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + where: 'Status==\"' + TrackingCategory.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + order: 'Name ASC', # String | Order by an any element + include_archived: true # Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response +} + +begin + #Allows you to retrieve tracking categories and options + result = api_instance.get_tracking_categories(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_tracking_categories: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + **include_archived** | **Boolean**| e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response | [optional] + +### Return type + +[**TrackingCategories**](TrackingCategories.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_tracking_category + +> TrackingCategories get_tracking_category(xero_tenant_id, tracking_category_id) + +Allows you to retrieve tracking categories and options for specified category + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory + +begin + #Allows you to retrieve tracking categories and options for specified category + result = api_instance.get_tracking_category(xero_tenant_id, tracking_category_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_tracking_category: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | + +### Return type + +[**TrackingCategories**](TrackingCategories.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_user + +> Users get_user(xero_tenant_id, user_id) + +Allows you to retrieve a specified user + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +user_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a User + +begin + #Allows you to retrieve a specified user + result = api_instance.get_user(xero_tenant_id, user_id) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_user: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **user_id** | [**String**](.md)| Unique identifier for a User | + +### Return type + +[**Users**](Users.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_users + +> Users get_users(xero_tenant_id, opts) + +Allows you to retrieve users + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +opts = { + if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'IsSubscriber==true', # String | Filter by an any element + order: 'LastName ASC' # String | Order by an any element +} + +begin + #Allows you to retrieve users + result = api_instance.get_users(xero_tenant_id, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->get_users: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **if_modified_since** | **DateTime**| Only records created or modified since this timestamp will be returned | [optional] + **where** | **String**| Filter by an any element | [optional] + **order** | **String**| Order by an any element | [optional] + +### Return type + +[**Users**](Users.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## update_account + +> Accounts update_account(xero_tenant_id, account_id, accounts) + +Allows you to update a chart of accounts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object +accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] } # Accounts | Request of type Accounts array with one Account + +begin + #Allows you to update a chart of accounts + result = api_instance.update_account(xero_tenant_id, account_id, accounts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_account: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for retrieving single object | + **accounts** | [**Accounts**](Accounts.md)| Request of type Accounts array with one Account | + +### Return type + +[**Accounts**](Accounts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_account_attachment_by_file_name + +> Attachments update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) + +Allows you to update Attachment on Account by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object +file_name = 'xero-dev.jpg' # String | Name of the attachment +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update Attachment on Account by Filename + result = api_instance.update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_account_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **account_id** | [**String**](.md)| Unique identifier for Account object | + **file_name** | **String**| Name of the attachment | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_bank_transaction + +> BankTransactions update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts) + +Allows you to update a single spend or receive money transaction + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] } # BankTransactions | +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update a single spend or receive money transaction + result = api_instance.update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_bank_transaction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + **bank_transactions** | [**BankTransactions**](BankTransactions.md)| | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**BankTransactions**](BankTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_bank_transaction_attachment_by_file_name + +> Attachments update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) + +Allows you to update an Attachment on BankTransaction by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +file_name = 'xero-dev.jpg' # String | The name of the file being attached +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update an Attachment on BankTransaction by Filename + result = api_instance.update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_bank_transaction_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | + **file_name** | **String**| The name of the file being attached | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_bank_transfer_attachment_by_file_name + +> Attachments update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) + + + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer +body = 'body_example' # String | Byte array of file in body of request + +begin + result = api_instance.update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_bank_transfer_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transfer_id** | [**String**](.md)| Xero generated unique identifier for a bank transfer | + **file_name** | **String**| The name of the file being attached to a Bank Transfer | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_contact + +> Contacts update_contact(xero_tenant_id, contact_id, contacts) + + + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] } # Contacts | an array of Contacts containing single Contact object with properties to update + +begin + result = api_instance.update_contact(xero_tenant_id, contact_id, contacts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_contact: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **contacts** | [**Contacts**](Contacts.md)| an array of Contacts containing single Contact object with properties to update | + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_contact_attachment_by_file_name + +> Attachments update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) + + + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +file_name = 'xero-dev.jpg' # String | Name for the file you are attaching +body = 'body_example' # String | Byte array of file in body of request + +begin + result = api_instance.update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_contact_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_id** | [**String**](.md)| Unique identifier for a Contact | + **file_name** | **String**| Name for the file you are attaching | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_contact_group + +> ContactGroups update_contact_group(xero_tenant_id, contact_group_id, contact_groups) + +Allows you to update a Contact Group + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group +contact_groups = { contactGroups:[ { name:"Vendor" } ] } # ContactGroups | an array of Contact groups with Name of specific group to update + +begin + #Allows you to update a Contact Group + result = api_instance.update_contact_group(xero_tenant_id, contact_group_id, contact_groups) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_contact_group: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contact_group_id** | [**String**](.md)| Unique identifier for a Contact Group | + **contact_groups** | [**ContactGroups**](ContactGroups.md)| an array of Contact groups with Name of specific group to update | + +### Return type + +[**ContactGroups**](ContactGroups.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_credit_note + +> CreditNotes update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts) + +Allows you to update a specific credit note + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +credit_notes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] } # CreditNotes | an array of Credit Notes containing credit note details to update +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update a specific credit note + result = api_instance.update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_credit_note: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **credit_notes** | [**CreditNotes**](CreditNotes.md)| an array of Credit Notes containing credit note details to update | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**CreditNotes**](CreditNotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_credit_note_attachment_by_file_name + +> Attachments update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body) + +Allows you to update Attachments on CreditNote by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update Attachments on CreditNote by file name + result = api_instance.update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_credit_note_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_note_id** | [**String**](.md)| Unique identifier for a Credit Note | + **file_name** | **String**| Name of the file you are attaching to Credit Note | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_expense_claim + +> ExpenseClaims update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims) + +Allows you to update specified expense claims + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim +expense_claims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] } # ExpenseClaims | + +begin + #Allows you to update specified expense claims + result = api_instance.update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_expense_claim: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **expense_claim_id** | [**String**](.md)| Unique identifier for a ExpenseClaim | + **expense_claims** | [**ExpenseClaims**](ExpenseClaims.md)| | + +### Return type + +[**ExpenseClaims**](ExpenseClaims.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_invoice + +> Invoices update_invoice(xero_tenant_id, invoice_id, invoices, opts) + +Allows you to update a specified sales invoices or purchase bills + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] } # Invoices | +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update a specified sales invoices or purchase bills + result = api_instance.update_invoice(xero_tenant_id, invoice_id, invoices, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_invoice: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **invoices** | [**Invoices**](Invoices.md)| | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Invoices**](Invoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_invoice_attachment_by_file_name + +> Attachments update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body) + +Allows you to update Attachment on invoices or purchase bills by it's filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +file_name = 'xero-dev.jpg' # String | Name of the file you are attaching +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update Attachment on invoices or purchase bills by it's filename + result = api_instance.update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_invoice_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoice_id** | [**String**](.md)| Unique identifier for an Invoice | + **file_name** | **String**| Name of the file you are attaching | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_item + +> Items update_item(xero_tenant_id, item_id, items, opts) + +Allows you to update a specified item + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item +items = { items:[ { code:"abc123", description:"Hello Xero" } ] } # Items | +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update a specified item + result = api_instance.update_item(xero_tenant_id, item_id, items, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_item: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **item_id** | [**String**](.md)| Unique identifier for an Item | + **items** | [**Items**](Items.md)| | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Items**](Items.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_linked_transaction + +> LinkedTransactions update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions) + +Allows you to update a specified linked transactions (billable expenses) + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction +linked_transactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] } # LinkedTransactions | + +begin + #Allows you to update a specified linked transactions (billable expenses) + result = api_instance.update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_linked_transaction: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **linked_transaction_id** | [**String**](.md)| Unique identifier for a LinkedTransaction | + **linked_transactions** | [**LinkedTransactions**](LinkedTransactions.md)| | + +### Return type + +[**LinkedTransactions**](LinkedTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_manual_journal + +> ManualJournals update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals) + +Allows you to update a specified manual journal + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal +manual_journals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] } # ManualJournals | + +begin + #Allows you to update a specified manual journal + result = api_instance.update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_manual_journal: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | + **manual_journals** | [**ManualJournals**](ManualJournals.md)| | + +### Return type + +[**ManualJournals**](ManualJournals.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_manual_journal_attachment_by_file_name + +> Attachments update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) + +Allows you to update a specified Attachment on ManualJournal by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update a specified Attachment on ManualJournal by file name + result = api_instance.update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_manual_journal_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journal_id** | [**String**](.md)| Unique identifier for a ManualJournal | + **file_name** | **String**| The name of the file being attached to a ManualJournal | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_or_create_bank_transactions + +> BankTransactions update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts) + +Allows you to update or create one or more spend or receive money transaction + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update or create one or more spend or receive money transaction + result = api_instance.update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_bank_transactions: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **bank_transactions** | [**BankTransactions**](BankTransactions.md)| | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**BankTransactions**](BankTransactions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_contacts + +> Contacts update_or_create_contacts(xero_tenant_id, contacts, opts) + +Allows you to update OR create one or more contacts in a Xero organisation + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to update OR create one or more contacts in a Xero organisation + result = api_instance.update_or_create_contacts(xero_tenant_id, contacts, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_contacts: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **contacts** | [**Contacts**](Contacts.md)| | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Contacts**](Contacts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_credit_notes + +> CreditNotes update_or_create_credit_notes(xero_tenant_id, credit_notes, opts) + +Allows you to update OR create one or more credit notes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +credit_notes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | an array of Credit Notes with a single CreditNote object. +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update OR create one or more credit notes + result = api_instance.update_or_create_credit_notes(xero_tenant_id, credit_notes, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_credit_notes: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **credit_notes** | [**CreditNotes**](CreditNotes.md)| an array of Credit Notes with a single CreditNote object. | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**CreditNotes**](CreditNotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_employees + +> Employees update_or_create_employees(xero_tenant_id, employees, opts) + +Allows you to create a single new employees used in Xero payrun + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | Employees with array of Employee object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create a single new employees used in Xero payrun + result = api_instance.update_or_create_employees(xero_tenant_id, employees, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_employees: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **employees** | [**Employees**](Employees.md)| Employees with array of Employee object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Employees**](Employees.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_invoices + +> Invoices update_or_create_invoices(xero_tenant_id, invoices, opts) + +Allows you to update OR create one or more sales invoices or purchase bills + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] } # Invoices | +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update OR create one or more sales invoices or purchase bills + result = api_instance.update_or_create_invoices(xero_tenant_id, invoices, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_invoices: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **invoices** | [**Invoices**](Invoices.md)| | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Invoices**](Invoices.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_items + +> Items update_or_create_items(xero_tenant_id, items, opts) + +Allows you to update or create one or more items + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] } # Items | +opts = { + summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to update or create one or more items + result = api_instance.update_or_create_items(xero_tenant_id, items, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_items: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **items** | [**Items**](Items.md)| | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Items**](Items.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_manual_journals + +> ManualJournals update_or_create_manual_journals(xero_tenant_id, manual_journals, opts) + +Allows you to create a single manual journal + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +manual_journals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | ManualJournals array with ManualJournal object in body of request +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to create a single manual journal + result = api_instance.update_or_create_manual_journals(xero_tenant_id, manual_journals, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_manual_journals: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **manual_journals** | [**ManualJournals**](ManualJournals.md)| ManualJournals array with ManualJournal object in body of request | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**ManualJournals**](ManualJournals.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_purchase_orders + +> PurchaseOrders update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts) + +Allows you to update or create one or more purchase orders + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_orders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to update or create one or more purchase orders + result = api_instance.update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_purchase_orders: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**PurchaseOrders**](PurchaseOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_or_create_quotes + +> Quotes update_or_create_quotes(xero_tenant_id, quotes, opts) + +Allows you to update OR create one or more quotes + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | +opts = { + summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors +} + +begin + #Allows you to update OR create one or more quotes + result = api_instance.update_or_create_quotes(xero_tenant_id, quotes, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_or_create_quotes: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quotes** | [**Quotes**](Quotes.md)| | + **summarize_errors** | **Boolean**| If false return 200 OK and mix of successfully created obejcts and any with validation errors | [optional] [default to false] + +### Return type + +[**Quotes**](Quotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_purchase_order + +> PurchaseOrders update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders) + +Allows you to update a specified purchase order + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder +purchase_orders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] } # PurchaseOrders | + +begin + #Allows you to update a specified purchase order + result = api_instance.update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_purchase_order: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **purchase_order_id** | [**String**](.md)| Unique identifier for a PurchaseOrder | + **purchase_orders** | [**PurchaseOrders**](PurchaseOrders.md)| | + +### Return type + +[**PurchaseOrders**](PurchaseOrders.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_quote + +> Quotes update_quote(xero_tenant_id, quote_id, quotes) + +Allows you to update a specified quote + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote +quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]} # Quotes | + +begin + #Allows you to update a specified quote + result = api_instance.update_quote(xero_tenant_id, quote_id, quotes) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_quote: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for an Quote | + **quotes** | [**Quotes**](Quotes.md)| | + +### Return type + +[**Quotes**](Quotes.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_quote_attachment_by_file_name + +> Attachments update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) + +Allows you to update Attachment on Quote by Filename + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object +file_name = 'xero-dev.jpg' # String | Name of the attachment +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update Attachment on Quote by Filename + result = api_instance.update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_quote_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **quote_id** | [**String**](.md)| Unique identifier for Quote object | + **file_name** | **String**| Name of the attachment | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_receipt + +> Receipts update_receipt(xero_tenant_id, receipt_id, receipts, opts) + +Allows you to retrieve a specified draft expense claim receipts + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] } # Receipts | +opts = { + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts +} + +begin + #Allows you to retrieve a specified draft expense claim receipts + result = api_instance.update_receipt(xero_tenant_id, receipt_id, receipts, opts) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_receipt: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + **receipts** | [**Receipts**](Receipts.md)| | + **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] + +### Return type + +[**Receipts**](Receipts.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_receipt_attachment_by_file_name + +> Attachments update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) + +Allows you to update Attachment on expense claim receipts by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update Attachment on expense claim receipts by file name + result = api_instance.update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_receipt_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **receipt_id** | [**String**](.md)| Unique identifier for a Receipt | + **file_name** | **String**| The name of the file being attached to the Receipt | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_repeating_invoice_attachment_by_file_name + +> Attachments update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) + +Allows you to update specified attachment on repeating invoices by file name + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice +body = 'body_example' # String | Byte array of file in body of request + +begin + #Allows you to update specified attachment on repeating invoices by file name + result = api_instance.update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_repeating_invoice_attachment_by_file_name: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **repeating_invoice_id** | [**String**](.md)| Unique identifier for a Repeating Invoice | + **file_name** | **String**| The name of the file being attached to a Repeating Invoice | + **body** | **String**| Byte array of file in body of request | + +### Return type + +[**Attachments**](Attachments.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/octet-stream +- **Accept**: application/json + + +## update_tax_rate + +> TaxRates update_tax_rate(xero_tenant_id, tax_rates) + +Allows you to update Tax Rates + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tax_rates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] } # TaxRates | + +begin + #Allows you to update Tax Rates + result = api_instance.update_tax_rate(xero_tenant_id, tax_rates) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_tax_rate: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tax_rates** | [**TaxRates**](TaxRates.md)| | + +### Return type + +[**TaxRates**](TaxRates.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_tracking_category + +> TrackingCategories update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) + +Allows you to update tracking categories + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory +tracking_category = { name:"Avengers" } # TrackingCategory | + +begin + #Allows you to update tracking categories + result = api_instance.update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_tracking_category: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | + **tracking_category** | [**TrackingCategory**](TrackingCategory.md)| | + +### Return type + +[**TrackingCategories**](TrackingCategories.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_tracking_options + +> TrackingOptions update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option) + +Allows you to update options for a specified tracking category + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory +tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option +tracking_option = { name:"Vision" } # TrackingOption | + +begin + #Allows you to update options for a specified tracking category + result = api_instance.update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option) + p result +rescue XeroRuby::Accounting::ApiError => e + puts "Exception when calling AccountingApi->update_tracking_options: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **tracking_category_id** | [**String**](.md)| Unique identifier for a TrackingCategory | + **tracking_option_id** | [**String**](.md)| Unique identifier for a Tracking Option | + **tracking_option** | [**TrackingOption**](TrackingOption.md)| | + +### Return type + +[**TrackingOptions**](TrackingOptions.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + diff --git a/docs/accounting/Accounts.md b/docs/accounting/Accounts.md new file mode 100644 index 00000000..0260f731 --- /dev/null +++ b/docs/accounting/Accounts.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Accounts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accounts** | [**Array<Account>**](Account.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Accounts.new(accounts: null) +``` + + diff --git a/docs/accounting/AccountsPayable.md b/docs/accounting/AccountsPayable.md new file mode 100644 index 00000000..812ad37d --- /dev/null +++ b/docs/accounting/AccountsPayable.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::AccountsPayable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outstanding** | **Float** | | [optional] +**overdue** | **Float** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::AccountsPayable.new(outstanding: null, + overdue: null) +``` + + diff --git a/docs/accounting/AccountsReceivable.md b/docs/accounting/AccountsReceivable.md new file mode 100644 index 00000000..4380c5b3 --- /dev/null +++ b/docs/accounting/AccountsReceivable.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::AccountsReceivable + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**outstanding** | **Float** | | [optional] +**overdue** | **Float** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::AccountsReceivable.new(outstanding: null, + overdue: null) +``` + + diff --git a/docs/accounting/Address.md b/docs/accounting/Address.md new file mode 100644 index 00000000..251cb8b4 --- /dev/null +++ b/docs/accounting/Address.md @@ -0,0 +1,35 @@ +# XeroRuby::Accounting::Address + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**address_type** | **String** | define the type of address | [optional] +**address_line1** | **String** | max length = 500 | [optional] +**address_line2** | **String** | max length = 500 | [optional] +**address_line3** | **String** | max length = 500 | [optional] +**address_line4** | **String** | max length = 500 | [optional] +**city** | **String** | max length = 255 | [optional] +**region** | **String** | max length = 255 | [optional] +**postal_code** | **String** | max length = 50 | [optional] +**country** | **String** | max length = 50, [A-Z], [a-z] only | [optional] +**attention_to** | **String** | max length = 255 | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Address.new(address_type: null, + address_line1: null, + address_line2: null, + address_line3: null, + address_line4: null, + city: null, + region: null, + postal_code: null, + country: null, + attention_to: null) +``` + + diff --git a/docs/accounting/Allocation.md b/docs/accounting/Allocation.md new file mode 100644 index 00000000..ef621144 --- /dev/null +++ b/docs/accounting/Allocation.md @@ -0,0 +1,31 @@ +# XeroRuby::Accounting::Allocation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invoice** | [**Invoice**](Invoice.md) | | +**overpayment** | [**Overpayment**](Overpayment.md) | | [optional] +**prepayment** | [**Prepayment**](Prepayment.md) | | [optional] +**credit_note** | [**CreditNote**](CreditNote.md) | | [optional] +**amount** | **Float** | the amount being applied to the invoice | +**date** | **Date** | the date the allocation is applied YYYY-MM-DD. | +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Allocation.new(invoice: null, + overpayment: null, + prepayment: null, + credit_note: null, + amount: null, + date: null, + status_attribute_string: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/Allocations.md b/docs/accounting/Allocations.md new file mode 100644 index 00000000..56aa691b --- /dev/null +++ b/docs/accounting/Allocations.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Allocations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**allocations** | [**Array<Allocation>**](Allocation.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Allocations.new(allocations: null) +``` + + diff --git a/docs/accounting/Attachment.md b/docs/accounting/Attachment.md new file mode 100644 index 00000000..94ecc6b0 --- /dev/null +++ b/docs/accounting/Attachment.md @@ -0,0 +1,27 @@ +# XeroRuby::Accounting::Attachment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attachment_id** | **String** | Unique ID for the file | [optional] +**file_name** | **String** | Name of the file | [optional] +**url** | **String** | URL to the file on xero.com | [optional] +**mime_type** | **String** | Type of file | [optional] +**content_length** | **Float** | Length of the file content | [optional] +**include_online** | **Boolean** | Include the file with the online invoice | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Attachment.new(attachment_id: 00000000-0000-0000-0000-000000000000, + file_name: xero-dev.jpg, + url: https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg, + mime_type: image/jpg, + content_length: null, + include_online: null) +``` + + diff --git a/docs/accounting/Attachments.md b/docs/accounting/Attachments.md new file mode 100644 index 00000000..5cf6a0f3 --- /dev/null +++ b/docs/accounting/Attachments.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Attachments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attachments** | [**Array<Attachment>**](Attachment.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Attachments.new(attachments: null) +``` + + diff --git a/docs/accounting/Balances.md b/docs/accounting/Balances.md new file mode 100644 index 00000000..a3918dd6 --- /dev/null +++ b/docs/accounting/Balances.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::Balances + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accounts_receivable** | [**AccountsReceivable**](AccountsReceivable.md) | | [optional] +**accounts_payable** | [**AccountsPayable**](AccountsPayable.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Balances.new(accounts_receivable: null, + accounts_payable: null) +``` + + diff --git a/docs/accounting/BankTransaction.md b/docs/accounting/BankTransaction.md new file mode 100644 index 00000000..ef09baaa --- /dev/null +++ b/docs/accounting/BankTransaction.md @@ -0,0 +1,59 @@ +# XeroRuby::Accounting::BankTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | See Bank Transaction Types | +**contact** | [**Contact**](Contact.md) | | +**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | +**bank_account** | [**Account**](Account.md) | | +**is_reconciled** | **Boolean** | Boolean to show if transaction is reconciled | [optional] +**date** | **Date** | Date of transaction – YYYY-MM-DD | [optional] +**reference** | **String** | Reference for the transaction. Only supported for SPEND and RECEIVE transactions. | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**currency_rate** | **Float** | Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. | [optional] +**url** | **String** | URL link to a source document – shown as “Go to App Name” | [optional] +**status** | **String** | See Bank Transaction Status Codes | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**sub_total** | **Float** | Total of bank transaction excluding taxes | [optional] +**total_tax** | **Float** | Total tax on bank transaction | [optional] +**total** | **Float** | Total of bank transaction tax inclusive | [optional] +**bank_transaction_id** | **String** | Xero generated unique identifier for bank transaction | [optional] +**prepayment_id** | **String** | Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT | [optional] +**overpayment_id** | **String** | Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT | [optional] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**has_attachments** | **Boolean** | Boolean to indicate if a bank transaction has an attachment | [optional] [default to false] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BankTransaction.new(type: null, + contact: null, + line_items: null, + bank_account: null, + is_reconciled: null, + date: null, + reference: null, + currency_code: null, + currency_rate: null, + url: null, + status: null, + line_amount_types: null, + sub_total: null, + total_tax: null, + total: null, + bank_transaction_id: 00000000-0000-0000-0000-000000000000, + prepayment_id: 00000000-0000-0000-0000-000000000000, + overpayment_id: 00000000-0000-0000-0000-000000000000, + updated_date_utc: null, + has_attachments: false, + status_attribute_string: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/BankTransactions.md b/docs/accounting/BankTransactions.md new file mode 100644 index 00000000..d938bf93 --- /dev/null +++ b/docs/accounting/BankTransactions.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::BankTransactions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_transactions** | [**Array<BankTransaction>**](BankTransaction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BankTransactions.new(bank_transactions: null) +``` + + diff --git a/docs/accounting/BankTransfer.md b/docs/accounting/BankTransfer.md new file mode 100644 index 00000000..0d783530 --- /dev/null +++ b/docs/accounting/BankTransfer.md @@ -0,0 +1,37 @@ +# XeroRuby::Accounting::BankTransfer + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from_bank_account** | [**Account**](Account.md) | | +**to_bank_account** | [**Account**](Account.md) | | +**amount** | **Float** | amount of the transaction | +**date** | **Date** | The date of the Transfer YYYY-MM-DD | [optional] +**bank_transfer_id** | **String** | The identifier of the Bank Transfer | [optional] +**currency_rate** | **Float** | The currency rate | [optional] +**from_bank_transaction_id** | **String** | The Bank Transaction ID for the source account | [optional] +**to_bank_transaction_id** | **String** | The Bank Transaction ID for the destination account | [optional] +**has_attachments** | **Boolean** | Boolean to indicate if a Bank Transfer has an attachment | [optional] [default to false] +**created_date_utc** | **DateTime** | UTC timestamp of creation date of bank transfer | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BankTransfer.new(from_bank_account: null, + to_bank_account: null, + amount: null, + date: null, + bank_transfer_id: null, + currency_rate: null, + from_bank_transaction_id: null, + to_bank_transaction_id: null, + has_attachments: false, + created_date_utc: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/BankTransfers.md b/docs/accounting/BankTransfers.md new file mode 100644 index 00000000..51138aec --- /dev/null +++ b/docs/accounting/BankTransfers.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::BankTransfers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_transfers** | [**Array<BankTransfer>**](BankTransfer.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BankTransfers.new(bank_transfers: null) +``` + + diff --git a/docs/accounting/BatchPayment.md b/docs/accounting/BatchPayment.md new file mode 100644 index 00000000..b36c2711 --- /dev/null +++ b/docs/accounting/BatchPayment.md @@ -0,0 +1,47 @@ +# XeroRuby::Accounting::BatchPayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**account** | [**Account**](Account.md) | | [optional] +**reference** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] +**particulars** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] +**code** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] +**details** | **String** | (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 | [optional] +**narrative** | **String** | (UK Only) Only shows on the statement line in Xero. Max length =18 | [optional] +**batch_payment_id** | **String** | The Xero generated unique identifier for the bank transaction (read-only) | [optional] +**date_string** | **String** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] +**date** | **Date** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] +**amount** | **Float** | The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 | [optional] +**payments** | [**Array<Payment>**](Payment.md) | | [optional] +**type** | **String** | PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) | [optional] +**status** | **String** | AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. | [optional] +**total_amount** | **String** | The total of the payments that make up the batch (read-only) | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the payment | [optional] +**is_reconciled** | **String** | Booelan that tells you if the batch payment has been reconciled (read-only) | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BatchPayment.new(account: null, + reference: null, + particulars: null, + code: null, + details: null, + narrative: null, + batch_payment_id: null, + date_string: null, + date: null, + amount: null, + payments: null, + type: null, + status: null, + total_amount: null, + updated_date_utc: null, + is_reconciled: null) +``` + + diff --git a/docs/accounting/BatchPaymentDetails.md b/docs/accounting/BatchPaymentDetails.md new file mode 100644 index 00000000..4b9c0a65 --- /dev/null +++ b/docs/accounting/BatchPaymentDetails.md @@ -0,0 +1,25 @@ +# XeroRuby::Accounting::BatchPaymentDetails + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bank_account_number** | **String** | Bank account number for use with Batch Payments | [optional] +**bank_account_name** | **String** | Name of bank for use with Batch Payments | [optional] +**details** | **String** | (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 | [optional] +**code** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] +**reference** | **String** | (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BatchPaymentDetails.new(bank_account_number: 123-456-1111111, + bank_account_name: ACME Bank, + details: Hello World, + code: ABC, + reference: Foobar) +``` + + diff --git a/docs/accounting/BatchPayments.md b/docs/accounting/BatchPayments.md new file mode 100644 index 00000000..00f86438 --- /dev/null +++ b/docs/accounting/BatchPayments.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::BatchPayments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**batch_payments** | [**Array<BatchPayment>**](BatchPayment.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BatchPayments.new(batch_payments: null) +``` + + diff --git a/docs/accounting/Bill.md b/docs/accounting/Bill.md new file mode 100644 index 00000000..d54b1eda --- /dev/null +++ b/docs/accounting/Bill.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::Bill + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**day** | **Integer** | Day of Month (0-31) | [optional] +**type** | [**PaymentTermType**](PaymentTermType.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Bill.new(day: null, + type: null) +``` + + diff --git a/docs/accounting/BrandingTheme.md b/docs/accounting/BrandingTheme.md new file mode 100644 index 00000000..655662f9 --- /dev/null +++ b/docs/accounting/BrandingTheme.md @@ -0,0 +1,27 @@ +# XeroRuby::Accounting::BrandingTheme + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branding_theme_id** | **String** | Xero identifier | [optional] +**name** | **String** | Name of branding theme | [optional] +**logo_url** | **String** | The location of the image file used as the logo on this branding theme | [optional] +**type** | **String** | Always INVOICE | [optional] +**sort_order** | **Integer** | Integer – ranked order of branding theme. The default branding theme has a value of 0 | [optional] +**created_date_utc** | **DateTime** | UTC timestamp of creation date of branding theme | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BrandingTheme.new(branding_theme_id: null, + name: null, + logo_url: null, + type: null, + sort_order: null, + created_date_utc: null) +``` + + diff --git a/docs/accounting/BrandingThemes.md b/docs/accounting/BrandingThemes.md new file mode 100644 index 00000000..52d18f54 --- /dev/null +++ b/docs/accounting/BrandingThemes.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::BrandingThemes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**branding_themes** | [**Array<BrandingTheme>**](BrandingTheme.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::BrandingThemes.new(branding_themes: null) +``` + + diff --git a/docs/accounting/CISOrgSetting.md b/docs/accounting/CISOrgSetting.md new file mode 100644 index 00000000..1ada1f21 --- /dev/null +++ b/docs/accounting/CISOrgSetting.md @@ -0,0 +1,21 @@ +# XeroRuby::Accounting::CISOrgSetting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cis_contractor_enabled** | **Boolean** | true or false - Boolean that describes if the organisation is a CIS Contractor | [optional] +**cis_sub_contractor_enabled** | **Boolean** | true or false - Boolean that describes if the organisation is a CIS SubContractor | [optional] +**rate** | **Integer** | CIS Deduction rate for the organisation | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::CISOrgSetting.new(cis_contractor_enabled: null, + cis_sub_contractor_enabled: null, + rate: null) +``` + + diff --git a/docs/accounting/CISSetting.md b/docs/accounting/CISSetting.md new file mode 100644 index 00000000..fa88222a --- /dev/null +++ b/docs/accounting/CISSetting.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::CISSetting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cis_enabled** | **Boolean** | Boolean that describes if the contact is a CIS Subcontractor | [optional] +**rate** | **Integer** | CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::CISSetting.new(cis_enabled: null, + rate: null) +``` + + diff --git a/docs/accounting/CISSettings.md b/docs/accounting/CISSettings.md new file mode 100644 index 00000000..d70ecfa9 --- /dev/null +++ b/docs/accounting/CISSettings.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::CISSettings + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cis_settings** | [**Array<CISSetting>**](CISSetting.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::CISSettings.new(cis_settings: null) +``` + + diff --git a/docs/accounting/Contact.md b/docs/accounting/Contact.md new file mode 100644 index 00000000..e9aacf1d --- /dev/null +++ b/docs/accounting/Contact.md @@ -0,0 +1,93 @@ +# XeroRuby::Accounting::Contact + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_id** | **String** | Xero identifier | [optional] +**contact_number** | **String** | This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. | [optional] +**account_number** | **String** | A user defined account number. This can be updated via the API and the Xero UI (max length = 50) | [optional] +**contact_status** | **String** | Current status of a contact – see contact status types | [optional] +**name** | **String** | Full name of contact/organisation (max length = 255) | [optional] +**first_name** | **String** | First name of contact person (max length = 255) | [optional] +**last_name** | **String** | Last name of contact person (max length = 255) | [optional] +**email_address** | **String** | Email address of contact person (umlauts not supported) (max length = 255) | [optional] +**skype_user_name** | **String** | Skype user name of contact | [optional] +**contact_persons** | [**Array<ContactPerson>**](ContactPerson.md) | See contact persons | [optional] +**bank_account_details** | **String** | Bank account number of contact | [optional] +**tax_number** | **String** | Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) | [optional] +**accounts_receivable_tax_type** | **String** | The tax type from TaxRates | [optional] +**accounts_payable_tax_type** | **String** | The tax type from TaxRates | [optional] +**addresses** | [**Array<Address>**](Address.md) | Store certain address types for a contact – see address types | [optional] +**phones** | [**Array<Phone>**](Phone.md) | Store certain phone types for a contact – see phone types | [optional] +**is_supplier** | **Boolean** | true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. | [optional] +**is_customer** | **Boolean** | true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. | [optional] +**default_currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**xero_network_key** | **String** | Store XeroNetworkKey for contacts. | [optional] +**sales_default_account_code** | **String** | The default sales account code for contacts | [optional] +**purchases_default_account_code** | **String** | The default purchases account code for contacts | [optional] +**sales_tracking_categories** | [**Array<SalesTrackingCategory>**](SalesTrackingCategory.md) | The default sales tracking categories for contacts | [optional] +**purchases_tracking_categories** | [**Array<SalesTrackingCategory>**](SalesTrackingCategory.md) | The default purchases tracking categories for contacts | [optional] +**tracking_category_name** | **String** | The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories | [optional] +**tracking_category_option** | **String** | The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories | [optional] +**payment_terms** | [**PaymentTerm**](PaymentTerm.md) | | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to contact | [optional] +**contact_groups** | [**Array<ContactGroup>**](ContactGroup.md) | Displays which contact groups a contact is included in | [optional] +**website** | **String** | Website address for contact (read only) | [optional] +**branding_theme** | [**BrandingTheme**](BrandingTheme.md) | | [optional] +**batch_payments** | [**BatchPaymentDetails**](BatchPaymentDetails.md) | | [optional] +**discount** | **Float** | The default discount rate for the contact (read only) | [optional] +**balances** | [**Balances**](Balances.md) | | [optional] +**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] +**has_attachments** | **Boolean** | A boolean to indicate if a contact has an attachment | [optional] [default to false] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays validation errors returned from the API | [optional] +**has_validation_errors** | **Boolean** | A boolean to indicate if a contact has an validation errors | [optional] [default to false] +**status_attribute_string** | **String** | Status of object | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Contact.new(contact_id: null, + contact_number: null, + account_number: null, + contact_status: null, + name: null, + first_name: null, + last_name: null, + email_address: null, + skype_user_name: null, + contact_persons: null, + bank_account_details: null, + tax_number: null, + accounts_receivable_tax_type: null, + accounts_payable_tax_type: null, + addresses: null, + phones: null, + is_supplier: null, + is_customer: null, + default_currency: null, + xero_network_key: null, + sales_default_account_code: null, + purchases_default_account_code: null, + sales_tracking_categories: null, + purchases_tracking_categories: null, + tracking_category_name: null, + tracking_category_option: null, + payment_terms: null, + updated_date_utc: null, + contact_groups: null, + website: null, + branding_theme: null, + batch_payments: null, + discount: null, + balances: null, + attachments: null, + has_attachments: false, + validation_errors: null, + has_validation_errors: false, + status_attribute_string: null) +``` + + diff --git a/docs/accounting/ContactGroup.md b/docs/accounting/ContactGroup.md new file mode 100644 index 00000000..cd4f24fe --- /dev/null +++ b/docs/accounting/ContactGroup.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::ContactGroup + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The Name of the contact group. Required when creating a new contact group | [optional] +**status** | **String** | The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. | [optional] +**contact_group_id** | **String** | The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] +**contacts** | [**Array<Contact>**](Contact.md) | The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ContactGroup.new(name: null, + status: null, + contact_group_id: null, + contacts: null) +``` + + diff --git a/docs/accounting/ContactGroups.md b/docs/accounting/ContactGroups.md new file mode 100644 index 00000000..57c039b6 --- /dev/null +++ b/docs/accounting/ContactGroups.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::ContactGroups + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_groups** | [**Array<ContactGroup>**](ContactGroup.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ContactGroups.new(contact_groups: null) +``` + + diff --git a/docs/accounting/ContactPerson.md b/docs/accounting/ContactPerson.md new file mode 100644 index 00000000..996035d5 --- /dev/null +++ b/docs/accounting/ContactPerson.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::ContactPerson + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **String** | First name of person | [optional] +**last_name** | **String** | Last name of person | [optional] +**email_address** | **String** | Email address of person | [optional] +**include_in_emails** | **Boolean** | boolean to indicate whether contact should be included on emails with invoices etc. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ContactPerson.new(first_name: null, + last_name: null, + email_address: null, + include_in_emails: null) +``` + + diff --git a/docs/accounting/Contacts.md b/docs/accounting/Contacts.md new file mode 100644 index 00000000..98afdd46 --- /dev/null +++ b/docs/accounting/Contacts.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Contacts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contacts** | [**Array<Contact>**](Contact.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Contacts.new(contacts: null) +``` + + diff --git a/docs/accounting/CountryCode.md b/docs/accounting/CountryCode.md new file mode 100644 index 00000000..2363624f --- /dev/null +++ b/docs/accounting/CountryCode.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::CountryCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::CountryCode.new() +``` + + diff --git a/docs/accounting/CreditNote.md b/docs/accounting/CreditNote.md new file mode 100644 index 00000000..e235b2cb --- /dev/null +++ b/docs/accounting/CreditNote.md @@ -0,0 +1,67 @@ +# XeroRuby::Accounting::CreditNote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | See Credit Note Types | [optional] +**contact** | [**Contact**](Contact.md) | | [optional] +**date** | **Date** | The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation | [optional] +**status** | **String** | See Credit Note Status Codes | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | See Invoice Line Items | [optional] +**sub_total** | **Float** | The subtotal of the credit note excluding taxes | [optional] +**total_tax** | **Float** | The total tax on the credit note | [optional] +**total** | **Float** | The total of the Credit Note(subtotal + total tax) | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the credit note | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**fully_paid_on_date** | **Date** | Date when credit note was fully paid(UTC format) | [optional] +**credit_note_id** | **String** | Xero generated unique identifier | [optional] +**credit_note_number** | **String** | ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) | [optional] +**reference** | **String** | ACCRECCREDIT only – additional reference number | [optional] +**sent_to_contact** | **Boolean** | boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) | [optional] +**currency_rate** | **Float** | The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used | [optional] +**remaining_credit** | **Float** | The remaining credit balance on the Credit Note | [optional] +**allocations** | [**Array<Allocation>**](Allocation.md) | See Allocations | [optional] +**applied_amount** | **Float** | The amount of applied to an invoice | [optional] +**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] +**branding_theme_id** | **String** | See BrandingThemes | [optional] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**has_attachments** | **Boolean** | boolean to indicate if a credit note has an attachment | [optional] [default to false] +**has_errors** | **Boolean** | A boolean to indicate if a credit note has an validation errors | [optional] [default to false] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::CreditNote.new(type: null, + contact: null, + date: null, + status: null, + line_amount_types: null, + line_items: null, + sub_total: null, + total_tax: null, + total: null, + updated_date_utc: null, + currency_code: null, + fully_paid_on_date: null, + credit_note_id: null, + credit_note_number: null, + reference: null, + sent_to_contact: null, + currency_rate: null, + remaining_credit: null, + allocations: null, + applied_amount: 2.0, + payments: null, + branding_theme_id: null, + status_attribute_string: null, + has_attachments: false, + has_errors: false, + validation_errors: null) +``` + + diff --git a/docs/accounting/CreditNotes.md b/docs/accounting/CreditNotes.md new file mode 100644 index 00000000..f63b5afb --- /dev/null +++ b/docs/accounting/CreditNotes.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::CreditNotes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**credit_notes** | [**Array<CreditNote>**](CreditNote.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::CreditNotes.new(credit_notes: null) +``` + + diff --git a/docs/accounting/Currencies.md b/docs/accounting/Currencies.md new file mode 100644 index 00000000..0329982f --- /dev/null +++ b/docs/accounting/Currencies.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Currencies + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currencies** | [**Array<Currency>**](Currency.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Currencies.new(currencies: null) +``` + + diff --git a/docs/accounting/Currency.md b/docs/accounting/Currency.md new file mode 100644 index 00000000..c2b8927c --- /dev/null +++ b/docs/accounting/Currency.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::Currency + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**description** | **String** | Name of Currency | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Currency.new(code: null, + description: null) +``` + + diff --git a/docs/accounting/CurrencyCode.md b/docs/accounting/CurrencyCode.md new file mode 100644 index 00000000..41c95de1 --- /dev/null +++ b/docs/accounting/CurrencyCode.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::CurrencyCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::CurrencyCode.new() +``` + + diff --git a/docs/accounting/Element.md b/docs/accounting/Element.md new file mode 100644 index 00000000..f3b23ea5 --- /dev/null +++ b/docs/accounting/Element.md @@ -0,0 +1,31 @@ +# XeroRuby::Accounting::Element + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Array of Validation Error message | [optional] +**batch_payment_id** | **String** | Unique ID for batch payment object with validation error | [optional] +**bank_transaction_id** | **String** | | [optional] +**credit_note_id** | **String** | | [optional] +**contact_id** | **String** | | [optional] +**invoice_id** | **String** | | [optional] +**item_id** | **String** | | [optional] +**purchase_order_id** | **String** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Element.new(validation_errors: null, + batch_payment_id: null, + bank_transaction_id: null, + credit_note_id: null, + contact_id: null, + invoice_id: null, + item_id: null, + purchase_order_id: null) +``` + + diff --git a/docs/accounting/Employee.md b/docs/accounting/Employee.md new file mode 100644 index 00000000..ac0f0708 --- /dev/null +++ b/docs/accounting/Employee.md @@ -0,0 +1,31 @@ +# XeroRuby::Accounting::Employee + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **String** | The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] +**status** | **String** | Current status of an employee – see contact status types | [optional] +**first_name** | **String** | First name of an employee (max length = 255) | [optional] +**last_name** | **String** | Last name of an employee (max length = 255) | [optional] +**external_link** | [**ExternalLink**](ExternalLink.md) | | [optional] +**updated_date_utc** | **DateTime** | | [optional] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Employee.new(employee_id: null, + status: null, + first_name: null, + last_name: null, + external_link: null, + updated_date_utc: null, + status_attribute_string: ERROR, + validation_errors: null) +``` + + diff --git a/docs/accounting/Employees.md b/docs/accounting/Employees.md new file mode 100644 index 00000000..eb025d5c --- /dev/null +++ b/docs/accounting/Employees.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Employees + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employees** | [**Array<Employee>**](Employee.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Employees.new(employees: null) +``` + + diff --git a/docs/accounting/Error.md b/docs/accounting/Error.md new file mode 100644 index 00000000..9fc959e1 --- /dev/null +++ b/docs/accounting/Error.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error_number** | **Integer** | Exception number | [optional] +**type** | **String** | Exception type | [optional] +**message** | **String** | Exception message | [optional] +**elements** | [**Array<Element>**](Element.md) | Array of Elements of validation Errors | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Error.new(error_number: null, + type: null, + message: null, + elements: null) +``` + + diff --git a/docs/accounting/ExpenseClaim.md b/docs/accounting/ExpenseClaim.md new file mode 100644 index 00000000..b5e7c7d6 --- /dev/null +++ b/docs/accounting/ExpenseClaim.md @@ -0,0 +1,39 @@ +# XeroRuby::Accounting::ExpenseClaim + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expense_claim_id** | **String** | Xero generated unique identifier for an expense claim | [optional] +**status** | **String** | Current status of an expense claim – see status types | [optional] +**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] +**user** | [**User**](User.md) | | [optional] +**receipts** | [**Array<Receipt>**](Receipt.md) | | [optional] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**total** | **Float** | The total of an expense claim being paid | [optional] +**amount_due** | **Float** | The amount due to be paid for an expense claim | [optional] +**amount_paid** | **Float** | The amount still to pay for an expense claim | [optional] +**payment_due_date** | **Date** | The date when the expense claim is due to be paid YYYY-MM-DD | [optional] +**reporting_date** | **Date** | The date the expense claim will be reported in Xero YYYY-MM-DD | [optional] +**receipt_id** | **String** | The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ExpenseClaim.new(expense_claim_id: null, + status: null, + payments: null, + user: null, + receipts: null, + updated_date_utc: null, + total: null, + amount_due: null, + amount_paid: null, + payment_due_date: null, + reporting_date: null, + receipt_id: null) +``` + + diff --git a/docs/accounting/ExpenseClaims.md b/docs/accounting/ExpenseClaims.md new file mode 100644 index 00000000..e8fa261d --- /dev/null +++ b/docs/accounting/ExpenseClaims.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::ExpenseClaims + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expense_claims** | [**Array<ExpenseClaim>**](ExpenseClaim.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ExpenseClaims.new(expense_claims: null) +``` + + diff --git a/docs/accounting/ExternalLink.md b/docs/accounting/ExternalLink.md new file mode 100644 index 00000000..172cebd6 --- /dev/null +++ b/docs/accounting/ExternalLink.md @@ -0,0 +1,21 @@ +# XeroRuby::Accounting::ExternalLink + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**link_type** | **String** | See External link types | [optional] +**url** | **String** | URL for service e.g. http://twitter.com/xeroapi | [optional] +**description** | **String** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ExternalLink.new(link_type: null, + url: null, + description: null) +``` + + diff --git a/docs/accounting/HistoryRecord.md b/docs/accounting/HistoryRecord.md new file mode 100644 index 00000000..4f22ed61 --- /dev/null +++ b/docs/accounting/HistoryRecord.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::HistoryRecord + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**details** | **String** | details | [optional] +**changes** | **String** | Name of branding theme | [optional] +**user** | **String** | has a value of 0 | [optional] +**date_utc** | **DateTime** | UTC timestamp of creation date of branding theme | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::HistoryRecord.new(details: null, + changes: null, + user: null, + date_utc: null) +``` + + diff --git a/docs/accounting/HistoryRecords.md b/docs/accounting/HistoryRecords.md new file mode 100644 index 00000000..1cff4225 --- /dev/null +++ b/docs/accounting/HistoryRecords.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::HistoryRecords + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**history_records** | [**Array<HistoryRecord>**](HistoryRecord.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::HistoryRecords.new(history_records: null) +``` + + diff --git a/docs/accounting/Invoice.md b/docs/accounting/Invoice.md new file mode 100644 index 00000000..6f67cd3f --- /dev/null +++ b/docs/accounting/Invoice.md @@ -0,0 +1,91 @@ +# XeroRuby::Accounting::Invoice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | See Invoice Types | [optional] +**contact** | [**Contact**](Contact.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] +**date** | **Date** | Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation | [optional] +**due_date** | **Date** | Date invoice is due – YYYY-MM-DD | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**invoice_number** | **String** | ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) | [optional] +**reference** | **String** | ACCREC only – additional reference number (max length = 255) | [optional] +**branding_theme_id** | **String** | See BrandingThemes | [optional] +**url** | **String** | URL link to a source document – shown as “Go to [appName]” in the Xero app | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**currency_rate** | **Float** | The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) | [optional] +**status** | **String** | See Invoice Status Codes | [optional] +**sent_to_contact** | **Boolean** | Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved | [optional] +**expected_payment_date** | **Date** | Shown on sales invoices (Accounts Receivable) when this has been set | [optional] +**planned_payment_date** | **Date** | Shown on bills (Accounts Payable) when this has been set | [optional] +**cis_deduction** | **Float** | CIS deduction for UK contractors | [optional] +**sub_total** | **Float** | Total of invoice excluding taxes | [optional] +**total_tax** | **Float** | Total tax on invoice | [optional] +**total** | **Float** | Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts | [optional] +**total_discount** | **Float** | Total of discounts applied on the invoice line items | [optional] +**invoice_id** | **String** | Xero generated unique identifier for invoice | [optional] +**has_attachments** | **Boolean** | boolean to indicate if an invoice has an attachment | [optional] [default to false] +**is_discounted** | **Boolean** | boolean to indicate if an invoice has a discount | [optional] +**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] +**prepayments** | [**Array<Prepayment>**](Prepayment.md) | See Prepayments | [optional] +**overpayments** | [**Array<Overpayment>**](Overpayment.md) | See Overpayments | [optional] +**amount_due** | **Float** | Amount remaining to be paid on invoice | [optional] +**amount_paid** | **Float** | Sum of payments received for invoice | [optional] +**fully_paid_on_date** | **Date** | The date the invoice was fully paid. Only returned on fully paid invoices | [optional] +**amount_credited** | **Float** | Sum of all credit notes, over-payments and pre-payments applied to invoice | [optional] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**credit_notes** | [**Array<CreditNote>**](CreditNote.md) | Details of credit notes that have been applied to an invoice | [optional] +**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] +**has_errors** | **Boolean** | A boolean to indicate if a invoice has an validation errors | [optional] [default to false] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Invoice.new(type: null, + contact: null, + line_items: null, + date: null, + due_date: null, + line_amount_types: null, + invoice_number: null, + reference: null, + branding_theme_id: null, + url: null, + currency_code: null, + currency_rate: null, + status: null, + sent_to_contact: null, + expected_payment_date: null, + planned_payment_date: null, + cis_deduction: null, + sub_total: null, + total_tax: null, + total: null, + total_discount: null, + invoice_id: null, + has_attachments: false, + is_discounted: null, + payments: null, + prepayments: null, + overpayments: null, + amount_due: null, + amount_paid: null, + fully_paid_on_date: null, + amount_credited: null, + updated_date_utc: null, + credit_notes: null, + attachments: null, + has_errors: false, + status_attribute_string: null, + validation_errors: null, + warnings: null) +``` + + diff --git a/docs/accounting/InvoiceReminder.md b/docs/accounting/InvoiceReminder.md new file mode 100644 index 00000000..04b1de25 --- /dev/null +++ b/docs/accounting/InvoiceReminder.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::InvoiceReminder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**enabled** | **Boolean** | setting for on or off | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::InvoiceReminder.new(enabled: null) +``` + + diff --git a/docs/accounting/InvoiceReminders.md b/docs/accounting/InvoiceReminders.md new file mode 100644 index 00000000..50f36f5b --- /dev/null +++ b/docs/accounting/InvoiceReminders.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::InvoiceReminders + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invoice_reminders** | [**Array<InvoiceReminder>**](InvoiceReminder.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::InvoiceReminders.new(invoice_reminders: null) +``` + + diff --git a/docs/accounting/Invoices.md b/docs/accounting/Invoices.md new file mode 100644 index 00000000..d240d4da --- /dev/null +++ b/docs/accounting/Invoices.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Invoices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invoices** | [**Array<Invoice>**](Invoice.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Invoices.new(invoices: null) +``` + + diff --git a/docs/accounting/Item.md b/docs/accounting/Item.md new file mode 100644 index 00000000..a729242f --- /dev/null +++ b/docs/accounting/Item.md @@ -0,0 +1,47 @@ +# XeroRuby::Accounting::Item + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **String** | User defined item code (max length = 30) | +**inventory_asset_account_code** | **String** | The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item | [optional] +**name** | **String** | The name of the item (max length = 50) | [optional] +**is_sold** | **Boolean** | Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. | [optional] +**is_purchased** | **Boolean** | Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. | [optional] +**description** | **String** | The sales description of the item (max length = 4000) | [optional] +**purchase_description** | **String** | The purchase description of the item (max length = 4000) | [optional] +**purchase_details** | [**Purchase**](Purchase.md) | | [optional] +**sales_details** | [**Purchase**](Purchase.md) | | [optional] +**is_tracked_as_inventory** | **Boolean** | True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. | [optional] +**total_cost_pool** | **Float** | The value of the item on hand. Calculated using average cost accounting. | [optional] +**quantity_on_hand** | **Float** | The quantity of the item on hand | [optional] +**updated_date_utc** | **DateTime** | Last modified date in UTC format | [optional] +**item_id** | **String** | The Xero identifier for an Item | [optional] +**status_attribute_string** | **String** | Status of object | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Item.new(code: null, + inventory_asset_account_code: null, + name: null, + is_sold: null, + is_purchased: null, + description: null, + purchase_description: null, + purchase_details: null, + sales_details: null, + is_tracked_as_inventory: null, + total_cost_pool: null, + quantity_on_hand: null, + updated_date_utc: null, + item_id: null, + status_attribute_string: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/Items.md b/docs/accounting/Items.md new file mode 100644 index 00000000..17802bf7 --- /dev/null +++ b/docs/accounting/Items.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Items + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**Array<Item>**](Item.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Items.new(items: null) +``` + + diff --git a/docs/accounting/Journal.md b/docs/accounting/Journal.md new file mode 100644 index 00000000..f6b7fc82 --- /dev/null +++ b/docs/accounting/Journal.md @@ -0,0 +1,31 @@ +# XeroRuby::Accounting::Journal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**journal_id** | **String** | Xero identifier | [optional] +**journal_date** | **Date** | Date the journal was posted | [optional] +**journal_number** | **Integer** | Xero generated journal number | [optional] +**created_date_utc** | **DateTime** | Created date UTC format | [optional] +**reference** | **String** | reference field for additional indetifying information | [optional] +**source_id** | **String** | The identifier for the source transaction (e.g. InvoiceID) | [optional] +**source_type** | **String** | The journal source type. The type of transaction that created the journal | [optional] +**journal_lines** | [**Array<JournalLine>**](JournalLine.md) | See JournalLines | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Journal.new(journal_id: null, + journal_date: null, + journal_number: null, + created_date_utc: null, + reference: null, + source_id: null, + source_type: null, + journal_lines: null) +``` + + diff --git a/docs/accounting/JournalLine.md b/docs/accounting/JournalLine.md new file mode 100644 index 00000000..55468a7e --- /dev/null +++ b/docs/accounting/JournalLine.md @@ -0,0 +1,39 @@ +# XeroRuby::Accounting::JournalLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**journal_line_id** | **String** | Xero identifier for Journal | [optional] +**account_id** | **String** | See Accounts | [optional] +**account_code** | **String** | See Accounts | [optional] +**account_type** | [**AccountType**](AccountType.md) | | [optional] +**account_name** | **String** | See AccountCodes | [optional] +**description** | **String** | The description from the source transaction line item. Only returned if populated. | [optional] +**net_amount** | **Float** | Net amount of journal line. This will be a positive value for a debit and negative for a credit | [optional] +**gross_amount** | **Float** | Gross amount of journal line (NetAmount + TaxAmount). | [optional] +**tax_amount** | **Float** | Total tax on a journal line | [optional] +**tax_type** | **String** | The tax type from TaxRates | [optional] +**tax_name** | **String** | see TaxRates | [optional] +**tracking_categories** | [**Array<TrackingCategory>**](TrackingCategory.md) | Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::JournalLine.new(journal_line_id: 7be9db36-3598-4755-ba5c-c2dbc8c4a7a2, + account_id: ceef66a5-a545-413b-9312-78a53caadbc4, + account_code: 90.0, + account_type: null, + account_name: Checking Account, + description: My business checking account, + net_amount: 4130.98, + gross_amount: 4130.98, + tax_amount: 0.0, + tax_type: null, + tax_name: Tax Exempt, + tracking_categories: null) +``` + + diff --git a/docs/accounting/Journals.md b/docs/accounting/Journals.md new file mode 100644 index 00000000..bccd124b --- /dev/null +++ b/docs/accounting/Journals.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Journals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**journals** | [**Array<Journal>**](Journal.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Journals.new(journals: null) +``` + + diff --git a/docs/accounting/LineAmountTypes.md b/docs/accounting/LineAmountTypes.md new file mode 100644 index 00000000..67e55198 --- /dev/null +++ b/docs/accounting/LineAmountTypes.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::LineAmountTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::LineAmountTypes.new() +``` + + diff --git a/docs/accounting/LineItem.md b/docs/accounting/LineItem.md new file mode 100644 index 00000000..3ec2f7ff --- /dev/null +++ b/docs/accounting/LineItem.md @@ -0,0 +1,41 @@ +# XeroRuby::Accounting::LineItem + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line_item_id** | **String** | LineItem unique ID | [optional] +**description** | **String** | Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character | [optional] +**quantity** | **Float** | LineItem Quantity | [optional] +**unit_amount** | **Float** | LineItem Unit Amount | [optional] +**item_code** | **String** | See Items | [optional] +**account_code** | **String** | See Accounts | [optional] +**tax_type** | **String** | The tax type from TaxRates | [optional] +**tax_amount** | **Float** | The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct. | [optional] +**line_amount** | **Float** | If you wish to omit either of the <Quantity> or <UnitAmount> you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) | [optional] +**tracking** | [**Array<LineItemTracking>**](LineItemTracking.md) | Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. | [optional] +**discount_rate** | **Float** | Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts | [optional] +**discount_amount** | **Float** | Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. | [optional] +**repeating_invoice_id** | **String** | The Xero identifier for a Repeating Invoice | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::LineItem.new(line_item_id: 00000000-0000-0000-0000-000000000000, + description: null, + quantity: null, + unit_amount: null, + item_code: null, + account_code: null, + tax_type: null, + tax_amount: null, + line_amount: null, + tracking: null, + discount_rate: null, + discount_amount: null, + repeating_invoice_id: 00000000-0000-0000-0000-000000000000) +``` + + diff --git a/docs/accounting/LineItemTracking.md b/docs/accounting/LineItemTracking.md new file mode 100644 index 00000000..e449245d --- /dev/null +++ b/docs/accounting/LineItemTracking.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::LineItemTracking + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_category_id** | **String** | The Xero identifier for a tracking category | [optional] +**tracking_option_id** | **String** | The Xero identifier for a tracking category option | [optional] +**name** | **String** | The name of the tracking category | [optional] +**option** | **String** | See Tracking Options | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::LineItemTracking.new(tracking_category_id: 00000000-0000-0000-0000-000000000000, + tracking_option_id: 00000000-0000-0000-0000-000000000000, + name: Region, + option: North) +``` + + diff --git a/docs/accounting/LinkedTransaction.md b/docs/accounting/LinkedTransaction.md new file mode 100644 index 00000000..08904c3a --- /dev/null +++ b/docs/accounting/LinkedTransaction.md @@ -0,0 +1,37 @@ +# XeroRuby::Accounting::LinkedTransaction + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_transaction_id** | **String** | Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice | [optional] +**source_line_item_id** | **String** | The line item identifier from the source transaction. | [optional] +**contact_id** | **String** | Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. | [optional] +**target_transaction_id** | **String** | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice | [optional] +**target_line_item_id** | **String** | The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. | [optional] +**linked_transaction_id** | **String** | The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] +**status** | **String** | Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. | [optional] +**type** | **String** | This will always be BILLABLEEXPENSE. More types may be added in future. | [optional] +**updated_date_utc** | **DateTime** | The last modified date in UTC format | [optional] +**source_transaction_type_code** | **String** | The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::LinkedTransaction.new(source_transaction_id: null, + source_line_item_id: null, + contact_id: null, + target_transaction_id: null, + target_line_item_id: null, + linked_transaction_id: null, + status: null, + type: null, + updated_date_utc: null, + source_transaction_type_code: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/LinkedTransactions.md b/docs/accounting/LinkedTransactions.md new file mode 100644 index 00000000..3839a5fb --- /dev/null +++ b/docs/accounting/LinkedTransactions.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::LinkedTransactions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**linked_transactions** | [**Array<LinkedTransaction>**](LinkedTransaction.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::LinkedTransactions.new(linked_transactions: null) +``` + + diff --git a/docs/accounting/ManualJournal.md b/docs/accounting/ManualJournal.md new file mode 100644 index 00000000..5b189fc2 --- /dev/null +++ b/docs/accounting/ManualJournal.md @@ -0,0 +1,43 @@ +# XeroRuby::Accounting::ManualJournal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**narration** | **String** | Description of journal being posted | +**journal_lines** | [**Array<ManualJournalLine>**](ManualJournalLine.md) | See JournalLines | [optional] +**date** | **Date** | Date journal was posted – YYYY-MM-DD | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**status** | **String** | See Manual Journal Status Codes | [optional] +**url** | **String** | Url link to a source document – shown as “Go to [appName]” in the Xero app | [optional] +**show_on_cash_basis_reports** | **Boolean** | Boolean – default is true if not specified | [optional] +**has_attachments** | **Boolean** | Boolean to indicate if a manual journal has an attachment | [optional] [default to false] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**manual_journal_id** | **String** | The Xero identifier for a Manual Journal | [optional] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] +**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ManualJournal.new(narration: null, + journal_lines: null, + date: null, + line_amount_types: null, + status: null, + url: null, + show_on_cash_basis_reports: null, + has_attachments: false, + updated_date_utc: null, + manual_journal_id: null, + status_attribute_string: ERROR, + warnings: null, + validation_errors: null, + attachments: null) +``` + + diff --git a/docs/accounting/ManualJournalLine.md b/docs/accounting/ManualJournalLine.md new file mode 100644 index 00000000..5cd35619 --- /dev/null +++ b/docs/accounting/ManualJournalLine.md @@ -0,0 +1,29 @@ +# XeroRuby::Accounting::ManualJournalLine + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**line_amount** | **Float** | total for line. Debits are positive, credits are negative value | [optional] +**account_code** | **String** | See Accounts | [optional] +**description** | **String** | Description for journal line | [optional] +**tax_type** | **String** | The tax type from TaxRates | [optional] +**tracking** | [**Array<TrackingCategory>**](TrackingCategory.md) | Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements. | [optional] +**tax_amount** | **Float** | The calculated tax amount based on the TaxType and LineAmount | [optional] +**is_blank** | **Boolean** | is the line blank | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ManualJournalLine.new(line_amount: -2569.0, + account_code: 720, + description: Coded incorrectly Office Equipment should be Computer Equipment, + tax_type: null, + tracking: null, + tax_amount: 0.0, + is_blank: false) +``` + + diff --git a/docs/accounting/ManualJournals.md b/docs/accounting/ManualJournals.md new file mode 100644 index 00000000..2e36a36f --- /dev/null +++ b/docs/accounting/ManualJournals.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::ManualJournals + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**manual_journals** | [**Array<ManualJournal>**](ManualJournal.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ManualJournals.new(manual_journals: null) +``` + + diff --git a/docs/accounting/OnlineInvoice.md b/docs/accounting/OnlineInvoice.md new file mode 100644 index 00000000..61515486 --- /dev/null +++ b/docs/accounting/OnlineInvoice.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::OnlineInvoice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**online_invoice_url** | **String** | the URL to an online invoice | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::OnlineInvoice.new(online_invoice_url: null) +``` + + diff --git a/docs/accounting/OnlineInvoices.md b/docs/accounting/OnlineInvoices.md new file mode 100644 index 00000000..bea96603 --- /dev/null +++ b/docs/accounting/OnlineInvoices.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::OnlineInvoices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**online_invoices** | [**Array<OnlineInvoice>**](OnlineInvoice.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::OnlineInvoices.new(online_invoices: null) +``` + + diff --git a/docs/accounting/Organisation.md b/docs/accounting/Organisation.md new file mode 100644 index 00000000..921d3ef4 --- /dev/null +++ b/docs/accounting/Organisation.md @@ -0,0 +1,81 @@ +# XeroRuby::Accounting::Organisation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organisation_id** | **String** | Unique Xero identifier | [optional] +**api_key** | **String** | Display a unique key used for Xero-to-Xero transactions | [optional] +**name** | **String** | Display name of organisation shown in Xero | [optional] +**legal_name** | **String** | Organisation name shown on Reports | [optional] +**pays_tax** | **Boolean** | Boolean to describe if organisation is registered with a local tax authority i.e. true, false | [optional] +**version** | **String** | See Version Types | [optional] +**organisation_type** | **String** | Organisation Type | [optional] +**base_currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**country_code** | [**CountryCode**](CountryCode.md) | | [optional] +**is_demo_company** | **Boolean** | Boolean to describe if organisation is a demo company. | [optional] +**organisation_status** | **String** | Will be set to ACTIVE if you can connect to organisation via the Xero API | [optional] +**registration_number** | **String** | Shows for New Zealand, Australian and UK organisations | [optional] +**employer_identification_number** | **String** | Shown if set. US Only. | [optional] +**tax_number** | **String** | Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). | [optional] +**financial_year_end_day** | **Integer** | Calendar day e.g. 0-31 | [optional] +**financial_year_end_month** | **Integer** | Calendar Month e.g. 1-12 | [optional] +**sales_tax_basis** | **String** | The accounting basis used for tax returns. See Sales Tax Basis | [optional] +**sales_tax_period** | **String** | The frequency with which tax returns are processed. See Sales Tax Period | [optional] +**default_sales_tax** | **String** | The default for LineAmountTypes on sales transactions | [optional] +**default_purchases_tax** | **String** | The default for LineAmountTypes on purchase transactions | [optional] +**period_lock_date** | **Date** | Shown if set. See lock dates | [optional] +**end_of_year_lock_date** | **Date** | Shown if set. See lock dates | [optional] +**created_date_utc** | **DateTime** | Timestamp when the organisation was created in Xero | [optional] +**timezone** | [**TimeZone**](TimeZone.md) | | [optional] +**organisation_entity_type** | **String** | Organisation Type | [optional] +**short_code** | **String** | A unique identifier for the organisation. Potential uses. | [optional] +**_class** | **String** | Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) | [optional] +**edition** | **String** | BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) | [optional] +**line_of_business** | **String** | Description of business type as defined in Organisation settings | [optional] +**addresses** | [**Array<Address>**](Address.md) | Address details for organisation – see Addresses | [optional] +**phones** | [**Array<Phone>**](Phone.md) | Phones details for organisation – see Phones | [optional] +**external_links** | [**Array<ExternalLink>**](ExternalLink.md) | Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below | [optional] +**payment_terms** | [**PaymentTerm**](PaymentTerm.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Organisation.new(organisation_id: 8be9db36-3598-4755-ba5c-c2dbc8c4a7a2, + api_key: null, + name: null, + legal_name: null, + pays_tax: null, + version: null, + organisation_type: null, + base_currency: null, + country_code: null, + is_demo_company: null, + organisation_status: null, + registration_number: null, + employer_identification_number: null, + tax_number: null, + financial_year_end_day: null, + financial_year_end_month: null, + sales_tax_basis: null, + sales_tax_period: null, + default_sales_tax: null, + default_purchases_tax: null, + period_lock_date: null, + end_of_year_lock_date: null, + created_date_utc: null, + timezone: null, + organisation_entity_type: null, + short_code: null, + _class: null, + edition: null, + line_of_business: null, + addresses: null, + phones: null, + external_links: null, + payment_terms: null) +``` + + diff --git a/docs/accounting/Organisations.md b/docs/accounting/Organisations.md new file mode 100644 index 00000000..8e83e8f8 --- /dev/null +++ b/docs/accounting/Organisations.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Organisations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**organisations** | [**Array<Organisation>**](Organisation.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Organisations.new(organisations: null) +``` + + diff --git a/docs/accounting/Overpayment.md b/docs/accounting/Overpayment.md new file mode 100644 index 00000000..94c4b024 --- /dev/null +++ b/docs/accounting/Overpayment.md @@ -0,0 +1,53 @@ +# XeroRuby::Accounting::Overpayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | See Overpayment Types | [optional] +**contact** | [**Contact**](Contact.md) | | [optional] +**date** | **Date** | The date the overpayment is created YYYY-MM-DD | [optional] +**status** | **String** | See Overpayment Status Codes | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | See Overpayment Line Items | [optional] +**sub_total** | **Float** | The subtotal of the overpayment excluding taxes | [optional] +**total_tax** | **Float** | The total tax on the overpayment | [optional] +**total** | **Float** | The total of the overpayment (subtotal + total tax) | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the overpayment | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**overpayment_id** | **String** | Xero generated unique identifier | [optional] +**currency_rate** | **Float** | The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used | [optional] +**remaining_credit** | **Float** | The remaining credit balance on the overpayment | [optional] +**allocations** | [**Array<Allocation>**](Allocation.md) | See Allocations | [optional] +**applied_amount** | **Float** | The amount of applied to an invoice | [optional] +**payments** | [**Array<Payment>**](Payment.md) | See Payments | [optional] +**has_attachments** | **Boolean** | boolean to indicate if a overpayment has an attachment | [optional] [default to false] +**attachments** | [**Array<Attachment>**](Attachment.md) | See Attachments | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Overpayment.new(type: null, + contact: null, + date: null, + status: null, + line_amount_types: null, + line_items: null, + sub_total: null, + total_tax: null, + total: null, + updated_date_utc: null, + currency_code: null, + overpayment_id: null, + currency_rate: null, + remaining_credit: null, + allocations: null, + applied_amount: 2.0, + payments: null, + has_attachments: false, + attachments: null) +``` + + diff --git a/docs/accounting/Overpayments.md b/docs/accounting/Overpayments.md new file mode 100644 index 00000000..899adeb5 --- /dev/null +++ b/docs/accounting/Overpayments.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Overpayments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**overpayments** | [**Array<Overpayment>**](Overpayment.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Overpayments.new(overpayments: null) +``` + + diff --git a/docs/accounting/Payment.md b/docs/accounting/Payment.md new file mode 100644 index 00000000..c1c29b6b --- /dev/null +++ b/docs/accounting/Payment.md @@ -0,0 +1,63 @@ +# XeroRuby::Accounting::Payment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**invoice** | [**Invoice**](Invoice.md) | | [optional] +**credit_note** | [**CreditNote**](CreditNote.md) | | [optional] +**prepayment** | [**Prepayment**](Prepayment.md) | | [optional] +**overpayment** | [**Overpayment**](Overpayment.md) | | [optional] +**invoice_number** | **String** | Number of invoice or credit note you are applying payment to e.g.INV-4003 | [optional] +**credit_note_number** | **String** | Number of invoice or credit note you are applying payment to e.g. INV-4003 | [optional] +**account** | [**Account**](Account.md) | | [optional] +**code** | **String** | Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) | [optional] +**date** | **Date** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] +**currency_rate** | **Float** | Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 | [optional] +**amount** | **Float** | The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 | [optional] +**reference** | **String** | An optional description for the payment e.g. Direct Debit | [optional] +**is_reconciled** | **Boolean** | An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET | [optional] +**status** | **String** | The status of the payment. | [optional] +**payment_type** | **String** | See Payment Types. | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the payment | [optional] +**payment_id** | **String** | The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] +**bank_account_number** | **String** | The suppliers bank account number the payment is being made to | [optional] +**particulars** | **String** | The suppliers bank account number the payment is being made to | [optional] +**details** | **String** | The information to appear on the supplier's bank account | [optional] +**has_account** | **Boolean** | A boolean to indicate if a contact has an validation errors | [optional] [default to false] +**has_validation_errors** | **Boolean** | A boolean to indicate if a contact has an validation errors | [optional] [default to false] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Payment.new(invoice: null, + credit_note: null, + prepayment: null, + overpayment: null, + invoice_number: null, + credit_note_number: null, + account: null, + code: null, + date: null, + currency_rate: null, + amount: null, + reference: null, + is_reconciled: null, + status: null, + payment_type: null, + updated_date_utc: null, + payment_id: null, + bank_account_number: null, + particulars: null, + details: null, + has_account: false, + has_validation_errors: false, + status_attribute_string: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/PaymentDelete.md b/docs/accounting/PaymentDelete.md new file mode 100644 index 00000000..12ac9164 --- /dev/null +++ b/docs/accounting/PaymentDelete.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::PaymentDelete + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | The status of the payment. | [default to 'DELETED'] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::PaymentDelete.new(status: null) +``` + + diff --git a/docs/accounting/PaymentService.md b/docs/accounting/PaymentService.md new file mode 100644 index 00000000..0b0d77d8 --- /dev/null +++ b/docs/accounting/PaymentService.md @@ -0,0 +1,27 @@ +# XeroRuby::Accounting::PaymentService + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_service_id** | **String** | Xero identifier | [optional] +**payment_service_name** | **String** | Name of payment service | [optional] +**payment_service_url** | **String** | The custom payment URL | [optional] +**pay_now_text** | **String** | The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card | [optional] +**payment_service_type** | **String** | This will always be CUSTOM for payment services created via the API. | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::PaymentService.new(payment_service_id: null, + payment_service_name: null, + payment_service_url: null, + pay_now_text: null, + payment_service_type: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/PaymentServices.md b/docs/accounting/PaymentServices.md new file mode 100644 index 00000000..b93fa57b --- /dev/null +++ b/docs/accounting/PaymentServices.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::PaymentServices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payment_services** | [**Array<PaymentService>**](PaymentService.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::PaymentServices.new(payment_services: null) +``` + + diff --git a/docs/accounting/PaymentTerm.md b/docs/accounting/PaymentTerm.md new file mode 100644 index 00000000..037bd9ed --- /dev/null +++ b/docs/accounting/PaymentTerm.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::PaymentTerm + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bills** | [**Bill**](Bill.md) | | [optional] +**sales** | [**Bill**](Bill.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::PaymentTerm.new(bills: null, + sales: null) +``` + + diff --git a/docs/accounting/PaymentTermType.md b/docs/accounting/PaymentTermType.md new file mode 100644 index 00000000..52219b37 --- /dev/null +++ b/docs/accounting/PaymentTermType.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::PaymentTermType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::PaymentTermType.new() +``` + + diff --git a/docs/accounting/Payments.md b/docs/accounting/Payments.md new file mode 100644 index 00000000..9506b5d8 --- /dev/null +++ b/docs/accounting/Payments.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Payments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**payments** | [**Array<Payment>**](Payment.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Payments.new(payments: null) +``` + + diff --git a/docs/accounting/Phone.md b/docs/accounting/Phone.md new file mode 100644 index 00000000..5477c5f6 --- /dev/null +++ b/docs/accounting/Phone.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::Phone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**phone_type** | **String** | | [optional] +**phone_number** | **String** | max length = 50 | [optional] +**phone_area_code** | **String** | max length = 10 | [optional] +**phone_country_code** | **String** | max length = 20 | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Phone.new(phone_type: null, + phone_number: null, + phone_area_code: null, + phone_country_code: null) +``` + + diff --git a/docs/accounting/Prepayment.md b/docs/accounting/Prepayment.md new file mode 100644 index 00000000..8fdfc6fd --- /dev/null +++ b/docs/accounting/Prepayment.md @@ -0,0 +1,53 @@ +# XeroRuby::Accounting::Prepayment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | See Prepayment Types | [optional] +**contact** | [**Contact**](Contact.md) | | [optional] +**date** | **Date** | The date the prepayment is created YYYY-MM-DD | [optional] +**status** | **String** | See Prepayment Status Codes | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | See Prepayment Line Items | [optional] +**sub_total** | **Float** | The subtotal of the prepayment excluding taxes | [optional] +**total_tax** | **Float** | The total tax on the prepayment | [optional] +**total** | **Float** | The total of the prepayment(subtotal + total tax) | [optional] +**reference** | **String** | Returns Invoice number field. Reference field isn't available. | [optional] +**updated_date_utc** | **DateTime** | UTC timestamp of last update to the prepayment | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**prepayment_id** | **String** | Xero generated unique identifier | [optional] +**currency_rate** | **Float** | The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used | [optional] +**remaining_credit** | **Float** | The remaining credit balance on the prepayment | [optional] +**allocations** | [**Array<Allocation>**](Allocation.md) | See Allocations | [optional] +**applied_amount** | **Float** | The amount of applied to an invoice | [optional] +**has_attachments** | **Boolean** | boolean to indicate if a prepayment has an attachment | [optional] [default to false] +**attachments** | [**Array<Attachment>**](Attachment.md) | See Attachments | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Prepayment.new(type: null, + contact: null, + date: null, + status: null, + line_amount_types: null, + line_items: null, + sub_total: null, + total_tax: null, + total: null, + reference: null, + updated_date_utc: null, + currency_code: null, + prepayment_id: null, + currency_rate: null, + remaining_credit: null, + allocations: null, + applied_amount: 2.0, + has_attachments: false, + attachments: null) +``` + + diff --git a/docs/accounting/Prepayments.md b/docs/accounting/Prepayments.md new file mode 100644 index 00000000..eb097e83 --- /dev/null +++ b/docs/accounting/Prepayments.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Prepayments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prepayments** | [**Array<Prepayment>**](Prepayment.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Prepayments.new(prepayments: null) +``` + + diff --git a/docs/accounting/Purchase.md b/docs/accounting/Purchase.md new file mode 100644 index 00000000..c5fdecb4 --- /dev/null +++ b/docs/accounting/Purchase.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::Purchase + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**unit_price** | **Float** | Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. | [optional] +**account_code** | **String** | Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items | [optional] +**cogs_account_code** | **String** | Cost of goods sold account. Only applicable to the purchase details of tracked items. | [optional] +**tax_type** | **String** | The tax type from TaxRates | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Purchase.new(unit_price: null, + account_code: null, + cogs_account_code: null, + tax_type: null) +``` + + diff --git a/docs/accounting/PurchaseOrder.md b/docs/accounting/PurchaseOrder.md new file mode 100644 index 00000000..262f2316 --- /dev/null +++ b/docs/accounting/PurchaseOrder.md @@ -0,0 +1,71 @@ +# XeroRuby::Accounting::PurchaseOrder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact** | [**Contact**](Contact.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] +**date** | **Date** | Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation | [optional] +**delivery_date** | **Date** | Date the goods are to be delivered – YYYY-MM-DD | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**purchase_order_number** | **String** | Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) | [optional] +**reference** | **String** | Additional reference number | [optional] +**branding_theme_id** | **String** | See BrandingThemes | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**status** | **String** | See Purchase Order Status Codes | [optional] +**sent_to_contact** | **Boolean** | Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed | [optional] +**delivery_address** | **String** | The address the goods are to be delivered to | [optional] +**attention_to** | **String** | The person that the delivery is going to | [optional] +**telephone** | **String** | The phone number for the person accepting the delivery | [optional] +**delivery_instructions** | **String** | A free text feild for instructions (500 characters max) | [optional] +**expected_arrival_date** | **Date** | The date the goods are expected to arrive. | [optional] +**purchase_order_id** | **String** | Xero generated unique identifier for purchase order | [optional] +**currency_rate** | **Float** | The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. | [optional] +**sub_total** | **Float** | Total of purchase order excluding taxes | [optional] +**total_tax** | **Float** | Total tax on purchase order | [optional] +**total** | **Float** | Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) | [optional] +**total_discount** | **Float** | Total of discounts applied on the purchase order line items | [optional] +**has_attachments** | **Boolean** | boolean to indicate if a purchase order has an attachment | [optional] [default to false] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] +**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::PurchaseOrder.new(contact: null, + line_items: null, + date: null, + delivery_date: null, + line_amount_types: null, + purchase_order_number: null, + reference: null, + branding_theme_id: null, + currency_code: null, + status: null, + sent_to_contact: null, + delivery_address: null, + attention_to: null, + telephone: null, + delivery_instructions: null, + expected_arrival_date: null, + purchase_order_id: null, + currency_rate: null, + sub_total: null, + total_tax: null, + total: null, + total_discount: null, + has_attachments: false, + updated_date_utc: null, + status_attribute_string: null, + validation_errors: null, + warnings: null, + attachments: null) +``` + + diff --git a/docs/accounting/PurchaseOrders.md b/docs/accounting/PurchaseOrders.md new file mode 100644 index 00000000..12b2826b --- /dev/null +++ b/docs/accounting/PurchaseOrders.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::PurchaseOrders + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**purchase_orders** | [**Array<PurchaseOrder>**](PurchaseOrder.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::PurchaseOrders.new(purchase_orders: null) +``` + + diff --git a/docs/accounting/Quote.md b/docs/accounting/Quote.md new file mode 100644 index 00000000..229c901e --- /dev/null +++ b/docs/accounting/Quote.md @@ -0,0 +1,63 @@ +# XeroRuby::Accounting::Quote + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quote_id** | **String** | QuoteID GUID is automatically generated and is returned after create or GET. | [optional] +**quote_number** | **String** | Unique alpha numeric code identifying a quote (Max Length = 255) | [optional] +**reference** | **String** | Additional reference number | [optional] +**terms** | **String** | Terms of the quote | [optional] +**contact** | [**Contact**](Contact.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] +**date** | **Date** | Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation | [optional] +**date_string** | **String** | Date the quote was issued (YYYY-MM-DD) | [optional] +**expiry_date** | **Date** | Date the quote expires – YYYY-MM-DD. | [optional] +**expiry_date_string** | **String** | Date the quote expires – YYYY-MM-DD. | [optional] +**status** | [**QuoteStatusCodes**](QuoteStatusCodes.md) | | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**currency_rate** | **Float** | The currency rate for a multicurrency quote | [optional] +**sub_total** | **Float** | Total of quote excluding taxes. | [optional] +**total_tax** | **Float** | Total tax on quote | [optional] +**total** | **Float** | Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts | [optional] +**total_discount** | **Float** | Total of discounts applied on the quote line items | [optional] +**title** | **String** | Title text for the quote | [optional] +**summary** | **String** | Summary text for the quote | [optional] +**branding_theme_id** | **String** | See BrandingThemes | [optional] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**line_amount_types** | [**QuoteLineAmountTypes**](QuoteLineAmountTypes.md) | | [optional] +**status_attribute_string** | **String** | A string to indicate if a invoice status | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Quote.new(quote_id: null, + quote_number: null, + reference: null, + terms: null, + contact: null, + line_items: null, + date: null, + date_string: null, + expiry_date: null, + expiry_date_string: null, + status: null, + currency_code: null, + currency_rate: null, + sub_total: null, + total_tax: null, + total: null, + total_discount: null, + title: null, + summary: null, + branding_theme_id: null, + updated_date_utc: null, + line_amount_types: null, + status_attribute_string: null, + validation_errors: null) +``` + + diff --git a/docs/accounting/QuoteLineAmountTypes.md b/docs/accounting/QuoteLineAmountTypes.md new file mode 100644 index 00000000..b2140631 --- /dev/null +++ b/docs/accounting/QuoteLineAmountTypes.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::QuoteLineAmountTypes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::QuoteLineAmountTypes.new() +``` + + diff --git a/docs/accounting/QuoteStatusCodes.md b/docs/accounting/QuoteStatusCodes.md new file mode 100644 index 00000000..443ff002 --- /dev/null +++ b/docs/accounting/QuoteStatusCodes.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::QuoteStatusCodes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::QuoteStatusCodes.new() +``` + + diff --git a/docs/accounting/Quotes.md b/docs/accounting/Quotes.md new file mode 100644 index 00000000..28ca980d --- /dev/null +++ b/docs/accounting/Quotes.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Quotes + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**quotes** | [**Array<Quote>**](Quote.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Quotes.new(quotes: null) +``` + + diff --git a/docs/accounting/Receipt.md b/docs/accounting/Receipt.md new file mode 100644 index 00000000..5f44e6df --- /dev/null +++ b/docs/accounting/Receipt.md @@ -0,0 +1,51 @@ +# XeroRuby::Accounting::Receipt + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**date** | **Date** | Date of receipt – YYYY-MM-DD | [optional] +**contact** | [**Contact**](Contact.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | | [optional] +**user** | [**User**](User.md) | | [optional] +**reference** | **String** | Additional reference number | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**sub_total** | **Float** | Total of receipt excluding taxes | [optional] +**total_tax** | **Float** | Total tax on receipt | [optional] +**total** | **Float** | Total of receipt tax inclusive (i.e. SubTotal + TotalTax) | [optional] +**receipt_id** | **String** | Xero generated unique identifier for receipt | [optional] +**status** | **String** | Current status of receipt – see status types | [optional] +**receipt_number** | **String** | Xero generated sequence number for receipt in current claim for a given user | [optional] +**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional] +**has_attachments** | **Boolean** | boolean to indicate if a receipt has an attachment | [optional] [default to false] +**url** | **String** | URL link to a source document – shown as “Go to [appName]” in the Xero app | [optional] +**validation_errors** | [**Array<ValidationError>**](ValidationError.md) | Displays array of validation error messages from the API | [optional] +**warnings** | [**Array<ValidationError>**](ValidationError.md) | Displays array of warning messages from the API | [optional] +**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Receipt.new(date: null, + contact: null, + line_items: null, + user: null, + reference: null, + line_amount_types: null, + sub_total: null, + total_tax: null, + total: null, + receipt_id: null, + status: null, + receipt_number: null, + updated_date_utc: null, + has_attachments: false, + url: null, + validation_errors: null, + warnings: null, + attachments: null) +``` + + diff --git a/docs/accounting/Receipts.md b/docs/accounting/Receipts.md new file mode 100644 index 00000000..3327dc32 --- /dev/null +++ b/docs/accounting/Receipts.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Receipts + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**receipts** | [**Array<Receipt>**](Receipt.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Receipts.new(receipts: null) +``` + + diff --git a/docs/accounting/RepeatingInvoice.md b/docs/accounting/RepeatingInvoice.md new file mode 100644 index 00000000..16acd6e2 --- /dev/null +++ b/docs/accounting/RepeatingInvoice.md @@ -0,0 +1,47 @@ +# XeroRuby::Accounting::RepeatingInvoice + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **String** | See Invoice Types | [optional] +**contact** | [**Contact**](Contact.md) | | [optional] +**schedule** | [**Schedule**](Schedule.md) | | [optional] +**line_items** | [**Array<LineItem>**](LineItem.md) | See LineItems | [optional] +**line_amount_types** | [**LineAmountTypes**](LineAmountTypes.md) | | [optional] +**reference** | **String** | ACCREC only – additional reference number | [optional] +**branding_theme_id** | **String** | See BrandingThemes | [optional] +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**status** | **String** | One of the following - DRAFT or AUTHORISED – See Invoice Status Codes | [optional] +**sub_total** | **Float** | Total of invoice excluding taxes | [optional] +**total_tax** | **Float** | Total tax on invoice | [optional] +**total** | **Float** | Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) | [optional] +**repeating_invoice_id** | **String** | Xero generated unique identifier for repeating invoice template | [optional] +**id** | **String** | Xero generated unique identifier for repeating invoice template | [optional] +**has_attachments** | **Boolean** | boolean to indicate if an invoice has an attachment | [optional] [default to false] +**attachments** | [**Array<Attachment>**](Attachment.md) | Displays array of attachments from the API | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::RepeatingInvoice.new(type: null, + contact: null, + schedule: null, + line_items: null, + line_amount_types: null, + reference: null, + branding_theme_id: null, + currency_code: null, + status: null, + sub_total: null, + total_tax: null, + total: null, + repeating_invoice_id: null, + id: null, + has_attachments: false, + attachments: null) +``` + + diff --git a/docs/accounting/RepeatingInvoices.md b/docs/accounting/RepeatingInvoices.md new file mode 100644 index 00000000..3a80aaea --- /dev/null +++ b/docs/accounting/RepeatingInvoices.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::RepeatingInvoices + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**repeating_invoices** | [**Array<RepeatingInvoice>**](RepeatingInvoice.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::RepeatingInvoices.new(repeating_invoices: null) +``` + + diff --git a/docs/accounting/Report.md b/docs/accounting/Report.md new file mode 100644 index 00000000..dcb380a3 --- /dev/null +++ b/docs/accounting/Report.md @@ -0,0 +1,29 @@ +# XeroRuby::Accounting::Report + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report_id** | **String** | See Prepayment Types | [optional] +**report_name** | **String** | See Prepayment Types | [optional] +**report_type** | **String** | See Prepayment Types | [optional] +**report_title** | **String** | See Prepayment Types | [optional] +**report_date** | **String** | Date of report | [optional] +**updated_date_utc** | **DateTime** | Updated Date | [optional] +**contacts** | [**Array<TenNinteyNineContact>**](TenNinteyNineContact.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Report.new(report_id: null, + report_name: null, + report_type: null, + report_title: null, + report_date: null, + updated_date_utc: null, + contacts: null) +``` + + diff --git a/docs/accounting/ReportAttribute.md b/docs/accounting/ReportAttribute.md new file mode 100644 index 00000000..cf98388f --- /dev/null +++ b/docs/accounting/ReportAttribute.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::ReportAttribute + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | | [optional] +**value** | **String** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ReportAttribute.new(id: null, + value: null) +``` + + diff --git a/docs/accounting/ReportCell.md b/docs/accounting/ReportCell.md new file mode 100644 index 00000000..b87b96a7 --- /dev/null +++ b/docs/accounting/ReportCell.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::ReportCell + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **String** | | [optional] +**attributes** | [**Array<ReportAttribute>**](ReportAttribute.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ReportCell.new(value: null, + attributes: null) +``` + + diff --git a/docs/accounting/ReportFields.md b/docs/accounting/ReportFields.md new file mode 100644 index 00000000..8e505ae8 --- /dev/null +++ b/docs/accounting/ReportFields.md @@ -0,0 +1,21 @@ +# XeroRuby::Accounting::ReportFields + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_id** | **String** | | [optional] +**description** | **String** | | [optional] +**value** | **String** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ReportFields.new(field_id: null, + description: null, + value: null) +``` + + diff --git a/docs/accounting/ReportRow.md b/docs/accounting/ReportRow.md new file mode 100644 index 00000000..16c6388a --- /dev/null +++ b/docs/accounting/ReportRow.md @@ -0,0 +1,21 @@ +# XeroRuby::Accounting::ReportRow + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**row_type** | [**RowType**](RowType.md) | | [optional] +**title** | **String** | | [optional] +**cells** | [**Array<ReportCell>**](ReportCell.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ReportRow.new(row_type: null, + title: null, + cells: null) +``` + + diff --git a/docs/accounting/ReportRows.md b/docs/accounting/ReportRows.md new file mode 100644 index 00000000..ac43b80d --- /dev/null +++ b/docs/accounting/ReportRows.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::ReportRows + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**row_type** | [**RowType**](RowType.md) | | [optional] +**title** | **String** | | [optional] +**cells** | [**Array<ReportCell>**](ReportCell.md) | | [optional] +**rows** | [**Array<ReportRow>**](ReportRow.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ReportRows.new(row_type: null, + title: null, + cells: null, + rows: null) +``` + + diff --git a/docs/accounting/ReportWithRow.md b/docs/accounting/ReportWithRow.md new file mode 100644 index 00000000..8b5f671f --- /dev/null +++ b/docs/accounting/ReportWithRow.md @@ -0,0 +1,33 @@ +# XeroRuby::Accounting::ReportWithRow + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**report_id** | **String** | Report id | [optional] +**report_name** | **String** | Name of the report | [optional] +**report_title** | **String** | Title of the report | [optional] +**report_type** | **String** | The type of report (BalanceSheet,ProfitLoss, etc) | [optional] +**report_titles** | **Array<String>** | Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) | [optional] +**report_date** | **String** | Date of report | [optional] +**rows** | [**Array<ReportRows>**](ReportRows.md) | | [optional] +**updated_date_utc** | **DateTime** | Updated Date | [optional] +**fields** | [**Array<ReportFields>**](ReportFields.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ReportWithRow.new(report_id: null, + report_name: null, + report_title: null, + report_type: null, + report_titles: null, + report_date: null, + rows: null, + updated_date_utc: null, + fields: null) +``` + + diff --git a/docs/accounting/ReportWithRows.md b/docs/accounting/ReportWithRows.md new file mode 100644 index 00000000..a949b8a3 --- /dev/null +++ b/docs/accounting/ReportWithRows.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::ReportWithRows + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reports** | [**Array<ReportWithRow>**](ReportWithRow.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ReportWithRows.new(reports: null) +``` + + diff --git a/docs/accounting/Reports.md b/docs/accounting/Reports.md new file mode 100644 index 00000000..1556e082 --- /dev/null +++ b/docs/accounting/Reports.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Reports + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reports** | [**Array<Report>**](Report.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Reports.new(reports: null) +``` + + diff --git a/docs/accounting/RequestEmpty.md b/docs/accounting/RequestEmpty.md new file mode 100644 index 00000000..6e1a8775 --- /dev/null +++ b/docs/accounting/RequestEmpty.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::RequestEmpty + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | Need at least one field to create an empty JSON payload | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::RequestEmpty.new(status: null) +``` + + diff --git a/docs/accounting/RowType.md b/docs/accounting/RowType.md new file mode 100644 index 00000000..a83a9c18 --- /dev/null +++ b/docs/accounting/RowType.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::RowType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::RowType.new() +``` + + diff --git a/docs/accounting/SalesTrackingCategory.md b/docs/accounting/SalesTrackingCategory.md new file mode 100644 index 00000000..dfe75953 --- /dev/null +++ b/docs/accounting/SalesTrackingCategory.md @@ -0,0 +1,19 @@ +# XeroRuby::Accounting::SalesTrackingCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_category_name** | **String** | The default sales tracking category name for contacts | [optional] +**tracking_option_name** | **String** | The default purchase tracking category name for contacts | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::SalesTrackingCategory.new(tracking_category_name: null, + tracking_option_name: null) +``` + + diff --git a/docs/accounting/Schedule.md b/docs/accounting/Schedule.md new file mode 100644 index 00000000..acb68f36 --- /dev/null +++ b/docs/accounting/Schedule.md @@ -0,0 +1,29 @@ +# XeroRuby::Accounting::Schedule + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**period** | **Integer** | Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) | [optional] +**unit** | **String** | One of the following - WEEKLY or MONTHLY | [optional] +**due_date** | **Integer** | Integer used with due date type e.g 20 (of following month), 31 (of current month) | [optional] +**due_date_type** | **String** | the payment terms | [optional] +**start_date** | **Date** | Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) | [optional] +**next_scheduled_date** | **Date** | The calendar date of the next invoice in the schedule to be generated | [optional] +**end_date** | **Date** | Invoice end date – only returned if the template has an end date set | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Schedule.new(period: null, + unit: null, + due_date: null, + due_date_type: null, + start_date: null, + next_scheduled_date: null, + end_date: null) +``` + + diff --git a/docs/accounting/TaxComponent.md b/docs/accounting/TaxComponent.md new file mode 100644 index 00000000..73d61537 --- /dev/null +++ b/docs/accounting/TaxComponent.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::TaxComponent + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of Tax Component | [optional] +**rate** | **Float** | Tax Rate (up to 4dp) | [optional] +**is_compound** | **Boolean** | Boolean to describe if Tax rate is compounded. | [optional] +**is_non_recoverable** | **Boolean** | Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TaxComponent.new(name: null, + rate: null, + is_compound: null, + is_non_recoverable: null) +``` + + diff --git a/docs/accounting/TaxRate.md b/docs/accounting/TaxRate.md new file mode 100644 index 00000000..045d24cc --- /dev/null +++ b/docs/accounting/TaxRate.md @@ -0,0 +1,39 @@ +# XeroRuby::Accounting::TaxRate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of tax rate | [optional] +**tax_type** | **String** | The tax type | [optional] +**tax_components** | [**Array<TaxComponent>**](TaxComponent.md) | See TaxComponents | [optional] +**status** | **String** | See Status Codes | [optional] +**report_tax_type** | **String** | See ReportTaxTypes | [optional] +**can_apply_to_assets** | **Boolean** | Boolean to describe if tax rate can be used for asset accounts i.e. true,false | [optional] +**can_apply_to_equity** | **Boolean** | Boolean to describe if tax rate can be used for equity accounts i.e true,false | [optional] +**can_apply_to_expenses** | **Boolean** | Boolean to describe if tax rate can be used for expense accounts i.e. true,false | [optional] +**can_apply_to_liabilities** | **Boolean** | Boolean to describe if tax rate can be used for liability accounts i.e. true,false | [optional] +**can_apply_to_revenue** | **Boolean** | Boolean to describe if tax rate can be used for revenue accounts i.e. true,false | [optional] +**display_tax_rate** | **Float** | Tax Rate (decimal to 4dp) e.g 12.5000 | [optional] +**effective_rate** | **Float** | Effective Tax Rate (decimal to 4dp) e.g 12.5000 | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TaxRate.new(name: null, + tax_type: null, + tax_components: null, + status: null, + report_tax_type: null, + can_apply_to_assets: null, + can_apply_to_equity: null, + can_apply_to_expenses: null, + can_apply_to_liabilities: null, + can_apply_to_revenue: null, + display_tax_rate: null, + effective_rate: null) +``` + + diff --git a/docs/accounting/TaxRates.md b/docs/accounting/TaxRates.md new file mode 100644 index 00000000..864490fd --- /dev/null +++ b/docs/accounting/TaxRates.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::TaxRates + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tax_rates** | [**Array<TaxRate>**](TaxRate.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TaxRates.new(tax_rates: null) +``` + + diff --git a/docs/accounting/TaxType.md b/docs/accounting/TaxType.md new file mode 100644 index 00000000..3ea46a8c --- /dev/null +++ b/docs/accounting/TaxType.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::TaxType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TaxType.new() +``` + + diff --git a/docs/accounting/TenNinteyNineContact.md b/docs/accounting/TenNinteyNineContact.md new file mode 100644 index 00000000..abe0b22a --- /dev/null +++ b/docs/accounting/TenNinteyNineContact.md @@ -0,0 +1,59 @@ +# XeroRuby::Accounting::TenNinteyNineContact + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**box1** | **Float** | Box 1 on 1099 Form | [optional] +**box2** | **Float** | Box 2 on 1099 Form | [optional] +**box3** | **Float** | Box 3 on 1099 Form | [optional] +**box4** | **Float** | Box 4 on 1099 Form | [optional] +**box5** | **Float** | Box 5 on 1099 Form | [optional] +**box6** | **Float** | Box 6 on 1099 Form | [optional] +**box7** | **Float** | Box 7 on 1099 Form | [optional] +**box8** | **Float** | Box 8 on 1099 Form | [optional] +**box9** | **Float** | Box 9 on 1099 Form | [optional] +**box10** | **Float** | Box 10 on 1099 Form | [optional] +**box11** | **Float** | Box 11 on 1099 Form | [optional] +**box13** | **Float** | Box 13 on 1099 Form | [optional] +**box14** | **Float** | Box 14 on 1099 Form | [optional] +**name** | **String** | Contact name on 1099 Form | [optional] +**federal_tax_id_type** | **String** | Contact Fed Tax ID type | [optional] +**city** | **String** | Contact city on 1099 Form | [optional] +**zip** | **String** | Contact zip on 1099 Form | [optional] +**state** | **String** | Contact State on 1099 Form | [optional] +**email** | **String** | Contact email on 1099 Form | [optional] +**street_address** | **String** | Contact address on 1099 Form | [optional] +**tax_id** | **String** | Contact tax id on 1099 Form | [optional] +**contact_id** | **String** | Contact contact id | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TenNinteyNineContact.new(box1: null, + box2: null, + box3: null, + box4: null, + box5: null, + box6: null, + box7: null, + box8: null, + box9: null, + box10: null, + box11: null, + box13: null, + box14: null, + name: null, + federal_tax_id_type: null, + city: null, + zip: null, + state: null, + email: null, + street_address: null, + tax_id: null, + contact_id: null) +``` + + diff --git a/docs/accounting/TimeZone.md b/docs/accounting/TimeZone.md new file mode 100644 index 00000000..722f6b8a --- /dev/null +++ b/docs/accounting/TimeZone.md @@ -0,0 +1,16 @@ +# XeroRuby::Accounting::TimeZone + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TimeZone.new() +``` + + diff --git a/docs/accounting/TrackingCategories.md b/docs/accounting/TrackingCategories.md new file mode 100644 index 00000000..226b2578 --- /dev/null +++ b/docs/accounting/TrackingCategories.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::TrackingCategories + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_categories** | [**Array<TrackingCategory>**](TrackingCategory.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TrackingCategories.new(tracking_categories: null) +``` + + diff --git a/docs/accounting/TrackingCategory.md b/docs/accounting/TrackingCategory.md new file mode 100644 index 00000000..76017a01 --- /dev/null +++ b/docs/accounting/TrackingCategory.md @@ -0,0 +1,27 @@ +# XeroRuby::Accounting::TrackingCategory + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_category_id** | **String** | The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] +**tracking_option_id** | **String** | The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f | [optional] +**name** | **String** | The name of the tracking category e.g. Department, Region (max length = 100) | [optional] +**option** | **String** | The option name of the tracking option e.g. East, West (max length = 100) | [optional] +**status** | **String** | The status of a tracking category | [optional] +**options** | [**Array<TrackingOption>**](TrackingOption.md) | See Tracking Options | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TrackingCategory.new(tracking_category_id: null, + tracking_option_id: null, + name: null, + option: null, + status: null, + options: null) +``` + + diff --git a/docs/accounting/TrackingOption.md b/docs/accounting/TrackingOption.md new file mode 100644 index 00000000..dc18756c --- /dev/null +++ b/docs/accounting/TrackingOption.md @@ -0,0 +1,23 @@ +# XeroRuby::Accounting::TrackingOption + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**tracking_option_id** | **String** | The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a | [optional] +**name** | **String** | The name of the tracking option e.g. Marketing, East (max length = 50) | [optional] +**status** | **String** | The status of a tracking option | [optional] +**tracking_category_id** | **String** | Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TrackingOption.new(tracking_option_id: null, + name: null, + status: null, + tracking_category_id: null) +``` + + diff --git a/docs/accounting/TrackingOptions.md b/docs/accounting/TrackingOptions.md new file mode 100644 index 00000000..ed2937f9 --- /dev/null +++ b/docs/accounting/TrackingOptions.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::TrackingOptions + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**options** | [**Array<TrackingOption>**](TrackingOption.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::TrackingOptions.new(options: null) +``` + + diff --git a/docs/accounting/User.md b/docs/accounting/User.md new file mode 100644 index 00000000..0c6095a9 --- /dev/null +++ b/docs/accounting/User.md @@ -0,0 +1,29 @@ +# XeroRuby::Accounting::User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **String** | Xero identifier | [optional] +**email_address** | **String** | Email address of user | [optional] +**first_name** | **String** | First name of user | [optional] +**last_name** | **String** | Last name of user | [optional] +**updated_date_utc** | **DateTime** | Timestamp of last change to user | [optional] +**is_subscriber** | **Boolean** | Boolean to indicate if user is the subscriber | [optional] +**organisation_role** | **String** | User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::User.new(user_id: null, + email_address: null, + first_name: null, + last_name: null, + updated_date_utc: null, + is_subscriber: null, + organisation_role: null) +``` + + diff --git a/docs/accounting/Users.md b/docs/accounting/Users.md new file mode 100644 index 00000000..dbb042f4 --- /dev/null +++ b/docs/accounting/Users.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::Users + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**users** | [**Array<User>**](User.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::Users.new(users: null) +``` + + diff --git a/docs/accounting/ValidationError.md b/docs/accounting/ValidationError.md new file mode 100644 index 00000000..db936d5b --- /dev/null +++ b/docs/accounting/ValidationError.md @@ -0,0 +1,17 @@ +# XeroRuby::Accounting::ValidationError + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | Validation error message | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Accounting' + +instance = XeroRuby::Accounting::ValidationError.new(message: null) +``` + + diff --git a/docs/assets/Asset.md b/docs/assets/Asset.md new file mode 100644 index 00000000..76f1a8a8 --- /dev/null +++ b/docs/assets/Asset.md @@ -0,0 +1,45 @@ +# XeroRuby::Assets::Asset + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset_id** | **String** | The Xero-generated Id for the asset | [optional] +**asset_name** | **String** | The name of the asset | +**asset_type_id** | **String** | The Xero-generated Id for the asset type | [optional] +**asset_number** | **String** | Must be unique. | [optional] +**purchase_date** | **Date** | The date the asset was purchased YYYY-MM-DD | [optional] +**purchase_price** | **Float** | The purchase price of the asset | [optional] +**disposal_price** | **Float** | The price the asset was disposed at | [optional] +**asset_status** | [**AssetStatus**](AssetStatus.md) | | [optional] +**warranty_expiry_date** | **String** | The date the asset’s warranty expires (if needed) YYYY-MM-DD | [optional] +**serial_number** | **String** | The asset's serial number | [optional] +**book_depreciation_setting** | [**BookDepreciationSetting**](BookDepreciationSetting.md) | | [optional] +**book_depreciation_detail** | [**BookDepreciationDetail**](BookDepreciationDetail.md) | | [optional] +**can_rollback** | **Boolean** | Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. | [optional] +**accounting_book_value** | **Float** | The accounting value of the asset | [optional] +**is_delete_enabled_for_date** | **Boolean** | Boolean to indicate whether delete is enabled | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::Asset.new(asset_id: 3b5b3a38-5649-495f-87a1-14a4e5918634, + asset_name: Awesome Truck 3, + asset_type_id: 3b5b3a38-5649-495f-87a1-14a4e5918634, + asset_number: FA-0013, + purchase_date: null, + purchase_price: 1000.0000, + disposal_price: 1.0000, + asset_status: null, + warranty_expiry_date: ca4c6b39-4f4f-43e8-98da-5e1f350a6694, + serial_number: ca4c6b39-4f4f-43e8-98da-5e1f350a6694, + book_depreciation_setting: null, + book_depreciation_detail: null, + can_rollback: true, + accounting_book_value: 0, + is_delete_enabled_for_date: true) +``` + + diff --git a/docs/assets/AssetApi.md b/docs/assets/AssetApi.md new file mode 100644 index 00000000..a8a9f721 --- /dev/null +++ b/docs/assets/AssetApi.md @@ -0,0 +1,414 @@ +# XeroRuby::Assets::AssetApi + +All URIs are relative to *https://api.xero.com/assets.xro/1.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_asset**](AssetApi.md#create_asset) | **POST** /Assets | adds a fixed asset +[**create_asset_type**](AssetApi.md#create_asset_type) | **POST** /AssetTypes | adds a fixed asset type +[**get_asset_by_id**](AssetApi.md#get_asset_by_id) | **GET** /Assets/{id} | retrieves fixed asset by id +[**get_asset_settings**](AssetApi.md#get_asset_settings) | **GET** /Settings | searches fixed asset settings +[**get_asset_types**](AssetApi.md#get_asset_types) | **GET** /AssetTypes | searches fixed asset types +[**get_assets**](AssetApi.md#get_assets) | **GET** /Assets | searches fixed asset + + + +## create_asset + +> Asset create_asset(xero_tenant_id, asset) + +adds a fixed asset + +Adds an asset to the system + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +asset = { "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01", "purchasePrice":100.0, "disposalPrice":23.23, "assetStatus":"Draft", "bookDepreciationSetting":{ "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.5, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "currentCapitalGain":5.32, "currentGainLoss":3.88, "depreciationStartDate":"2020-01-02", "costLimit":100.0, "currentAccumDepreciationAmount":2.25 }, "AccountingBookValue":99.5 } # Asset | Fixed asset you are creating + +begin + #adds a fixed asset + result = api_instance.create_asset(xero_tenant_id, asset) + p result +rescue XeroRuby::Assets::ApiError => e + puts "Exception when calling AssetApi->create_asset: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **asset** | [**Asset**](Asset.md)| Fixed asset you are creating | + +### Return type + +[**Asset**](Asset.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_asset_type + +> AssetType create_asset_type(xero_tenant_id, opts) + +adds a fixed asset type + +Adds an fixed asset type to the system + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + asset_type: { "assetTypeName":"Machinery11004", "fixedAssetAccountId":"3d8d063a-c148-4bb8-8b3c-a5e2ad3b1e82", "depreciationExpenseAccountId":"d1602f69-f900-4616-8d34-90af393fa368", "accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8", "bookDepreciationSetting":{ "depreciationMethod":"DiminishingValue100", "averagingMethod":"ActualDays", "depreciationRate":0.05, "depreciationCalculationMethod":"None" } } # AssetType | Asset type to add +} + +begin + #adds a fixed asset type + result = api_instance.create_asset_type(xero_tenant_id, opts) + p result +rescue XeroRuby::Assets::ApiError => e + puts "Exception when calling AssetApi->create_asset_type: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **asset_type** | [**AssetType**](AssetType.md)| Asset type to add | [optional] + +### Return type + +[**AssetType**](AssetType.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## get_asset_by_id + +> Asset get_asset_by_id(xero_tenant_id, id) + +retrieves fixed asset by id + +By passing in the appropriate asset id, you can search for a specific fixed asset in the system + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +id = '4f7bcdcb-5ec1-4258-9558-19f662fccdfe' # String | fixed asset id for single object + +begin + #retrieves fixed asset by id + result = api_instance.get_asset_by_id(xero_tenant_id, id) + p result +rescue XeroRuby::Assets::ApiError => e + puts "Exception when calling AssetApi->get_asset_by_id: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **id** | [**String**](.md)| fixed asset id for single object | + +### Return type + +[**Asset**](Asset.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_asset_settings + +> Setting get_asset_settings(xero_tenant_id) + +searches fixed asset settings + +By passing in the appropriate options, you can search for available fixed asset types in the system + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant + +begin + #searches fixed asset settings + result = api_instance.get_asset_settings(xero_tenant_id) + p result +rescue XeroRuby::Assets::ApiError => e + puts "Exception when calling AssetApi->get_asset_settings: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**Setting**](Setting.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_asset_types + +> Array<AssetType> get_asset_types(xero_tenant_id) + +searches fixed asset types + +By passing in the appropriate options, you can search for available fixed asset types in the system + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant + +begin + #searches fixed asset types + result = api_instance.get_asset_types(xero_tenant_id) + p result +rescue XeroRuby::Assets::ApiError => e + puts "Exception when calling AssetApi->get_asset_types: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + +### Return type + +[**Array<AssetType>**](AssetType.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_assets + +> Assets get_assets(xero_tenant_id, status, opts) + +searches fixed asset + +By passing in the appropriate options, you can search for available fixed asset in the system + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +status = XeroRuby::Assets::AssetStatusQueryParam.new # AssetStatusQueryParam | Required when retrieving a collection of assets. See Asset Status Codes +opts = { + page: 1, # Integer | Results are paged. This specifies which page of the results to return. The default page is 1. + page_size: 5, # Integer | The number of records returned per page. By default the number of records returned is 10. + order_by: 'AssetName', # String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + sort_direction: 'ASC', # String | ASC or DESC + filter_by: 'Draft' # String | A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. +} + +begin + #searches fixed asset + result = api_instance.get_assets(xero_tenant_id, status, opts) + p result +rescue XeroRuby::Assets::ApiError => e + puts "Exception when calling AssetApi->get_assets: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **status** | [**AssetStatusQueryParam**](.md)| Required when retrieving a collection of assets. See Asset Status Codes | + **page** | **Integer**| Results are paged. This specifies which page of the results to return. The default page is 1. | [optional] + **page_size** | **Integer**| The number of records returned per page. By default the number of records returned is 10. | [optional] + **order_by** | **String**| Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. | [optional] + **sort_direction** | **String**| ASC or DESC | [optional] + **filter_by** | **String**| A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. | [optional] + +### Return type + +[**Assets**](Assets.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + diff --git a/docs/assets/AssetStatus.md b/docs/assets/AssetStatus.md new file mode 100644 index 00000000..20f5f516 --- /dev/null +++ b/docs/assets/AssetStatus.md @@ -0,0 +1,16 @@ +# XeroRuby::Assets::AssetStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::AssetStatus.new() +``` + + diff --git a/docs/assets/AssetStatusQueryParam.md b/docs/assets/AssetStatusQueryParam.md new file mode 100644 index 00000000..894c0bdd --- /dev/null +++ b/docs/assets/AssetStatusQueryParam.md @@ -0,0 +1,16 @@ +# XeroRuby::Assets::AssetStatusQueryParam + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::AssetStatusQueryParam.new() +``` + + diff --git a/docs/assets/AssetType.md b/docs/assets/AssetType.md new file mode 100644 index 00000000..cdff54ab --- /dev/null +++ b/docs/assets/AssetType.md @@ -0,0 +1,29 @@ +# XeroRuby::Assets::AssetType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset_type_id** | **String** | Xero generated unique identifier for asset types | +**asset_type_name** | **String** | The name of the asset type | +**fixed_asset_account_id** | **String** | The asset account for fixed assets of this type | [optional] +**depreciation_expense_account_id** | **String** | The expense account for the depreciation of fixed assets of this type | [optional] +**accumulated_depreciation_account_id** | **String** | The account for accumulated depreciation of fixed assets of this type | [optional] +**book_depreciation_setting** | [**BookDepreciationSetting**](BookDepreciationSetting.md) | | +**locks** | **Integer** | All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::AssetType.new(asset_type_id: 5da209c5-5e19-4a43-b925-71b776c49ced, + asset_type_name: Computer Equipment, + fixed_asset_account_id: 24e260f1-bfc4-4766-ad7f-8a8ce01de879, + depreciation_expense_account_id: b23fc79b-d66b-44b0-a240-e138e086fcbc, + accumulated_depreciation_account_id: ca4c6b39-4f4f-43e8-98da-5e1f350a6694, + book_depreciation_setting: null, + locks: 33) +``` + + diff --git a/docs/assets/Assets.md b/docs/assets/Assets.md new file mode 100644 index 00000000..5cb72fd2 --- /dev/null +++ b/docs/assets/Assets.md @@ -0,0 +1,19 @@ +# XeroRuby::Assets::Assets + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**items** | [**Array<Asset>**](Asset.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::Assets.new(pagination: null, + items: null) +``` + + diff --git a/docs/assets/BookDepreciationDetail.md b/docs/assets/BookDepreciationDetail.md new file mode 100644 index 00000000..0117c97b --- /dev/null +++ b/docs/assets/BookDepreciationDetail.md @@ -0,0 +1,29 @@ +# XeroRuby::Assets::BookDepreciationDetail + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**current_capital_gain** | **Float** | When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. | [optional] +**current_gain_loss** | **Float** | When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. | [optional] +**depreciation_start_date** | **Date** | YYYY-MM-DD | [optional] +**cost_limit** | **Float** | The value of the asset you want to depreciate, if this is less than the cost of the asset. | [optional] +**residual_value** | **Float** | The value of the asset remaining when you've fully depreciated it. | [optional] +**prior_accum_depreciation_amount** | **Float** | All depreciation prior to the current financial year. | [optional] +**current_accum_depreciation_amount** | **Float** | All depreciation occurring in the current financial year. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::BookDepreciationDetail.new(current_capital_gain: 5.25, + current_gain_loss: 10.5, + depreciation_start_date: null, + cost_limit: 9000.0, + residual_value: 10000.0, + prior_accum_depreciation_amount: 0.45, + current_accum_depreciation_amount: 5.0) +``` + + diff --git a/docs/assets/BookDepreciationSetting.md b/docs/assets/BookDepreciationSetting.md new file mode 100644 index 00000000..febeb256 --- /dev/null +++ b/docs/assets/BookDepreciationSetting.md @@ -0,0 +1,31 @@ +# XeroRuby::Assets::BookDepreciationSetting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**depreciation_method** | **String** | The method of depreciation applied to this asset. See Depreciation Methods | [optional] +**averaging_method** | **String** | The method of averaging applied to this asset. See Averaging Methods | [optional] +**depreciation_rate** | **Float** | The rate of depreciation (e.g. 0.05) | [optional] +**effective_life_years** | **Integer** | Effective life of the asset in years (e.g. 5) | [optional] +**depreciation_calculation_method** | **String** | See Depreciation Calculation Methods | [optional] +**depreciable_object_id** | **String** | Unique Xero identifier for the depreciable object | [optional] +**depreciable_object_type** | **String** | The type of asset object | [optional] +**book_effective_date_of_change_id** | **String** | Unique Xero identifier for the effective date change | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::BookDepreciationSetting.new(depreciation_method: StraightLine, + averaging_method: ActualDays, + depreciation_rate: 0.05, + effective_life_years: 5, + depreciation_calculation_method: None, + depreciable_object_id: 68f17094-af97-4f1b-b36b-013b45b6ad3c, + depreciable_object_type: Asset, + book_effective_date_of_change_id: 68f17094-af97-4f1b-b36b-013b45b6ad3c) +``` + + diff --git a/docs/assets/Error.md b/docs/assets/Error.md new file mode 100644 index 00000000..6882a2a4 --- /dev/null +++ b/docs/assets/Error.md @@ -0,0 +1,25 @@ +# XeroRuby::Assets::Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_validation_errors** | [**Array<ResourceValidationErrorsElement>**](ResourceValidationErrorsElement.md) | Array of elements of resource validation errors | [optional] +**field_validation_errors** | [**Array<FieldValidationErrorsElement>**](FieldValidationErrorsElement.md) | Array of elements of field validation errors | [optional] +**type** | **String** | The internal type of error, not accessible externally | [optional] +**title** | **String** | Title of the error | [optional] +**detail** | **String** | Detail of the error | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::Error.new(resource_validation_errors: null, + field_validation_errors: null, + type: null, + title: null, + detail: null) +``` + + diff --git a/docs/assets/FieldValidationErrorsElement.md b/docs/assets/FieldValidationErrorsElement.md new file mode 100644 index 00000000..eda00fa1 --- /dev/null +++ b/docs/assets/FieldValidationErrorsElement.md @@ -0,0 +1,27 @@ +# XeroRuby::Assets::FieldValidationErrorsElement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**field_name** | **String** | The field name of the erroneous field | [optional] +**value_provided** | **String** | The provided value | [optional] +**localised_message** | **String** | Explaination of the field validation error | [optional] +**type** | **String** | Internal type of the field validation error message | [optional] +**title** | **String** | Title of the field validation error | [optional] +**detail** | **String** | Detail of the field validation error | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::FieldValidationErrorsElement.new(field_name: null, + value_provided: null, + localised_message: null, + type: null, + title: null, + detail: null) +``` + + diff --git a/docs/assets/Pagination.md b/docs/assets/Pagination.md new file mode 100644 index 00000000..eabecc70 --- /dev/null +++ b/docs/assets/Pagination.md @@ -0,0 +1,23 @@ +# XeroRuby::Assets::Pagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **Integer** | | [optional] +**page_size** | **Integer** | | [optional] +**page_count** | **Integer** | | [optional] +**item_count** | **Integer** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::Pagination.new(page: 1, + page_size: 10, + page_count: 1, + item_count: 2) +``` + + diff --git a/docs/assets/ResourceValidationErrorsElement.md b/docs/assets/ResourceValidationErrorsElement.md new file mode 100644 index 00000000..ef1e02e4 --- /dev/null +++ b/docs/assets/ResourceValidationErrorsElement.md @@ -0,0 +1,25 @@ +# XeroRuby::Assets::ResourceValidationErrorsElement + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**resource_name** | **String** | The field name of the erroneous field | [optional] +**localised_message** | **String** | Explaination of the resource validation error | [optional] +**type** | **String** | Internal type of the resource error message | [optional] +**title** | **String** | Title of the resource validation error | [optional] +**detail** | **String** | Detail of the resource validation error | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::ResourceValidationErrorsElement.new(resource_name: null, + localised_message: null, + type: null, + title: null, + detail: null) +``` + + diff --git a/docs/assets/Setting.md b/docs/assets/Setting.md new file mode 100644 index 00000000..05c0c193 --- /dev/null +++ b/docs/assets/Setting.md @@ -0,0 +1,31 @@ +# XeroRuby::Assets::Setting + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**asset_number_prefix** | **String** | The prefix used for fixed asset numbers (“FA-” by default) | [optional] +**asset_number_sequence** | **String** | The next available sequence number | [optional] +**asset_start_date** | **Date** | The date depreciation calculations started on registered fixed assets in Xero | [optional] +**last_depreciation_date** | **Date** | The last depreciation date | [optional] +**default_gain_on_disposal_account_id** | **String** | Default account that gains are posted to | [optional] +**default_loss_on_disposal_account_id** | **String** | Default account that losses are posted to | [optional] +**default_capital_gain_on_disposal_account_id** | **String** | Default account that capital gains are posted to | [optional] +**opt_in_for_tax** | **Boolean** | opt in for tax calculation | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Assets' + +instance = XeroRuby::Assets::Setting.new(asset_number_prefix: FA-, + asset_number_sequence: 0022, + asset_start_date: null, + last_depreciation_date: null, + default_gain_on_disposal_account_id: 346ddb97-739a-4274-b43b-66aa3218d17c, + default_loss_on_disposal_account_id: 1b798541-24e2-4855-9309-c023a0b576f3, + default_capital_gain_on_disposal_account_id: 6d6a0bdb-e118-45d8-a023-2ad617ec1cb7, + opt_in_for_tax: false) +``` + + diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb new file mode 100644 index 00000000..1d9e557b --- /dev/null +++ b/lib/xero-ruby.rb @@ -0,0 +1,174 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +# Common files +require 'xero-ruby/api_client' +require 'xero-ruby/api_error' +require 'xero-ruby/version' +require 'xero-ruby/configuration' + +# Models +require 'xero-ruby/models/assets/asset' +require 'xero-ruby/models/assets/asset_status' +require 'xero-ruby/models/assets/asset_status_query_param' +require 'xero-ruby/models/assets/asset_type' +require 'xero-ruby/models/assets/assets' +require 'xero-ruby/models/assets/book_depreciation_detail' +require 'xero-ruby/models/assets/book_depreciation_setting' +require 'xero-ruby/models/assets/error' +require 'xero-ruby/models/assets/field_validation_errors_element' +require 'xero-ruby/models/assets/pagination' +require 'xero-ruby/models/assets/resource_validation_errors_element' +require 'xero-ruby/models/assets/setting' +require 'xero-ruby/models/assets/asset' +require 'xero-ruby/models/assets/asset_status' +require 'xero-ruby/models/assets/asset_status_query_param' +require 'xero-ruby/models/assets/asset_type' +require 'xero-ruby/models/assets/assets' +require 'xero-ruby/models/assets/book_depreciation_detail' +require 'xero-ruby/models/assets/book_depreciation_setting' +require 'xero-ruby/models/assets/error' +require 'xero-ruby/models/assets/field_validation_errors_element' +require 'xero-ruby/models/assets/pagination' +require 'xero-ruby/models/assets/resource_validation_errors_element' +require 'xero-ruby/models/assets/setting' +require 'xero-ruby/models/accounting/account' +require 'xero-ruby/models/accounting/account_type' +require 'xero-ruby/models/accounting/accounts' +require 'xero-ruby/models/accounting/accounts_payable' +require 'xero-ruby/models/accounting/accounts_receivable' +require 'xero-ruby/models/accounting/address' +require 'xero-ruby/models/accounting/allocation' +require 'xero-ruby/models/accounting/allocations' +require 'xero-ruby/models/accounting/attachment' +require 'xero-ruby/models/accounting/attachments' +require 'xero-ruby/models/accounting/balances' +require 'xero-ruby/models/accounting/bank_transaction' +require 'xero-ruby/models/accounting/bank_transactions' +require 'xero-ruby/models/accounting/bank_transfer' +require 'xero-ruby/models/accounting/bank_transfers' +require 'xero-ruby/models/accounting/batch_payment' +require 'xero-ruby/models/accounting/batch_payment_details' +require 'xero-ruby/models/accounting/batch_payments' +require 'xero-ruby/models/accounting/bill' +require 'xero-ruby/models/accounting/branding_theme' +require 'xero-ruby/models/accounting/branding_themes' +require 'xero-ruby/models/accounting/cis_org_setting' +require 'xero-ruby/models/accounting/cis_setting' +require 'xero-ruby/models/accounting/cis_settings' +require 'xero-ruby/models/accounting/contact' +require 'xero-ruby/models/accounting/contact_group' +require 'xero-ruby/models/accounting/contact_groups' +require 'xero-ruby/models/accounting/contact_person' +require 'xero-ruby/models/accounting/contacts' +require 'xero-ruby/models/accounting/country_code' +require 'xero-ruby/models/accounting/credit_note' +require 'xero-ruby/models/accounting/credit_notes' +require 'xero-ruby/models/accounting/currencies' +require 'xero-ruby/models/accounting/currency' +require 'xero-ruby/models/accounting/currency_code' +require 'xero-ruby/models/accounting/element' +require 'xero-ruby/models/accounting/employee' +require 'xero-ruby/models/accounting/employees' +require 'xero-ruby/models/accounting/error' +require 'xero-ruby/models/accounting/expense_claim' +require 'xero-ruby/models/accounting/expense_claims' +require 'xero-ruby/models/accounting/external_link' +require 'xero-ruby/models/accounting/history_record' +require 'xero-ruby/models/accounting/history_records' +require 'xero-ruby/models/accounting/invoice' +require 'xero-ruby/models/accounting/invoice_reminder' +require 'xero-ruby/models/accounting/invoice_reminders' +require 'xero-ruby/models/accounting/invoices' +require 'xero-ruby/models/accounting/item' +require 'xero-ruby/models/accounting/items' +require 'xero-ruby/models/accounting/journal' +require 'xero-ruby/models/accounting/journal_line' +require 'xero-ruby/models/accounting/journals' +require 'xero-ruby/models/accounting/line_amount_types' +require 'xero-ruby/models/accounting/line_item' +require 'xero-ruby/models/accounting/line_item_tracking' +require 'xero-ruby/models/accounting/linked_transaction' +require 'xero-ruby/models/accounting/linked_transactions' +require 'xero-ruby/models/accounting/manual_journal' +require 'xero-ruby/models/accounting/manual_journal_line' +require 'xero-ruby/models/accounting/manual_journals' +require 'xero-ruby/models/accounting/online_invoice' +require 'xero-ruby/models/accounting/online_invoices' +require 'xero-ruby/models/accounting/organisation' +require 'xero-ruby/models/accounting/organisations' +require 'xero-ruby/models/accounting/overpayment' +require 'xero-ruby/models/accounting/overpayments' +require 'xero-ruby/models/accounting/payment' +require 'xero-ruby/models/accounting/payment_delete' +require 'xero-ruby/models/accounting/payment_service' +require 'xero-ruby/models/accounting/payment_services' +require 'xero-ruby/models/accounting/payment_term' +require 'xero-ruby/models/accounting/payment_term_type' +require 'xero-ruby/models/accounting/payments' +require 'xero-ruby/models/accounting/phone' +require 'xero-ruby/models/accounting/prepayment' +require 'xero-ruby/models/accounting/prepayments' +require 'xero-ruby/models/accounting/purchase' +require 'xero-ruby/models/accounting/purchase_order' +require 'xero-ruby/models/accounting/purchase_orders' +require 'xero-ruby/models/accounting/quote' +require 'xero-ruby/models/accounting/quote_line_amount_types' +require 'xero-ruby/models/accounting/quote_status_codes' +require 'xero-ruby/models/accounting/quotes' +require 'xero-ruby/models/accounting/receipt' +require 'xero-ruby/models/accounting/receipts' +require 'xero-ruby/models/accounting/repeating_invoice' +require 'xero-ruby/models/accounting/repeating_invoices' +require 'xero-ruby/models/accounting/report' +require 'xero-ruby/models/accounting/report_attribute' +require 'xero-ruby/models/accounting/report_cell' +require 'xero-ruby/models/accounting/report_fields' +require 'xero-ruby/models/accounting/report_row' +require 'xero-ruby/models/accounting/report_rows' +require 'xero-ruby/models/accounting/report_with_row' +require 'xero-ruby/models/accounting/report_with_rows' +require 'xero-ruby/models/accounting/reports' +require 'xero-ruby/models/accounting/request_empty' +require 'xero-ruby/models/accounting/row_type' +require 'xero-ruby/models/accounting/sales_tracking_category' +require 'xero-ruby/models/accounting/schedule' +require 'xero-ruby/models/accounting/tax_component' +require 'xero-ruby/models/accounting/tax_rate' +require 'xero-ruby/models/accounting/tax_rates' +require 'xero-ruby/models/accounting/tax_type' +require 'xero-ruby/models/accounting/ten_nintey_nine_contact' +require 'xero-ruby/models/accounting/time_zone' +require 'xero-ruby/models/accounting/tracking_categories' +require 'xero-ruby/models/accounting/tracking_category' +require 'xero-ruby/models/accounting/tracking_option' +require 'xero-ruby/models/accounting/tracking_options' +require 'xero-ruby/models/accounting/user' +require 'xero-ruby/models/accounting/users' +require 'xero-ruby/models/accounting/validation_error' + +# APIs +require 'xero-ruby/api/asset_api' +require 'xero-ruby/api/asset_api' +require 'xero-ruby/api/accounting_api' + +module XeroRuby + class << self + def configure + if block_given? + yield(Configuration.default) + else + Configuration.default + end + end + end +end diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb new file mode 100644 index 00000000..057a9f7e --- /dev/null +++ b/lib/xero-ruby/api/accounting_api.rb @@ -0,0 +1,15675 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'cgi' + +module XeroRuby + class AccountingApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # Allows you to create a new chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account [Account] Account object in body of request + # @param [Hash] opts the optional parameters + # @return [Accounts] + def create_account(xero_tenant_id, account, opts = {}) + data, _status_code, _headers = create_account_with_http_info(xero_tenant_id, account, opts) + data + end + + # Allows you to create a new chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account [Account] Account object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers + def create_account_with_http_info(xero_tenant_id, account, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_account ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_account" + end + # verify the required parameter 'account' is set + if @api_client.config.client_side_validation && account.nil? + fail ArgumentError, "Missing the required parameter 'account' when calling AccountingApi.create_account" + end + # resource path + local_var_path = '/Accounts' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(account) + + # return_type + return_type = opts[:return_type] || 'Accounts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create Attachment on Account + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, opts = {}) + data, _status_code, _headers = create_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts) + data + end + + # Allows you to create Attachment on Account + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_account_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_account_attachment_by_file_name" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.create_account_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_account_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_account_attachment_by_file_name" + end + # resource path + local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to createa an Attachment on BankTransaction by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param file_name [String] The name of the file being attached + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) + data, _status_code, _headers = create_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts) + data + end + + # Allows you to createa an Attachment on BankTransaction by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param file_name [String] The name of the file being attached + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transaction_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_bank_transaction_attachment_by_file_name" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create history record for a bank transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records, opts = {}) + data, _status_code, _headers = create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_transaction_id, history_records, opts) + data + end + + # Allows you to create history record for a bank transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_bank_transaction_history_record_with_http_info(xero_tenant_id, bank_transaction_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transaction_history_record ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transaction_history_record" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.create_bank_transaction_history_record" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_bank_transaction_history_record" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}/History'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_bank_transaction_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create one or more spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [BankTransactions] + def create_bank_transactions(xero_tenant_id, bank_transactions, opts = {}) + data, _status_code, _headers = create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts) + data + end + + # Allows you to create one or more spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transactions [BankTransactions] BankTransactions with an array of BankTransaction objects in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers + def create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transactions ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transactions" + end + # verify the required parameter 'bank_transactions' is set + if @api_client.config.client_side_validation && bank_transactions.nil? + fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.create_bank_transactions" + end + # resource path + local_var_path = '/BankTransactions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(bank_transactions) + + # return_type + return_type = opts[:return_type] || 'BankTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfers [BankTransfers] BankTransfers with array of BankTransfer objects in request body + # @param [Hash] opts the optional parameters + # @return [BankTransfers] + def create_bank_transfer(xero_tenant_id, bank_transfers, opts = {}) + data, _status_code, _headers = create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts) + data + end + + # Allows you to create a bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfers [BankTransfers] BankTransfers with array of BankTransfer objects in request body + # @param [Hash] opts the optional parameters + # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers + def create_bank_transfer_with_http_info(xero_tenant_id, bank_transfers, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transfer" + end + # verify the required parameter 'bank_transfers' is set + if @api_client.config.client_side_validation && bank_transfers.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfers' when calling AccountingApi.create_bank_transfer" + end + # resource path + local_var_path = '/BankTransfers' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(bank_transfers) + + # return_type + return_type = opts[:return_type] || 'BankTransfers' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param file_name [String] The name of the file being attached to a Bank Transfer + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) + data, _status_code, _headers = create_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts) + data + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param file_name [String] The name of the file being attached to a Bank Transfer + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_bank_transfer_attachment_by_file_name" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records, opts = {}) + data, _status_code, _headers = create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_transfer_id, history_records, opts) + data + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_bank_transfer_history_record_with_http_info(xero_tenant_id, bank_transfer_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_bank_transfer_history_record ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_bank_transfer_history_record" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.create_bank_transfer_history_record" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_bank_transfer_history_record" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}/History'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_bank_transfer_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create one or many BatchPayments for invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [BatchPayments] + def create_batch_payment(xero_tenant_id, batch_payments, opts = {}) + data, _status_code, _headers = create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts) + data + end + + # Create one or many BatchPayments for invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param batch_payments [BatchPayments] BatchPayments with an array of Payments in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers + def create_batch_payment_with_http_info(xero_tenant_id, batch_payments, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_batch_payment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_batch_payment" + end + # verify the required parameter 'batch_payments' is set + if @api_client.config.client_side_validation && batch_payments.nil? + fail ArgumentError, "Missing the required parameter 'batch_payments' when calling AccountingApi.create_batch_payment" + end + # resource path + local_var_path = '/BatchPayments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(batch_payments) + + # return_type + return_type = opts[:return_type] || 'BatchPayments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_batch_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a history record for a Batch Payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param batch_payment_id [String] Unique identifier for BatchPayment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records, opts = {}) + data, _status_code, _headers = create_batch_payment_history_record_with_http_info(xero_tenant_id, batch_payment_id, history_records, opts) + data + end + + # Allows you to create a history record for a Batch Payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param batch_payment_id [String] Unique identifier for BatchPayment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_batch_payment_history_record_with_http_info(xero_tenant_id, batch_payment_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_batch_payment_history_record ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_batch_payment_history_record" + end + # verify the required parameter 'batch_payment_id' is set + if @api_client.config.client_side_validation && batch_payment_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_payment_id' when calling AccountingApi.create_batch_payment_history_record" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_batch_payment_history_record" + end + # resource path + local_var_path = '/BatchPayments/{BatchPaymentID}/History'.sub('{' + 'BatchPaymentID' + '}', batch_payment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_batch_payment_history_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allow for the creation of new custom payment service for specified Branding Theme + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param branding_theme_id [String] Unique identifier for a Branding Theme + # @param payment_service [PaymentService] PaymentService object in body of request + # @param [Hash] opts the optional parameters + # @return [PaymentServices] + def create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service, opts = {}) + data, _status_code, _headers = create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_service, opts) + data + end + + # Allow for the creation of new custom payment service for specified Branding Theme + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param branding_theme_id [String] Unique identifier for a Branding Theme + # @param payment_service [PaymentService] PaymentService object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers + def create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_service, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_branding_theme_payment_services ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_branding_theme_payment_services" + end + # verify the required parameter 'branding_theme_id' is set + if @api_client.config.client_side_validation && branding_theme_id.nil? + fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.create_branding_theme_payment_services" + end + # verify the required parameter 'payment_service' is set + if @api_client.config.client_side_validation && payment_service.nil? + fail ArgumentError, "Missing the required parameter 'payment_service' when calling AccountingApi.create_branding_theme_payment_services" + end + # resource path + local_var_path = '/BrandingThemes/{BrandingThemeID}/PaymentServices'.sub('{' + 'BrandingThemeID' + '}', branding_theme_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payment_service) + + # return_type + return_type = opts[:return_type] || 'PaymentServices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_branding_theme_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param file_name [String] Name for the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, opts = {}) + data, _status_code, _headers = create_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts) + data + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param file_name [String] Name for the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_attachment_by_file_name" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.create_contact_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_contact_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_contact_attachment_by_file_name" + end + # resource path + local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a contact group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_groups [ContactGroups] ContactGroups with an array of names in request body + # @param [Hash] opts the optional parameters + # @return [ContactGroups] + def create_contact_group(xero_tenant_id, contact_groups, opts = {}) + data, _status_code, _headers = create_contact_group_with_http_info(xero_tenant_id, contact_groups, opts) + data + end + + # Allows you to create a contact group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_groups [ContactGroups] ContactGroups with an array of names in request body + # @param [Hash] opts the optional parameters + # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers + def create_contact_group_with_http_info(xero_tenant_id, contact_groups, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_group ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_group" + end + # verify the required parameter 'contact_groups' is set + if @api_client.config.client_side_validation && contact_groups.nil? + fail ArgumentError, "Missing the required parameter 'contact_groups' when calling AccountingApi.create_contact_group" + end + # resource path + local_var_path = '/ContactGroups' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(contact_groups) + + # return_type + return_type = opts[:return_type] || 'ContactGroups' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to add Contacts to a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param contacts [Contacts] Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request + # @param [Hash] opts the optional parameters + # @return [Contacts] + def create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts, opts = {}) + data, _status_code, _headers = create_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, contacts, opts) + data + end + + # Allows you to add Contacts to a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param contacts [Contacts] Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers + def create_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, contacts, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_group_contacts ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_group_contacts" + end + # verify the required parameter 'contact_group_id' is set + if @api_client.config.client_side_validation && contact_group_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.create_contact_group_contacts" + end + # verify the required parameter 'contacts' is set + if @api_client.config.client_side_validation && contacts.nil? + fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.create_contact_group_contacts" + end + # resource path + local_var_path = '/ContactGroups/{ContactGroupID}/Contacts'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(contacts) + + # return_type + return_type = opts[:return_type] || 'Contacts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_contact_group_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an Contact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_contact_history(xero_tenant_id, contact_id, history_records, opts = {}) + data, _status_code, _headers = create_contact_history_with_http_info(xero_tenant_id, contact_id, history_records, opts) + data + end + + # Allows you to retrieve a history records of an Contact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_contact_history_with_http_info(xero_tenant_id, contact_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_contact_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contact_history" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.create_contact_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_contact_history" + end + # resource path + local_var_path = '/Contacts/{ContactID}/History'.sub('{' + 'ContactID' + '}', contact_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_contact_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a multiple contacts (bulk) in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Contacts] + def create_contacts(xero_tenant_id, contacts, opts = {}) + data, _status_code, _headers = create_contacts_with_http_info(xero_tenant_id, contacts, opts) + data + end + + # Allows you to create a multiple contacts (bulk) in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contacts [Contacts] Contacts with an array of Contact objects to create in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers + def create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_contacts ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_contacts" + end + # verify the required parameter 'contacts' is set + if @api_client.config.client_side_validation && contacts.nil? + fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.create_contacts" + end + # resource path + local_var_path = '/Contacts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(contacts) + + # return_type + return_type = opts[:return_type] || 'Contacts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create Allocation on CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param allocations [Allocations] Allocations with array of Allocation object in body of request. + # @param [Hash] opts the optional parameters + # @return [Allocations] + def create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations, opts = {}) + data, _status_code, _headers = create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts) + data + end + + # Allows you to create Allocation on CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param allocations [Allocations] Allocations with array of Allocation object in body of request. + # @param [Hash] opts the optional parameters + # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers + def create_credit_note_allocation_with_http_info(xero_tenant_id, credit_note_id, allocations, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_allocation ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_allocation" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_allocation" + end + # verify the required parameter 'allocations' is set + if @api_client.config.client_side_validation && allocations.nil? + fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_credit_note_allocation" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/Allocations'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(allocations) + + # return_type + return_type = opts[:return_type] || 'Allocations' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_allocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create Attachments on CreditNote by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param file_name [String] Name of the file you are attaching to Credit Note + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false) + # @return [Attachments] + def create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {}) + data, _status_code, _headers = create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts) + data + end + + # Allows you to create Attachments on CreditNote by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param file_name [String] Name of the file you are attaching to Credit Note + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_attachment_by_file_name" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_credit_note_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_credit_note_attachment_by_file_name" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_credit_note_history(xero_tenant_id, credit_note_id, history_records, opts = {}) + data, _status_code, _headers = create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, history_records, opts) + data + end + + # Allows you to retrieve a history records of an CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_note_history" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.create_credit_note_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_credit_note_history" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/History'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_credit_note_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a credit note + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [CreditNotes] + def create_credit_notes(xero_tenant_id, credit_notes, opts = {}) + data, _status_code, _headers = create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts) + data + end + + # Allows you to create a credit note + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_notes [CreditNotes] Credit Notes with array of CreditNote object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers + def create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_notes ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_credit_notes" + end + # verify the required parameter 'credit_notes' is set + if @api_client.config.client_side_validation && credit_notes.nil? + fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.create_credit_notes" + end + # resource path + local_var_path = '/CreditNotes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(credit_notes) + + # return_type + return_type = opts[:return_type] || 'CreditNotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param currency [Currency] Currency obejct in the body of request + # @param [Hash] opts the optional parameters + # @return [Currencies] + def create_currency(xero_tenant_id, currency, opts = {}) + data, _status_code, _headers = create_currency_with_http_info(xero_tenant_id, currency, opts) + data + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param currency [Currency] Currency obejct in the body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Currencies, Integer, Hash)>] Currencies data, response status code and response headers + def create_currency_with_http_info(xero_tenant_id, currency, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_currency ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_currency" + end + # verify the required parameter 'currency' is set + if @api_client.config.client_side_validation && currency.nil? + fail ArgumentError, "Missing the required parameter 'currency' when calling AccountingApi.create_currency" + end + # resource path + local_var_path = '/Currencies' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(currency) + + # return_type + return_type = opts[:return_type] || 'Currencies' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_currency\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create new employees used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employees [Employees] Employees with array of Employee object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Employees] + def create_employees(xero_tenant_id, employees, opts = {}) + data, _status_code, _headers = create_employees_with_http_info(xero_tenant_id, employees, opts) + data + end + + # Allows you to create new employees used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employees [Employees] Employees with array of Employee object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def create_employees_with_http_info(xero_tenant_id, employees, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_employees ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_employees" + end + # verify the required parameter 'employees' is set + if @api_client.config.client_side_validation && employees.nil? + fail ArgumentError, "Missing the required parameter 'employees' when calling AccountingApi.create_employees" + end + # resource path + local_var_path = '/Employees' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employees) + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a history records of an ExpenseClaim + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records, opts = {}) + data, _status_code, _headers = create_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, history_records, opts) + data + end + + # Allows you to create a history records of an ExpenseClaim + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_expense_claim_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_expense_claim_history" + end + # verify the required parameter 'expense_claim_id' is set + if @api_client.config.client_side_validation && expense_claim_id.nil? + fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.create_expense_claim_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_expense_claim_history" + end + # resource path + local_var_path = '/ExpenseClaims/{ExpenseClaimID}/History'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_expense_claim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve expense claims + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claims [ExpenseClaims] ExpenseClaims with array of ExpenseClaim object in body of request + # @param [Hash] opts the optional parameters + # @return [ExpenseClaims] + def create_expense_claims(xero_tenant_id, expense_claims, opts = {}) + data, _status_code, _headers = create_expense_claims_with_http_info(xero_tenant_id, expense_claims, opts) + data + end + + # Allows you to retrieve expense claims + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claims [ExpenseClaims] ExpenseClaims with array of ExpenseClaim object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers + def create_expense_claims_with_http_info(xero_tenant_id, expense_claims, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_expense_claims ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_expense_claims" + end + # verify the required parameter 'expense_claims' is set + if @api_client.config.client_side_validation && expense_claims.nil? + fail ArgumentError, "Missing the required parameter 'expense_claims' when calling AccountingApi.create_expense_claims" + end + # resource path + local_var_path = '/ExpenseClaims' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(expense_claims) + + # return_type + return_type = opts[:return_type] || 'ExpenseClaims' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_expense_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create an Attachment on invoices or purchase bills by it's filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param file_name [String] Name of the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false) + # @return [Attachments] + def create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {}) + data, _status_code, _headers = create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts) + data + end + + # Allows you to create an Attachment on invoices or purchase bills by it's filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param file_name [String] Name of the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_invoice_attachment_by_file_name" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.create_invoice_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_invoice_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_invoice_attachment_by_file_name" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_invoice_history(xero_tenant_id, invoice_id, history_records, opts = {}) + data, _status_code, _headers = create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_records, opts) + data + end + + # Allows you to retrieve a history records of an invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_invoice_history_with_http_info(xero_tenant_id, invoice_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_invoice_history" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.create_invoice_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_invoice_history" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/History'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create one or more sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoices [Invoices] Invoices with an array of invoice objects in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Invoices] + def create_invoices(xero_tenant_id, invoices, opts = {}) + data, _status_code, _headers = create_invoices_with_http_info(xero_tenant_id, invoices, opts) + data + end + + # Allows you to create one or more sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoices [Invoices] Invoices with an array of invoice objects in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers + def create_invoices_with_http_info(xero_tenant_id, invoices, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoices ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_invoices" + end + # verify the required parameter 'invoices' is set + if @api_client.config.client_side_validation && invoices.nil? + fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.create_invoices" + end + # resource path + local_var_path = '/Invoices' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(invoices) + + # return_type + return_type = opts[:return_type] || 'Invoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a history record for items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_item_history(xero_tenant_id, item_id, history_records, opts = {}) + data, _status_code, _headers = create_item_history_with_http_info(xero_tenant_id, item_id, history_records, opts) + data + end + + # Allows you to create a history record for items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_item_history_with_http_info(xero_tenant_id, item_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_item_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_item_history" + end + # verify the required parameter 'item_id' is set + if @api_client.config.client_side_validation && item_id.nil? + fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.create_item_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_item_history" + end + # resource path + local_var_path = '/Items/{ItemID}/History'.sub('{' + 'ItemID' + '}', item_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_item_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create one or more items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param items [Items] Items with an array of Item objects in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Items] + def create_items(xero_tenant_id, items, opts = {}) + data, _status_code, _headers = create_items_with_http_info(xero_tenant_id, items, opts) + data + end + + # Allows you to create one or more items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param items [Items] Items with an array of Item objects in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers + def create_items_with_http_info(xero_tenant_id, items, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_items ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_items" + end + # verify the required parameter 'items' is set + if @api_client.config.client_side_validation && items.nil? + fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.create_items" + end + # resource path + local_var_path = '/Items' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(items) + + # return_type + return_type = opts[:return_type] || 'Items' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction [LinkedTransaction] LinkedTransaction object in body of request + # @param [Hash] opts the optional parameters + # @return [LinkedTransactions] + def create_linked_transaction(xero_tenant_id, linked_transaction, opts = {}) + data, _status_code, _headers = create_linked_transaction_with_http_info(xero_tenant_id, linked_transaction, opts) + data + end + + # Allows you to create linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction [LinkedTransaction] LinkedTransaction object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers + def create_linked_transaction_with_http_info(xero_tenant_id, linked_transaction, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_linked_transaction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_linked_transaction" + end + # verify the required parameter 'linked_transaction' is set + if @api_client.config.client_side_validation && linked_transaction.nil? + fail ArgumentError, "Missing the required parameter 'linked_transaction' when calling AccountingApi.create_linked_transaction" + end + # resource path + local_var_path = '/LinkedTransactions' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(linked_transaction) + + # return_type + return_type = opts[:return_type] || 'LinkedTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a specified Attachment on ManualJournal by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param file_name [String] The name of the file being attached to a ManualJournal + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) + data, _status_code, _headers = create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts) + data + end + + # Allows you to create a specified Attachment on ManualJournal by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param file_name [String] The name of the file being attached to a ManualJournal + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journal_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.create_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_manual_journal_attachment_by_file_name" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create one or more manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [ManualJournals] + def create_manual_journals(xero_tenant_id, manual_journals, opts = {}) + data, _status_code, _headers = create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts) + data + end + + # Allows you to create one or more manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers + def create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_manual_journals ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_manual_journals" + end + # verify the required parameter 'manual_journals' is set + if @api_client.config.client_side_validation && manual_journals.nil? + fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.create_manual_journals" + end + # resource path + local_var_path = '/ManualJournals' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(manual_journals) + + # return_type + return_type = opts[:return_type] || 'ManualJournals' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a single allocation for an overpayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param allocations [Allocations] Allocations array with Allocation object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Allocations] + def create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts = {}) + data, _status_code, _headers = create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts) + data + end + + # Allows you to create a single allocation for an overpayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param allocations [Allocations] Allocations array with Allocation object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers + def create_overpayment_allocations_with_http_info(xero_tenant_id, overpayment_id, allocations, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_overpayment_allocations ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_overpayment_allocations" + end + # verify the required parameter 'overpayment_id' is set + if @api_client.config.client_side_validation && overpayment_id.nil? + fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.create_overpayment_allocations" + end + # verify the required parameter 'allocations' is set + if @api_client.config.client_side_validation && allocations.nil? + fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_overpayment_allocations" + end + # resource path + local_var_path = '/Overpayments/{OverpaymentID}/Allocations'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(allocations) + + # return_type + return_type = opts[:return_type] || 'Allocations' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_overpayment_allocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create history records of an Overpayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_overpayment_history(xero_tenant_id, overpayment_id, history_records, opts = {}) + data, _status_code, _headers = create_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, history_records, opts) + data + end + + # Allows you to create history records of an Overpayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_overpayment_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_overpayment_history" + end + # verify the required parameter 'overpayment_id' is set + if @api_client.config.client_side_validation && overpayment_id.nil? + fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.create_overpayment_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_overpayment_history" + end + # resource path + local_var_path = '/Overpayments/{OverpaymentID}/History'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_overpayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a single payment for invoices or credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment [Payment] Request body with a single Payment object + # @param [Hash] opts the optional parameters + # @return [Payments] + def create_payment(xero_tenant_id, payment, opts = {}) + data, _status_code, _headers = create_payment_with_http_info(xero_tenant_id, payment, opts) + data + end + + # Allows you to create a single payment for invoices or credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment [Payment] Request body with a single Payment object + # @param [Hash] opts the optional parameters + # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers + def create_payment_with_http_info(xero_tenant_id, payment, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payment" + end + # verify the required parameter 'payment' is set + if @api_client.config.client_side_validation && payment.nil? + fail ArgumentError, "Missing the required parameter 'payment' when calling AccountingApi.create_payment" + end + # resource path + local_var_path = '/Payments' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payment) + + # return_type + return_type = opts[:return_type] || 'Payments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a history record for a payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_payment_history(xero_tenant_id, payment_id, history_records, opts = {}) + data, _status_code, _headers = create_payment_history_with_http_info(xero_tenant_id, payment_id, history_records, opts) + data + end + + # Allows you to create a history record for a payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_payment_history_with_http_info(xero_tenant_id, payment_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payment_history" + end + # verify the required parameter 'payment_id' is set + if @api_client.config.client_side_validation && payment_id.nil? + fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.create_payment_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_payment_history" + end + # resource path + local_var_path = '/Payments/{PaymentID}/History'.sub('{' + 'PaymentID' + '}', payment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create payment services + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request + # @param [Hash] opts the optional parameters + # @return [PaymentServices] + def create_payment_service(xero_tenant_id, payment_services, opts = {}) + data, _status_code, _headers = create_payment_service_with_http_info(xero_tenant_id, payment_services, opts) + data + end + + # Allows you to create payment services + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers + def create_payment_service_with_http_info(xero_tenant_id, payment_services, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_payment_service ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payment_service" + end + # verify the required parameter 'payment_services' is set + if @api_client.config.client_side_validation && payment_services.nil? + fail ArgumentError, "Missing the required parameter 'payment_services' when calling AccountingApi.create_payment_service" + end + # resource path + local_var_path = '/PaymentServices' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payment_services) + + # return_type + return_type = opts[:return_type] || 'PaymentServices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_payment_service\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create multiple payments for invoices or credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payments [Payments] Payments array with Payment object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Payments] + def create_payments(xero_tenant_id, payments, opts = {}) + data, _status_code, _headers = create_payments_with_http_info(xero_tenant_id, payments, opts) + data + end + + # Allows you to create multiple payments for invoices or credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payments [Payments] Payments array with Payment object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers + def create_payments_with_http_info(xero_tenant_id, payments, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_payments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_payments" + end + # verify the required parameter 'payments' is set + if @api_client.config.client_side_validation && payments.nil? + fail ArgumentError, "Missing the required parameter 'payments' when calling AccountingApi.create_payments" + end + # resource path + local_var_path = '/Payments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payments) + + # return_type + return_type = opts[:return_type] || 'Payments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create an Allocation for prepayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for Prepayment + # @param allocations [Allocations] Allocations with an array of Allocation object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Allocations] + def create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts = {}) + data, _status_code, _headers = create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts) + data + end + + # Allows you to create an Allocation for prepayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for Prepayment + # @param allocations [Allocations] Allocations with an array of Allocation object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Allocations, Integer, Hash)>] Allocations data, response status code and response headers + def create_prepayment_allocations_with_http_info(xero_tenant_id, prepayment_id, allocations, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_prepayment_allocations ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_prepayment_allocations" + end + # verify the required parameter 'prepayment_id' is set + if @api_client.config.client_side_validation && prepayment_id.nil? + fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.create_prepayment_allocations" + end + # verify the required parameter 'allocations' is set + if @api_client.config.client_side_validation && allocations.nil? + fail ArgumentError, "Missing the required parameter 'allocations' when calling AccountingApi.create_prepayment_allocations" + end + # resource path + local_var_path = '/Prepayments/{PrepaymentID}/Allocations'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(allocations) + + # return_type + return_type = opts[:return_type] || 'Allocations' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_prepayment_allocations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a history record for an Prepayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for a PrePayment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_prepayment_history(xero_tenant_id, prepayment_id, history_records, opts = {}) + data, _status_code, _headers = create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, history_records, opts) + data + end + + # Allows you to create a history record for an Prepayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for a PrePayment + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_prepayment_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_prepayment_history" + end + # verify the required parameter 'prepayment_id' is set + if @api_client.config.client_side_validation && prepayment_id.nil? + fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.create_prepayment_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_prepayment_history" + end + # resource path + local_var_path = '/Prepayments/{PrepaymentID}/History'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_prepayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create HistoryRecord for purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records, opts = {}) + data, _status_code, _headers = create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, history_records, opts) + data + end + + # Allows you to create HistoryRecord for purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_purchase_order_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_purchase_order_history" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.create_purchase_order_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_purchase_order_history" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}/History'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_purchase_order_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create one or more purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [PurchaseOrders] + def create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) + data, _status_code, _headers = create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts) + data + end + + # Allows you to create one or more purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_orders [PurchaseOrders] PurchaseOrders with an array of PurchaseOrder object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers + def create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_purchase_orders ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_purchase_orders" + end + # verify the required parameter 'purchase_orders' is set + if @api_client.config.client_side_validation && purchase_orders.nil? + fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.create_purchase_orders" + end + # resource path + local_var_path = '/PurchaseOrders' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(purchase_orders) + + # return_type + return_type = opts[:return_type] || 'PurchaseOrders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create Attachment on Quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body, opts = {}) + data, _status_code, _headers = create_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts) + data + end + + # Allows you to create Attachment on Quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_quote_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_quote_attachment_by_file_name" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.create_quote_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_quote_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_quote_attachment_by_file_name" + end + # resource path + local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_quote_history(xero_tenant_id, quote_id, history_records, opts = {}) + data, _status_code, _headers = create_quote_history_with_http_info(xero_tenant_id, quote_id, history_records, opts) + data + end + + # Allows you to retrieve a history records of an quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_quote_history_with_http_info(xero_tenant_id, quote_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_quote_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_quote_history" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.create_quote_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_quote_history" + end + # resource path + local_var_path = '/Quotes/{QuoteID}/History'.sub('{' + 'QuoteID' + '}', quote_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_quote_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create one or more quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quotes [Quotes] Quotes with an array of Quote object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Quotes] + def create_quotes(xero_tenant_id, quotes, opts = {}) + data, _status_code, _headers = create_quotes_with_http_info(xero_tenant_id, quotes, opts) + data + end + + # Allows you to create one or more quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quotes [Quotes] Quotes with an array of Quote object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers + def create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_quotes ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_quotes" + end + # verify the required parameter 'quotes' is set + if @api_client.config.client_side_validation && quotes.nil? + fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.create_quotes" + end + # resource path + local_var_path = '/Quotes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(quotes) + + # return_type + return_type = opts[:return_type] || 'Quotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create draft expense claim receipts for any user + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipts [Receipts] Receipts with an array of Receipt object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Receipts] + def create_receipt(xero_tenant_id, receipts, opts = {}) + data, _status_code, _headers = create_receipt_with_http_info(xero_tenant_id, receipts, opts) + data + end + + # Allows you to create draft expense claim receipts for any user + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipts [Receipts] Receipts with an array of Receipt object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers + def create_receipt_with_http_info(xero_tenant_id, receipts, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_receipt" + end + # verify the required parameter 'receipts' is set + if @api_client.config.client_side_validation && receipts.nil? + fail ArgumentError, "Missing the required parameter 'receipts' when calling AccountingApi.create_receipt" + end + # resource path + local_var_path = '/Receipts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(receipts) + + # return_type + return_type = opts[:return_type] || 'Receipts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create Attachment on expense claim receipts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param file_name [String] The name of the file being attached to the Receipt + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body, opts = {}) + data, _status_code, _headers = create_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts) + data + end + + # Allows you to create Attachment on expense claim receipts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param file_name [String] The name of the file being attached to the Receipt + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_receipt_attachment_by_file_name" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.create_receipt_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_receipt_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_receipt_attachment_by_file_name" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an Receipt + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_receipt_history(xero_tenant_id, receipt_id, history_records, opts = {}) + data, _status_code, _headers = create_receipt_history_with_http_info(xero_tenant_id, receipt_id, history_records, opts) + data + end + + # Allows you to retrieve a history records of an Receipt + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_receipt_history_with_http_info(xero_tenant_id, receipt_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_receipt_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_receipt_history" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.create_receipt_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_receipt_history" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}/History'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_receipt_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create attachment on repeating invoices by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param file_name [String] The name of the file being attached to a Repeating Invoice + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) + data, _status_code, _headers = create_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts) + data + end + + # Allows you to create attachment on repeating invoices by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param file_name [String] The name of the file being attached to a Repeating Invoice + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def create_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_repeating_invoice_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_repeating_invoice_attachment_by_file_name" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create history for a repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records, opts = {}) + data, _status_code, _headers = create_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, history_records, opts) + data + end + + # Allows you to create history for a repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param history_records [HistoryRecords] HistoryRecords containing an array of HistoryRecord objects in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def create_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, history_records, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_repeating_invoice_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_repeating_invoice_history" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.create_repeating_invoice_history" + end + # verify the required parameter 'history_records' is set + if @api_client.config.client_side_validation && history_records.nil? + fail ArgumentError, "Missing the required parameter 'history_records' when calling AccountingApi.create_repeating_invoice_history" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/History'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(history_records) + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_repeating_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create one or more Tax Rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tax_rates [TaxRates] TaxRates array with TaxRate object in body of request + # @param [Hash] opts the optional parameters + # @return [TaxRates] + def create_tax_rates(xero_tenant_id, tax_rates, opts = {}) + data, _status_code, _headers = create_tax_rates_with_http_info(xero_tenant_id, tax_rates, opts) + data + end + + # Allows you to create one or more Tax Rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tax_rates [TaxRates] TaxRates array with TaxRate object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers + def create_tax_rates_with_http_info(xero_tenant_id, tax_rates, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_tax_rates ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_tax_rates" + end + # verify the required parameter 'tax_rates' is set + if @api_client.config.client_side_validation && tax_rates.nil? + fail ArgumentError, "Missing the required parameter 'tax_rates' when calling AccountingApi.create_tax_rates" + end + # resource path + local_var_path = '/TaxRates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(tax_rates) + + # return_type + return_type = opts[:return_type] || 'TaxRates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_tax_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category [TrackingCategory] TrackingCategory object in body of request + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + def create_tracking_category(xero_tenant_id, tracking_category, opts = {}) + data, _status_code, _headers = create_tracking_category_with_http_info(xero_tenant_id, tracking_category, opts) + data + end + + # Allows you to create tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category [TrackingCategory] TrackingCategory object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers + def create_tracking_category_with_http_info(xero_tenant_id, tracking_category, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_tracking_category ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_tracking_category" + end + # verify the required parameter 'tracking_category' is set + if @api_client.config.client_side_validation && tracking_category.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category' when calling AccountingApi.create_tracking_category" + end + # resource path + local_var_path = '/TrackingCategories' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(tracking_category) + + # return_type + return_type = opts[:return_type] || 'TrackingCategories' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create options for a specified tracking category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_option [TrackingOption] TrackingOption object in body of request + # @param [Hash] opts the optional parameters + # @return [TrackingOptions] + def create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option, opts = {}) + data, _status_code, _headers = create_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option, opts) + data + end + + # Allows you to create options for a specified tracking category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_option [TrackingOption] TrackingOption object in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers + def create_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.create_tracking_options ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.create_tracking_options" + end + # verify the required parameter 'tracking_category_id' is set + if @api_client.config.client_side_validation && tracking_category_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.create_tracking_options" + end + # verify the required parameter 'tracking_option' is set + if @api_client.config.client_side_validation && tracking_option.nil? + fail ArgumentError, "Missing the required parameter 'tracking_option' when calling AccountingApi.create_tracking_options" + end + # resource path + local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(tracking_option) + + # return_type + return_type = opts[:return_type] || 'TrackingOptions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#create_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete a chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for retrieving single object + # @param [Hash] opts the optional parameters + # @return [Accounts] + def delete_account(xero_tenant_id, account_id, opts = {}) + data, _status_code, _headers = delete_account_with_http_info(xero_tenant_id, account_id, opts) + data + end + + # Allows you to delete a chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for retrieving single object + # @param [Hash] opts the optional parameters + # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers + def delete_account_with_http_info(xero_tenant_id, account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_account ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.delete_account" + end + # resource path + local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Accounts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete a specific Contact from a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id, opts = {}) + delete_contact_group_contact_with_http_info(xero_tenant_id, contact_group_id, contact_id, opts) + nil + end + + # Allows you to delete a specific Contact from a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_contact_group_contact_with_http_info(xero_tenant_id, contact_group_id, contact_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_contact_group_contact ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_contact_group_contact" + end + # verify the required parameter 'contact_group_id' is set + if @api_client.config.client_side_validation && contact_group_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.delete_contact_group_contact" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.delete_contact_group_contact" + end + # resource path + local_var_path = '/ContactGroups/{ContactGroupID}/Contacts/{ContactID}'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s).sub('{' + 'ContactID' + '}', contact_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_contact_group_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete all Contacts from a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_contact_group_contacts(xero_tenant_id, contact_group_id, opts = {}) + delete_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, opts) + nil + end + + # Allows you to delete all Contacts from a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_contact_group_contacts_with_http_info(xero_tenant_id, contact_group_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_contact_group_contacts ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_contact_group_contacts" + end + # verify the required parameter 'contact_group_id' is set + if @api_client.config.client_side_validation && contact_group_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.delete_contact_group_contacts" + end + # resource path + local_var_path = '/ContactGroups/{ContactGroupID}/Contacts'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_contact_group_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete a specified item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_item(xero_tenant_id, item_id, opts = {}) + delete_item_with_http_info(xero_tenant_id, item_id, opts) + nil + end + + # Allows you to delete a specified item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_item_with_http_info(xero_tenant_id, item_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_item ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_item" + end + # verify the required parameter 'item_id' is set + if @api_client.config.client_side_validation && item_id.nil? + fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.delete_item" + end + # resource path + local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete a specified linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_linked_transaction(xero_tenant_id, linked_transaction_id, opts = {}) + delete_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts) + nil + end + + # Allows you to delete a specified linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_linked_transaction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_linked_transaction" + end + # verify the required parameter 'linked_transaction_id' is set + if @api_client.config.client_side_validation && linked_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.delete_linked_transaction" + end + # resource path + local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified payment for invoices and credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param payment_delete [PaymentDelete] + # @param [Hash] opts the optional parameters + # @return [Payments] + def delete_payment(xero_tenant_id, payment_id, payment_delete, opts = {}) + data, _status_code, _headers = delete_payment_with_http_info(xero_tenant_id, payment_id, payment_delete, opts) + data + end + + # Allows you to update a specified payment for invoices and credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param payment_delete [PaymentDelete] + # @param [Hash] opts the optional parameters + # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers + def delete_payment_with_http_info(xero_tenant_id, payment_id, payment_delete, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_payment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_payment" + end + # verify the required parameter 'payment_id' is set + if @api_client.config.client_side_validation && payment_id.nil? + fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.delete_payment" + end + # verify the required parameter 'payment_delete' is set + if @api_client.config.client_side_validation && payment_delete.nil? + fail ArgumentError, "Missing the required parameter 'payment_delete' when calling AccountingApi.delete_payment" + end + # resource path + local_var_path = '/Payments/{PaymentID}'.sub('{' + 'PaymentID' + '}', payment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(payment_delete) + + # return_type + return_type = opts[:return_type] || 'Payments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + def delete_tracking_category(xero_tenant_id, tracking_category_id, opts = {}) + data, _status_code, _headers = delete_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts) + data + end + + # Allows you to delete tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers + def delete_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_tracking_category ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_tracking_category" + end + # verify the required parameter 'tracking_category_id' is set + if @api_client.config.client_side_validation && tracking_category_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.delete_tracking_category" + end + # resource path + local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TrackingCategories' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete a specified option for a specified tracking category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_option_id [String] Unique identifier for a Tracking Option + # @param [Hash] opts the optional parameters + # @return [TrackingOptions] + def delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, opts = {}) + data, _status_code, _headers = delete_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, opts) + data + end + + # Allows you to delete a specified option for a specified tracking category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_option_id [String] Unique identifier for a Tracking Option + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers + def delete_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.delete_tracking_options ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.delete_tracking_options" + end + # verify the required parameter 'tracking_category_id' is set + if @api_client.config.client_side_validation && tracking_category_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.delete_tracking_options" + end + # verify the required parameter 'tracking_option_id' is set + if @api_client.config.client_side_validation && tracking_option_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_option_id' when calling AccountingApi.delete_tracking_options" + end + # resource path + local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s).sub('{' + 'TrackingOptionID' + '}', tracking_option_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TrackingOptions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#delete_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to email a copy of invoice to related Contact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param request_empty [RequestEmpty] + # @param [Hash] opts the optional parameters + # @return [nil] + def email_invoice(xero_tenant_id, invoice_id, request_empty, opts = {}) + email_invoice_with_http_info(xero_tenant_id, invoice_id, request_empty, opts) + nil + end + + # Allows you to email a copy of invoice to related Contact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param request_empty [RequestEmpty] + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def email_invoice_with_http_info(xero_tenant_id, invoice_id, request_empty, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.email_invoice ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.email_invoice" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.email_invoice" + end + # verify the required parameter 'request_empty' is set + if @api_client.config.client_side_validation && request_empty.nil? + fail ArgumentError, "Missing the required parameter 'request_empty' when calling AccountingApi.email_invoice" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/Email'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(request_empty) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#email_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a single chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for retrieving single object + # @param [Hash] opts the optional parameters + # @return [Accounts] + def get_account(xero_tenant_id, account_id, opts = {}) + data, _status_code, _headers = get_account_with_http_info(xero_tenant_id, account_id, opts) + data + end + + # Allows you to retrieve a single chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for retrieving single object + # @param [Hash] opts the optional parameters + # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers + def get_account_with_http_info(xero_tenant_id, account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_account ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account" + end + # resource path + local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Accounts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachment on Account by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param file_name [String] Name of the attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachment on Account by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param file_name [String] Name of the attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account_attachment_by_file_name" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_account_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_account_attachment_by_file_name" + end + # resource path + local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve specific Attachment on Account + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param attachment_id [String] Unique identifier for Attachment object + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_account_attachment_by_id_with_http_info(xero_tenant_id, account_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve specific Attachment on Account + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param attachment_id [String] Unique identifier for Attachment object + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_account_attachment_by_id_with_http_info(xero_tenant_id, account_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account_attachment_by_id" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_account_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_account_attachment_by_id" + end + # resource path + local_var_path = '/Accounts/{AccountID}/Attachments/{AttachmentID}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_account_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments for accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_account_attachments(xero_tenant_id, account_id, opts = {}) + data, _status_code, _headers = get_account_attachments_with_http_info(xero_tenant_id, account_id, opts) + data + end + + # Allows you to retrieve Attachments for accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_account_attachments_with_http_info(xero_tenant_id, account_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_account_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_account_attachments" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.get_account_attachments" + end + # resource path + local_var_path = '/Accounts/{AccountID}/Attachments'.sub('{' + 'AccountID' + '}', account_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_account_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve the full chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Accounts] + def get_accounts(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_accounts_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve the full chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers + def get_accounts_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_accounts ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_accounts" + end + # resource path + local_var_path = '/Accounts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Accounts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a single spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [BankTransactions] + def get_bank_transaction(xero_tenant_id, bank_transaction_id, opts = {}) + data, _status_code, _headers = get_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, opts) + data + end + + # Allows you to retrieve a single spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers + def get_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BankTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on BankTransaction by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param file_name [String] The name of the file being attached + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachments on BankTransaction by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param file_name [String] The name of the file being attached + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transaction_attachment_by_file_name" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on a specific BankTransaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param attachment_id [String] Xero generated unique identifier for an attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_bank_transaction_attachment_by_id_with_http_info(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve Attachments on a specific BankTransaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param attachment_id [String] Xero generated unique identifier for an attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_bank_transaction_attachment_by_id_with_http_info(xero_tenant_id, bank_transaction_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction_attachment_by_id" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_bank_transaction_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transaction_attachment_by_id" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{AttachmentID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any attachments to bank transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id, opts = {}) + data, _status_code, _headers = get_bank_transaction_attachments_with_http_info(xero_tenant_id, bank_transaction_id, opts) + data + end + + # Allows you to retrieve any attachments to bank transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_bank_transaction_attachments_with_http_info(xero_tenant_id, bank_transaction_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transaction_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transaction_attachments" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transaction_attachments" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}/Attachments'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transaction_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any spend or receive money transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page Up to 100 bank transactions will be returned in a single API call with line items details + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [BankTransactions] + def get_bank_transactions(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_bank_transactions_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any spend or receive money transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page Up to 100 bank transactions will be returned in a single API call with line items details + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers + def get_bank_transactions_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transactions ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transactions" + end + # resource path + local_var_path = '/BankTransactions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BankTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve history from a bank transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_bank_transactions_history(xero_tenant_id, bank_transaction_id, opts = {}) + data, _status_code, _headers = get_bank_transactions_history_with_http_info(xero_tenant_id, bank_transaction_id, opts) + data + end + + # Allows you to retrieve history from a bank transactions + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_bank_transactions_history_with_http_info(xero_tenant_id, bank_transaction_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transactions_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transactions_history" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.get_bank_transactions_history" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}/History'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transactions_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param [Hash] opts the optional parameters + # @return [BankTransfers] + def get_bank_transfer(xero_tenant_id, bank_transfer_id, opts = {}) + data, _status_code, _headers = get_bank_transfer_with_http_info(xero_tenant_id, bank_transfer_id, opts) + data + end + + # Allows you to retrieve any bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param [Hash] opts the optional parameters + # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers + def get_bank_transfer_with_http_info(xero_tenant_id, bank_transfer_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BankTransfers' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on BankTransfer by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param file_name [String] The name of the file being attached to a Bank Transfer + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachments on BankTransfer by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param file_name [String] The name of the file being attached to a Bank Transfer + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transfer_attachment_by_file_name" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on BankTransfer + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param attachment_id [String] Xero generated unique identifier for an Attachment to a bank transfer + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_bank_transfer_attachment_by_id_with_http_info(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve Attachments on BankTransfer + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param attachment_id [String] Xero generated unique identifier for an Attachment to a bank transfer + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_bank_transfer_attachment_by_id_with_http_info(xero_tenant_id, bank_transfer_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_attachment_by_id" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_bank_transfer_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_bank_transfer_attachment_by_id" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{AttachmentID}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments from bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id, opts = {}) + data, _status_code, _headers = get_bank_transfer_attachments_with_http_info(xero_tenant_id, bank_transfer_id, opts) + data + end + + # Allows you to retrieve Attachments from bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_bank_transfer_attachments_with_http_info(xero_tenant_id, bank_transfer_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_attachments" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_attachments" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}/Attachments'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve history from a bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_bank_transfer_history(xero_tenant_id, bank_transfer_id, opts = {}) + data, _status_code, _headers = get_bank_transfer_history_with_http_info(xero_tenant_id, bank_transfer_id, opts) + data + end + + # Allows you to retrieve history from a bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_bank_transfer_history_with_http_info(xero_tenant_id, bank_transfer_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfer_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfer_history" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.get_bank_transfer_history" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}/History'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfer_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve all bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [BankTransfers] + def get_bank_transfers(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_bank_transfers_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve all bank transfers + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(BankTransfers, Integer, Hash)>] BankTransfers data, response status code and response headers + def get_bank_transfers_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_bank_transfers ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_bank_transfers" + end + # resource path + local_var_path = '/BankTransfers' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BankTransfers' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_bank_transfers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve history from a Batch Payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param batch_payment_id [String] Unique identifier for BatchPayment + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_batch_payment_history(xero_tenant_id, batch_payment_id, opts = {}) + data, _status_code, _headers = get_batch_payment_history_with_http_info(xero_tenant_id, batch_payment_id, opts) + data + end + + # Allows you to retrieve history from a Batch Payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param batch_payment_id [String] Unique identifier for BatchPayment + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_batch_payment_history_with_http_info(xero_tenant_id, batch_payment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_batch_payment_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_batch_payment_history" + end + # verify the required parameter 'batch_payment_id' is set + if @api_client.config.client_side_validation && batch_payment_id.nil? + fail ArgumentError, "Missing the required parameter 'batch_payment_id' when calling AccountingApi.get_batch_payment_history" + end + # resource path + local_var_path = '/BatchPayments/{BatchPaymentID}/History'.sub('{' + 'BatchPaymentID' + '}', batch_payment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_batch_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve either one or many BatchPayments for invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [BatchPayments] + def get_batch_payments(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_batch_payments_with_http_info(xero_tenant_id, opts) + data + end + + # Retrieve either one or many BatchPayments for invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers + def get_batch_payments_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_batch_payments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_batch_payments" + end + # resource path + local_var_path = '/BatchPayments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BatchPayments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_batch_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specific BrandingThemes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param branding_theme_id [String] Unique identifier for a Branding Theme + # @param [Hash] opts the optional parameters + # @return [BrandingThemes] + def get_branding_theme(xero_tenant_id, branding_theme_id, opts = {}) + data, _status_code, _headers = get_branding_theme_with_http_info(xero_tenant_id, branding_theme_id, opts) + data + end + + # Allows you to retrieve a specific BrandingThemes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param branding_theme_id [String] Unique identifier for a Branding Theme + # @param [Hash] opts the optional parameters + # @return [Array<(BrandingThemes, Integer, Hash)>] BrandingThemes data, response status code and response headers + def get_branding_theme_with_http_info(xero_tenant_id, branding_theme_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_theme ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_branding_theme" + end + # verify the required parameter 'branding_theme_id' is set + if @api_client.config.client_side_validation && branding_theme_id.nil? + fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.get_branding_theme" + end + # resource path + local_var_path = '/BrandingThemes/{BrandingThemeID}'.sub('{' + 'BrandingThemeID' + '}', branding_theme_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BrandingThemes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_branding_theme\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve the Payment services for a Branding Theme + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param branding_theme_id [String] Unique identifier for a Branding Theme + # @param [Hash] opts the optional parameters + # @return [PaymentServices] + def get_branding_theme_payment_services(xero_tenant_id, branding_theme_id, opts = {}) + data, _status_code, _headers = get_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, opts) + data + end + + # Allows you to retrieve the Payment services for a Branding Theme + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param branding_theme_id [String] Unique identifier for a Branding Theme + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers + def get_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_theme_payment_services ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_branding_theme_payment_services" + end + # verify the required parameter 'branding_theme_id' is set + if @api_client.config.client_side_validation && branding_theme_id.nil? + fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.get_branding_theme_payment_services" + end + # resource path + local_var_path = '/BrandingThemes/{BrandingThemeID}/PaymentServices'.sub('{' + 'BrandingThemeID' + '}', branding_theme_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PaymentServices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_branding_theme_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve all the BrandingThemes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [BrandingThemes] + def get_branding_themes(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_branding_themes_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve all the BrandingThemes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(BrandingThemes, Integer, Hash)>] BrandingThemes data, response status code and response headers + def get_branding_themes_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_branding_themes ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_branding_themes" + end + # resource path + local_var_path = '/BrandingThemes' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'BrandingThemes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_branding_themes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a single contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [Contacts] + def get_contact(xero_tenant_id, contact_id, opts = {}) + data, _status_code, _headers = get_contact_with_http_info(xero_tenant_id, contact_id, opts) + data + end + + # Allows you to retrieve a single contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers + def get_contact_with_http_info(xero_tenant_id, contact_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact" + end + # resource path + local_var_path = '/Contacts/{ContactID}'.sub('{' + 'ContactID' + '}', contact_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Contacts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on Contacts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param file_name [String] Name for the file you are attaching + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachments on Contacts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param file_name [String] Name for the file you are attaching + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_attachment_by_file_name" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_contact_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_contact_attachment_by_file_name" + end + # resource path + local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on Contacts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_contact_attachment_by_id_with_http_info(xero_tenant_id, contact_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve Attachments on Contacts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_contact_attachment_by_id_with_http_info(xero_tenant_id, contact_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_attachment_by_id" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_contact_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_contact_attachment_by_id" + end + # resource path + local_var_path = '/Contacts/{ContactID}/Attachments/{AttachmentID}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve, add and update contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_contact_attachments(xero_tenant_id, contact_id, opts = {}) + data, _status_code, _headers = get_contact_attachments_with_http_info(xero_tenant_id, contact_id, opts) + data + end + + # Allows you to retrieve, add and update contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_contact_attachments_with_http_info(xero_tenant_id, contact_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_attachments" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_attachments" + end + # resource path + local_var_path = '/Contacts/{ContactID}/Attachments'.sub('{' + 'ContactID' + '}', contact_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a single contact by Contact Number in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_number [String] This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). + # @param [Hash] opts the optional parameters + # @return [Contacts] + def get_contact_by_contact_number(xero_tenant_id, contact_number, opts = {}) + data, _status_code, _headers = get_contact_by_contact_number_with_http_info(xero_tenant_id, contact_number, opts) + data + end + + # Allows you to retrieve a single contact by Contact Number in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_number [String] This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). + # @param [Hash] opts the optional parameters + # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers + def get_contact_by_contact_number_with_http_info(xero_tenant_id, contact_number, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_by_contact_number ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_by_contact_number" + end + # verify the required parameter 'contact_number' is set + if @api_client.config.client_side_validation && contact_number.nil? + fail ArgumentError, "Missing the required parameter 'contact_number' when calling AccountingApi.get_contact_by_contact_number" + end + # resource path + local_var_path = '/Contacts/{ContactNumber}'.sub('{' + 'ContactNumber' + '}', contact_number.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Contacts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_by_contact_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve CISSettings for a contact in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [CISSettings] + def get_contact_cis_settings(xero_tenant_id, contact_id, opts = {}) + data, _status_code, _headers = get_contact_cis_settings_with_http_info(xero_tenant_id, contact_id, opts) + data + end + + # Allows you to retrieve CISSettings for a contact in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [Array<(CISSettings, Integer, Hash)>] CISSettings data, response status code and response headers + def get_contact_cis_settings_with_http_info(xero_tenant_id, contact_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_cis_settings ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_cis_settings" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_cis_settings" + end + # resource path + local_var_path = '/Contacts/{ContactID}/CISSettings'.sub('{' + 'ContactID' + '}', contact_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'CISSettings' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a unique Contact Group by ID + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param [Hash] opts the optional parameters + # @return [ContactGroups] + def get_contact_group(xero_tenant_id, contact_group_id, opts = {}) + data, _status_code, _headers = get_contact_group_with_http_info(xero_tenant_id, contact_group_id, opts) + data + end + + # Allows you to retrieve a unique Contact Group by ID + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param [Hash] opts the optional parameters + # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers + def get_contact_group_with_http_info(xero_tenant_id, contact_group_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_group ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_group" + end + # verify the required parameter 'contact_group_id' is set + if @api_client.config.client_side_validation && contact_group_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.get_contact_group" + end + # resource path + local_var_path = '/ContactGroups/{ContactGroupID}'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ContactGroups' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve the ContactID and Name of all the contacts in a contact group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [ContactGroups] + def get_contact_groups(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_contact_groups_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve the ContactID and Name of all the contacts in a contact group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers + def get_contact_groups_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_groups ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_groups" + end + # resource path + local_var_path = '/ContactGroups' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ContactGroups' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_groups\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an Contact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_contact_history(xero_tenant_id, contact_id, opts = {}) + data, _status_code, _headers = get_contact_history_with_http_info(xero_tenant_id, contact_id, opts) + data + end + + # Allows you to retrieve a history records of an Contact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_contact_history_with_http_info(xero_tenant_id, contact_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_history" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_contact_history" + end + # resource path + local_var_path = '/Contacts/{ContactID}/History'.sub('{' + 'ContactID' + '}', contact_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contact_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve all contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Array] :i_ds Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + # @option opts [Integer] :page e.g. page=1 - Up to 100 contacts will be returned in a single API call. + # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + # @return [Contacts] + def get_contacts(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_contacts_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve all contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Array] :i_ds Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + # @option opts [Integer] :page e.g. page=1 - Up to 100 contacts will be returned in a single API call. + # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers + def get_contacts_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_contacts ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contacts" + end + # resource path + local_var_path = '/Contacts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'i_ds'], :csv) if !opts[:'i_ds'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Contacts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specific credit note + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [CreditNotes] + def get_credit_note(xero_tenant_id, credit_note_id, opts = {}) + data, _status_code, _headers = get_credit_note_with_http_info(xero_tenant_id, credit_note_id, opts) + data + end + + # Allows you to retrieve a specific credit note + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers + def get_credit_note_with_http_info(xero_tenant_id, credit_note_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'CreditNotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_credit_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Credit Note as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @return [File] + def get_credit_note_as_pdf(xero_tenant_id, credit_note_id, opts = {}) + data, _status_code, _headers = get_credit_note_as_pdf_with_http_info(xero_tenant_id, credit_note_id, opts) + data + end + + # Allows you to retrieve Credit Note as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_credit_note_as_pdf_with_http_info(xero_tenant_id, credit_note_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_as_pdf ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_as_pdf" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_as_pdf" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on CreditNote by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param file_name [String] Name of the file you are attaching to Credit Note + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachments on CreditNote by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param file_name [String] Name of the file you are attaching to Credit Note + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_attachment_by_file_name" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_credit_note_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_credit_note_attachment_by_file_name" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_credit_note_attachment_by_id_with_http_info(xero_tenant_id, credit_note_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve Attachments on CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_credit_note_attachment_by_id_with_http_info(xero_tenant_id, credit_note_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_attachment_by_id" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_credit_note_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_credit_note_attachment_by_id" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{AttachmentID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments for credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_credit_note_attachments(xero_tenant_id, credit_note_id, opts = {}) + data, _status_code, _headers = get_credit_note_attachments_with_http_info(xero_tenant_id, credit_note_id, opts) + data + end + + # Allows you to retrieve Attachments for credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_credit_note_attachments_with_http_info(xero_tenant_id, credit_note_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_attachments" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_attachments" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/Attachments'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_credit_note_history(xero_tenant_id, credit_note_id, opts = {}) + data, _status_code, _headers = get_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, opts) + data + end + + # Allows you to retrieve a history records of an CreditNote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_credit_note_history_with_http_info(xero_tenant_id, credit_note_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_note_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_note_history" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.get_credit_note_history" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/History'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_credit_note_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [CreditNotes] + def get_credit_notes(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_credit_notes_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers + def get_credit_notes_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_credit_notes ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_credit_notes" + end + # resource path + local_var_path = '/CreditNotes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'CreditNotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve currencies for your organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Currencies] + def get_currencies(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_currencies_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve currencies for your organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(Currencies, Integer, Hash)>] Currencies data, response status code and response headers + def get_currencies_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_currencies ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_currencies" + end + # resource path + local_var_path = '/Currencies' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Currencies' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_currencies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specific employee used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Unique identifier for a Employee + # @param [Hash] opts the optional parameters + # @return [Employees] + def get_employee(xero_tenant_id, employee_id, opts = {}) + data, _status_code, _headers = get_employee_with_http_info(xero_tenant_id, employee_id, opts) + data + end + + # Allows you to retrieve a specific employee used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employee_id [String] Unique identifier for a Employee + # @param [Hash] opts the optional parameters + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def get_employee_with_http_info(xero_tenant_id, employee_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_employee ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_employee" + end + # verify the required parameter 'employee_id' is set + if @api_client.config.client_side_validation && employee_id.nil? + fail ArgumentError, "Missing the required parameter 'employee_id' when calling AccountingApi.get_employee" + end + # resource path + local_var_path = '/Employees/{EmployeeID}'.sub('{' + 'EmployeeID' + '}', employee_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_employee\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve employees used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Employees] + def get_employees(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_employees_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve employees used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def get_employees_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_employees ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_employees" + end + # resource path + local_var_path = '/Employees' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified expense claim + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param [Hash] opts the optional parameters + # @return [ExpenseClaims] + def get_expense_claim(xero_tenant_id, expense_claim_id, opts = {}) + data, _status_code, _headers = get_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, opts) + data + end + + # Allows you to retrieve a specified expense claim + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param [Hash] opts the optional parameters + # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers + def get_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claim ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_expense_claim" + end + # verify the required parameter 'expense_claim_id' is set + if @api_client.config.client_side_validation && expense_claim_id.nil? + fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.get_expense_claim" + end + # resource path + local_var_path = '/ExpenseClaims/{ExpenseClaimID}'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ExpenseClaims' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_expense_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an ExpenseClaim + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_expense_claim_history(xero_tenant_id, expense_claim_id, opts = {}) + data, _status_code, _headers = get_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, opts) + data + end + + # Allows you to retrieve a history records of an ExpenseClaim + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_expense_claim_history_with_http_info(xero_tenant_id, expense_claim_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claim_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_expense_claim_history" + end + # verify the required parameter 'expense_claim_id' is set + if @api_client.config.client_side_validation && expense_claim_id.nil? + fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.get_expense_claim_history" + end + # resource path + local_var_path = '/ExpenseClaims/{ExpenseClaimID}/History'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_expense_claim_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve expense claims + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [ExpenseClaims] + def get_expense_claims(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_expense_claims_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve expense claims + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers + def get_expense_claims_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_expense_claims ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_expense_claims" + end + # resource path + local_var_path = '/ExpenseClaims' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ExpenseClaims' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_expense_claims\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified sales invoice or purchase bill + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Invoices] + def get_invoice(xero_tenant_id, invoice_id, opts = {}) + data, _status_code, _headers = get_invoice_with_http_info(xero_tenant_id, invoice_id, opts) + data + end + + # Allows you to retrieve a specified sales invoice or purchase bill + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers + def get_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Invoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve invoices or purchase bills as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [File] + def get_invoice_as_pdf(xero_tenant_id, invoice_id, opts = {}) + data, _status_code, _headers = get_invoice_as_pdf_with_http_info(xero_tenant_id, invoice_id, opts) + data + end + + # Allows you to retrieve invoices or purchase bills as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_invoice_as_pdf_with_http_info(xero_tenant_id, invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_as_pdf ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_as_pdf" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_as_pdf" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoice_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachment on invoices or purchase bills by it's filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param file_name [String] Name of the file you are attaching + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachment on invoices or purchase bills by it's filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param file_name [String] Name of the file you are attaching + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_attachment_by_file_name" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_invoice_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_invoice_attachment_by_file_name" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param attachment_id [String] Unique identifier for an Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_invoice_attachment_by_id_with_http_info(xero_tenant_id, invoice_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param attachment_id [String] Unique identifier for an Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_invoice_attachment_by_id_with_http_info(xero_tenant_id, invoice_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_attachment_by_id" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_invoice_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_invoice_attachment_by_id" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/Attachments/{AttachmentID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_invoice_attachments(xero_tenant_id, invoice_id, opts = {}) + data, _status_code, _headers = get_invoice_attachments_with_http_info(xero_tenant_id, invoice_id, opts) + data + end + + # Allows you to retrieve Attachments on invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_invoice_attachments_with_http_info(xero_tenant_id, invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_attachments" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_attachments" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/Attachments'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoice_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_invoice_history(xero_tenant_id, invoice_id, opts = {}) + data, _status_code, _headers = get_invoice_history_with_http_info(xero_tenant_id, invoice_id, opts) + data + end + + # Allows you to retrieve a history records of an invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_invoice_history_with_http_info(xero_tenant_id, invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_history" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_invoice_history" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/History'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve invoice reminder settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [InvoiceReminders] + def get_invoice_reminders(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_invoice_reminders_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve invoice reminder settings + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(InvoiceReminders, Integer, Hash)>] InvoiceReminders data, response status code and response headers + def get_invoice_reminders_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoice_reminders ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoice_reminders" + end + # resource path + local_var_path = '/InvoiceReminders/Settings' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'InvoiceReminders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoice_reminders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Array] :i_ds Filter by a comma-separated list of InvoicesIDs. + # @option opts [Array] :invoice_numbers Filter by a comma-separated list of InvoiceNumbers. + # @option opts [Array] :contact_i_ds Filter by a comma-separated list of ContactIDs. + # @option opts [Array] :statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + # @option opts [Integer] :page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice + # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + # @option opts [Boolean] :created_by_my_app When set to true you'll only retrieve Invoices created by your app + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Invoices] + def get_invoices(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_invoices_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Array] :i_ds Filter by a comma-separated list of InvoicesIDs. + # @option opts [Array] :invoice_numbers Filter by a comma-separated list of InvoiceNumbers. + # @option opts [Array] :contact_i_ds Filter by a comma-separated list of ContactIDs. + # @option opts [Array] :statuses Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + # @option opts [Integer] :page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice + # @option opts [Boolean] :include_archived e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + # @option opts [Boolean] :created_by_my_app When set to true you'll only retrieve Invoices created by your app + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers + def get_invoices_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_invoices ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_invoices" + end + # resource path + local_var_path = '/Invoices' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'IDs'] = @api_client.build_collection_param(opts[:'i_ds'], :csv) if !opts[:'i_ds'].nil? + query_params[:'InvoiceNumbers'] = @api_client.build_collection_param(opts[:'invoice_numbers'], :csv) if !opts[:'invoice_numbers'].nil? + query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_i_ds'], :csv) if !opts[:'contact_i_ds'].nil? + query_params[:'Statuses'] = @api_client.build_collection_param(opts[:'statuses'], :csv) if !opts[:'statuses'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil? + query_params[:'createdByMyApp'] = opts[:'created_by_my_app'] if !opts[:'created_by_my_app'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Invoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Items] + def get_item(xero_tenant_id, item_id, opts = {}) + data, _status_code, _headers = get_item_with_http_info(xero_tenant_id, item_id, opts) + data + end + + # Allows you to retrieve a specified item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers + def get_item_with_http_info(xero_tenant_id, item_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_item ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_item" + end + # verify the required parameter 'item_id' is set + if @api_client.config.client_side_validation && item_id.nil? + fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.get_item" + end + # resource path + local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Items' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve history for items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_item_history(xero_tenant_id, item_id, opts = {}) + data, _status_code, _headers = get_item_history_with_http_info(xero_tenant_id, item_id, opts) + data + end + + # Allows you to retrieve history for items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_item_history_with_http_info(xero_tenant_id, item_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_item_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_item_history" + end + # verify the required parameter 'item_id' is set + if @api_client.config.client_side_validation && item_id.nil? + fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.get_item_history" + end + # resource path + local_var_path = '/Items/{ItemID}/History'.sub('{' + 'ItemID' + '}', item_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_item_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Items] + def get_items(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_items_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers + def get_items_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_items ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_items" + end + # resource path + local_var_path = '/Items' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Items' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified journals. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param journal_id [String] Unique identifier for a Journal + # @param [Hash] opts the optional parameters + # @return [Journals] + def get_journal(xero_tenant_id, journal_id, opts = {}) + data, _status_code, _headers = get_journal_with_http_info(xero_tenant_id, journal_id, opts) + data + end + + # Allows you to retrieve a specified journals. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param journal_id [String] Unique identifier for a Journal + # @param [Hash] opts the optional parameters + # @return [Array<(Journals, Integer, Hash)>] Journals data, response status code and response headers + def get_journal_with_http_info(xero_tenant_id, journal_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_journal ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_journal" + end + # verify the required parameter 'journal_id' is set + if @api_client.config.client_side_validation && journal_id.nil? + fail ArgumentError, "Missing the required parameter 'journal_id' when calling AccountingApi.get_journal" + end + # resource path + local_var_path = '/Journals/{JournalID}'.sub('{' + 'JournalID' + '}', journal_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Journals' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any journals. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [Integer] :offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + # @option opts [Boolean] :payments_only Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. + # @return [Journals] + def get_journals(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_journals_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any journals. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [Integer] :offset Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + # @option opts [Boolean] :payments_only Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. + # @return [Array<(Journals, Integer, Hash)>] Journals data, response status code and response headers + def get_journals_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_journals ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_journals" + end + # resource path + local_var_path = '/Journals' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? + query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Journals' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction + # @param [Hash] opts the optional parameters + # @return [LinkedTransactions] + def get_linked_transaction(xero_tenant_id, linked_transaction_id, opts = {}) + data, _status_code, _headers = get_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts) + data + end + + # Allows you to retrieve a specified linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction + # @param [Hash] opts the optional parameters + # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers + def get_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_linked_transaction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_linked_transaction" + end + # verify the required parameter 'linked_transaction_id' is set + if @api_client.config.client_side_validation && linked_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.get_linked_transaction" + end + # resource path + local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LinkedTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Retrieve linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + # @option opts [String] :linked_transaction_id The Xero identifier for an Linked Transaction + # @option opts [String] :source_transaction_id Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + # @option opts [String] :contact_id Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + # @option opts [String] :status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status + # @option opts [String] :target_transaction_id Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + # @return [LinkedTransactions] + def get_linked_transactions(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_linked_transactions_with_http_info(xero_tenant_id, opts) + data + end + + # Retrieve linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + # @option opts [String] :linked_transaction_id The Xero identifier for an Linked Transaction + # @option opts [String] :source_transaction_id Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + # @option opts [String] :contact_id Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + # @option opts [String] :status Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status + # @option opts [String] :target_transaction_id Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers + def get_linked_transactions_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_linked_transactions ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_linked_transactions" + end + # resource path + local_var_path = '/LinkedTransactions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'LinkedTransactionID'] = opts[:'linked_transaction_id'] if !opts[:'linked_transaction_id'].nil? + query_params[:'SourceTransactionID'] = opts[:'source_transaction_id'] if !opts[:'source_transaction_id'].nil? + query_params[:'ContactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil? + query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'TargetTransactionID'] = opts[:'target_transaction_id'] if !opts[:'target_transaction_id'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'LinkedTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_linked_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param [Hash] opts the optional parameters + # @return [ManualJournals] + def get_manual_journal(xero_tenant_id, manual_journal_id, opts = {}) + data, _status_code, _headers = get_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, opts) + data + end + + # Allows you to retrieve a specified manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param [Hash] opts the optional parameters + # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers + def get_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ManualJournals' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve specified Attachment on ManualJournal by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param file_name [String] The name of the file being attached to a ManualJournal + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve specified Attachment on ManualJournal by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param file_name [String] The name of the file being attached to a ManualJournal + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_manual_journal_attachment_by_file_name" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve specified Attachment on ManualJournals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_manual_journal_attachment_by_id_with_http_info(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve specified Attachment on ManualJournals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_manual_journal_attachment_by_id_with_http_info(xero_tenant_id, manual_journal_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal_attachment_by_id" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_manual_journal_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_manual_journal_attachment_by_id" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{AttachmentID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachment for manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_manual_journal_attachments(xero_tenant_id, manual_journal_id, opts = {}) + data, _status_code, _headers = get_manual_journal_attachments_with_http_info(xero_tenant_id, manual_journal_id, opts) + data + end + + # Allows you to retrieve Attachment for manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_manual_journal_attachments_with_http_info(xero_tenant_id, manual_journal_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journal_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journal_attachments" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.get_manual_journal_attachments" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}/Attachments'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_manual_journal_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment + # @return [ManualJournals] + def get_manual_journals(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_manual_journals_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any manual journals + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment + # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers + def get_manual_journals_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_manual_journals ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_manual_journals" + end + # resource path + local_var_path = '/ManualJournals' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ManualJournals' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a URL to an online invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [OnlineInvoices] + def get_online_invoice(xero_tenant_id, invoice_id, opts = {}) + data, _status_code, _headers = get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts) + data + end + + # Allows you to retrieve a URL to an online invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param [Hash] opts the optional parameters + # @return [Array<(OnlineInvoices, Integer, Hash)>] OnlineInvoices data, response status code and response headers + def get_online_invoice_with_http_info(xero_tenant_id, invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_online_invoice ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_online_invoice" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.get_online_invoice" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/OnlineInvoice'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'OnlineInvoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_online_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param organisation_id [String] The unique Xero identifier for an organisation + # @param [Hash] opts the optional parameters + # @return [CISOrgSetting] + def get_organisation_cis_settings(xero_tenant_id, organisation_id, opts = {}) + data, _status_code, _headers = get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts) + data + end + + # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param organisation_id [String] The unique Xero identifier for an organisation + # @param [Hash] opts the optional parameters + # @return [Array<(CISOrgSetting, Integer, Hash)>] CISOrgSetting data, response status code and response headers + def get_organisation_cis_settings_with_http_info(xero_tenant_id, organisation_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisation_cis_settings ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisation_cis_settings" + end + # verify the required parameter 'organisation_id' is set + if @api_client.config.client_side_validation && organisation_id.nil? + fail ArgumentError, "Missing the required parameter 'organisation_id' when calling AccountingApi.get_organisation_cis_settings" + end + # resource path + local_var_path = '/Organisation/{OrganisationID}/CISSettings'.sub('{' + 'OrganisationID' + '}', organisation_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'CISOrgSetting' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_organisation_cis_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Organisation details + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Organisations] + def get_organisations(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_organisations_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve Organisation details + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(Organisations, Integer, Hash)>] Organisations data, response status code and response headers + def get_organisations_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_organisations ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_organisations" + end + # resource path + local_var_path = '/Organisation' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Organisations' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_organisations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified overpayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param [Hash] opts the optional parameters + # @return [Overpayments] + def get_overpayment(xero_tenant_id, overpayment_id, opts = {}) + data, _status_code, _headers = get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts) + data + end + + # Allows you to retrieve a specified overpayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param [Hash] opts the optional parameters + # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers + def get_overpayment_with_http_info(xero_tenant_id, overpayment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayment" + end + # verify the required parameter 'overpayment_id' is set + if @api_client.config.client_side_validation && overpayment_id.nil? + fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment" + end + # resource path + local_var_path = '/Overpayments/{OverpaymentID}'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Overpayments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_overpayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an Overpayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_overpayment_history(xero_tenant_id, overpayment_id, opts = {}) + data, _status_code, _headers = get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts) + data + end + + # Allows you to retrieve a history records of an Overpayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param overpayment_id [String] Unique identifier for a Overpayment + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_overpayment_history_with_http_info(xero_tenant_id, overpayment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayment_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayment_history" + end + # verify the required parameter 'overpayment_id' is set + if @api_client.config.client_side_validation && overpayment_id.nil? + fail ArgumentError, "Missing the required parameter 'overpayment_id' when calling AccountingApi.get_overpayment_history" + end + # resource path + local_var_path = '/Overpayments/{OverpaymentID}/History'.sub('{' + 'OverpaymentID' + '}', overpayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_overpayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve overpayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Overpayments] + def get_overpayments(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_overpayments_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve overpayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers + def get_overpayments_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_overpayments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_overpayments" + end + # resource path + local_var_path = '/Overpayments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Overpayments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_overpayments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified payment for invoices and credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param [Hash] opts the optional parameters + # @return [Payments] + def get_payment(xero_tenant_id, payment_id, opts = {}) + data, _status_code, _headers = get_payment_with_http_info(xero_tenant_id, payment_id, opts) + data + end + + # Allows you to retrieve a specified payment for invoices and credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param [Hash] opts the optional parameters + # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers + def get_payment_with_http_info(xero_tenant_id, payment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payment" + end + # verify the required parameter 'payment_id' is set + if @api_client.config.client_side_validation && payment_id.nil? + fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.get_payment" + end + # resource path + local_var_path = '/Payments/{PaymentID}'.sub('{' + 'PaymentID' + '}', payment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Payments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve history records of a payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_payment_history(xero_tenant_id, payment_id, opts = {}) + data, _status_code, _headers = get_payment_history_with_http_info(xero_tenant_id, payment_id, opts) + data + end + + # Allows you to retrieve history records of a payment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param payment_id [String] Unique identifier for a Payment + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_payment_history_with_http_info(xero_tenant_id, payment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payment_history" + end + # verify the required parameter 'payment_id' is set + if @api_client.config.client_side_validation && payment_id.nil? + fail ArgumentError, "Missing the required parameter 'payment_id' when calling AccountingApi.get_payment_history" + end + # resource path + local_var_path = '/Payments/{PaymentID}/History'.sub('{' + 'PaymentID' + '}', payment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_payment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve payment services + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [PaymentServices] + def get_payment_services(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_payment_services_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve payment services + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers + def get_payment_services_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_payment_services ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payment_services" + end + # resource path + local_var_path = '/PaymentServices' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PaymentServices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_payment_services\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve payments for invoices and credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page Up to 100 payments will be returned in a single API call + # @return [Payments] + def get_payments(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_payments_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve payments for invoices and credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page Up to 100 payments will be returned in a single API call + # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers + def get_payments_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_payments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_payments" + end + # resource path + local_var_path = '/Payments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Payments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_payments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified prepayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for a PrePayment + # @param [Hash] opts the optional parameters + # @return [Prepayments] + def get_prepayment(xero_tenant_id, prepayment_id, opts = {}) + data, _status_code, _headers = get_prepayment_with_http_info(xero_tenant_id, prepayment_id, opts) + data + end + + # Allows you to retrieve a specified prepayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for a PrePayment + # @param [Hash] opts the optional parameters + # @return [Array<(Prepayments, Integer, Hash)>] Prepayments data, response status code and response headers + def get_prepayment_with_http_info(xero_tenant_id, prepayment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayment ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_prepayment" + end + # verify the required parameter 'prepayment_id' is set + if @api_client.config.client_side_validation && prepayment_id.nil? + fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.get_prepayment" + end + # resource path + local_var_path = '/Prepayments/{PrepaymentID}'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Prepayments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_prepayment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an Prepayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for a PrePayment + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_prepayment_history(xero_tenant_id, prepayment_id, opts = {}) + data, _status_code, _headers = get_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, opts) + data + end + + # Allows you to retrieve a history records of an Prepayment + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param prepayment_id [String] Unique identifier for a PrePayment + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_prepayment_history_with_http_info(xero_tenant_id, prepayment_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayment_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_prepayment_history" + end + # verify the required parameter 'prepayment_id' is set + if @api_client.config.client_side_validation && prepayment_id.nil? + fail ArgumentError, "Missing the required parameter 'prepayment_id' when calling AccountingApi.get_prepayment_history" + end + # resource path + local_var_path = '/Prepayments/{PrepaymentID}/History'.sub('{' + 'PrepaymentID' + '}', prepayment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_prepayment_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve prepayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Prepayments] + def get_prepayments(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_prepayments_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve prepayments + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Prepayments, Integer, Hash)>] Prepayments data, response status code and response headers + def get_prepayments_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_prepayments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_prepayments" + end + # resource path + local_var_path = '/Prepayments' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Prepayments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_prepayments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param [Hash] opts the optional parameters + # @return [PurchaseOrders] + def get_purchase_order(xero_tenant_id, purchase_order_id, opts = {}) + data, _status_code, _headers = get_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, opts) + data + end + + # Allows you to retrieve a specified purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param [Hash] opts the optional parameters + # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers + def get_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PurchaseOrders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve purchase orders as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for an Purchase Order + # @param [Hash] opts the optional parameters + # @return [File] + def get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id, opts = {}) + data, _status_code, _headers = get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts) + data + end + + # Allows you to retrieve purchase orders as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for an Purchase Order + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_as_pdf ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_as_pdf" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_as_pdf" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_number [String] Unique identifier for a PurchaseOrder + # @param [Hash] opts the optional parameters + # @return [PurchaseOrders] + def get_purchase_order_by_number(xero_tenant_id, purchase_order_number, opts = {}) + data, _status_code, _headers = get_purchase_order_by_number_with_http_info(xero_tenant_id, purchase_order_number, opts) + data + end + + # Allows you to retrieve a specified purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_number [String] Unique identifier for a PurchaseOrder + # @param [Hash] opts the optional parameters + # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers + def get_purchase_order_by_number_with_http_info(xero_tenant_id, purchase_order_number, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_by_number ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_by_number" + end + # verify the required parameter 'purchase_order_number' is set + if @api_client.config.client_side_validation && purchase_order_number.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_number' when calling AccountingApi.get_purchase_order_by_number" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderNumber}'.sub('{' + 'PurchaseOrderNumber' + '}', purchase_order_number.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PurchaseOrders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_by_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve history for PurchaseOrder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_purchase_order_history(xero_tenant_id, purchase_order_id, opts = {}) + data, _status_code, _headers = get_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, opts) + data + end + + # Allows you to retrieve history for PurchaseOrder + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_purchase_order_history_with_http_info(xero_tenant_id, purchase_order_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_history" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_history" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}/History'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :status Filter by purchase order status + # @option opts [String] :date_from Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + # @option opts [String] :date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. + # @return [PurchaseOrders] + def get_purchase_orders(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_purchase_orders_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :status Filter by purchase order status + # @option opts [String] :date_from Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + # @option opts [String] :date_to Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + # @option opts [String] :order Order by an any element + # @option opts [Integer] :page To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. + # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers + def get_purchase_orders_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_orders ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_orders" + end + allowable_values = ["DRAFT", "SUBMITTED", "AUTHORISED", "BILLED", "DELETED"] + if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) + fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/PurchaseOrders' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'DateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil? + query_params[:'DateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'PurchaseOrders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param [Hash] opts the optional parameters + # @return [Quotes] + def get_quote(xero_tenant_id, quote_id, opts = {}) + data, _status_code, _headers = get_quote_with_http_info(xero_tenant_id, quote_id, opts) + data + end + + # Allows you to retrieve a specified quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param [Hash] opts the optional parameters + # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers + def get_quote_with_http_info(xero_tenant_id, quote_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote" + end + # resource path + local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Quotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve quotes as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param [Hash] opts the optional parameters + # @return [File] + def get_quote_as_pdf(xero_tenant_id, quote_id, opts = {}) + data, _status_code, _headers = get_quote_as_pdf_with_http_info(xero_tenant_id, quote_id, opts) + data + end + + # Allows you to retrieve quotes as PDF files + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_quote_as_pdf_with_http_info(xero_tenant_id, quote_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_as_pdf ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_as_pdf" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_as_pdf" + end + # resource path + local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/pdf']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_quote_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachment on Quote by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param file_name [String] Name of the attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachment on Quote by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param file_name [String] Name of the attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_attachment_by_file_name" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_quote_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_quote_attachment_by_file_name" + end + # resource path + local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve specific Attachment on Quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param attachment_id [String] Unique identifier for Attachment object + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_quote_attachment_by_id_with_http_info(xero_tenant_id, quote_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve specific Attachment on Quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param attachment_id [String] Unique identifier for Attachment object + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_quote_attachment_by_id_with_http_info(xero_tenant_id, quote_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_attachment_by_id" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_quote_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_quote_attachment_by_id" + end + # resource path + local_var_path = '/Quotes/{QuoteID}/Attachments/{AttachmentID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments for Quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_quote_attachments(xero_tenant_id, quote_id, opts = {}) + data, _status_code, _headers = get_quote_attachments_with_http_info(xero_tenant_id, quote_id, opts) + data + end + + # Allows you to retrieve Attachments for Quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_quote_attachments_with_http_info(xero_tenant_id, quote_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_attachments" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_attachments" + end + # resource path + local_var_path = '/Quotes/{QuoteID}/Attachments'.sub('{' + 'QuoteID' + '}', quote_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_quote_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_quote_history(xero_tenant_id, quote_id, opts = {}) + data, _status_code, _headers = get_quote_history_with_http_info(xero_tenant_id, quote_id, opts) + data + end + + # Allows you to retrieve a history records of an quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_quote_history_with_http_info(xero_tenant_id, quote_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_quote_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quote_history" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.get_quote_history" + end + # resource path + local_var_path = '/Quotes/{QuoteID}/History'.sub('{' + 'QuoteID' + '}', quote_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_quote_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any sales quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [Date] :date_from Filter for quotes after a particular date + # @option opts [Date] :date_to Filter for quotes before a particular date + # @option opts [Date] :expiry_date_from Filter for quotes expiring after a particular date + # @option opts [Date] :expiry_date_to Filter for quotes before a particular date + # @option opts [String] :contact_id Filter for quotes belonging to a particular contact + # @option opts [String] :status Filter for quotes of a particular Status + # @option opts [Integer] :page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote + # @option opts [String] :order Order by an any element + # @return [Quotes] + def get_quotes(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_quotes_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any sales quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [Date] :date_from Filter for quotes after a particular date + # @option opts [Date] :date_to Filter for quotes before a particular date + # @option opts [Date] :expiry_date_from Filter for quotes expiring after a particular date + # @option opts [Date] :expiry_date_to Filter for quotes before a particular date + # @option opts [String] :contact_id Filter for quotes belonging to a particular contact + # @option opts [String] :status Filter for quotes of a particular Status + # @option opts [Integer] :page e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote + # @option opts [String] :order Order by an any element + # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers + def get_quotes_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_quotes ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_quotes" + end + # resource path + local_var_path = '/Quotes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'DateFrom'] = opts[:'date_from'] if !opts[:'date_from'].nil? + query_params[:'DateTo'] = opts[:'date_to'] if !opts[:'date_to'].nil? + query_params[:'ExpiryDateFrom'] = opts[:'expiry_date_from'] if !opts[:'expiry_date_from'].nil? + query_params[:'ExpiryDateTo'] = opts[:'expiry_date_to'] if !opts[:'expiry_date_to'].nil? + query_params[:'ContactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil? + query_params[:'Status'] = opts[:'status'] if !opts[:'status'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Quotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified draft expense claim receipts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Receipts] + def get_receipt(xero_tenant_id, receipt_id, opts = {}) + data, _status_code, _headers = get_receipt_with_http_info(xero_tenant_id, receipt_id, opts) + data + end + + # Allows you to retrieve a specified draft expense claim receipts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers + def get_receipt_with_http_info(xero_tenant_id, receipt_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Receipts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on expense claim receipts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param file_name [String] The name of the file being attached to the Receipt + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve Attachments on expense claim receipts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param file_name [String] The name of the file being attached to the Receipt + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_attachment_by_file_name" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_receipt_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_receipt_attachment_by_file_name" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on expense claim receipts by ID + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_receipt_attachment_by_id_with_http_info(xero_tenant_id, receipt_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve Attachments on expense claim receipts by ID + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_receipt_attachment_by_id_with_http_info(xero_tenant_id, receipt_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_attachment_by_id" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_receipt_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_receipt_attachment_by_id" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}/Attachments/{AttachmentID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments for expense claim receipts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_receipt_attachments(xero_tenant_id, receipt_id, opts = {}) + data, _status_code, _headers = get_receipt_attachments_with_http_info(xero_tenant_id, receipt_id, opts) + data + end + + # Allows you to retrieve Attachments for expense claim receipts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_receipt_attachments_with_http_info(xero_tenant_id, receipt_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_attachments" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_attachments" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}/Attachments'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_receipt_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a history records of an Receipt + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_receipt_history(xero_tenant_id, receipt_id, opts = {}) + data, _status_code, _headers = get_receipt_history_with_http_info(xero_tenant_id, receipt_id, opts) + data + end + + # Allows you to retrieve a history records of an Receipt + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_receipt_history_with_http_info(xero_tenant_id, receipt_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipt_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipt_history" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.get_receipt_history" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}/History'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_receipt_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve draft expense claim receipts for any user + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Receipts] + def get_receipts(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_receipts_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve draft expense claim receipts for any user + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers + def get_receipts_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_receipts ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_receipts" + end + # resource path + local_var_path = '/Receipts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Receipts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_receipts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param [Hash] opts the optional parameters + # @return [RepeatingInvoices] + def get_repeating_invoice(xero_tenant_id, repeating_invoice_id, opts = {}) + data, _status_code, _headers = get_repeating_invoice_with_http_info(xero_tenant_id, repeating_invoice_id, opts) + data + end + + # Allows you to retrieve a specified repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param [Hash] opts the optional parameters + # @return [Array<(RepeatingInvoices, Integer, Hash)>] RepeatingInvoices data, response status code and response headers + def get_repeating_invoice_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'RepeatingInvoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve specified attachment on repeating invoices by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param file_name [String] The name of the file being attached to a Repeating Invoice + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts = {}) + data, _status_code, _headers = get_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts) + data + end + + # Allows you to retrieve specified attachment on repeating invoices by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param file_name [String] The name of the file being attached to a Repeating Invoice + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_repeating_invoice_attachment_by_file_name" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified Attachments on repeating invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [File] + def get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts = {}) + data, _status_code, _headers = get_repeating_invoice_attachment_by_id_with_http_info(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts) + data + end + + # Allows you to retrieve a specified Attachments on repeating invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param attachment_id [String] Unique identifier for a Attachment + # @param content_type [String] The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf + # @param [Hash] opts the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_repeating_invoice_attachment_by_id_with_http_info(xero_tenant_id, repeating_invoice_id, attachment_id, content_type, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachment_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling AccountingApi.get_repeating_invoice_attachment_by_id" + end + # verify the required parameter 'content_type' is set + if @api_client.config.client_side_validation && content_type.nil? + fail ArgumentError, "Missing the required parameter 'content_type' when calling AccountingApi.get_repeating_invoice_attachment_by_id" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{AttachmentID}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'AttachmentID' + '}', attachment_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'contentType'] = content_type + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'File' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachment_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Attachments on repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param [Hash] opts the optional parameters + # @return [Attachments] + def get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id, opts = {}) + data, _status_code, _headers = get_repeating_invoice_attachments_with_http_info(xero_tenant_id, repeating_invoice_id, opts) + data + end + + # Allows you to retrieve Attachments on repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def get_repeating_invoice_attachments_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_attachments ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_attachments" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_attachments" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve history for a repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param [Hash] opts the optional parameters + # @return [HistoryRecords] + def get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, opts = {}) + data, _status_code, _headers = get_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, opts) + data + end + + # Allows you to retrieve history for a repeating invoice + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param [Hash] opts the optional parameters + # @return [Array<(HistoryRecords, Integer, Hash)>] HistoryRecords data, response status code and response headers + def get_repeating_invoice_history_with_http_info(xero_tenant_id, repeating_invoice_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoice_history ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoice_history" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.get_repeating_invoice_history" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/History'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'HistoryRecords' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoice_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve any repeating invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [RepeatingInvoices] + def get_repeating_invoices(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_repeating_invoices_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve any repeating invoices + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(RepeatingInvoices, Integer, Hash)>] RepeatingInvoices data, response status code and response headers + def get_repeating_invoices_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_repeating_invoices ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_repeating_invoices" + end + # resource path + local_var_path = '/RepeatingInvoices' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'RepeatingInvoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_repeating_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for AgedPayablesByContact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date of the Aged Payables By Contact report + # @option opts [Date] :from_date The from date of the Aged Payables By Contact report + # @option opts [Date] :to_date The to date of the Aged Payables By Contact report + # @return [ReportWithRows] + def get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts = {}) + data, _status_code, _headers = get_report_aged_payables_by_contact_with_http_info(xero_tenant_id, contact_id, opts) + data + end + + # Allows you to retrieve report for AgedPayablesByContact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date of the Aged Payables By Contact report + # @option opts [Date] :from_date The from date of the Aged Payables By Contact report + # @option opts [Date] :to_date The to date of the Aged Payables By Contact report + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_aged_payables_by_contact_with_http_info(xero_tenant_id, contact_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_aged_payables_by_contact ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_aged_payables_by_contact" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_report_aged_payables_by_contact" + end + # resource path + local_var_path = '/Reports/AgedPayablesByContact' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'contactId'] = contact_id + query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? + query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? + query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_aged_payables_by_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for AgedReceivablesByContact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date of the Aged Receivables By Contact report + # @option opts [Date] :from_date The from date of the Aged Receivables By Contact report + # @option opts [Date] :to_date The to date of the Aged Receivables By Contact report + # @return [ReportWithRows] + def get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts = {}) + data, _status_code, _headers = get_report_aged_receivables_by_contact_with_http_info(xero_tenant_id, contact_id, opts) + data + end + + # Allows you to retrieve report for AgedReceivablesByContact + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date of the Aged Receivables By Contact report + # @option opts [Date] :from_date The from date of the Aged Receivables By Contact report + # @option opts [Date] :to_date The to date of the Aged Receivables By Contact report + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_aged_receivables_by_contact_with_http_info(xero_tenant_id, contact_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_aged_receivables_by_contact ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_aged_receivables_by_contact" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.get_report_aged_receivables_by_contact" + end + # resource path + local_var_path = '/Reports/AgedReceivablesByContact' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'contactId'] = contact_id + query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? + query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? + query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_aged_receivables_by_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for BAS only valid for AU orgs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param report_id [String] Unique identifier for a Report + # @param [Hash] opts the optional parameters + # @return [ReportWithRows] + def get_report_ba_sor_gst(xero_tenant_id, report_id, opts = {}) + data, _status_code, _headers = get_report_ba_sor_gst_with_http_info(xero_tenant_id, report_id, opts) + data + end + + # Allows you to retrieve report for BAS only valid for AU orgs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param report_id [String] Unique identifier for a Report + # @param [Hash] opts the optional parameters + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_ba_sor_gst_with_http_info(xero_tenant_id, report_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ba_sor_gst ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_ba_sor_gst" + end + # verify the required parameter 'report_id' is set + if @api_client.config.client_side_validation && report_id.nil? + fail ArgumentError, "Missing the required parameter 'report_id' when calling AccountingApi.get_report_ba_sor_gst" + end + # resource path + local_var_path = '/Reports/{ReportID}'.sub('{' + 'ReportID' + '}', report_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_ba_sor_gst\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for BAS only valid for AU orgs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [ReportWithRows] + def get_report_ba_sor_gst_list(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_ba_sor_gst_list_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for BAS only valid for AU orgs + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_ba_sor_gst_list_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ba_sor_gst_list ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_ba_sor_gst_list" + end + # resource path + local_var_path = '/Reports' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_ba_sor_gst_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for BalanceSheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :date The date of the Balance Sheet report + # @option opts [Integer] :periods The number of periods for the Balance Sheet report + # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) + # @option opts [String] :tracking_option_id1 The tracking option 1 for the Balance Sheet report + # @option opts [String] :tracking_option_id2 The tracking option 2 for the Balance Sheet report + # @option opts [Boolean] :standard_layout The standard layout boolean for the Balance Sheet report + # @option opts [Boolean] :payments_only return a cash basis for the Balance Sheet report + # @return [ReportWithRows] + def get_report_balance_sheet(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_balance_sheet_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for BalanceSheet + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :date The date of the Balance Sheet report + # @option opts [Integer] :periods The number of periods for the Balance Sheet report + # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) + # @option opts [String] :tracking_option_id1 The tracking option 1 for the Balance Sheet report + # @option opts [String] :tracking_option_id2 The tracking option 2 for the Balance Sheet report + # @option opts [Boolean] :standard_layout The standard layout boolean for the Balance Sheet report + # @option opts [Boolean] :payments_only return a cash basis for the Balance Sheet report + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_balance_sheet_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_balance_sheet ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_balance_sheet" + end + allowable_values = ["MONTH", "QUARTER", "YEAR"] + if @api_client.config.client_side_validation && opts[:'timeframe'] && !allowable_values.include?(opts[:'timeframe']) + fail ArgumentError, "invalid value for \"timeframe\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/Reports/BalanceSheet' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? + query_params[:'periods'] = opts[:'periods'] if !opts[:'periods'].nil? + query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil? + query_params[:'trackingOptionID1'] = opts[:'tracking_option_id1'] if !opts[:'tracking_option_id1'].nil? + query_params[:'trackingOptionID2'] = opts[:'tracking_option_id2'] if !opts[:'tracking_option_id2'].nil? + query_params[:'standardLayout'] = opts[:'standard_layout'] if !opts[:'standard_layout'].nil? + query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_balance_sheet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for BankSummary + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :from_date The from date for the Bank Summary report e.g. 2018-03-31 + # @option opts [Date] :to_date The to date for the Bank Summary report e.g. 2018-03-31 + # @return [ReportWithRows] + def get_report_bank_summary(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_bank_summary_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for BankSummary + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :from_date The from date for the Bank Summary report e.g. 2018-03-31 + # @option opts [Date] :to_date The to date for the Bank Summary report e.g. 2018-03-31 + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_bank_summary_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_bank_summary ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_bank_summary" + end + # resource path + local_var_path = '/Reports/BankSummary' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? + query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_bank_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for Budget Summary + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 + # @option opts [Integer] :period The number of periods to compare (integer between 1 and 12) + # @option opts [Integer] :timeframe The period size to compare to (1=month, 3=quarter, 12=year) + # @return [ReportWithRows] + def get_report_budget_summary(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_budget_summary_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for Budget Summary + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 + # @option opts [Integer] :period The number of periods to compare (integer between 1 and 12) + # @option opts [Integer] :timeframe The period size to compare to (1=month, 3=quarter, 12=year) + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_budget_summary_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_budget_summary ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_budget_summary" + end + # resource path + local_var_path = '/Reports/BudgetSummary' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? + query_params[:'period'] = opts[:'period'] if !opts[:'period'].nil? + query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_budget_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for ExecutiveSummary + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 + # @return [ReportWithRows] + def get_report_executive_summary(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_executive_summary_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for ExecutiveSummary + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date for the Bank Summary report e.g. 2018-03-31 + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_executive_summary_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_executive_summary ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_executive_summary" + end + # resource path + local_var_path = '/Reports/ExecutiveSummary' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_executive_summary\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for ProfitAndLoss + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :from_date The from date for the ProfitAndLoss report e.g. 2018-03-31 + # @option opts [Date] :to_date The to date for the ProfitAndLoss report e.g. 2018-03-31 + # @option opts [Integer] :periods The number of periods to compare (integer between 1 and 12) + # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) + # @option opts [String] :tracking_category_id The trackingCategory 1 for the ProfitAndLoss report + # @option opts [String] :tracking_category_id2 The trackingCategory 2 for the ProfitAndLoss report + # @option opts [String] :tracking_option_id The tracking option 1 for the ProfitAndLoss report + # @option opts [String] :tracking_option_id2 The tracking option 2 for the ProfitAndLoss report + # @option opts [Boolean] :standard_layout Return the standard layout for the ProfitAndLoss report + # @option opts [Boolean] :payments_only Return cash only basis for the ProfitAndLoss report + # @return [ReportWithRows] + def get_report_profit_and_loss(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_profit_and_loss_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for ProfitAndLoss + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :from_date The from date for the ProfitAndLoss report e.g. 2018-03-31 + # @option opts [Date] :to_date The to date for the ProfitAndLoss report e.g. 2018-03-31 + # @option opts [Integer] :periods The number of periods to compare (integer between 1 and 12) + # @option opts [String] :timeframe The period size to compare to (MONTH, QUARTER, YEAR) + # @option opts [String] :tracking_category_id The trackingCategory 1 for the ProfitAndLoss report + # @option opts [String] :tracking_category_id2 The trackingCategory 2 for the ProfitAndLoss report + # @option opts [String] :tracking_option_id The tracking option 1 for the ProfitAndLoss report + # @option opts [String] :tracking_option_id2 The tracking option 2 for the ProfitAndLoss report + # @option opts [Boolean] :standard_layout Return the standard layout for the ProfitAndLoss report + # @option opts [Boolean] :payments_only Return cash only basis for the ProfitAndLoss report + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_profit_and_loss_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_profit_and_loss ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_profit_and_loss" + end + allowable_values = ["MONTH", "QUARTER", "YEAR"] + if @api_client.config.client_side_validation && opts[:'timeframe'] && !allowable_values.include?(opts[:'timeframe']) + fail ArgumentError, "invalid value for \"timeframe\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/Reports/ProfitAndLoss' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'fromDate'] = opts[:'from_date'] if !opts[:'from_date'].nil? + query_params[:'toDate'] = opts[:'to_date'] if !opts[:'to_date'].nil? + query_params[:'periods'] = opts[:'periods'] if !opts[:'periods'].nil? + query_params[:'timeframe'] = opts[:'timeframe'] if !opts[:'timeframe'].nil? + query_params[:'trackingCategoryID'] = opts[:'tracking_category_id'] if !opts[:'tracking_category_id'].nil? + query_params[:'trackingCategoryID2'] = opts[:'tracking_category_id2'] if !opts[:'tracking_category_id2'].nil? + query_params[:'trackingOptionID'] = opts[:'tracking_option_id'] if !opts[:'tracking_option_id'].nil? + query_params[:'trackingOptionID2'] = opts[:'tracking_option_id2'] if !opts[:'tracking_option_id2'].nil? + query_params[:'standardLayout'] = opts[:'standard_layout'] if !opts[:'standard_layout'].nil? + query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_profit_and_loss\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for TenNinetyNine + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :report_year The year of the 1099 report + # @return [Reports] + def get_report_ten_ninety_nine(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_ten_ninety_nine_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for TenNinetyNine + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :report_year The year of the 1099 report + # @return [Array<(Reports, Integer, Hash)>] Reports data, response status code and response headers + def get_report_ten_ninety_nine_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_ten_ninety_nine ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_ten_ninety_nine" + end + # resource path + local_var_path = '/Reports/TenNinetyNine' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'reportYear'] = opts[:'report_year'] if !opts[:'report_year'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Reports' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_ten_ninety_nine\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve report for TrialBalance + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date for the Trial Balance report e.g. 2018-03-31 + # @option opts [Boolean] :payments_only Return cash only basis for the Trial Balance report + # @return [ReportWithRows] + def get_report_trial_balance(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_report_trial_balance_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve report for TrialBalance + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Date] :date The date for the Trial Balance report e.g. 2018-03-31 + # @option opts [Boolean] :payments_only Return cash only basis for the Trial Balance report + # @return [Array<(ReportWithRows, Integer, Hash)>] ReportWithRows data, response status code and response headers + def get_report_trial_balance_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_report_trial_balance ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_report_trial_balance" + end + # resource path + local_var_path = '/Reports/TrialBalance' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil? + query_params[:'paymentsOnly'] = opts[:'payments_only'] if !opts[:'payments_only'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ReportWithRows' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_report_trial_balance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve Tax Rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [String] :tax_type Filter by tax type + # @return [TaxRates] + def get_tax_rates(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_tax_rates_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve Tax Rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [String] :tax_type Filter by tax type + # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers + def get_tax_rates_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_tax_rates ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_tax_rates" + end + # resource path + local_var_path = '/TaxRates' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'TaxType'] = opts[:'tax_type'] if !opts[:'tax_type'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TaxRates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_tax_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve tracking categories and options + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Boolean] :include_archived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response + # @return [TrackingCategories] + def get_tracking_categories(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_tracking_categories_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve tracking categories and options + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @option opts [Boolean] :include_archived e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response + # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers + def get_tracking_categories_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_tracking_categories ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_tracking_categories" + end + # resource path + local_var_path = '/TrackingCategories' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TrackingCategories' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_tracking_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve tracking categories and options for specified category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + def get_tracking_category(xero_tenant_id, tracking_category_id, opts = {}) + data, _status_code, _headers = get_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts) + data + end + + # Allows you to retrieve tracking categories and options for specified category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers + def get_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_tracking_category ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_tracking_category" + end + # verify the required parameter 'tracking_category_id' is set + if @api_client.config.client_side_validation && tracking_category_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.get_tracking_category" + end + # resource path + local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TrackingCategories' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified user + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param user_id [String] Unique identifier for a User + # @param [Hash] opts the optional parameters + # @return [Users] + def get_user(xero_tenant_id, user_id, opts = {}) + data, _status_code, _headers = get_user_with_http_info(xero_tenant_id, user_id, opts) + data + end + + # Allows you to retrieve a specified user + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param user_id [String] Unique identifier for a User + # @param [Hash] opts the optional parameters + # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers + def get_user_with_http_info(xero_tenant_id, user_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_user ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_user" + end + # verify the required parameter 'user_id' is set + if @api_client.config.client_side_validation && user_id.nil? + fail ArgumentError, "Missing the required parameter 'user_id' when calling AccountingApi.get_user" + end + # resource path + local_var_path = '/Users/{UserID}'.sub('{' + 'UserID' + '}', user_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Users' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve users + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Users] + def get_users(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_users_with_http_info(xero_tenant_id, opts) + data + end + + # Allows you to retrieve users + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned + # @option opts [String] :where Filter by an any element + # @option opts [String] :order Order by an any element + # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers + def get_users_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.get_users ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_users" + end + # resource path + local_var_path = '/Users' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil? + query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil? + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Users' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for retrieving single object + # @param accounts [Accounts] Request of type Accounts array with one Account + # @param [Hash] opts the optional parameters + # @return [Accounts] + def update_account(xero_tenant_id, account_id, accounts, opts = {}) + data, _status_code, _headers = update_account_with_http_info(xero_tenant_id, account_id, accounts, opts) + data + end + + # Allows you to update a chart of accounts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for retrieving single object + # @param accounts [Accounts] Request of type Accounts array with one Account + # @param [Hash] opts the optional parameters + # @return [Array<(Accounts, Integer, Hash)>] Accounts data, response status code and response headers + def update_account_with_http_info(xero_tenant_id, account_id, accounts, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_account ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_account" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.update_account" + end + # verify the required parameter 'accounts' is set + if @api_client.config.client_side_validation && accounts.nil? + fail ArgumentError, "Missing the required parameter 'accounts' when calling AccountingApi.update_account" + end + # resource path + local_var_path = '/Accounts/{AccountID}'.sub('{' + 'AccountID' + '}', account_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(accounts) + + # return_type + return_type = opts[:return_type] || 'Accounts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_account\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update Attachment on Account by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body, opts = {}) + data, _status_code, _headers = update_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts) + data + end + + # Allows you to update Attachment on Account by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param account_id [String] Unique identifier for Account object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_account_attachment_by_file_name_with_http_info(xero_tenant_id, account_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_account_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_account_attachment_by_file_name" + end + # verify the required parameter 'account_id' is set + if @api_client.config.client_side_validation && account_id.nil? + fail ArgumentError, "Missing the required parameter 'account_id' when calling AccountingApi.update_account_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_account_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_account_attachment_by_file_name" + end + # resource path + local_var_path = '/Accounts/{AccountID}/Attachments/{FileName}'.sub('{' + 'AccountID' + '}', account_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_account_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a single spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param bank_transactions [BankTransactions] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [BankTransactions] + def update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {}) + data, _status_code, _headers = update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts) + data + end + + # Allows you to update a single spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param bank_transactions [BankTransactions] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers + def update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transaction" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction" + end + # verify the required parameter 'bank_transactions' is set + if @api_client.config.client_side_validation && bank_transactions.nil? + fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_bank_transaction" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(bank_transactions) + + # return_type + return_type = opts[:return_type] || 'BankTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_bank_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update an Attachment on BankTransaction by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param file_name [String] The name of the file being attached + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) + data, _status_code, _headers = update_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts) + data + end + + # Allows you to update an Attachment on BankTransaction by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction + # @param file_name [String] The name of the file being attached + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_bank_transaction_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transaction_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'bank_transaction_id' is set + if @api_client.config.client_side_validation && bank_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_bank_transaction_attachment_by_file_name" + end + # resource path + local_var_path = '/BankTransactions/{BankTransactionID}/Attachments/{FileName}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_bank_transaction_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param file_name [String] The name of the file being attached to a Bank Transfer + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) + data, _status_code, _headers = update_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts) + data + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transfer_id [String] Xero generated unique identifier for a bank transfer + # @param file_name [String] The name of the file being attached to a Bank Transfer + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_bank_transfer_attachment_by_file_name_with_http_info(xero_tenant_id, bank_transfer_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transfer_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'bank_transfer_id' is set + if @api_client.config.client_side_validation && bank_transfer_id.nil? + fail ArgumentError, "Missing the required parameter 'bank_transfer_id' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_bank_transfer_attachment_by_file_name" + end + # resource path + local_var_path = '/BankTransfers/{BankTransferID}/Attachments/{FileName}'.sub('{' + 'BankTransferID' + '}', bank_transfer_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_bank_transfer_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param contacts [Contacts] an array of Contacts containing single Contact object with properties to update + # @param [Hash] opts the optional parameters + # @return [Contacts] + def update_contact(xero_tenant_id, contact_id, contacts, opts = {}) + data, _status_code, _headers = update_contact_with_http_info(xero_tenant_id, contact_id, contacts, opts) + data + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param contacts [Contacts] an array of Contacts containing single Contact object with properties to update + # @param [Hash] opts the optional parameters + # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers + def update_contact_with_http_info(xero_tenant_id, contact_id, contacts, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_contact" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.update_contact" + end + # verify the required parameter 'contacts' is set + if @api_client.config.client_side_validation && contacts.nil? + fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.update_contact" + end + # resource path + local_var_path = '/Contacts/{ContactID}'.sub('{' + 'ContactID' + '}', contact_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(contacts) + + # return_type + return_type = opts[:return_type] || 'Contacts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param file_name [String] Name for the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body, opts = {}) + data, _status_code, _headers = update_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts) + data + end + + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_id [String] Unique identifier for a Contact + # @param file_name [String] Name for the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_contact_attachment_by_file_name_with_http_info(xero_tenant_id, contact_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_contact_attachment_by_file_name" + end + # verify the required parameter 'contact_id' is set + if @api_client.config.client_side_validation && contact_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_id' when calling AccountingApi.update_contact_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_contact_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_contact_attachment_by_file_name" + end + # resource path + local_var_path = '/Contacts/{ContactID}/Attachments/{FileName}'.sub('{' + 'ContactID' + '}', contact_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_contact_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param contact_groups [ContactGroups] an array of Contact groups with Name of specific group to update + # @param [Hash] opts the optional parameters + # @return [ContactGroups] + def update_contact_group(xero_tenant_id, contact_group_id, contact_groups, opts = {}) + data, _status_code, _headers = update_contact_group_with_http_info(xero_tenant_id, contact_group_id, contact_groups, opts) + data + end + + # Allows you to update a Contact Group + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contact_group_id [String] Unique identifier for a Contact Group + # @param contact_groups [ContactGroups] an array of Contact groups with Name of specific group to update + # @param [Hash] opts the optional parameters + # @return [Array<(ContactGroups, Integer, Hash)>] ContactGroups data, response status code and response headers + def update_contact_group_with_http_info(xero_tenant_id, contact_group_id, contact_groups, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_contact_group ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_contact_group" + end + # verify the required parameter 'contact_group_id' is set + if @api_client.config.client_side_validation && contact_group_id.nil? + fail ArgumentError, "Missing the required parameter 'contact_group_id' when calling AccountingApi.update_contact_group" + end + # verify the required parameter 'contact_groups' is set + if @api_client.config.client_side_validation && contact_groups.nil? + fail ArgumentError, "Missing the required parameter 'contact_groups' when calling AccountingApi.update_contact_group" + end + # resource path + local_var_path = '/ContactGroups/{ContactGroupID}'.sub('{' + 'ContactGroupID' + '}', contact_group_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(contact_groups) + + # return_type + return_type = opts[:return_type] || 'ContactGroups' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_contact_group\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specific credit note + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param credit_notes [CreditNotes] an array of Credit Notes containing credit note details to update + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [CreditNotes] + def update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts = {}) + data, _status_code, _headers = update_credit_note_with_http_info(xero_tenant_id, credit_note_id, credit_notes, opts) + data + end + + # Allows you to update a specific credit note + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param credit_notes [CreditNotes] an array of Credit Notes containing credit note details to update + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers + def update_credit_note_with_http_info(xero_tenant_id, credit_note_id, credit_notes, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_credit_note ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_credit_note" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.update_credit_note" + end + # verify the required parameter 'credit_notes' is set + if @api_client.config.client_side_validation && credit_notes.nil? + fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.update_credit_note" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(credit_notes) + + # return_type + return_type = opts[:return_type] || 'CreditNotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_credit_note\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update Attachments on CreditNote by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param file_name [String] Name of the file you are attaching to Credit Note + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {}) + data, _status_code, _headers = update_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts) + data + end + + # Allows you to update Attachments on CreditNote by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_note_id [String] Unique identifier for a Credit Note + # @param file_name [String] Name of the file you are attaching to Credit Note + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_credit_note_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_credit_note_attachment_by_file_name" + end + # verify the required parameter 'credit_note_id' is set + if @api_client.config.client_side_validation && credit_note_id.nil? + fail ArgumentError, "Missing the required parameter 'credit_note_id' when calling AccountingApi.update_credit_note_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_credit_note_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_credit_note_attachment_by_file_name" + end + # resource path + local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_credit_note_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update specified expense claims + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param expense_claims [ExpenseClaims] + # @param [Hash] opts the optional parameters + # @return [ExpenseClaims] + def update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims, opts = {}) + data, _status_code, _headers = update_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, expense_claims, opts) + data + end + + # Allows you to update specified expense claims + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param expense_claim_id [String] Unique identifier for a ExpenseClaim + # @param expense_claims [ExpenseClaims] + # @param [Hash] opts the optional parameters + # @return [Array<(ExpenseClaims, Integer, Hash)>] ExpenseClaims data, response status code and response headers + def update_expense_claim_with_http_info(xero_tenant_id, expense_claim_id, expense_claims, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_expense_claim ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_expense_claim" + end + # verify the required parameter 'expense_claim_id' is set + if @api_client.config.client_side_validation && expense_claim_id.nil? + fail ArgumentError, "Missing the required parameter 'expense_claim_id' when calling AccountingApi.update_expense_claim" + end + # verify the required parameter 'expense_claims' is set + if @api_client.config.client_side_validation && expense_claims.nil? + fail ArgumentError, "Missing the required parameter 'expense_claims' when calling AccountingApi.update_expense_claim" + end + # resource path + local_var_path = '/ExpenseClaims/{ExpenseClaimID}'.sub('{' + 'ExpenseClaimID' + '}', expense_claim_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(expense_claims) + + # return_type + return_type = opts[:return_type] || 'ExpenseClaims' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_expense_claim\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param invoices [Invoices] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Invoices] + def update_invoice(xero_tenant_id, invoice_id, invoices, opts = {}) + data, _status_code, _headers = update_invoice_with_http_info(xero_tenant_id, invoice_id, invoices, opts) + data + end + + # Allows you to update a specified sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param invoices [Invoices] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers + def update_invoice_with_http_info(xero_tenant_id, invoice_id, invoices, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_invoice ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_invoice" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.update_invoice" + end + # verify the required parameter 'invoices' is set + if @api_client.config.client_side_validation && invoices.nil? + fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.update_invoice" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(invoices) + + # return_type + return_type = opts[:return_type] || 'Invoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_invoice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update Attachment on invoices or purchase bills by it's filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param file_name [String] Name of the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {}) + data, _status_code, _headers = update_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts) + data + end + + # Allows you to update Attachment on invoices or purchase bills by it's filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoice_id [String] Unique identifier for an Invoice + # @param file_name [String] Name of the file you are attaching + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_invoice_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_invoice_attachment_by_file_name" + end + # verify the required parameter 'invoice_id' is set + if @api_client.config.client_side_validation && invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'invoice_id' when calling AccountingApi.update_invoice_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_invoice_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_invoice_attachment_by_file_name" + end + # resource path + local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param items [Items] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Items] + def update_item(xero_tenant_id, item_id, items, opts = {}) + data, _status_code, _headers = update_item_with_http_info(xero_tenant_id, item_id, items, opts) + data + end + + # Allows you to update a specified item + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param item_id [String] Unique identifier for an Item + # @param items [Items] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers + def update_item_with_http_info(xero_tenant_id, item_id, items, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_item ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_item" + end + # verify the required parameter 'item_id' is set + if @api_client.config.client_side_validation && item_id.nil? + fail ArgumentError, "Missing the required parameter 'item_id' when calling AccountingApi.update_item" + end + # verify the required parameter 'items' is set + if @api_client.config.client_side_validation && items.nil? + fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.update_item" + end + # resource path + local_var_path = '/Items/{ItemID}'.sub('{' + 'ItemID' + '}', item_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(items) + + # return_type + return_type = opts[:return_type] || 'Items' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_item\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction + # @param linked_transactions [LinkedTransactions] + # @param [Hash] opts the optional parameters + # @return [LinkedTransactions] + def update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions, opts = {}) + data, _status_code, _headers = update_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, linked_transactions, opts) + data + end + + # Allows you to update a specified linked transactions (billable expenses) + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param linked_transaction_id [String] Unique identifier for a LinkedTransaction + # @param linked_transactions [LinkedTransactions] + # @param [Hash] opts the optional parameters + # @return [Array<(LinkedTransactions, Integer, Hash)>] LinkedTransactions data, response status code and response headers + def update_linked_transaction_with_http_info(xero_tenant_id, linked_transaction_id, linked_transactions, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_linked_transaction ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_linked_transaction" + end + # verify the required parameter 'linked_transaction_id' is set + if @api_client.config.client_side_validation && linked_transaction_id.nil? + fail ArgumentError, "Missing the required parameter 'linked_transaction_id' when calling AccountingApi.update_linked_transaction" + end + # verify the required parameter 'linked_transactions' is set + if @api_client.config.client_side_validation && linked_transactions.nil? + fail ArgumentError, "Missing the required parameter 'linked_transactions' when calling AccountingApi.update_linked_transaction" + end + # resource path + local_var_path = '/LinkedTransactions/{LinkedTransactionID}'.sub('{' + 'LinkedTransactionID' + '}', linked_transaction_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(linked_transactions) + + # return_type + return_type = opts[:return_type] || 'LinkedTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_linked_transaction\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified manual journal + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param manual_journals [ManualJournals] + # @param [Hash] opts the optional parameters + # @return [ManualJournals] + def update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals, opts = {}) + data, _status_code, _headers = update_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, manual_journals, opts) + data + end + + # Allows you to update a specified manual journal + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param manual_journals [ManualJournals] + # @param [Hash] opts the optional parameters + # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers + def update_manual_journal_with_http_info(xero_tenant_id, manual_journal_id, manual_journals, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_manual_journal ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_manual_journal" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.update_manual_journal" + end + # verify the required parameter 'manual_journals' is set + if @api_client.config.client_side_validation && manual_journals.nil? + fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.update_manual_journal" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(manual_journals) + + # return_type + return_type = opts[:return_type] || 'ManualJournals' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_manual_journal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified Attachment on ManualJournal by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param file_name [String] The name of the file being attached to a ManualJournal + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) + data, _status_code, _headers = update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts) + data + end + + # Allows you to update a specified Attachment on ManualJournal by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journal_id [String] Unique identifier for a ManualJournal + # @param file_name [String] The name of the file being attached to a ManualJournal + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_manual_journal_attachment_by_file_name_with_http_info(xero_tenant_id, manual_journal_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_manual_journal_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'manual_journal_id' is set + if @api_client.config.client_side_validation && manual_journal_id.nil? + fail ArgumentError, "Missing the required parameter 'manual_journal_id' when calling AccountingApi.update_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_manual_journal_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_manual_journal_attachment_by_file_name" + end + # resource path + local_var_path = '/ManualJournals/{ManualJournalID}/Attachments/{FileName}'.sub('{' + 'ManualJournalID' + '}', manual_journal_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_manual_journal_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update or create one or more spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transactions [BankTransactions] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [BankTransactions] + def update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts = {}) + data, _status_code, _headers = update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts) + data + end + + # Allows you to update or create one or more spend or receive money transaction + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param bank_transactions [BankTransactions] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers + def update_or_create_bank_transactions_with_http_info(xero_tenant_id, bank_transactions, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_bank_transactions ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_bank_transactions" + end + # verify the required parameter 'bank_transactions' is set + if @api_client.config.client_side_validation && bank_transactions.nil? + fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_or_create_bank_transactions" + end + # resource path + local_var_path = '/BankTransactions' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(bank_transactions) + + # return_type + return_type = opts[:return_type] || 'BankTransactions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_bank_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update OR create one or more contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contacts [Contacts] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Contacts] + def update_or_create_contacts(xero_tenant_id, contacts, opts = {}) + data, _status_code, _headers = update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts) + data + end + + # Allows you to update OR create one or more contacts in a Xero organisation + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param contacts [Contacts] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers + def update_or_create_contacts_with_http_info(xero_tenant_id, contacts, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_contacts ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_contacts" + end + # verify the required parameter 'contacts' is set + if @api_client.config.client_side_validation && contacts.nil? + fail ArgumentError, "Missing the required parameter 'contacts' when calling AccountingApi.update_or_create_contacts" + end + # resource path + local_var_path = '/Contacts' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(contacts) + + # return_type + return_type = opts[:return_type] || 'Contacts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update OR create one or more credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object. + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [CreditNotes] + def update_or_create_credit_notes(xero_tenant_id, credit_notes, opts = {}) + data, _status_code, _headers = update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts) + data + end + + # Allows you to update OR create one or more credit notes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param credit_notes [CreditNotes] an array of Credit Notes with a single CreditNote object. + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(CreditNotes, Integer, Hash)>] CreditNotes data, response status code and response headers + def update_or_create_credit_notes_with_http_info(xero_tenant_id, credit_notes, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_credit_notes ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_credit_notes" + end + # verify the required parameter 'credit_notes' is set + if @api_client.config.client_side_validation && credit_notes.nil? + fail ArgumentError, "Missing the required parameter 'credit_notes' when calling AccountingApi.update_or_create_credit_notes" + end + # resource path + local_var_path = '/CreditNotes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(credit_notes) + + # return_type + return_type = opts[:return_type] || 'CreditNotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_credit_notes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a single new employees used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employees [Employees] Employees with array of Employee object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Employees] + def update_or_create_employees(xero_tenant_id, employees, opts = {}) + data, _status_code, _headers = update_or_create_employees_with_http_info(xero_tenant_id, employees, opts) + data + end + + # Allows you to create a single new employees used in Xero payrun + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param employees [Employees] Employees with array of Employee object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Employees, Integer, Hash)>] Employees data, response status code and response headers + def update_or_create_employees_with_http_info(xero_tenant_id, employees, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_employees ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_employees" + end + # verify the required parameter 'employees' is set + if @api_client.config.client_side_validation && employees.nil? + fail ArgumentError, "Missing the required parameter 'employees' when calling AccountingApi.update_or_create_employees" + end + # resource path + local_var_path = '/Employees' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(employees) + + # return_type + return_type = opts[:return_type] || 'Employees' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_employees\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update OR create one or more sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoices [Invoices] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Invoices] + def update_or_create_invoices(xero_tenant_id, invoices, opts = {}) + data, _status_code, _headers = update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts) + data + end + + # Allows you to update OR create one or more sales invoices or purchase bills + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param invoices [Invoices] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers + def update_or_create_invoices_with_http_info(xero_tenant_id, invoices, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_invoices ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_invoices" + end + # verify the required parameter 'invoices' is set + if @api_client.config.client_side_validation && invoices.nil? + fail ArgumentError, "Missing the required parameter 'invoices' when calling AccountingApi.update_or_create_invoices" + end + # resource path + local_var_path = '/Invoices' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(invoices) + + # return_type + return_type = opts[:return_type] || 'Invoices' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_invoices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update or create one or more items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param items [Items] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Items] + def update_or_create_items(xero_tenant_id, items, opts = {}) + data, _status_code, _headers = update_or_create_items_with_http_info(xero_tenant_id, items, opts) + data + end + + # Allows you to update or create one or more items + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param items [Items] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Items, Integer, Hash)>] Items data, response status code and response headers + def update_or_create_items_with_http_info(xero_tenant_id, items, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_items ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_items" + end + # verify the required parameter 'items' is set + if @api_client.config.client_side_validation && items.nil? + fail ArgumentError, "Missing the required parameter 'items' when calling AccountingApi.update_or_create_items" + end + # resource path + local_var_path = '/Items' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(items) + + # return_type + return_type = opts[:return_type] || 'Items' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a single manual journal + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [ManualJournals] + def update_or_create_manual_journals(xero_tenant_id, manual_journals, opts = {}) + data, _status_code, _headers = update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts) + data + end + + # Allows you to create a single manual journal + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param manual_journals [ManualJournals] ManualJournals array with ManualJournal object in body of request + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(ManualJournals, Integer, Hash)>] ManualJournals data, response status code and response headers + def update_or_create_manual_journals_with_http_info(xero_tenant_id, manual_journals, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_manual_journals ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_manual_journals" + end + # verify the required parameter 'manual_journals' is set + if @api_client.config.client_side_validation && manual_journals.nil? + fail ArgumentError, "Missing the required parameter 'manual_journals' when calling AccountingApi.update_or_create_manual_journals" + end + # resource path + local_var_path = '/ManualJournals' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(manual_journals) + + # return_type + return_type = opts[:return_type] || 'ManualJournals' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_manual_journals\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update or create one or more purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_orders [PurchaseOrders] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [PurchaseOrders] + def update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts = {}) + data, _status_code, _headers = update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts) + data + end + + # Allows you to update or create one or more purchase orders + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_orders [PurchaseOrders] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers + def update_or_create_purchase_orders_with_http_info(xero_tenant_id, purchase_orders, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_purchase_orders ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_purchase_orders" + end + # verify the required parameter 'purchase_orders' is set + if @api_client.config.client_side_validation && purchase_orders.nil? + fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.update_or_create_purchase_orders" + end + # resource path + local_var_path = '/PurchaseOrders' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(purchase_orders) + + # return_type + return_type = opts[:return_type] || 'PurchaseOrders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_purchase_orders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update OR create one or more quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quotes [Quotes] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false) + # @return [Quotes] + def update_or_create_quotes(xero_tenant_id, quotes, opts = {}) + data, _status_code, _headers = update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts) + data + end + + # Allows you to update OR create one or more quotes + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quotes [Quotes] + # @param [Hash] opts the optional parameters + # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors + # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers + def update_or_create_quotes_with_http_info(xero_tenant_id, quotes, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_or_create_quotes ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_or_create_quotes" + end + # verify the required parameter 'quotes' is set + if @api_client.config.client_side_validation && quotes.nil? + fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.update_or_create_quotes" + end + # resource path + local_var_path = '/Quotes' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(quotes) + + # return_type + return_type = opts[:return_type] || 'Quotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_or_create_quotes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified purchase order + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param purchase_orders [PurchaseOrders] + # @param [Hash] opts the optional parameters + # @return [PurchaseOrders] + def update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders, opts = {}) + data, _status_code, _headers = update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purchase_orders, opts) + data + end + + # Allows you to update a specified purchase order + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param purchase_order_id [String] Unique identifier for a PurchaseOrder + # @param purchase_orders [PurchaseOrders] + # @param [Hash] opts the optional parameters + # @return [Array<(PurchaseOrders, Integer, Hash)>] PurchaseOrders data, response status code and response headers + def update_purchase_order_with_http_info(xero_tenant_id, purchase_order_id, purchase_orders, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_purchase_order ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_purchase_order" + end + # verify the required parameter 'purchase_order_id' is set + if @api_client.config.client_side_validation && purchase_order_id.nil? + fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.update_purchase_order" + end + # verify the required parameter 'purchase_orders' is set + if @api_client.config.client_side_validation && purchase_orders.nil? + fail ArgumentError, "Missing the required parameter 'purchase_orders' when calling AccountingApi.update_purchase_order" + end + # resource path + local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(purchase_orders) + + # return_type + return_type = opts[:return_type] || 'PurchaseOrders' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_purchase_order\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update a specified quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param quotes [Quotes] + # @param [Hash] opts the optional parameters + # @return [Quotes] + def update_quote(xero_tenant_id, quote_id, quotes, opts = {}) + data, _status_code, _headers = update_quote_with_http_info(xero_tenant_id, quote_id, quotes, opts) + data + end + + # Allows you to update a specified quote + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for an Quote + # @param quotes [Quotes] + # @param [Hash] opts the optional parameters + # @return [Array<(Quotes, Integer, Hash)>] Quotes data, response status code and response headers + def update_quote_with_http_info(xero_tenant_id, quote_id, quotes, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_quote ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_quote" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.update_quote" + end + # verify the required parameter 'quotes' is set + if @api_client.config.client_side_validation && quotes.nil? + fail ArgumentError, "Missing the required parameter 'quotes' when calling AccountingApi.update_quote" + end + # resource path + local_var_path = '/Quotes/{QuoteID}'.sub('{' + 'QuoteID' + '}', quote_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(quotes) + + # return_type + return_type = opts[:return_type] || 'Quotes' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update Attachment on Quote by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body, opts = {}) + data, _status_code, _headers = update_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts) + data + end + + # Allows you to update Attachment on Quote by Filename + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param quote_id [String] Unique identifier for Quote object + # @param file_name [String] Name of the attachment + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_quote_attachment_by_file_name_with_http_info(xero_tenant_id, quote_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_quote_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_quote_attachment_by_file_name" + end + # verify the required parameter 'quote_id' is set + if @api_client.config.client_side_validation && quote_id.nil? + fail ArgumentError, "Missing the required parameter 'quote_id' when calling AccountingApi.update_quote_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_quote_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_quote_attachment_by_file_name" + end + # resource path + local_var_path = '/Quotes/{QuoteID}/Attachments/{FileName}'.sub('{' + 'QuoteID' + '}', quote_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_quote_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a specified draft expense claim receipts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param receipts [Receipts] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Receipts] + def update_receipt(xero_tenant_id, receipt_id, receipts, opts = {}) + data, _status_code, _headers = update_receipt_with_http_info(xero_tenant_id, receipt_id, receipts, opts) + data + end + + # Allows you to retrieve a specified draft expense claim receipts + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param receipts [Receipts] + # @param [Hash] opts the optional parameters + # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts + # @return [Array<(Receipts, Integer, Hash)>] Receipts data, response status code and response headers + def update_receipt_with_http_info(xero_tenant_id, receipt_id, receipts, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_receipt ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_receipt" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.update_receipt" + end + # verify the required parameter 'receipts' is set + if @api_client.config.client_side_validation && receipts.nil? + fail ArgumentError, "Missing the required parameter 'receipts' when calling AccountingApi.update_receipt" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(receipts) + + # return_type + return_type = opts[:return_type] || 'Receipts' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_receipt\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update Attachment on expense claim receipts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param file_name [String] The name of the file being attached to the Receipt + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body, opts = {}) + data, _status_code, _headers = update_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts) + data + end + + # Allows you to update Attachment on expense claim receipts by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param receipt_id [String] Unique identifier for a Receipt + # @param file_name [String] The name of the file being attached to the Receipt + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_receipt_attachment_by_file_name_with_http_info(xero_tenant_id, receipt_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_receipt_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_receipt_attachment_by_file_name" + end + # verify the required parameter 'receipt_id' is set + if @api_client.config.client_side_validation && receipt_id.nil? + fail ArgumentError, "Missing the required parameter 'receipt_id' when calling AccountingApi.update_receipt_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_receipt_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_receipt_attachment_by_file_name" + end + # resource path + local_var_path = '/Receipts/{ReceiptID}/Attachments/{FileName}'.sub('{' + 'ReceiptID' + '}', receipt_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_receipt_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update specified attachment on repeating invoices by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param file_name [String] The name of the file being attached to a Repeating Invoice + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Attachments] + def update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) + data, _status_code, _headers = update_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts) + data + end + + # Allows you to update specified attachment on repeating invoices by file name + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param repeating_invoice_id [String] Unique identifier for a Repeating Invoice + # @param file_name [String] The name of the file being attached to a Repeating Invoice + # @param body [String] Byte array of file in body of request + # @param [Hash] opts the optional parameters + # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers + def update_repeating_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, repeating_invoice_id, file_name, body, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_repeating_invoice_attachment_by_file_name ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'repeating_invoice_id' is set + if @api_client.config.client_side_validation && repeating_invoice_id.nil? + fail ArgumentError, "Missing the required parameter 'repeating_invoice_id' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'file_name' is set + if @api_client.config.client_side_validation && file_name.nil? + fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.update_repeating_invoice_attachment_by_file_name" + end + # resource path + local_var_path = '/RepeatingInvoices/{RepeatingInvoiceID}/Attachments/{FileName}'.sub('{' + 'RepeatingInvoiceID' + '}', repeating_invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/octet-stream']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:return_type] || 'Attachments' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_repeating_invoice_attachment_by_file_name\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update Tax Rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tax_rates [TaxRates] + # @param [Hash] opts the optional parameters + # @return [TaxRates] + def update_tax_rate(xero_tenant_id, tax_rates, opts = {}) + data, _status_code, _headers = update_tax_rate_with_http_info(xero_tenant_id, tax_rates, opts) + data + end + + # Allows you to update Tax Rates + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tax_rates [TaxRates] + # @param [Hash] opts the optional parameters + # @return [Array<(TaxRates, Integer, Hash)>] TaxRates data, response status code and response headers + def update_tax_rate_with_http_info(xero_tenant_id, tax_rates, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_tax_rate ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_tax_rate" + end + # verify the required parameter 'tax_rates' is set + if @api_client.config.client_side_validation && tax_rates.nil? + fail ArgumentError, "Missing the required parameter 'tax_rates' when calling AccountingApi.update_tax_rate" + end + # resource path + local_var_path = '/TaxRates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(tax_rates) + + # return_type + return_type = opts[:return_type] || 'TaxRates' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_tax_rate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_category [TrackingCategory] + # @param [Hash] opts the optional parameters + # @return [TrackingCategories] + def update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category, opts = {}) + data, _status_code, _headers = update_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, tracking_category, opts) + data + end + + # Allows you to update tracking categories + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_category [TrackingCategory] + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingCategories, Integer, Hash)>] TrackingCategories data, response status code and response headers + def update_tracking_category_with_http_info(xero_tenant_id, tracking_category_id, tracking_category, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_tracking_category ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_tracking_category" + end + # verify the required parameter 'tracking_category_id' is set + if @api_client.config.client_side_validation && tracking_category_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.update_tracking_category" + end + # verify the required parameter 'tracking_category' is set + if @api_client.config.client_side_validation && tracking_category.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category' when calling AccountingApi.update_tracking_category" + end + # resource path + local_var_path = '/TrackingCategories/{TrackingCategoryID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(tracking_category) + + # return_type + return_type = opts[:return_type] || 'TrackingCategories' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_tracking_category\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update options for a specified tracking category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_option_id [String] Unique identifier for a Tracking Option + # @param tracking_option [TrackingOption] + # @param [Hash] opts the optional parameters + # @return [TrackingOptions] + def update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts = {}) + data, _status_code, _headers = update_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts) + data + end + + # Allows you to update options for a specified tracking category + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param tracking_category_id [String] Unique identifier for a TrackingCategory + # @param tracking_option_id [String] Unique identifier for a Tracking Option + # @param tracking_option [TrackingOption] + # @param [Hash] opts the optional parameters + # @return [Array<(TrackingOptions, Integer, Hash)>] TrackingOptions data, response status code and response headers + def update_tracking_options_with_http_info(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AccountingApi.update_tracking_options ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_tracking_options" + end + # verify the required parameter 'tracking_category_id' is set + if @api_client.config.client_side_validation && tracking_category_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_category_id' when calling AccountingApi.update_tracking_options" + end + # verify the required parameter 'tracking_option_id' is set + if @api_client.config.client_side_validation && tracking_option_id.nil? + fail ArgumentError, "Missing the required parameter 'tracking_option_id' when calling AccountingApi.update_tracking_options" + end + # verify the required parameter 'tracking_option' is set + if @api_client.config.client_side_validation && tracking_option.nil? + fail ArgumentError, "Missing the required parameter 'tracking_option' when calling AccountingApi.update_tracking_options" + end + # resource path + local_var_path = '/TrackingCategories/{TrackingCategoryID}/Options/{TrackingOptionID}'.sub('{' + 'TrackingCategoryID' + '}', tracking_category_id.to_s).sub('{' + 'TrackingOptionID' + '}', tracking_option_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'xero-tenant-id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(tracking_option) + + # return_type + return_type = opts[:return_type] || 'TrackingOptions' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AccountingApi#update_tracking_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb new file mode 100644 index 00000000..e445fb3b --- /dev/null +++ b/lib/xero-ruby/api/asset_api.rb @@ -0,0 +1,452 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'cgi' + +module XeroRuby + class AssetApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.default) + @api_client = api_client + end + # adds a fixed asset + # Adds an asset to the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param asset [Asset] Fixed asset you are creating + # @param [Hash] opts the optional parameters + # @return [Asset] + def create_asset(xero_tenant_id, asset, opts = {}) + data, _status_code, _headers = create_asset_with_http_info(xero_tenant_id, asset, opts) + data + end + + # adds a fixed asset + # Adds an asset to the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param asset [Asset] Fixed asset you are creating + # @param [Hash] opts the optional parameters + # @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers + def create_asset_with_http_info(xero_tenant_id, asset, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AssetApi.create_asset ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset" + end + # verify the required parameter 'asset' is set + if @api_client.config.client_side_validation && asset.nil? + fail ArgumentError, "Missing the required parameter 'asset' when calling AssetApi.create_asset" + end + # resource path + local_var_path = '/Assets' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(asset) + + # return_type + return_type = opts[:return_type] || 'Asset' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AssetApi#create_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # adds a fixed asset type + # Adds an fixed asset type to the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [AssetType] :asset_type Asset type to add + # @return [AssetType] + def create_asset_type(xero_tenant_id, opts = {}) + data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, opts) + data + end + + # adds a fixed asset type + # Adds an fixed asset type to the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [AssetType] :asset_type Asset type to add + # @return [Array<(AssetType, Integer, Hash)>] AssetType data, response status code and response headers + def create_asset_type_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AssetApi.create_asset_type ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset_type" + end + # resource path + local_var_path = '/AssetTypes' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(opts[:'asset_type']) + + # return_type + return_type = opts[:return_type] || 'AssetType' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AssetApi#create_asset_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # retrieves fixed asset by id + # By passing in the appropriate asset id, you can search for a specific fixed asset in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] fixed asset id for single object + # @param [Hash] opts the optional parameters + # @return [Asset] + def get_asset_by_id(xero_tenant_id, id, opts = {}) + data, _status_code, _headers = get_asset_by_id_with_http_info(xero_tenant_id, id, opts) + data + end + + # retrieves fixed asset by id + # By passing in the appropriate asset id, you can search for a specific fixed asset in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param id [String] fixed asset id for single object + # @param [Hash] opts the optional parameters + # @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers + def get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_by_id ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_by_id" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling AssetApi.get_asset_by_id" + end + # resource path + local_var_path = '/Assets/{id}'.sub('{' + 'id' + '}', id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Asset' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AssetApi#get_asset_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches fixed asset settings + # By passing in the appropriate options, you can search for available fixed asset types in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Setting] + def get_asset_settings(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_asset_settings_with_http_info(xero_tenant_id, opts) + data + end + + # searches fixed asset settings + # By passing in the appropriate options, you can search for available fixed asset types in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(Setting, Integer, Hash)>] Setting data, response status code and response headers + def get_asset_settings_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_settings ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_settings" + end + # resource path + local_var_path = '/Settings' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Setting' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AssetApi#get_asset_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches fixed asset types + # By passing in the appropriate options, you can search for available fixed asset types in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array] + def get_asset_types(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_asset_types_with_http_info(xero_tenant_id, opts) + data + end + + # searches fixed asset types + # By passing in the appropriate options, you can search for available fixed asset types in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @return [Array<(Array, Integer, Hash)>] Array data, response status code and response headers + def get_asset_types_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_types ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_types" + end + # resource path + local_var_path = '/AssetTypes' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Array' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AssetApi#get_asset_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # searches fixed asset + # By passing in the appropriate options, you can search for available fixed asset in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1. + # @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10. + # @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + # @option opts [String] :sort_direction ASC or DESC + # @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. + # @return [Assets] + def get_assets(xero_tenant_id, status, opts = {}) + data, _status_code, _headers = get_assets_with_http_info(xero_tenant_id, status, opts) + data + end + + # searches fixed asset + # By passing in the appropriate options, you can search for available fixed asset in the system + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1. + # @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10. + # @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + # @option opts [String] :sort_direction ASC or DESC + # @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. + # @return [Array<(Assets, Integer, Hash)>] Assets data, response status code and response headers + def get_assets_with_http_info(xero_tenant_id, status, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: AssetApi.get_assets ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_assets" + end + # verify the required parameter 'status' is set + if @api_client.config.client_side_validation && status.nil? + fail ArgumentError, "Missing the required parameter 'status' when calling AssetApi.get_assets" + end + allowable_values = ["AssetType", "AssetName", "AssetNumber", "PurchaseDate", "PurchasePrice", "DisposalDate", "DisposalPrice"] + if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by']) + fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}" + end + allowable_values = ["asc", "desc"] + if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction']) + fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}" + end + allowable_values = ["AssetName", "AssetNumber", "Description", "AssetTypeName"] + if @api_client.config.client_side_validation && opts[:'filter_by'] && !allowable_values.include?(opts[:'filter_by']) + fail ArgumentError, "invalid value for \"filter_by\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/Assets' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'status'] = status + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil? + query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil? + query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Assets' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: AssetApi#get_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb new file mode 100644 index 00000000..c580498f --- /dev/null +++ b/lib/xero-ruby/api_client.rb @@ -0,0 +1,488 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'date' +require 'json' +require 'logger' +require 'tempfile' +require 'faraday' + +module XeroRuby + class ApiClient + # The Configuration object holding settings to be used in the API client. + attr_accessor :config + + # Defines the headers to be used in HTTP requests of all API calls by default. + # + # @return [Hash] + attr_accessor :default_headers + + # Initializes the ApiClient + # @option config [Configuration] Configuration for initializing the object, default to Configuration.default + def initialize(config: Configuration.default, credentials: {}) + @client_id = credentials[:client_id] + @client_secret = credentials[:client_secret] + @redirect_uri = credentials[:redirect_uri] + @scopes = credentials[:scopes] + @config = config + @user_agent = "xero-ruby-#{VERSION}" + @default_headers = { + 'Content-Type' => 'application/json', + 'User-Agent' => @user_agent + } + end + + def authorization_url + url = "#{@config.login_url}?response_type=code&client_id=#{@client_id}&redirect_uri=#{@redirect_uri}&scope=#{@scopes}" + return url + end + + def accounting_api + @config.base_url = @config.accounting_url + XeroRuby::AccountingApi.new(self) + end + + def asset_api + @config.base_url = @config.asset_url + XeroRuby::AssetApi.new(self) + end + + # Token Helpers + def token_set + XeroRuby.configure.token_set + end + + def access_token + XeroRuby.configure.access_token + end + + def set_token_set(token_set) + # helper to set the token_set on a client once the user has y + # has a valid token set ( access_token & refresh_token ) + XeroRuby.configure.token_set = token_set + set_access_token(token_set['access_token']) + end + + def set_access_token(access_token) + XeroRuby.configure.access_token = access_token + end + + def get_token_set_from_callback(params) + data = { + grant_type: 'authorization_code', + code: params['code'], + redirect_uri: @redirect_uri + } + return token_request(data) + end + + def refresh_token_set(token_set) + data = { + grant_type: 'refresh_token', + refresh_token: token_set['refresh_token'] + } + return token_request(data) + end + + def token_request(data) + response = Faraday.post(@config.token_url) do |req| + req.headers['Authorization'] = "Basic " + Base64.strict_encode64("#{@client_id}:#{@client_secret}") + req.headers['Content-Type'] = 'application/x-www-form-urlencoded' + req.body = URI.encode_www_form(data) + end + body = JSON.parse(response.body) + set_token_set(body) + return body + end + + # Connection heplers + def connections + response = Faraday.get('https://api.xero.com/connections') do |req| + req.headers['Authorization'] = "Bearer #{access_token}" + req.headers['Content-Type'] = 'application/json' + end + body = JSON.parse(response.body) + return body + end + + def disconnect(connection_id) + Faraday.delete("https://api.xero.com/connections/#{connection_id}") do |req| + req.headers['Authorization'] = "Bearer #{access_token}" + req.headers['Content-Type'] = 'application/json' + end + return connections + end + + # Call an API with given options. + # + # @return [Array<(Object, Integer, Hash)>] an array of 3 elements: + # the data deserialized from response body (could be nil), response status code and response headers. + def call_api(http_method, path, opts = {}) + ssl_options = { + :ca_file => @config.ssl_ca_file, + :verify => @config.ssl_verify, + :verify_mode => @config.ssl_verify_mode, + :client_cert => @config.ssl_client_cert, + :client_key => @config.ssl_client_key + } + + connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| + conn.basic_auth(config.username, config.password) + if opts[:header_params]["Content-Type"] == "multipart/form-data" + conn.request :multipart + conn.request :url_encoded + end + conn.adapter(Faraday.default_adapter) + end + + begin + response = connection.public_send(http_method.to_sym.downcase) do |req| + build_request(http_method, path, req, opts) + end + + if @config.debugging + @config.logger.debug "HTTP response body ~BEGIN~\n#{response.body}\n~END~\n" + end + + unless response.success? + if response.status == 0 + # Errors from libcurl will be made visible here + fail ApiError.new(:code => 0, + :message => response.return_message) + else + fail ApiError.new(:code => response.status, + :response_headers => response.headers, + :response_body => response.body), + response.reason_phrase + end + end + rescue Faraday::TimeoutError + fail ApiError.new('Connection timed out') + end + + if opts[:return_type] + data = deserialize(response, opts[:return_type]) + else + data = nil + end + return data, response.status, response.headers + end + + # Builds the HTTP request + # + # @param [String] http_method HTTP method/verb (e.g. POST) + # @param [String] path URL path (e.g. /account/new) + # @option opts [Hash] :header_params Header parameters + # @option opts [Hash] :query_params Query parameters + # @option opts [Hash] :form_params Query parameters + # @option opts [Object] :body HTTP body (JSON/XML) + # @return [Typhoeus::Request] A Typhoeus Request + def build_request(http_method, path, request, opts = {}) + url = build_request_url(path) + http_method = http_method.to_sym.downcase + + header_params = @default_headers.merge(opts[:header_params] || {}) + query_params = opts[:query_params] || {} + form_params = opts[:form_params] || {} + + update_params_for_auth! header_params, query_params, opts[:auth_names] + + req_opts = { + :method => http_method, + :headers => header_params, + :params => query_params, + :params_encoding => @config.params_encoding, + :timeout => @config.timeout, + :verbose => @config.debugging + } + + if [:post, :patch, :put, :delete].include?(http_method) + req_body = build_request_body(header_params, form_params, opts[:body]) + req_opts.update :body => req_body + if @config.debugging + @config.logger.debug "HTTP request body param ~BEGIN~\n#{req_body}\n~END~\n" + end + end + request.headers = header_params + request.body = req_body + request.url url + request.params = query_params + download_file(request) if opts[:return_type] == 'File' + request + end + + # Builds the HTTP request body + # + # @param [Hash] header_params Header parameters + # @param [Hash] form_params Query parameters + # @param [Object] body HTTP body (JSON/XML) + # @return [String] HTTP body data in the form of string + def build_request_body(header_params, form_params, body) + # http form + if header_params['Content-Type'] == 'application/x-www-form-urlencoded' + data = URI.encode_www_form(form_params) + elsif header_params['Content-Type'] == 'multipart/form-data' + data = {} + form_params.each do |key, value| + case value + when ::File, ::Tempfile + # TODO hardcode to application/octet-stream, need better way to detect content type + data[key] = Faraday::UploadIO.new(value.path, 'application/octet-stream', value.path) + when ::Array, nil + # let Faraday handle Array and nil parameters + data[key] = value + else + data[key] = value.to_s + end + end + elsif body + data = body.is_a?(String) ? body : body.to_json + else + data = nil + end + data + end + + # Check if the given MIME is a JSON MIME. + # JSON MIME examples: + # application/json + # application/json; charset=UTF8 + # APPLICATION/JSON + # */* + # @param [String] mime MIME + # @return [Boolean] True if the MIME is application/json + def json_mime?(mime) + (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil? + end + + # Deserialize the response to the given return type. + # + # @param [Response] response HTTP response + # @param [String] return_type some examples: "User", "Array", "Hash" + def deserialize(response, return_type) + body = response.body + + # handle file downloading - return the File instance processed in request callbacks + # note that response body is empty when the file is written in chunks in request on_body callback + return @tempfile if return_type == 'File' + + return nil if body.nil? || body.empty? + + # return response body directly for String return type + return body if return_type == 'String' + + # ensuring a default content type + content_type = response.headers['Content-Type'] || 'application/json' + + fail "Content-Type is not supported: #{content_type}" unless json_mime?(content_type) + + begin + data = JSON.parse("[#{body}]", :symbolize_names => true)[0] + rescue JSON::ParserError => e + if %w(String Date DateTime).include?(return_type) + data = body + else + raise e + end + end + + convert_to_type data, return_type + end + + # Convert data to the given return type. + # @param [Object] data Data to be converted + # @param [String] return_type Return type + # @return [Mixed] Data in a particular type + def convert_to_type(data, return_type) + return nil if data.nil? + case return_type + when 'String' + data.to_s + when 'Integer' + data.to_i + when 'Float' + data.to_f + when 'Boolean' + data == true + when 'DateTime' + # parse date time (expecting ISO 8601 format) + DateTime.parse data + when 'Date' + # parse date time (expecting ISO 8601 format) + Date.parse data + when 'Object' + # generic object (usually a Hash), return directly + data + when /\AArray<(.+)>\z/ + # e.g. Array + sub_type = $1 + data.map { |item| convert_to_type(item, sub_type) } + when /\AHash\\z/ + # e.g. Hash + sub_type = $1 + {}.tap do |hash| + data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } + end + else + begin + XeroRuby::Accounting.const_get(return_type).build_from_hash(data) + rescue + XeroRuby::Assets.const_get(return_type).build_from_hash(data) + # rescue + # XeroRuby::.const_get(return_type).build_from_hash(data) + end + end + end + + # Save response body into a file in (the defined) temporary folder, using the filename + # from the "Content-Disposition" header if provided, otherwise a random filename. + # The response body is written to the file in chunks in order to handle files which + # size is larger than maximum Ruby String or even larger than the maximum memory a Ruby + # process can use. + # + # @see Configuration#temp_folder_path + def download_file(request) + tempfile = nil + encoding = nil + request.on_headers do |response| + content_disposition = response.headers['Content-Disposition'] + if content_disposition && content_disposition =~ /filename=/i + filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1] + prefix = sanitize_filename(filename) + else + prefix = 'download-' + end + prefix = prefix + '-' unless prefix.end_with?('-') + encoding = response.body.encoding + tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding) + @tempfile = tempfile + end + request.on_body do |chunk| + chunk.force_encoding(encoding) + tempfile.write(chunk) + end + request.on_complete do |response| + tempfile.close if tempfile + @config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\ + "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\ + "will be deleted automatically with GC. It's also recommended to delete the temp file "\ + "explicitly with `tempfile.delete`" + end + end + + # Sanitize filename by removing path. + # e.g. ../../sun.gif becomes sun.gif + # + # @param [String] filename the filename to be sanitized + # @return [String] the sanitized filename + def sanitize_filename(filename) + filename.gsub(/.*[\/\\]/, '') + end + + def build_request_url(path) + # Add leading and trailing slashes to path + path = "/#{path}".gsub(/\/+/, '/') + @config.base_url + path + end + + # Update hearder and query params based on authentication settings. + # + # @param [Hash] header_params Header parameters + # @param [Hash] query_params Query parameters + # @param [String] auth_names Authentication scheme name + def update_params_for_auth!(header_params, query_params, auth_names) + Array(auth_names).each do |auth_name| + auth_setting = @config.auth_settings[auth_name] + next unless auth_setting + case auth_setting[:in] + when 'header' then header_params[auth_setting[:key]] = auth_setting[:value] + when 'query' then query_params[auth_setting[:key]] = auth_setting[:value] + else fail ArgumentError, 'Authentication token must be in `query` of `header`' + end + end + end + + # Sets user agent in HTTP header + # + # @param [String] user_agent User agent (e.g. openapi-generator/ruby/1.0.0) + def user_agent=(user_agent) + @user_agent = user_agent + @default_headers['User-Agent'] = @user_agent + end + + # Return Accept header based on an array of accepts provided. + # @param [Array] accepts array for Accept + # @return [String] the Accept header (e.g. application/json) + def select_header_accept(accepts) + return nil if accepts.nil? || accepts.empty? + # use JSON when present, otherwise use all of the provided + json_accept = accepts.find { |s| json_mime?(s) } + json_accept || accepts.join(',') + end + + # Return Content-Type header based on an array of content types provided. + # @param [Array] content_types array for Content-Type + # @return [String] the Content-Type header (e.g. application/json) + def select_header_content_type(content_types) + # use application/json by default + return 'application/json' if content_types.nil? || content_types.empty? + # use JSON when present, otherwise use the first one + json_content_type = content_types.find { |s| json_mime?(s) } + json_content_type || content_types.first + end + + # Convert object (array, hash, object, etc) to JSON string. + # @param [Object] model object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_http_body(model) + return model if model.nil? || model.is_a?(String) + local_body = nil + if model.is_a?(Array) + local_body = model.map { |m| object_to_hash(m) } + else + local_body = object_to_hash(model) + end + local_body.to_json + end + + # Convert object(non-array) to hash. + # @param [Object] obj object to be converted into JSON string + # @return [String] JSON string representation of the object + def object_to_hash(obj) + if obj.respond_to?(:to_hash) + obj.to_hash + else + obj + end + end + + # Build parameter value according to the given collection format. + # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi + def build_collection_param(param, collection_format) + case collection_format + when :csv + param.join(',') + when :ssv + param.join(' ') + when :tsv + param.join("\t") + when :pipes + param.join('|') + when :multi + # return the array directly as typhoeus will handle it as expected + param + else + fail "unknown collection format: #{collection_format.inspect}" + end + end + end +end diff --git a/lib/xero-ruby/api_error.rb b/lib/xero-ruby/api_error.rb new file mode 100644 index 00000000..fe6065f6 --- /dev/null +++ b/lib/xero-ruby/api_error.rb @@ -0,0 +1,57 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +module XeroRuby + class ApiError < StandardError + attr_reader :code, :response_headers, :response_body + + # Usage examples: + # ApiError.new + # ApiError.new("message") + # ApiError.new(:code => 500, :response_headers => {}, :response_body => "") + # ApiError.new(:code => 404, :message => "Not Found") + def initialize(arg = nil) + if arg.is_a? Hash + if arg.key?(:message) || arg.key?('message') + super(arg[:message] || arg['message']) + else + super arg + end + + arg.each do |k, v| + instance_variable_set "@#{k}", v + end + else + super arg + end + end + + # Override to_s to display a friendly error message + def to_s + message + end + + def message + if @message.nil? + msg = "Error message: the server returns an error" + else + msg = @message + end + + msg += "\nHTTP status code: #{code}" if code + msg += "\nResponse headers: #{response_headers}" if response_headers + msg += "\nResponse body: #{response_body}" if response_body + + msg + end + end +end diff --git a/lib/xero-ruby/configuration.rb b/lib/xero-ruby/configuration.rb new file mode 100644 index 00000000..53ff7624 --- /dev/null +++ b/lib/xero-ruby/configuration.rb @@ -0,0 +1,259 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +module XeroRuby + class Configuration + # Defines url scheme + attr_accessor :scheme + + # Defines url host + attr_accessor :host + + # Defines url base path & url for overwriting + attr_accessor :base_path + attr_accessor :base_url + + # Defines url for identity routes + attr_accessor :login_url + attr_accessor :token_url + + # Defines base paths for seperate API's + attr_accessor :accounting_url + attr_accessor :asset_url + + # Defines API keys used with API Key authentications. + # + # @return [Hash] key: parameter name, value: parameter value (API key) + # + # @example parameter name is "api_key", API key is "xxx" (e.g. "api_key=xxx" in query string) + # config.api_key['api_key'] = 'xxx' + attr_accessor :api_key + + # Defines API key prefixes used with API Key authentications. + # + # @return [Hash] key: parameter name, value: API key prefix + # + # @example parameter name is "Authorization", API key prefix is "Token" (e.g. "Authorization: Token xxx" in headers) + # config.api_key_prefix['api_key'] = 'Token' + attr_accessor :api_key_prefix + + # Defines the username used with HTTP basic authentication. + # + # @return [String] + attr_accessor :username + + # Defines the password used with HTTP basic authentication. + # + # @return [String] + attr_accessor :password + + # Defines the access token (Bearer) used with OAuth2. + attr_accessor :access_token + + # Defines the token set used with OAuth2. May include id/access/refresh token & other meta info. + attr_accessor :token_set + + # Set this to enable/disable debugging. When enabled (set to true), HTTP request/response + # details will be logged with `logger.debug` (see the `logger` attribute). + # Default to false. + # + # @return [true, false] + attr_accessor :debugging + + # Defines the logger used for debugging. + # Default to `Rails.logger` (when in Rails) or logging to STDOUT. + # + # @return [#debug] + attr_accessor :logger + + # Defines the temporary folder to store downloaded files + # (for API endpoints that have file response). + # Default to use `Tempfile`. + # + # @return [String] + attr_accessor :temp_folder_path + + # The time limit for HTTP request in seconds. + # Default to 0 (never times out). + attr_accessor :timeout + + # Set this to false to skip client side validation in the operation. + # Default to true. + # @return [true, false] + attr_accessor :client_side_validation + + ### TLS/SSL setting + # Set this to false to skip verifying SSL certificate when calling API from https server. + # Default to true. + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + # @return [true, false] + attr_accessor :ssl_verify + + ### TLS/SSL setting + # Any `OpenSSL::SSL::` constant (see https://ruby-doc.org/stdlib-2.5.1/libdoc/openssl/rdoc/OpenSSL/SSL.html) + # + # @note Do NOT set it to false in production code, otherwise you would face multiple types of cryptographic attacks. + # + attr_accessor :ssl_verify_mode + + ### TLS/SSL setting + # Set this to customize the certificate file to verify the peer. + # + # @return [String] the path to the certificate file + attr_accessor :ssl_ca_file + + ### TLS/SSL setting + # Client certificate file (for client certificate) + attr_accessor :ssl_client_cert + + ### TLS/SSL setting + # Client private key file (for client certificate) + attr_accessor :ssl_client_key + + # Set this to customize parameters encoding of array parameter with multi collectionFormat. + # Default to nil. + # + # @see The params_encoding option of Ethon. Related source code: + # https://github.com/typhoeus/ethon/blob/master/lib/ethon/easy/queryable.rb#L96 + attr_accessor :params_encoding + + attr_accessor :inject_format + + attr_accessor :force_ending_format + + def initialize + @scheme = 'https' + @host = 'api.xero.com' + @base_path = '/api.xro/2.0' + @login_url = 'https://login.xero.com/identity/connect/authorize' + @token_url = 'https://identity.xero.com/connect/token' + @accounting_url = 'https://api.xero.com/api.xro/2.0' + @asset_url = 'https://api.xero.com/assets.xro/1.0' + @api_key = {} + @api_key_prefix = {} + @timeout = 0 + @client_side_validation = true + @ssl_verify = true + @ssl_verify_mode = nil + @ssl_ca_file = nil + @ssl_client_cert = nil + @ssl_client_key = nil + @debugging = false + @inject_format = false + @force_ending_format = false + @logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT) + + yield(self) if block_given? + end + + # The default Configuration object. + def self.default + @@default ||= Configuration.new + end + + def configure + yield(self) if block_given? + end + + def scheme=(scheme) + # remove :// from scheme + @scheme = scheme.sub(/:\/\//, '') + end + + def host=(host) + # remove http(s):// and anything after a slash + @host = host.sub(/https?:\/\//, '').split('/').first + end + + def base_path=(base_path) + # Add leading and trailing slashes to base_path + @base_path = "/#{base_path}".gsub(/\/+/, '/') + @base_path = '' if @base_path == '/' + end + + def base_url=(api_url) + @base_url = api_url + end + + # Gets API key (with prefix if set). + # @param [String] param_name the parameter name of API key auth + def api_key_with_prefix(param_name) + if @api_key_prefix[param_name] + "#{@api_key_prefix[param_name]} #{@api_key[param_name]}" + else + @api_key[param_name] + end + end + + # Gets Basic Auth token string + def basic_auth_token + 'Basic ' + ["#{username}:#{password}"].pack('m').delete("\r\n") + end + + # Returns Auth Settings hash for api client. + def auth_settings + { + 'OAuth2' => + { + type: 'oauth2', + in: 'header', + key: 'Authorization', + value: "Bearer #{access_token}" + }, + } + end + + # Returns an array of Server setting + def server_settings + [ + { + url: "https://api.xero.com/api.xro/2.0", + description: "Xero Accounting API servers", + } + ] + end + + # Returns URL based on server settings + # + # @param index array index of the server settings + # @param variables hash of variable and the corresponding value + def server_url(index, variables = {}) + servers = server_settings + + # check array index out of bound + if (index < 0 || index >= servers.size) + fail ArgumentError, "Invalid index #{index} when selecting the server. Must be less than #{servers.size}" + end + + server = servers[index] + url = server[:url] + + # go through variable and assign a value + server[:variables].each do |name, variable| + if variables.key?(name) + if (server[:variables][name][:enum_values].include? variables[name]) + url.gsub! "{" + name.to_s + "}", variables[name] + else + fail ArgumentError, "The variable `#{name}` in the server URL has invalid value #{variables[name]}. Must be #{server[:variables][name][:enum_values]}." + end + else + # use default value + url.gsub! "{" + name.to_s + "}", server[:variables][name][:default_value] + end + end + + url + end + end +end diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb new file mode 100644 index 00000000..7fc99fc3 --- /dev/null +++ b/lib/xero-ruby/models/accounting/account.rb @@ -0,0 +1,496 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Account + # Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) + attr_accessor :code + + # Name of account (max length = 150) + attr_accessor :name + + # The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 + attr_accessor :account_id + + attr_accessor :type + + # For bank accounts only (Account Type BANK) + attr_accessor :bank_account_number + + # Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes + attr_accessor :status + + # Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) + attr_accessor :description + + # For bank accounts only. See Bank Account types + attr_accessor :bank_account_type + + attr_accessor :currency_code + + # The tax type from TaxRates + attr_accessor :tax_type + + # Boolean – describes whether account can have payments applied to it + attr_accessor :enable_payments_to_account + + # Boolean – describes whether account code is available for use with expense claims + attr_accessor :show_in_expense_claims + + # See Account Class Types + attr_accessor :_class + + # If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. + attr_accessor :system_account + + # Shown if set + attr_accessor :reporting_code + + # Shown if set + attr_accessor :reporting_code_name + + # boolean to indicate if an account has an attachment (read only) + attr_accessor :has_attachments + + # Last modified date UTC format + attr_accessor :updated_date_utc + + # Boolean – describes whether the account is shown in the watchlist widget on the dashboard + attr_accessor :add_to_watchlist + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'Code', + :'name' => :'Name', + :'account_id' => :'AccountID', + :'type' => :'Type', + :'bank_account_number' => :'BankAccountNumber', + :'status' => :'Status', + :'description' => :'Description', + :'bank_account_type' => :'BankAccountType', + :'currency_code' => :'CurrencyCode', + :'tax_type' => :'TaxType', + :'enable_payments_to_account' => :'EnablePaymentsToAccount', + :'show_in_expense_claims' => :'ShowInExpenseClaims', + :'_class' => :'Class', + :'system_account' => :'SystemAccount', + :'reporting_code' => :'ReportingCode', + :'reporting_code_name' => :'ReportingCodeName', + :'has_attachments' => :'HasAttachments', + :'updated_date_utc' => :'UpdatedDateUTC', + :'add_to_watchlist' => :'AddToWatchlist', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'name' => :'String', + :'account_id' => :'String', + :'type' => :'AccountType', + :'bank_account_number' => :'String', + :'status' => :'String', + :'description' => :'String', + :'bank_account_type' => :'String', + :'currency_code' => :'CurrencyCode', + :'tax_type' => :'String', + :'enable_payments_to_account' => :'Boolean', + :'show_in_expense_claims' => :'Boolean', + :'_class' => :'String', + :'system_account' => :'String', + :'reporting_code' => :'String', + :'reporting_code_name' => :'String', + :'has_attachments' => :'Boolean', + :'updated_date_utc' => :'DateTime', + :'add_to_watchlist' => :'Boolean', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Account` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Account`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'bank_account_number') + self.bank_account_number = attributes[:'bank_account_number'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'bank_account_type') + self.bank_account_type = attributes[:'bank_account_type'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'tax_type') + self.tax_type = attributes[:'tax_type'] + end + + if attributes.key?(:'enable_payments_to_account') + self.enable_payments_to_account = attributes[:'enable_payments_to_account'] + end + + if attributes.key?(:'show_in_expense_claims') + self.show_in_expense_claims = attributes[:'show_in_expense_claims'] + end + + if attributes.key?(:'_class') + self._class = attributes[:'_class'] + end + + if attributes.key?(:'system_account') + self.system_account = attributes[:'system_account'] + end + + if attributes.key?(:'reporting_code') + self.reporting_code = attributes[:'reporting_code'] + end + + if attributes.key?(:'reporting_code_name') + self.reporting_code_name = attributes[:'reporting_code_name'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'add_to_watchlist') + self.add_to_watchlist = attributes[:'add_to_watchlist'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@code.nil? && @code.to_s.length > 10 + invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 10.') + end + + if !@name.nil? && @name.to_s.length > 150 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 150.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@code.nil? && @code.to_s.length > 10 + return false if !@name.nil? && @name.to_s.length > 150 + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) + return false unless status_validator.valid?(@status) + bank_account_type_validator = EnumAttributeValidator.new('String', ["BANK", "CREDITCARD", "PAYPAL", "NONE", ""]) + return false unless bank_account_type_validator.valid?(@bank_account_type) + _class_validator = EnumAttributeValidator.new('String', ["ASSET", "EQUITY", "EXPENSE", "LIABILITY", "REVENUE"]) + return false unless _class_validator.valid?(@_class) + system_account_validator = EnumAttributeValidator.new('String', ["DEBTORS", "CREDITORS", "BANKCURRENCYGAIN", "GST", "GSTONIMPORTS", "HISTORICAL", "REALISEDCURRENCYGAIN", "RETAINEDEARNINGS", "ROUNDING", "TRACKINGTRANSFERS", "UNPAIDEXPCLM", "UNREALISEDCURRENCYGAIN", "WAGEPAYABLES", "CISASSETS", "CISASSET", "CISLABOUR", "CISLABOUREXPENSE", "CISLABOURINCOME", "CISLIABILITY", "CISMATERIALS", ""]) + return false unless system_account_validator.valid?(@system_account) + true + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if !code.nil? && code.to_s.length > 10 + fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 10.' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 150 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 150.' + end + + @name = name + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] bank_account_type Object to be assigned + def bank_account_type=(bank_account_type) + validator = EnumAttributeValidator.new('String', ["BANK", "CREDITCARD", "PAYPAL", "NONE", ""]) + unless validator.valid?(bank_account_type) + fail ArgumentError, "invalid value for \"bank_account_type\", must be one of #{validator.allowable_values}." + end + @bank_account_type = bank_account_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] _class Object to be assigned + def _class=(_class) + validator = EnumAttributeValidator.new('String', ["ASSET", "EQUITY", "EXPENSE", "LIABILITY", "REVENUE"]) + unless validator.valid?(_class) + fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}." + end + @_class = _class + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] system_account Object to be assigned + def system_account=(system_account) + validator = EnumAttributeValidator.new('String', ["DEBTORS", "CREDITORS", "BANKCURRENCYGAIN", "GST", "GSTONIMPORTS", "HISTORICAL", "REALISEDCURRENCYGAIN", "RETAINEDEARNINGS", "ROUNDING", "TRACKINGTRANSFERS", "UNPAIDEXPCLM", "UNREALISEDCURRENCYGAIN", "WAGEPAYABLES", "CISASSETS", "CISASSET", "CISLABOUR", "CISLABOUREXPENSE", "CISLABOURINCOME", "CISLIABILITY", "CISMATERIALS", ""]) + unless validator.valid?(system_account) + fail ArgumentError, "invalid value for \"system_account\", must be one of #{validator.allowable_values}." + end + @system_account = system_account + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + name == o.name && + account_id == o.account_id && + type == o.type && + bank_account_number == o.bank_account_number && + status == o.status && + description == o.description && + bank_account_type == o.bank_account_type && + currency_code == o.currency_code && + tax_type == o.tax_type && + enable_payments_to_account == o.enable_payments_to_account && + show_in_expense_claims == o.show_in_expense_claims && + _class == o._class && + system_account == o.system_account && + reporting_code == o.reporting_code && + reporting_code_name == o.reporting_code_name && + has_attachments == o.has_attachments && + updated_date_utc == o.updated_date_utc && + add_to_watchlist == o.add_to_watchlist && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, name, account_id, type, bank_account_number, status, description, bank_account_type, currency_code, tax_type, enable_payments_to_account, show_in_expense_claims, _class, system_account, reporting_code, reporting_code_name, has_attachments, updated_date_utc, add_to_watchlist, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/account_type.rb b/lib/xero-ruby/models/accounting/account_type.rb new file mode 100644 index 00000000..60406e95 --- /dev/null +++ b/lib/xero-ruby/models/accounting/account_type.rb @@ -0,0 +1,57 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class AccountType + BANK = "BANK".freeze + CURRENT = "CURRENT".freeze + CURRLIAB = "CURRLIAB".freeze + DEPRECIATN = "DEPRECIATN".freeze + DIRECTCOSTS = "DIRECTCOSTS".freeze + EQUITY = "EQUITY".freeze + EXPENSE = "EXPENSE".freeze + FIXED = "FIXED".freeze + INVENTORY = "INVENTORY".freeze + LIABILITY = "LIABILITY".freeze + NONCURRENT = "NONCURRENT".freeze + OTHERINCOME = "OTHERINCOME".freeze + OVERHEADS = "OVERHEADS".freeze + PREPAYMENT = "PREPAYMENT".freeze + REVENUE = "REVENUE".freeze + SALES = "SALES".freeze + TERMLIAB = "TERMLIAB".freeze + PAYGLIABILITY = "PAYGLIABILITY".freeze + PAYG = "PAYG".freeze + SUPERANNUATIONEXPENSE = "SUPERANNUATIONEXPENSE".freeze + SUPERANNUATIONLIABILITY = "SUPERANNUATIONLIABILITY".freeze + WAGESEXPENSE = "WAGESEXPENSE".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AccountType.constants.select { |c| AccountType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AccountType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/accounts.rb b/lib/xero-ruby/models/accounting/accounts.rb new file mode 100644 index 00000000..7248b510 --- /dev/null +++ b/lib/xero-ruby/models/accounting/accounts.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Accounts + attr_accessor :accounts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'accounts' => :'Accounts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'accounts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Accounts` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Accounts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'accounts') + if (value = attributes[:'accounts']).is_a?(Array) + self.accounts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + accounts == o.accounts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [accounts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/accounts_payable.rb b/lib/xero-ruby/models/accounting/accounts_payable.rb new file mode 100644 index 00000000..aed25592 --- /dev/null +++ b/lib/xero-ruby/models/accounting/accounts_payable.rb @@ -0,0 +1,212 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class AccountsPayable + attr_accessor :outstanding + + attr_accessor :overdue + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'outstanding' => :'Outstanding', + :'overdue' => :'Overdue' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'outstanding' => :'Float', + :'overdue' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::AccountsPayable` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::AccountsPayable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'outstanding') + self.outstanding = attributes[:'outstanding'] + end + + if attributes.key?(:'overdue') + self.overdue = attributes[:'overdue'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + outstanding == o.outstanding && + overdue == o.overdue + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [outstanding, overdue].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/accounts_receivable.rb b/lib/xero-ruby/models/accounting/accounts_receivable.rb new file mode 100644 index 00000000..aa4a1b6a --- /dev/null +++ b/lib/xero-ruby/models/accounting/accounts_receivable.rb @@ -0,0 +1,212 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class AccountsReceivable + attr_accessor :outstanding + + attr_accessor :overdue + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'outstanding' => :'Outstanding', + :'overdue' => :'Overdue' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'outstanding' => :'Float', + :'overdue' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::AccountsReceivable` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::AccountsReceivable`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'outstanding') + self.outstanding = attributes[:'outstanding'] + end + + if attributes.key?(:'overdue') + self.overdue = attributes[:'overdue'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + outstanding == o.outstanding && + overdue == o.overdue + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [outstanding, overdue].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/address.rb b/lib/xero-ruby/models/accounting/address.rb new file mode 100644 index 00000000..84a34f4c --- /dev/null +++ b/lib/xero-ruby/models/accounting/address.rb @@ -0,0 +1,463 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Address + # define the type of address + attr_accessor :address_type + + # max length = 500 + attr_accessor :address_line1 + + # max length = 500 + attr_accessor :address_line2 + + # max length = 500 + attr_accessor :address_line3 + + # max length = 500 + attr_accessor :address_line4 + + # max length = 255 + attr_accessor :city + + # max length = 255 + attr_accessor :region + + # max length = 50 + attr_accessor :postal_code + + # max length = 50, [A-Z], [a-z] only + attr_accessor :country + + # max length = 255 + attr_accessor :attention_to + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'address_type' => :'AddressType', + :'address_line1' => :'AddressLine1', + :'address_line2' => :'AddressLine2', + :'address_line3' => :'AddressLine3', + :'address_line4' => :'AddressLine4', + :'city' => :'City', + :'region' => :'Region', + :'postal_code' => :'PostalCode', + :'country' => :'Country', + :'attention_to' => :'AttentionTo' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'address_type' => :'String', + :'address_line1' => :'String', + :'address_line2' => :'String', + :'address_line3' => :'String', + :'address_line4' => :'String', + :'city' => :'String', + :'region' => :'String', + :'postal_code' => :'String', + :'country' => :'String', + :'attention_to' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Address` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Address`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'address_type') + self.address_type = attributes[:'address_type'] + end + + if attributes.key?(:'address_line1') + self.address_line1 = attributes[:'address_line1'] + end + + if attributes.key?(:'address_line2') + self.address_line2 = attributes[:'address_line2'] + end + + if attributes.key?(:'address_line3') + self.address_line3 = attributes[:'address_line3'] + end + + if attributes.key?(:'address_line4') + self.address_line4 = attributes[:'address_line4'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'region') + self.region = attributes[:'region'] + end + + if attributes.key?(:'postal_code') + self.postal_code = attributes[:'postal_code'] + end + + if attributes.key?(:'country') + self.country = attributes[:'country'] + end + + if attributes.key?(:'attention_to') + self.attention_to = attributes[:'attention_to'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@address_line1.nil? && @address_line1.to_s.length > 500 + invalid_properties.push('invalid value for "address_line1", the character length must be smaller than or equal to 500.') + end + + if !@address_line2.nil? && @address_line2.to_s.length > 500 + invalid_properties.push('invalid value for "address_line2", the character length must be smaller than or equal to 500.') + end + + if !@address_line3.nil? && @address_line3.to_s.length > 500 + invalid_properties.push('invalid value for "address_line3", the character length must be smaller than or equal to 500.') + end + + if !@address_line4.nil? && @address_line4.to_s.length > 500 + invalid_properties.push('invalid value for "address_line4", the character length must be smaller than or equal to 500.') + end + + if !@city.nil? && @city.to_s.length > 255 + invalid_properties.push('invalid value for "city", the character length must be smaller than or equal to 255.') + end + + if !@region.nil? && @region.to_s.length > 255 + invalid_properties.push('invalid value for "region", the character length must be smaller than or equal to 255.') + end + + if !@postal_code.nil? && @postal_code.to_s.length > 50 + invalid_properties.push('invalid value for "postal_code", the character length must be smaller than or equal to 50.') + end + + if !@country.nil? && @country.to_s.length > 50 + invalid_properties.push('invalid value for "country", the character length must be smaller than or equal to 50.') + end + + if !@attention_to.nil? && @attention_to.to_s.length > 255 + invalid_properties.push('invalid value for "attention_to", the character length must be smaller than or equal to 255.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + address_type_validator = EnumAttributeValidator.new('String', ["POBOX", "STREET", "DELIVERY"]) + return false unless address_type_validator.valid?(@address_type) + return false if !@address_line1.nil? && @address_line1.to_s.length > 500 + return false if !@address_line2.nil? && @address_line2.to_s.length > 500 + return false if !@address_line3.nil? && @address_line3.to_s.length > 500 + return false if !@address_line4.nil? && @address_line4.to_s.length > 500 + return false if !@city.nil? && @city.to_s.length > 255 + return false if !@region.nil? && @region.to_s.length > 255 + return false if !@postal_code.nil? && @postal_code.to_s.length > 50 + return false if !@country.nil? && @country.to_s.length > 50 + return false if !@attention_to.nil? && @attention_to.to_s.length > 255 + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] address_type Object to be assigned + def address_type=(address_type) + validator = EnumAttributeValidator.new('String', ["POBOX", "STREET", "DELIVERY"]) + unless validator.valid?(address_type) + fail ArgumentError, "invalid value for \"address_type\", must be one of #{validator.allowable_values}." + end + @address_type = address_type + end + + # Custom attribute writer method with validation + # @param [Object] address_line1 Value to be assigned + def address_line1=(address_line1) + if !address_line1.nil? && address_line1.to_s.length > 500 + fail ArgumentError, 'invalid value for "address_line1", the character length must be smaller than or equal to 500.' + end + + @address_line1 = address_line1 + end + + # Custom attribute writer method with validation + # @param [Object] address_line2 Value to be assigned + def address_line2=(address_line2) + if !address_line2.nil? && address_line2.to_s.length > 500 + fail ArgumentError, 'invalid value for "address_line2", the character length must be smaller than or equal to 500.' + end + + @address_line2 = address_line2 + end + + # Custom attribute writer method with validation + # @param [Object] address_line3 Value to be assigned + def address_line3=(address_line3) + if !address_line3.nil? && address_line3.to_s.length > 500 + fail ArgumentError, 'invalid value for "address_line3", the character length must be smaller than or equal to 500.' + end + + @address_line3 = address_line3 + end + + # Custom attribute writer method with validation + # @param [Object] address_line4 Value to be assigned + def address_line4=(address_line4) + if !address_line4.nil? && address_line4.to_s.length > 500 + fail ArgumentError, 'invalid value for "address_line4", the character length must be smaller than or equal to 500.' + end + + @address_line4 = address_line4 + end + + # Custom attribute writer method with validation + # @param [Object] city Value to be assigned + def city=(city) + if !city.nil? && city.to_s.length > 255 + fail ArgumentError, 'invalid value for "city", the character length must be smaller than or equal to 255.' + end + + @city = city + end + + # Custom attribute writer method with validation + # @param [Object] region Value to be assigned + def region=(region) + if !region.nil? && region.to_s.length > 255 + fail ArgumentError, 'invalid value for "region", the character length must be smaller than or equal to 255.' + end + + @region = region + end + + # Custom attribute writer method with validation + # @param [Object] postal_code Value to be assigned + def postal_code=(postal_code) + if !postal_code.nil? && postal_code.to_s.length > 50 + fail ArgumentError, 'invalid value for "postal_code", the character length must be smaller than or equal to 50.' + end + + @postal_code = postal_code + end + + # Custom attribute writer method with validation + # @param [Object] country Value to be assigned + def country=(country) + if !country.nil? && country.to_s.length > 50 + fail ArgumentError, 'invalid value for "country", the character length must be smaller than or equal to 50.' + end + + @country = country + end + + # Custom attribute writer method with validation + # @param [Object] attention_to Value to be assigned + def attention_to=(attention_to) + if !attention_to.nil? && attention_to.to_s.length > 255 + fail ArgumentError, 'invalid value for "attention_to", the character length must be smaller than or equal to 255.' + end + + @attention_to = attention_to + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + address_type == o.address_type && + address_line1 == o.address_line1 && + address_line2 == o.address_line2 && + address_line3 == o.address_line3 && + address_line4 == o.address_line4 && + city == o.city && + region == o.region && + postal_code == o.postal_code && + country == o.country && + attention_to == o.attention_to + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [address_type, address_line1, address_line2, address_line3, address_line4, city, region, postal_code, country, attention_to].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/allocation.rb b/lib/xero-ruby/models/accounting/allocation.rb new file mode 100644 index 00000000..2f97d886 --- /dev/null +++ b/lib/xero-ruby/models/accounting/allocation.rb @@ -0,0 +1,287 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Allocation + attr_accessor :invoice + + attr_accessor :overpayment + + attr_accessor :prepayment + + attr_accessor :credit_note + + # the amount being applied to the invoice + attr_accessor :amount + + # the date the allocation is applied YYYY-MM-DD. + attr_accessor :date + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'invoice' => :'Invoice', + :'overpayment' => :'Overpayment', + :'prepayment' => :'Prepayment', + :'credit_note' => :'CreditNote', + :'amount' => :'Amount', + :'date' => :'Date', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'invoice' => :'Invoice', + :'overpayment' => :'Overpayment', + :'prepayment' => :'Prepayment', + :'credit_note' => :'CreditNote', + :'amount' => :'Float', + :'date' => :'Date', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Allocation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Allocation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'invoice') + self.invoice = attributes[:'invoice'] + end + + if attributes.key?(:'overpayment') + self.overpayment = attributes[:'overpayment'] + end + + if attributes.key?(:'prepayment') + self.prepayment = attributes[:'prepayment'] + end + + if attributes.key?(:'credit_note') + self.credit_note = attributes[:'credit_note'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @invoice.nil? + invalid_properties.push('invalid value for "invoice", invoice cannot be nil.') + end + + if @amount.nil? + invalid_properties.push('invalid value for "amount", amount cannot be nil.') + end + + if @date.nil? + invalid_properties.push('invalid value for "date", date cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @invoice.nil? + return false if @amount.nil? + return false if @date.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + invoice == o.invoice && + overpayment == o.overpayment && + prepayment == o.prepayment && + credit_note == o.credit_note && + amount == o.amount && + date == o.date && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [invoice, overpayment, prepayment, credit_note, amount, date, status_attribute_string, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/allocations.rb b/lib/xero-ruby/models/accounting/allocations.rb new file mode 100644 index 00000000..f870c643 --- /dev/null +++ b/lib/xero-ruby/models/accounting/allocations.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Allocations + attr_accessor :allocations + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'allocations' => :'Allocations' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'allocations' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Allocations` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Allocations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'allocations') + if (value = attributes[:'allocations']).is_a?(Array) + self.allocations = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + allocations == o.allocations + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [allocations].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/attachment.rb b/lib/xero-ruby/models/accounting/attachment.rb new file mode 100644 index 00000000..07360e4c --- /dev/null +++ b/lib/xero-ruby/models/accounting/attachment.rb @@ -0,0 +1,254 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Attachment + # Unique ID for the file + attr_accessor :attachment_id + + # Name of the file + attr_accessor :file_name + + # URL to the file on xero.com + attr_accessor :url + + # Type of file + attr_accessor :mime_type + + # Length of the file content + attr_accessor :content_length + + # Include the file with the online invoice + attr_accessor :include_online + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'attachment_id' => :'AttachmentID', + :'file_name' => :'FileName', + :'url' => :'Url', + :'mime_type' => :'MimeType', + :'content_length' => :'ContentLength', + :'include_online' => :'IncludeOnline' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'attachment_id' => :'String', + :'file_name' => :'String', + :'url' => :'String', + :'mime_type' => :'String', + :'content_length' => :'Float', + :'include_online' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Attachment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Attachment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attachment_id') + self.attachment_id = attributes[:'attachment_id'] + end + + if attributes.key?(:'file_name') + self.file_name = attributes[:'file_name'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'mime_type') + self.mime_type = attributes[:'mime_type'] + end + + if attributes.key?(:'content_length') + self.content_length = attributes[:'content_length'] + end + + if attributes.key?(:'include_online') + self.include_online = attributes[:'include_online'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attachment_id == o.attachment_id && + file_name == o.file_name && + url == o.url && + mime_type == o.mime_type && + content_length == o.content_length && + include_online == o.include_online + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [attachment_id, file_name, url, mime_type, content_length, include_online].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/attachments.rb b/lib/xero-ruby/models/accounting/attachments.rb new file mode 100644 index 00000000..60863e63 --- /dev/null +++ b/lib/xero-ruby/models/accounting/attachments.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Attachments + attr_accessor :attachments + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'attachments' => :'Attachments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'attachments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Attachments` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Attachments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attachments == o.attachments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [attachments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/balances.rb b/lib/xero-ruby/models/accounting/balances.rb new file mode 100644 index 00000000..bed0c395 --- /dev/null +++ b/lib/xero-ruby/models/accounting/balances.rb @@ -0,0 +1,213 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + # The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) + class Balances + attr_accessor :accounts_receivable + + attr_accessor :accounts_payable + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'accounts_receivable' => :'AccountsReceivable', + :'accounts_payable' => :'AccountsPayable' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'accounts_receivable' => :'AccountsReceivable', + :'accounts_payable' => :'AccountsPayable' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Balances` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Balances`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'accounts_receivable') + self.accounts_receivable = attributes[:'accounts_receivable'] + end + + if attributes.key?(:'accounts_payable') + self.accounts_payable = attributes[:'accounts_payable'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + accounts_receivable == o.accounts_receivable && + accounts_payable == o.accounts_payable + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [accounts_receivable, accounts_payable].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/bank_transaction.rb b/lib/xero-ruby/models/accounting/bank_transaction.rb new file mode 100644 index 00000000..2cde0c77 --- /dev/null +++ b/lib/xero-ruby/models/accounting/bank_transaction.rb @@ -0,0 +1,482 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BankTransaction + # See Bank Transaction Types + attr_accessor :type + + attr_accessor :contact + + # See LineItems + attr_accessor :line_items + + attr_accessor :bank_account + + # Boolean to show if transaction is reconciled + attr_accessor :is_reconciled + + # Date of transaction – YYYY-MM-DD + attr_accessor :date + + # Reference for the transaction. Only supported for SPEND and RECEIVE transactions. + attr_accessor :reference + + attr_accessor :currency_code + + # Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. + attr_accessor :currency_rate + + # URL link to a source document – shown as “Go to App Name” + attr_accessor :url + + # See Bank Transaction Status Codes + attr_accessor :status + + attr_accessor :line_amount_types + + # Total of bank transaction excluding taxes + attr_accessor :sub_total + + # Total tax on bank transaction + attr_accessor :total_tax + + # Total of bank transaction tax inclusive + attr_accessor :total + + # Xero generated unique identifier for bank transaction + attr_accessor :bank_transaction_id + + # Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT + attr_accessor :prepayment_id + + # Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT + attr_accessor :overpayment_id + + # Last modified date UTC format + attr_accessor :updated_date_utc + + # Boolean to indicate if a bank transaction has an attachment + attr_accessor :has_attachments + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'Type', + :'contact' => :'Contact', + :'line_items' => :'LineItems', + :'bank_account' => :'BankAccount', + :'is_reconciled' => :'IsReconciled', + :'date' => :'Date', + :'reference' => :'Reference', + :'currency_code' => :'CurrencyCode', + :'currency_rate' => :'CurrencyRate', + :'url' => :'Url', + :'status' => :'Status', + :'line_amount_types' => :'LineAmountTypes', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'bank_transaction_id' => :'BankTransactionID', + :'prepayment_id' => :'PrepaymentID', + :'overpayment_id' => :'OverpaymentID', + :'updated_date_utc' => :'UpdatedDateUTC', + :'has_attachments' => :'HasAttachments', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'contact' => :'Contact', + :'line_items' => :'Array', + :'bank_account' => :'Account', + :'is_reconciled' => :'Boolean', + :'date' => :'Date', + :'reference' => :'String', + :'currency_code' => :'CurrencyCode', + :'currency_rate' => :'Float', + :'url' => :'String', + :'status' => :'String', + :'line_amount_types' => :'LineAmountTypes', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'bank_transaction_id' => :'String', + :'prepayment_id' => :'String', + :'overpayment_id' => :'String', + :'updated_date_utc' => :'DateTime', + :'has_attachments' => :'Boolean', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransaction` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'bank_account') + self.bank_account = attributes[:'bank_account'] + end + + if attributes.key?(:'is_reconciled') + self.is_reconciled = attributes[:'is_reconciled'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'bank_transaction_id') + self.bank_transaction_id = attributes[:'bank_transaction_id'] + end + + if attributes.key?(:'prepayment_id') + self.prepayment_id = attributes[:'prepayment_id'] + end + + if attributes.key?(:'overpayment_id') + self.overpayment_id = attributes[:'overpayment_id'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @type.nil? + invalid_properties.push('invalid value for "type", type cannot be nil.') + end + + if @contact.nil? + invalid_properties.push('invalid value for "contact", contact cannot be nil.') + end + + if @line_items.nil? + invalid_properties.push('invalid value for "line_items", line_items cannot be nil.') + end + + if @bank_account.nil? + invalid_properties.push('invalid value for "bank_account", bank_account cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @type.nil? + type_validator = EnumAttributeValidator.new('String', ["RECEIVE", "RECEIVE-OVERPAYMENT", "RECEIVE-PREPAYMENT", "SPEND", "SPEND-OVERPAYMENT", "SPEND-PREPAYMENT", "RECEIVE-TRANSFER", "SPEND-TRANSFER"]) + return false unless type_validator.valid?(@type) + return false if @contact.nil? + return false if @line_items.nil? + return false if @bank_account.nil? + status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED", "VOIDED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["RECEIVE", "RECEIVE-OVERPAYMENT", "RECEIVE-PREPAYMENT", "SPEND", "SPEND-OVERPAYMENT", "SPEND-PREPAYMENT", "RECEIVE-TRANSFER", "SPEND-TRANSFER"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED", "VOIDED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + contact == o.contact && + line_items == o.line_items && + bank_account == o.bank_account && + is_reconciled == o.is_reconciled && + date == o.date && + reference == o.reference && + currency_code == o.currency_code && + currency_rate == o.currency_rate && + url == o.url && + status == o.status && + line_amount_types == o.line_amount_types && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + bank_transaction_id == o.bank_transaction_id && + prepayment_id == o.prepayment_id && + overpayment_id == o.overpayment_id && + updated_date_utc == o.updated_date_utc && + has_attachments == o.has_attachments && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, contact, line_items, bank_account, is_reconciled, date, reference, currency_code, currency_rate, url, status, line_amount_types, sub_total, total_tax, total, bank_transaction_id, prepayment_id, overpayment_id, updated_date_utc, has_attachments, status_attribute_string, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/bank_transactions.rb b/lib/xero-ruby/models/accounting/bank_transactions.rb new file mode 100644 index 00000000..073083a2 --- /dev/null +++ b/lib/xero-ruby/models/accounting/bank_transactions.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BankTransactions + attr_accessor :bank_transactions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bank_transactions' => :'BankTransactions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bank_transactions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransactions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'bank_transactions') + if (value = attributes[:'bank_transactions']).is_a?(Array) + self.bank_transactions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bank_transactions == o.bank_transactions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bank_transactions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/bank_transfer.rb b/lib/xero-ruby/models/accounting/bank_transfer.rb new file mode 100644 index 00000000..64d9c17c --- /dev/null +++ b/lib/xero-ruby/models/accounting/bank_transfer.rb @@ -0,0 +1,321 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BankTransfer + attr_accessor :from_bank_account + + attr_accessor :to_bank_account + + # amount of the transaction + attr_accessor :amount + + # The date of the Transfer YYYY-MM-DD + attr_accessor :date + + # The identifier of the Bank Transfer + attr_accessor :bank_transfer_id + + # The currency rate + attr_accessor :currency_rate + + # The Bank Transaction ID for the source account + attr_accessor :from_bank_transaction_id + + # The Bank Transaction ID for the destination account + attr_accessor :to_bank_transaction_id + + # Boolean to indicate if a Bank Transfer has an attachment + attr_accessor :has_attachments + + # UTC timestamp of creation date of bank transfer + attr_accessor :created_date_utc + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'from_bank_account' => :'FromBankAccount', + :'to_bank_account' => :'ToBankAccount', + :'amount' => :'Amount', + :'date' => :'Date', + :'bank_transfer_id' => :'BankTransferID', + :'currency_rate' => :'CurrencyRate', + :'from_bank_transaction_id' => :'FromBankTransactionID', + :'to_bank_transaction_id' => :'ToBankTransactionID', + :'has_attachments' => :'HasAttachments', + :'created_date_utc' => :'CreatedDateUTC', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'from_bank_account' => :'Account', + :'to_bank_account' => :'Account', + :'amount' => :'Float', + :'date' => :'Date', + :'bank_transfer_id' => :'String', + :'currency_rate' => :'Float', + :'from_bank_transaction_id' => :'String', + :'to_bank_transaction_id' => :'String', + :'has_attachments' => :'Boolean', + :'created_date_utc' => :'DateTime', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransfer` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransfer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'from_bank_account') + self.from_bank_account = attributes[:'from_bank_account'] + end + + if attributes.key?(:'to_bank_account') + self.to_bank_account = attributes[:'to_bank_account'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'bank_transfer_id') + self.bank_transfer_id = attributes[:'bank_transfer_id'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'from_bank_transaction_id') + self.from_bank_transaction_id = attributes[:'from_bank_transaction_id'] + end + + if attributes.key?(:'to_bank_transaction_id') + self.to_bank_transaction_id = attributes[:'to_bank_transaction_id'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'created_date_utc') + self.created_date_utc = attributes[:'created_date_utc'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @from_bank_account.nil? + invalid_properties.push('invalid value for "from_bank_account", from_bank_account cannot be nil.') + end + + if @to_bank_account.nil? + invalid_properties.push('invalid value for "to_bank_account", to_bank_account cannot be nil.') + end + + if @amount.nil? + invalid_properties.push('invalid value for "amount", amount cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @from_bank_account.nil? + return false if @to_bank_account.nil? + return false if @amount.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + from_bank_account == o.from_bank_account && + to_bank_account == o.to_bank_account && + amount == o.amount && + date == o.date && + bank_transfer_id == o.bank_transfer_id && + currency_rate == o.currency_rate && + from_bank_transaction_id == o.from_bank_transaction_id && + to_bank_transaction_id == o.to_bank_transaction_id && + has_attachments == o.has_attachments && + created_date_utc == o.created_date_utc && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [from_bank_account, to_bank_account, amount, date, bank_transfer_id, currency_rate, from_bank_transaction_id, to_bank_transaction_id, has_attachments, created_date_utc, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/bank_transfers.rb b/lib/xero-ruby/models/accounting/bank_transfers.rb new file mode 100644 index 00000000..dbdf9785 --- /dev/null +++ b/lib/xero-ruby/models/accounting/bank_transfers.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BankTransfers + attr_accessor :bank_transfers + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bank_transfers' => :'BankTransfers' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bank_transfers' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BankTransfers` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BankTransfers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'bank_transfers') + if (value = attributes[:'bank_transfers']).is_a?(Array) + self.bank_transfers = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bank_transfers == o.bank_transfers + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bank_transfers].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/batch_payment.rb b/lib/xero-ruby/models/accounting/batch_payment.rb new file mode 100644 index 00000000..9e7da43d --- /dev/null +++ b/lib/xero-ruby/models/accounting/batch_payment.rb @@ -0,0 +1,475 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BatchPayment + attr_accessor :account + + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + attr_accessor :reference + + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + attr_accessor :particulars + + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + attr_accessor :code + + # (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + attr_accessor :details + + # (UK Only) Only shows on the statement line in Xero. Max length =18 + attr_accessor :narrative + + # The Xero generated unique identifier for the bank transaction (read-only) + attr_accessor :batch_payment_id + + # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + attr_accessor :date_string + + # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + attr_accessor :date + + # The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + attr_accessor :amount + + attr_accessor :payments + + # PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) + attr_accessor :type + + # AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. + attr_accessor :status + + # The total of the payments that make up the batch (read-only) + attr_accessor :total_amount + + # UTC timestamp of last update to the payment + attr_accessor :updated_date_utc + + # Booelan that tells you if the batch payment has been reconciled (read-only) + attr_accessor :is_reconciled + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'account' => :'Account', + :'reference' => :'Reference', + :'particulars' => :'Particulars', + :'code' => :'Code', + :'details' => :'Details', + :'narrative' => :'Narrative', + :'batch_payment_id' => :'BatchPaymentID', + :'date_string' => :'DateString', + :'date' => :'Date', + :'amount' => :'Amount', + :'payments' => :'Payments', + :'type' => :'Type', + :'status' => :'Status', + :'total_amount' => :'TotalAmount', + :'updated_date_utc' => :'UpdatedDateUTC', + :'is_reconciled' => :'IsReconciled' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'account' => :'Account', + :'reference' => :'String', + :'particulars' => :'String', + :'code' => :'String', + :'details' => :'String', + :'narrative' => :'String', + :'batch_payment_id' => :'String', + :'date_string' => :'String', + :'date' => :'Date', + :'amount' => :'Float', + :'payments' => :'Array', + :'type' => :'String', + :'status' => :'String', + :'total_amount' => :'String', + :'updated_date_utc' => :'DateTime', + :'is_reconciled' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BatchPayment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BatchPayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'account') + self.account = attributes[:'account'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'particulars') + self.particulars = attributes[:'particulars'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'narrative') + self.narrative = attributes[:'narrative'] + end + + if attributes.key?(:'batch_payment_id') + self.batch_payment_id = attributes[:'batch_payment_id'] + end + + if attributes.key?(:'date_string') + self.date_string = attributes[:'date_string'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'payments') + if (value = attributes[:'payments']).is_a?(Array) + self.payments = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'total_amount') + self.total_amount = attributes[:'total_amount'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'is_reconciled') + self.is_reconciled = attributes[:'is_reconciled'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@reference.nil? && @reference.to_s.length > 12 + invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 12.') + end + + if !@particulars.nil? && @particulars.to_s.length > 12 + invalid_properties.push('invalid value for "particulars", the character length must be smaller than or equal to 12.') + end + + if !@code.nil? && @code.to_s.length > 12 + invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 12.') + end + + if !@details.nil? && @details.to_s.length > 18 + invalid_properties.push('invalid value for "details", the character length must be smaller than or equal to 18.') + end + + if !@narrative.nil? && @narrative.to_s.length > 18 + invalid_properties.push('invalid value for "narrative", the character length must be smaller than or equal to 18.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@reference.nil? && @reference.to_s.length > 12 + return false if !@particulars.nil? && @particulars.to_s.length > 12 + return false if !@code.nil? && @code.to_s.length > 12 + return false if !@details.nil? && @details.to_s.length > 18 + return false if !@narrative.nil? && @narrative.to_s.length > 18 + type_validator = EnumAttributeValidator.new('String', ["PAYBATCH", "RECBATCH"]) + return false unless type_validator.valid?(@type) + status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method with validation + # @param [Object] reference Value to be assigned + def reference=(reference) + if !reference.nil? && reference.to_s.length > 12 + fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 12.' + end + + @reference = reference + end + + # Custom attribute writer method with validation + # @param [Object] particulars Value to be assigned + def particulars=(particulars) + if !particulars.nil? && particulars.to_s.length > 12 + fail ArgumentError, 'invalid value for "particulars", the character length must be smaller than or equal to 12.' + end + + @particulars = particulars + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if !code.nil? && code.to_s.length > 12 + fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 12.' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] details Value to be assigned + def details=(details) + if !details.nil? && details.to_s.length > 18 + fail ArgumentError, 'invalid value for "details", the character length must be smaller than or equal to 18.' + end + + @details = details + end + + # Custom attribute writer method with validation + # @param [Object] narrative Value to be assigned + def narrative=(narrative) + if !narrative.nil? && narrative.to_s.length > 18 + fail ArgumentError, 'invalid value for "narrative", the character length must be smaller than or equal to 18.' + end + + @narrative = narrative + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["PAYBATCH", "RECBATCH"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account == o.account && + reference == o.reference && + particulars == o.particulars && + code == o.code && + details == o.details && + narrative == o.narrative && + batch_payment_id == o.batch_payment_id && + date_string == o.date_string && + date == o.date && + amount == o.amount && + payments == o.payments && + type == o.type && + status == o.status && + total_amount == o.total_amount && + updated_date_utc == o.updated_date_utc && + is_reconciled == o.is_reconciled + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [account, reference, particulars, code, details, narrative, batch_payment_id, date_string, date, amount, payments, type, status, total_amount, updated_date_utc, is_reconciled].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/batch_payment_details.rb b/lib/xero-ruby/models/accounting/batch_payment_details.rb new file mode 100644 index 00000000..2cf2fdb2 --- /dev/null +++ b/lib/xero-ruby/models/accounting/batch_payment_details.rb @@ -0,0 +1,290 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + # Bank details for use on a batch payment stored with each contact + class BatchPaymentDetails + # Bank account number for use with Batch Payments + attr_accessor :bank_account_number + + # Name of bank for use with Batch Payments + attr_accessor :bank_account_name + + # (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 + attr_accessor :details + + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + attr_accessor :code + + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. + attr_accessor :reference + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bank_account_number' => :'BankAccountNumber', + :'bank_account_name' => :'BankAccountName', + :'details' => :'Details', + :'code' => :'Code', + :'reference' => :'Reference' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bank_account_number' => :'String', + :'bank_account_name' => :'String', + :'details' => :'String', + :'code' => :'String', + :'reference' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BatchPaymentDetails` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BatchPaymentDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'bank_account_number') + self.bank_account_number = attributes[:'bank_account_number'] + end + + if attributes.key?(:'bank_account_name') + self.bank_account_name = attributes[:'bank_account_name'] + end + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@details.nil? && @details.to_s.length > 18 + invalid_properties.push('invalid value for "details", the character length must be smaller than or equal to 18.') + end + + if !@code.nil? && @code.to_s.length > 12 + invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 12.') + end + + if !@reference.nil? && @reference.to_s.length > 12 + invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 12.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@details.nil? && @details.to_s.length > 18 + return false if !@code.nil? && @code.to_s.length > 12 + return false if !@reference.nil? && @reference.to_s.length > 12 + true + end + + # Custom attribute writer method with validation + # @param [Object] details Value to be assigned + def details=(details) + if !details.nil? && details.to_s.length > 18 + fail ArgumentError, 'invalid value for "details", the character length must be smaller than or equal to 18.' + end + + @details = details + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if !code.nil? && code.to_s.length > 12 + fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 12.' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] reference Value to be assigned + def reference=(reference) + if !reference.nil? && reference.to_s.length > 12 + fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 12.' + end + + @reference = reference + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bank_account_number == o.bank_account_number && + bank_account_name == o.bank_account_name && + details == o.details && + code == o.code && + reference == o.reference + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bank_account_number, bank_account_name, details, code, reference].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/batch_payments.rb b/lib/xero-ruby/models/accounting/batch_payments.rb new file mode 100644 index 00000000..79fd4d21 --- /dev/null +++ b/lib/xero-ruby/models/accounting/batch_payments.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BatchPayments + attr_accessor :batch_payments + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'batch_payments' => :'BatchPayments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'batch_payments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BatchPayments` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BatchPayments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'batch_payments') + if (value = attributes[:'batch_payments']).is_a?(Array) + self.batch_payments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + batch_payments == o.batch_payments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [batch_payments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/bill.rb b/lib/xero-ruby/models/accounting/bill.rb new file mode 100644 index 00000000..6d5e1f66 --- /dev/null +++ b/lib/xero-ruby/models/accounting/bill.rb @@ -0,0 +1,213 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Bill + # Day of Month (0-31) + attr_accessor :day + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'day' => :'Day', + :'type' => :'Type' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'day' => :'Integer', + :'type' => :'PaymentTermType' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Bill` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Bill`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'day') + self.day = attributes[:'day'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + day == o.day && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [day, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/branding_theme.rb b/lib/xero-ruby/models/accounting/branding_theme.rb new file mode 100644 index 00000000..c0073094 --- /dev/null +++ b/lib/xero-ruby/models/accounting/branding_theme.rb @@ -0,0 +1,288 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BrandingTheme + # Xero identifier + attr_accessor :branding_theme_id + + # Name of branding theme + attr_accessor :name + + # The location of the image file used as the logo on this branding theme + attr_accessor :logo_url + + # Always INVOICE + attr_accessor :type + + # Integer – ranked order of branding theme. The default branding theme has a value of 0 + attr_accessor :sort_order + + # UTC timestamp of creation date of branding theme + attr_accessor :created_date_utc + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'branding_theme_id' => :'BrandingThemeID', + :'name' => :'Name', + :'logo_url' => :'LogoUrl', + :'type' => :'Type', + :'sort_order' => :'SortOrder', + :'created_date_utc' => :'CreatedDateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'branding_theme_id' => :'String', + :'name' => :'String', + :'logo_url' => :'String', + :'type' => :'String', + :'sort_order' => :'Integer', + :'created_date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BrandingTheme` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BrandingTheme`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'branding_theme_id') + self.branding_theme_id = attributes[:'branding_theme_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'logo_url') + self.logo_url = attributes[:'logo_url'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'sort_order') + self.sort_order = attributes[:'sort_order'] + end + + if attributes.key?(:'created_date_utc') + self.created_date_utc = attributes[:'created_date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["INVOICE"]) + return false unless type_validator.valid?(@type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["INVOICE"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + branding_theme_id == o.branding_theme_id && + name == o.name && + logo_url == o.logo_url && + type == o.type && + sort_order == o.sort_order && + created_date_utc == o.created_date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [branding_theme_id, name, logo_url, type, sort_order, created_date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/branding_themes.rb b/lib/xero-ruby/models/accounting/branding_themes.rb new file mode 100644 index 00000000..c9b03f77 --- /dev/null +++ b/lib/xero-ruby/models/accounting/branding_themes.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class BrandingThemes + attr_accessor :branding_themes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'branding_themes' => :'BrandingThemes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'branding_themes' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BrandingThemes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BrandingThemes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'branding_themes') + if (value = attributes[:'branding_themes']).is_a?(Array) + self.branding_themes = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + branding_themes == o.branding_themes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [branding_themes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/cis_org_setting.rb b/lib/xero-ruby/models/accounting/cis_org_setting.rb new file mode 100644 index 00000000..d4978856 --- /dev/null +++ b/lib/xero-ruby/models/accounting/cis_org_setting.rb @@ -0,0 +1,224 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class CISOrgSetting + # true or false - Boolean that describes if the organisation is a CIS Contractor + attr_accessor :cis_contractor_enabled + + # true or false - Boolean that describes if the organisation is a CIS SubContractor + attr_accessor :cis_sub_contractor_enabled + + # CIS Deduction rate for the organisation + attr_accessor :rate + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'cis_contractor_enabled' => :'CISContractorEnabled', + :'cis_sub_contractor_enabled' => :'CISSubContractorEnabled', + :'rate' => :'Rate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'cis_contractor_enabled' => :'Boolean', + :'cis_sub_contractor_enabled' => :'Boolean', + :'rate' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CISOrgSetting` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CISOrgSetting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'cis_contractor_enabled') + self.cis_contractor_enabled = attributes[:'cis_contractor_enabled'] + end + + if attributes.key?(:'cis_sub_contractor_enabled') + self.cis_sub_contractor_enabled = attributes[:'cis_sub_contractor_enabled'] + end + + if attributes.key?(:'rate') + self.rate = attributes[:'rate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cis_contractor_enabled == o.cis_contractor_enabled && + cis_sub_contractor_enabled == o.cis_sub_contractor_enabled && + rate == o.rate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [cis_contractor_enabled, cis_sub_contractor_enabled, rate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/cis_setting.rb b/lib/xero-ruby/models/accounting/cis_setting.rb new file mode 100644 index 00000000..6e77e8a0 --- /dev/null +++ b/lib/xero-ruby/models/accounting/cis_setting.rb @@ -0,0 +1,214 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class CISSetting + # Boolean that describes if the contact is a CIS Subcontractor + attr_accessor :cis_enabled + + # CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned + attr_accessor :rate + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'cis_enabled' => :'CISEnabled', + :'rate' => :'Rate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'cis_enabled' => :'Boolean', + :'rate' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CISSetting` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CISSetting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'cis_enabled') + self.cis_enabled = attributes[:'cis_enabled'] + end + + if attributes.key?(:'rate') + self.rate = attributes[:'rate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cis_enabled == o.cis_enabled && + rate == o.rate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [cis_enabled, rate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/cis_settings.rb b/lib/xero-ruby/models/accounting/cis_settings.rb new file mode 100644 index 00000000..c39c1197 --- /dev/null +++ b/lib/xero-ruby/models/accounting/cis_settings.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class CISSettings + attr_accessor :cis_settings + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'cis_settings' => :'CISSettings' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'cis_settings' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CISSettings` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CISSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'cis_settings') + if (value = attributes[:'cis_settings']).is_a?(Array) + self.cis_settings = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cis_settings == o.cis_settings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [cis_settings].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/contact.rb b/lib/xero-ruby/models/accounting/contact.rb new file mode 100644 index 00000000..57f70f78 --- /dev/null +++ b/lib/xero-ruby/models/accounting/contact.rb @@ -0,0 +1,738 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Contact + # Xero identifier + attr_accessor :contact_id + + # This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. + attr_accessor :contact_number + + # A user defined account number. This can be updated via the API and the Xero UI (max length = 50) + attr_accessor :account_number + + # Current status of a contact – see contact status types + attr_accessor :contact_status + + # Full name of contact/organisation (max length = 255) + attr_accessor :name + + # First name of contact person (max length = 255) + attr_accessor :first_name + + # Last name of contact person (max length = 255) + attr_accessor :last_name + + # Email address of contact person (umlauts not supported) (max length = 255) + attr_accessor :email_address + + # Skype user name of contact + attr_accessor :skype_user_name + + # See contact persons + attr_accessor :contact_persons + + # Bank account number of contact + attr_accessor :bank_account_details + + # Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) + attr_accessor :tax_number + + # The tax type from TaxRates + attr_accessor :accounts_receivable_tax_type + + # The tax type from TaxRates + attr_accessor :accounts_payable_tax_type + + # Store certain address types for a contact – see address types + attr_accessor :addresses + + # Store certain phone types for a contact – see phone types + attr_accessor :phones + + # true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. + attr_accessor :is_supplier + + # true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. + attr_accessor :is_customer + + attr_accessor :default_currency + + # Store XeroNetworkKey for contacts. + attr_accessor :xero_network_key + + # The default sales account code for contacts + attr_accessor :sales_default_account_code + + # The default purchases account code for contacts + attr_accessor :purchases_default_account_code + + # The default sales tracking categories for contacts + attr_accessor :sales_tracking_categories + + # The default purchases tracking categories for contacts + attr_accessor :purchases_tracking_categories + + # The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories + attr_accessor :tracking_category_name + + # The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories + attr_accessor :tracking_category_option + + attr_accessor :payment_terms + + # UTC timestamp of last update to contact + attr_accessor :updated_date_utc + + # Displays which contact groups a contact is included in + attr_accessor :contact_groups + + # Website address for contact (read only) + attr_accessor :website + + attr_accessor :branding_theme + + attr_accessor :batch_payments + + # The default discount rate for the contact (read only) + attr_accessor :discount + + attr_accessor :balances + + # Displays array of attachments from the API + attr_accessor :attachments + + # A boolean to indicate if a contact has an attachment + attr_accessor :has_attachments + + # Displays validation errors returned from the API + attr_accessor :validation_errors + + # A boolean to indicate if a contact has an validation errors + attr_accessor :has_validation_errors + + # Status of object + attr_accessor :status_attribute_string + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'contact_id' => :'ContactID', + :'contact_number' => :'ContactNumber', + :'account_number' => :'AccountNumber', + :'contact_status' => :'ContactStatus', + :'name' => :'Name', + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'email_address' => :'EmailAddress', + :'skype_user_name' => :'SkypeUserName', + :'contact_persons' => :'ContactPersons', + :'bank_account_details' => :'BankAccountDetails', + :'tax_number' => :'TaxNumber', + :'accounts_receivable_tax_type' => :'AccountsReceivableTaxType', + :'accounts_payable_tax_type' => :'AccountsPayableTaxType', + :'addresses' => :'Addresses', + :'phones' => :'Phones', + :'is_supplier' => :'IsSupplier', + :'is_customer' => :'IsCustomer', + :'default_currency' => :'DefaultCurrency', + :'xero_network_key' => :'XeroNetworkKey', + :'sales_default_account_code' => :'SalesDefaultAccountCode', + :'purchases_default_account_code' => :'PurchasesDefaultAccountCode', + :'sales_tracking_categories' => :'SalesTrackingCategories', + :'purchases_tracking_categories' => :'PurchasesTrackingCategories', + :'tracking_category_name' => :'TrackingCategoryName', + :'tracking_category_option' => :'TrackingCategoryOption', + :'payment_terms' => :'PaymentTerms', + :'updated_date_utc' => :'UpdatedDateUTC', + :'contact_groups' => :'ContactGroups', + :'website' => :'Website', + :'branding_theme' => :'BrandingTheme', + :'batch_payments' => :'BatchPayments', + :'discount' => :'Discount', + :'balances' => :'Balances', + :'attachments' => :'Attachments', + :'has_attachments' => :'HasAttachments', + :'validation_errors' => :'ValidationErrors', + :'has_validation_errors' => :'HasValidationErrors', + :'status_attribute_string' => :'StatusAttributeString' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'contact_id' => :'String', + :'contact_number' => :'String', + :'account_number' => :'String', + :'contact_status' => :'String', + :'name' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'email_address' => :'String', + :'skype_user_name' => :'String', + :'contact_persons' => :'Array', + :'bank_account_details' => :'String', + :'tax_number' => :'String', + :'accounts_receivable_tax_type' => :'String', + :'accounts_payable_tax_type' => :'String', + :'addresses' => :'Array
', + :'phones' => :'Array', + :'is_supplier' => :'Boolean', + :'is_customer' => :'Boolean', + :'default_currency' => :'CurrencyCode', + :'xero_network_key' => :'String', + :'sales_default_account_code' => :'String', + :'purchases_default_account_code' => :'String', + :'sales_tracking_categories' => :'Array', + :'purchases_tracking_categories' => :'Array', + :'tracking_category_name' => :'String', + :'tracking_category_option' => :'String', + :'payment_terms' => :'PaymentTerm', + :'updated_date_utc' => :'DateTime', + :'contact_groups' => :'Array', + :'website' => :'String', + :'branding_theme' => :'BrandingTheme', + :'batch_payments' => :'BatchPaymentDetails', + :'discount' => :'Float', + :'balances' => :'Balances', + :'attachments' => :'Array', + :'has_attachments' => :'Boolean', + :'validation_errors' => :'Array', + :'has_validation_errors' => :'Boolean', + :'status_attribute_string' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Contact` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Contact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'contact_id') + self.contact_id = attributes[:'contact_id'] + end + + if attributes.key?(:'contact_number') + self.contact_number = attributes[:'contact_number'] + end + + if attributes.key?(:'account_number') + self.account_number = attributes[:'account_number'] + end + + if attributes.key?(:'contact_status') + self.contact_status = attributes[:'contact_status'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'email_address') + self.email_address = attributes[:'email_address'] + end + + if attributes.key?(:'skype_user_name') + self.skype_user_name = attributes[:'skype_user_name'] + end + + if attributes.key?(:'contact_persons') + if (value = attributes[:'contact_persons']).is_a?(Array) + self.contact_persons = value + end + end + + if attributes.key?(:'bank_account_details') + self.bank_account_details = attributes[:'bank_account_details'] + end + + if attributes.key?(:'tax_number') + self.tax_number = attributes[:'tax_number'] + end + + if attributes.key?(:'accounts_receivable_tax_type') + self.accounts_receivable_tax_type = attributes[:'accounts_receivable_tax_type'] + end + + if attributes.key?(:'accounts_payable_tax_type') + self.accounts_payable_tax_type = attributes[:'accounts_payable_tax_type'] + end + + if attributes.key?(:'addresses') + if (value = attributes[:'addresses']).is_a?(Array) + self.addresses = value + end + end + + if attributes.key?(:'phones') + if (value = attributes[:'phones']).is_a?(Array) + self.phones = value + end + end + + if attributes.key?(:'is_supplier') + self.is_supplier = attributes[:'is_supplier'] + end + + if attributes.key?(:'is_customer') + self.is_customer = attributes[:'is_customer'] + end + + if attributes.key?(:'default_currency') + self.default_currency = attributes[:'default_currency'] + end + + if attributes.key?(:'xero_network_key') + self.xero_network_key = attributes[:'xero_network_key'] + end + + if attributes.key?(:'sales_default_account_code') + self.sales_default_account_code = attributes[:'sales_default_account_code'] + end + + if attributes.key?(:'purchases_default_account_code') + self.purchases_default_account_code = attributes[:'purchases_default_account_code'] + end + + if attributes.key?(:'sales_tracking_categories') + if (value = attributes[:'sales_tracking_categories']).is_a?(Array) + self.sales_tracking_categories = value + end + end + + if attributes.key?(:'purchases_tracking_categories') + if (value = attributes[:'purchases_tracking_categories']).is_a?(Array) + self.purchases_tracking_categories = value + end + end + + if attributes.key?(:'tracking_category_name') + self.tracking_category_name = attributes[:'tracking_category_name'] + end + + if attributes.key?(:'tracking_category_option') + self.tracking_category_option = attributes[:'tracking_category_option'] + end + + if attributes.key?(:'payment_terms') + self.payment_terms = attributes[:'payment_terms'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'contact_groups') + if (value = attributes[:'contact_groups']).is_a?(Array) + self.contact_groups = value + end + end + + if attributes.key?(:'website') + self.website = attributes[:'website'] + end + + if attributes.key?(:'branding_theme') + self.branding_theme = attributes[:'branding_theme'] + end + + if attributes.key?(:'batch_payments') + self.batch_payments = attributes[:'batch_payments'] + end + + if attributes.key?(:'discount') + self.discount = attributes[:'discount'] + end + + if attributes.key?(:'balances') + self.balances = attributes[:'balances'] + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'has_validation_errors') + self.has_validation_errors = attributes[:'has_validation_errors'] + else + self.has_validation_errors = false + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@contact_number.nil? && @contact_number.to_s.length > 50 + invalid_properties.push('invalid value for "contact_number", the character length must be smaller than or equal to 50.') + end + + if !@account_number.nil? && @account_number.to_s.length > 50 + invalid_properties.push('invalid value for "account_number", the character length must be smaller than or equal to 50.') + end + + if !@name.nil? && @name.to_s.length > 255 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 255.') + end + + if !@first_name.nil? && @first_name.to_s.length > 255 + invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.') + end + + if !@last_name.nil? && @last_name.to_s.length > 255 + invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.') + end + + if !@email_address.nil? && @email_address.to_s.length > 255 + invalid_properties.push('invalid value for "email_address", the character length must be smaller than or equal to 255.') + end + + if !@tax_number.nil? && @tax_number.to_s.length > 50 + invalid_properties.push('invalid value for "tax_number", the character length must be smaller than or equal to 50.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@contact_number.nil? && @contact_number.to_s.length > 50 + return false if !@account_number.nil? && @account_number.to_s.length > 50 + contact_status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) + return false unless contact_status_validator.valid?(@contact_status) + return false if !@name.nil? && @name.to_s.length > 255 + return false if !@first_name.nil? && @first_name.to_s.length > 255 + return false if !@last_name.nil? && @last_name.to_s.length > 255 + return false if !@email_address.nil? && @email_address.to_s.length > 255 + return false if !@tax_number.nil? && @tax_number.to_s.length > 50 + true + end + + # Custom attribute writer method with validation + # @param [Object] contact_number Value to be assigned + def contact_number=(contact_number) + if !contact_number.nil? && contact_number.to_s.length > 50 + fail ArgumentError, 'invalid value for "contact_number", the character length must be smaller than or equal to 50.' + end + + @contact_number = contact_number + end + + # Custom attribute writer method with validation + # @param [Object] account_number Value to be assigned + def account_number=(account_number) + if !account_number.nil? && account_number.to_s.length > 50 + fail ArgumentError, 'invalid value for "account_number", the character length must be smaller than or equal to 50.' + end + + @account_number = account_number + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] contact_status Object to be assigned + def contact_status=(contact_status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) + unless validator.valid?(contact_status) + fail ArgumentError, "invalid value for \"contact_status\", must be one of #{validator.allowable_values}." + end + @contact_status = contact_status + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] first_name Value to be assigned + def first_name=(first_name) + if !first_name.nil? && first_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 255.' + end + + @first_name = first_name + end + + # Custom attribute writer method with validation + # @param [Object] last_name Value to be assigned + def last_name=(last_name) + if !last_name.nil? && last_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 255.' + end + + @last_name = last_name + end + + # Custom attribute writer method with validation + # @param [Object] email_address Value to be assigned + def email_address=(email_address) + if !email_address.nil? && email_address.to_s.length > 255 + fail ArgumentError, 'invalid value for "email_address", the character length must be smaller than or equal to 255.' + end + + @email_address = email_address + end + + # Custom attribute writer method with validation + # @param [Object] tax_number Value to be assigned + def tax_number=(tax_number) + if !tax_number.nil? && tax_number.to_s.length > 50 + fail ArgumentError, 'invalid value for "tax_number", the character length must be smaller than or equal to 50.' + end + + @tax_number = tax_number + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + contact_id == o.contact_id && + contact_number == o.contact_number && + account_number == o.account_number && + contact_status == o.contact_status && + name == o.name && + first_name == o.first_name && + last_name == o.last_name && + email_address == o.email_address && + skype_user_name == o.skype_user_name && + contact_persons == o.contact_persons && + bank_account_details == o.bank_account_details && + tax_number == o.tax_number && + accounts_receivable_tax_type == o.accounts_receivable_tax_type && + accounts_payable_tax_type == o.accounts_payable_tax_type && + addresses == o.addresses && + phones == o.phones && + is_supplier == o.is_supplier && + is_customer == o.is_customer && + default_currency == o.default_currency && + xero_network_key == o.xero_network_key && + sales_default_account_code == o.sales_default_account_code && + purchases_default_account_code == o.purchases_default_account_code && + sales_tracking_categories == o.sales_tracking_categories && + purchases_tracking_categories == o.purchases_tracking_categories && + tracking_category_name == o.tracking_category_name && + tracking_category_option == o.tracking_category_option && + payment_terms == o.payment_terms && + updated_date_utc == o.updated_date_utc && + contact_groups == o.contact_groups && + website == o.website && + branding_theme == o.branding_theme && + batch_payments == o.batch_payments && + discount == o.discount && + balances == o.balances && + attachments == o.attachments && + has_attachments == o.has_attachments && + validation_errors == o.validation_errors && + has_validation_errors == o.has_validation_errors && + status_attribute_string == o.status_attribute_string + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [contact_id, contact_number, account_number, contact_status, name, first_name, last_name, email_address, skype_user_name, contact_persons, bank_account_details, tax_number, accounts_receivable_tax_type, accounts_payable_tax_type, addresses, phones, is_supplier, is_customer, default_currency, xero_network_key, sales_default_account_code, purchases_default_account_code, sales_tracking_categories, purchases_tracking_categories, tracking_category_name, tracking_category_option, payment_terms, updated_date_utc, contact_groups, website, branding_theme, batch_payments, discount, balances, attachments, has_attachments, validation_errors, has_validation_errors, status_attribute_string].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/contact_group.rb b/lib/xero-ruby/models/accounting/contact_group.rb new file mode 100644 index 00000000..386bd65c --- /dev/null +++ b/lib/xero-ruby/models/accounting/contact_group.rb @@ -0,0 +1,270 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ContactGroup + # The Name of the contact group. Required when creating a new contact group + attr_accessor :name + + # The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. + attr_accessor :status + + # The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 + attr_accessor :contact_group_id + + # The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. + attr_accessor :contacts + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'status' => :'Status', + :'contact_group_id' => :'ContactGroupID', + :'contacts' => :'Contacts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'status' => :'String', + :'contact_group_id' => :'String', + :'contacts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ContactGroup` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ContactGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'contact_group_id') + self.contact_group_id = attributes[:'contact_group_id'] + end + + if attributes.key?(:'contacts') + if (value = attributes[:'contacts']).is_a?(Array) + self.contacts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + status == o.status && + contact_group_id == o.contact_group_id && + contacts == o.contacts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, status, contact_group_id, contacts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/contact_groups.rb b/lib/xero-ruby/models/accounting/contact_groups.rb new file mode 100644 index 00000000..289ff347 --- /dev/null +++ b/lib/xero-ruby/models/accounting/contact_groups.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ContactGroups + attr_accessor :contact_groups + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'contact_groups' => :'ContactGroups' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'contact_groups' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ContactGroups` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ContactGroups`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'contact_groups') + if (value = attributes[:'contact_groups']).is_a?(Array) + self.contact_groups = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + contact_groups == o.contact_groups + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [contact_groups].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/contact_person.rb b/lib/xero-ruby/models/accounting/contact_person.rb new file mode 100644 index 00000000..3d30621e --- /dev/null +++ b/lib/xero-ruby/models/accounting/contact_person.rb @@ -0,0 +1,234 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ContactPerson + # First name of person + attr_accessor :first_name + + # Last name of person + attr_accessor :last_name + + # Email address of person + attr_accessor :email_address + + # boolean to indicate whether contact should be included on emails with invoices etc. + attr_accessor :include_in_emails + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'email_address' => :'EmailAddress', + :'include_in_emails' => :'IncludeInEmails' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'first_name' => :'String', + :'last_name' => :'String', + :'email_address' => :'String', + :'include_in_emails' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ContactPerson` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ContactPerson`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'email_address') + self.email_address = attributes[:'email_address'] + end + + if attributes.key?(:'include_in_emails') + self.include_in_emails = attributes[:'include_in_emails'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + first_name == o.first_name && + last_name == o.last_name && + email_address == o.email_address && + include_in_emails == o.include_in_emails + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [first_name, last_name, email_address, include_in_emails].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/contacts.rb b/lib/xero-ruby/models/accounting/contacts.rb new file mode 100644 index 00000000..71990109 --- /dev/null +++ b/lib/xero-ruby/models/accounting/contacts.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Contacts + attr_accessor :contacts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'contacts' => :'Contacts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'contacts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Contacts` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Contacts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'contacts') + if (value = attributes[:'contacts']).is_a?(Array) + self.contacts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + contacts == o.contacts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [contacts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/country_code.rb b/lib/xero-ruby/models/accounting/country_code.rb new file mode 100644 index 00000000..4a6f5c1d --- /dev/null +++ b/lib/xero-ruby/models/accounting/country_code.rb @@ -0,0 +1,275 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class CountryCode + AD = "AD".freeze + AE = "AE".freeze + AF = "AF".freeze + AG = "AG".freeze + AI = "AI".freeze + AL = "AL".freeze + AM = "AM".freeze + AN = "AN".freeze + AO = "AO".freeze + AQ = "AQ".freeze + AR = "AR".freeze + AS = "AS".freeze + AT = "AT".freeze + AU = "AU".freeze + AW = "AW".freeze + AZ = "AZ".freeze + BA = "BA".freeze + BB = "BB".freeze + BD = "BD".freeze + BE = "BE".freeze + BF = "BF".freeze + BG = "BG".freeze + BH = "BH".freeze + BI = "BI".freeze + BJ = "BJ".freeze + BL = "BL".freeze + BM = "BM".freeze + BN = "BN".freeze + BO = "BO".freeze + BR = "BR".freeze + BS = "BS".freeze + BT = "BT".freeze + BW = "BW".freeze + BY = "BY".freeze + BZ = "BZ".freeze + CA = "CA".freeze + CC = "CC".freeze + CD = "CD".freeze + CF = "CF".freeze + CG = "CG".freeze + CH = "CH".freeze + CI = "CI".freeze + CK = "CK".freeze + CL = "CL".freeze + CM = "CM".freeze + CN = "CN".freeze + CO = "CO".freeze + CR = "CR".freeze + CU = "CU".freeze + CV = "CV".freeze + CW = "CW".freeze + CX = "CX".freeze + CY = "CY".freeze + CZ = "CZ".freeze + DE = "DE".freeze + DJ = "DJ".freeze + DK = "DK".freeze + DM = "DM".freeze + DO = "DO".freeze + DZ = "DZ".freeze + EC = "EC".freeze + EE = "EE".freeze + EG = "EG".freeze + EH = "EH".freeze + ER = "ER".freeze + ES = "ES".freeze + ET = "ET".freeze + FI = "FI".freeze + FJ = "FJ".freeze + FK = "FK".freeze + FM = "FM".freeze + FO = "FO".freeze + FR = "FR".freeze + GA = "GA".freeze + GB = "GB".freeze + GD = "GD".freeze + GE = "GE".freeze + GG = "GG".freeze + GH = "GH".freeze + GI = "GI".freeze + GL = "GL".freeze + GM = "GM".freeze + GN = "GN".freeze + GQ = "GQ".freeze + GR = "GR".freeze + GT = "GT".freeze + GU = "GU".freeze + GW = "GW".freeze + GY = "GY".freeze + HK = "HK".freeze + HN = "HN".freeze + HR = "HR".freeze + HT = "HT".freeze + HU = "HU".freeze + ID = "ID".freeze + IE = "IE".freeze + IL = "IL".freeze + IM = "IM".freeze + IN = "IN".freeze + IO = "IO".freeze + IQ = "IQ".freeze + IR = "IR".freeze + IS = "IS".freeze + IT = "IT".freeze + JE = "JE".freeze + JM = "JM".freeze + JO = "JO".freeze + JP = "JP".freeze + KE = "KE".freeze + KG = "KG".freeze + KH = "KH".freeze + KI = "KI".freeze + KM = "KM".freeze + KN = "KN".freeze + KP = "KP".freeze + KR = "KR".freeze + KW = "KW".freeze + KY = "KY".freeze + KZ = "KZ".freeze + LA = "LA".freeze + LB = "LB".freeze + LC = "LC".freeze + LI = "LI".freeze + LK = "LK".freeze + LR = "LR".freeze + LS = "LS".freeze + LT = "LT".freeze + LU = "LU".freeze + LV = "LV".freeze + LY = "LY".freeze + MA = "MA".freeze + MC = "MC".freeze + MD = "MD".freeze + ME = "ME".freeze + MF = "MF".freeze + MG = "MG".freeze + MH = "MH".freeze + MK = "MK".freeze + ML = "ML".freeze + MM = "MM".freeze + MN = "MN".freeze + MO = "MO".freeze + MP = "MP".freeze + MR = "MR".freeze + MS = "MS".freeze + MT = "MT".freeze + MU = "MU".freeze + MV = "MV".freeze + MW = "MW".freeze + MX = "MX".freeze + MY = "MY".freeze + MZ = "MZ".freeze + NA = "NA".freeze + NC = "NC".freeze + NE = "NE".freeze + NG = "NG".freeze + NI = "NI".freeze + NL = "NL".freeze + NO = "NO".freeze + NP = "NP".freeze + NR = "NR".freeze + NU = "NU".freeze + NZ = "NZ".freeze + OM = "OM".freeze + PA = "PA".freeze + PE = "PE".freeze + PF = "PF".freeze + PG = "PG".freeze + PH = "PH".freeze + PK = "PK".freeze + PL = "PL".freeze + PM = "PM".freeze + PN = "PN".freeze + PR = "PR".freeze + PS = "PS".freeze + PT = "PT".freeze + PW = "PW".freeze + PY = "PY".freeze + QA = "QA".freeze + RE = "RE".freeze + RO = "RO".freeze + RS = "RS".freeze + RU = "RU".freeze + RW = "RW".freeze + SA = "SA".freeze + SB = "SB".freeze + SC = "SC".freeze + SD = "SD".freeze + SE = "SE".freeze + SG = "SG".freeze + SH = "SH".freeze + SI = "SI".freeze + SJ = "SJ".freeze + SK = "SK".freeze + SL = "SL".freeze + SM = "SM".freeze + SN = "SN".freeze + SO = "SO".freeze + SR = "SR".freeze + SS = "SS".freeze + ST = "ST".freeze + SV = "SV".freeze + SX = "SX".freeze + SY = "SY".freeze + SZ = "SZ".freeze + TC = "TC".freeze + TD = "TD".freeze + TG = "TG".freeze + TH = "TH".freeze + TJ = "TJ".freeze + TK = "TK".freeze + TL = "TL".freeze + TM = "TM".freeze + TN = "TN".freeze + TO = "TO".freeze + TR = "TR".freeze + TT = "TT".freeze + TV = "TV".freeze + TW = "TW".freeze + TZ = "TZ".freeze + UA = "UA".freeze + UG = "UG".freeze + US = "US".freeze + UY = "UY".freeze + UZ = "UZ".freeze + VA = "VA".freeze + VC = "VC".freeze + VE = "VE".freeze + VG = "VG".freeze + VI = "VI".freeze + VN = "VN".freeze + VU = "VU".freeze + WF = "WF".freeze + WS = "WS".freeze + XK = "XK".freeze + YE = "YE".freeze + YT = "YT".freeze + ZA = "ZA".freeze + ZM = "ZM".freeze + ZW = "ZW".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CountryCode.constants.select { |c| CountryCode::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CountryCode" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/credit_note.rb b/lib/xero-ruby/models/accounting/credit_note.rb new file mode 100644 index 00000000..d3723760 --- /dev/null +++ b/lib/xero-ruby/models/accounting/credit_note.rb @@ -0,0 +1,509 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class CreditNote + # See Credit Note Types + attr_accessor :type + + attr_accessor :contact + + # The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + attr_accessor :date + + # See Credit Note Status Codes + attr_accessor :status + + attr_accessor :line_amount_types + + # See Invoice Line Items + attr_accessor :line_items + + # The subtotal of the credit note excluding taxes + attr_accessor :sub_total + + # The total tax on the credit note + attr_accessor :total_tax + + # The total of the Credit Note(subtotal + total tax) + attr_accessor :total + + # UTC timestamp of last update to the credit note + attr_accessor :updated_date_utc + + attr_accessor :currency_code + + # Date when credit note was fully paid(UTC format) + attr_accessor :fully_paid_on_date + + # Xero generated unique identifier + attr_accessor :credit_note_id + + # ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) + attr_accessor :credit_note_number + + # ACCRECCREDIT only – additional reference number + attr_accessor :reference + + # boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) + attr_accessor :sent_to_contact + + # The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used + attr_accessor :currency_rate + + # The remaining credit balance on the Credit Note + attr_accessor :remaining_credit + + # See Allocations + attr_accessor :allocations + + # The amount of applied to an invoice + attr_accessor :applied_amount + + # See Payments + attr_accessor :payments + + # See BrandingThemes + attr_accessor :branding_theme_id + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # boolean to indicate if a credit note has an attachment + attr_accessor :has_attachments + + # A boolean to indicate if a credit note has an validation errors + attr_accessor :has_errors + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'Type', + :'contact' => :'Contact', + :'date' => :'Date', + :'status' => :'Status', + :'line_amount_types' => :'LineAmountTypes', + :'line_items' => :'LineItems', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'updated_date_utc' => :'UpdatedDateUTC', + :'currency_code' => :'CurrencyCode', + :'fully_paid_on_date' => :'FullyPaidOnDate', + :'credit_note_id' => :'CreditNoteID', + :'credit_note_number' => :'CreditNoteNumber', + :'reference' => :'Reference', + :'sent_to_contact' => :'SentToContact', + :'currency_rate' => :'CurrencyRate', + :'remaining_credit' => :'RemainingCredit', + :'allocations' => :'Allocations', + :'applied_amount' => :'AppliedAmount', + :'payments' => :'Payments', + :'branding_theme_id' => :'BrandingThemeID', + :'status_attribute_string' => :'StatusAttributeString', + :'has_attachments' => :'HasAttachments', + :'has_errors' => :'HasErrors', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'contact' => :'Contact', + :'date' => :'Date', + :'status' => :'String', + :'line_amount_types' => :'LineAmountTypes', + :'line_items' => :'Array', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'updated_date_utc' => :'DateTime', + :'currency_code' => :'CurrencyCode', + :'fully_paid_on_date' => :'Date', + :'credit_note_id' => :'String', + :'credit_note_number' => :'String', + :'reference' => :'String', + :'sent_to_contact' => :'Boolean', + :'currency_rate' => :'Float', + :'remaining_credit' => :'Float', + :'allocations' => :'Array', + :'applied_amount' => :'Float', + :'payments' => :'Array', + :'branding_theme_id' => :'String', + :'status_attribute_string' => :'String', + :'has_attachments' => :'Boolean', + :'has_errors' => :'Boolean', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CreditNote` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CreditNote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'fully_paid_on_date') + self.fully_paid_on_date = attributes[:'fully_paid_on_date'] + end + + if attributes.key?(:'credit_note_id') + self.credit_note_id = attributes[:'credit_note_id'] + end + + if attributes.key?(:'credit_note_number') + self.credit_note_number = attributes[:'credit_note_number'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'sent_to_contact') + self.sent_to_contact = attributes[:'sent_to_contact'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'remaining_credit') + self.remaining_credit = attributes[:'remaining_credit'] + end + + if attributes.key?(:'allocations') + if (value = attributes[:'allocations']).is_a?(Array) + self.allocations = value + end + end + + if attributes.key?(:'applied_amount') + self.applied_amount = attributes[:'applied_amount'] + end + + if attributes.key?(:'payments') + if (value = attributes[:'payments']).is_a?(Array) + self.payments = value + end + end + + if attributes.key?(:'branding_theme_id') + self.branding_theme_id = attributes[:'branding_theme_id'] + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'has_errors') + self.has_errors = attributes[:'has_errors'] + else + self.has_errors = false + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["ACCPAYCREDIT", "ACCRECCREDIT"]) + return false unless type_validator.valid?(@type) + status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["ACCPAYCREDIT", "ACCRECCREDIT"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + contact == o.contact && + date == o.date && + status == o.status && + line_amount_types == o.line_amount_types && + line_items == o.line_items && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + updated_date_utc == o.updated_date_utc && + currency_code == o.currency_code && + fully_paid_on_date == o.fully_paid_on_date && + credit_note_id == o.credit_note_id && + credit_note_number == o.credit_note_number && + reference == o.reference && + sent_to_contact == o.sent_to_contact && + currency_rate == o.currency_rate && + remaining_credit == o.remaining_credit && + allocations == o.allocations && + applied_amount == o.applied_amount && + payments == o.payments && + branding_theme_id == o.branding_theme_id && + status_attribute_string == o.status_attribute_string && + has_attachments == o.has_attachments && + has_errors == o.has_errors && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/credit_notes.rb b/lib/xero-ruby/models/accounting/credit_notes.rb new file mode 100644 index 00000000..bbbefb3c --- /dev/null +++ b/lib/xero-ruby/models/accounting/credit_notes.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class CreditNotes + attr_accessor :credit_notes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'credit_notes' => :'CreditNotes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'credit_notes' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::CreditNotes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::CreditNotes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'credit_notes') + if (value = attributes[:'credit_notes']).is_a?(Array) + self.credit_notes = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + credit_notes == o.credit_notes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [credit_notes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/currencies.rb b/lib/xero-ruby/models/accounting/currencies.rb new file mode 100644 index 00000000..c3dc69fd --- /dev/null +++ b/lib/xero-ruby/models/accounting/currencies.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Currencies + attr_accessor :currencies + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'currencies' => :'Currencies' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'currencies' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Currencies` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Currencies`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'currencies') + if (value = attributes[:'currencies']).is_a?(Array) + self.currencies = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + currencies == o.currencies + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [currencies].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/currency.rb b/lib/xero-ruby/models/accounting/currency.rb new file mode 100644 index 00000000..92436f02 --- /dev/null +++ b/lib/xero-ruby/models/accounting/currency.rb @@ -0,0 +1,213 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Currency + attr_accessor :code + + # Name of Currency + attr_accessor :description + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'Code', + :'description' => :'Description' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'CurrencyCode', + :'description' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Currency` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Currency`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + description == o.description + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, description].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/currency_code.rb b/lib/xero-ruby/models/accounting/currency_code.rb new file mode 100644 index 00000000..c4cdc829 --- /dev/null +++ b/lib/xero-ruby/models/accounting/currency_code.rb @@ -0,0 +1,199 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class CurrencyCode + AED = "AED".freeze + AFN = "AFN".freeze + ALL = "ALL".freeze + AMD = "AMD".freeze + ANG = "ANG".freeze + AOA = "AOA".freeze + ARS = "ARS".freeze + AUD = "AUD".freeze + AWG = "AWG".freeze + AZN = "AZN".freeze + BAM = "BAM".freeze + BBD = "BBD".freeze + BDT = "BDT".freeze + BGN = "BGN".freeze + BHD = "BHD".freeze + BIF = "BIF".freeze + BMD = "BMD".freeze + BND = "BND".freeze + BOB = "BOB".freeze + BRL = "BRL".freeze + BSD = "BSD".freeze + BTN = "BTN".freeze + BWP = "BWP".freeze + BYN = "BYN".freeze + BZD = "BZD".freeze + CAD = "CAD".freeze + CDF = "CDF".freeze + CHF = "CHF".freeze + CLP = "CLP".freeze + CNY = "CNY".freeze + COP = "COP".freeze + CRC = "CRC".freeze + CUC = "CUC".freeze + CUP = "CUP".freeze + CVE = "CVE".freeze + CZK = "CZK".freeze + DJF = "DJF".freeze + DKK = "DKK".freeze + DOP = "DOP".freeze + DZD = "DZD".freeze + EGP = "EGP".freeze + ERN = "ERN".freeze + ETB = "ETB".freeze + EUR = "EUR".freeze + FJD = "FJD".freeze + FKP = "FKP".freeze + GBP = "GBP".freeze + GEL = "GEL".freeze + GGP = "GGP".freeze + GHS = "GHS".freeze + GIP = "GIP".freeze + GMD = "GMD".freeze + GNF = "GNF".freeze + GTQ = "GTQ".freeze + GYD = "GYD".freeze + HKD = "HKD".freeze + HNL = "HNL".freeze + HRK = "HRK".freeze + HTG = "HTG".freeze + HUF = "HUF".freeze + IDR = "IDR".freeze + ILS = "ILS".freeze + IMP = "IMP".freeze + INR = "INR".freeze + IQD = "IQD".freeze + IRR = "IRR".freeze + ISK = "ISK".freeze + JEP = "JEP".freeze + JMD = "JMD".freeze + JOD = "JOD".freeze + JPY = "JPY".freeze + KES = "KES".freeze + KGS = "KGS".freeze + KHR = "KHR".freeze + KMF = "KMF".freeze + KPW = "KPW".freeze + KRW = "KRW".freeze + KWD = "KWD".freeze + KYD = "KYD".freeze + KZT = "KZT".freeze + LAK = "LAK".freeze + LBP = "LBP".freeze + LKR = "LKR".freeze + LRD = "LRD".freeze + LSL = "LSL".freeze + LYD = "LYD".freeze + MAD = "MAD".freeze + MDL = "MDL".freeze + MGA = "MGA".freeze + MKD = "MKD".freeze + MMK = "MMK".freeze + MNT = "MNT".freeze + MOP = "MOP".freeze + MRU = "MRU".freeze + MUR = "MUR".freeze + MVR = "MVR".freeze + MWK = "MWK".freeze + MXN = "MXN".freeze + MYR = "MYR".freeze + MZN = "MZN".freeze + NAD = "NAD".freeze + NGN = "NGN".freeze + NIO = "NIO".freeze + NOK = "NOK".freeze + NPR = "NPR".freeze + NZD = "NZD".freeze + OMR = "OMR".freeze + PAB = "PAB".freeze + PEN = "PEN".freeze + PGK = "PGK".freeze + PHP = "PHP".freeze + PKR = "PKR".freeze + PLN = "PLN".freeze + PYG = "PYG".freeze + QAR = "QAR".freeze + RON = "RON".freeze + RSD = "RSD".freeze + RUB = "RUB".freeze + RWF = "RWF".freeze + SAR = "SAR".freeze + SBD = "SBD".freeze + SCR = "SCR".freeze + SDG = "SDG".freeze + SEK = "SEK".freeze + SGD = "SGD".freeze + SHP = "SHP".freeze + SLL = "SLL".freeze + SOS = "SOS".freeze + SPL = "SPL".freeze + SRD = "SRD".freeze + STN = "STN".freeze + SVC = "SVC".freeze + SYP = "SYP".freeze + SZL = "SZL".freeze + THB = "THB".freeze + TJS = "TJS".freeze + TMT = "TMT".freeze + TND = "TND".freeze + TOP = "TOP".freeze + _TRY = "TRY".freeze + TTD = "TTD".freeze + TVD = "TVD".freeze + TWD = "TWD".freeze + TZS = "TZS".freeze + UAH = "UAH".freeze + UGX = "UGX".freeze + USD = "USD".freeze + UYU = "UYU".freeze + UZS = "UZS".freeze + VEF = "VEF".freeze + VND = "VND".freeze + VUV = "VUV".freeze + WST = "WST".freeze + XAF = "XAF".freeze + XCD = "XCD".freeze + XDR = "XDR".freeze + XOF = "XOF".freeze + XPF = "XPF".freeze + YER = "YER".freeze + ZAR = "ZAR".freeze + ZMW = "ZMW".freeze + ZMK = "ZMK".freeze + ZWD = "ZWD".freeze + _EMPTY = "".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CurrencyCode.constants.select { |c| CurrencyCode::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CurrencyCode" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/element.rb b/lib/xero-ruby/models/accounting/element.rb new file mode 100644 index 00000000..924fdb6e --- /dev/null +++ b/lib/xero-ruby/models/accounting/element.rb @@ -0,0 +1,270 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Element + # Array of Validation Error message + attr_accessor :validation_errors + + # Unique ID for batch payment object with validation error + attr_accessor :batch_payment_id + + attr_accessor :bank_transaction_id + + attr_accessor :credit_note_id + + attr_accessor :contact_id + + attr_accessor :invoice_id + + attr_accessor :item_id + + attr_accessor :purchase_order_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'validation_errors' => :'ValidationErrors', + :'batch_payment_id' => :'BatchPaymentID', + :'bank_transaction_id' => :'BankTransactionID', + :'credit_note_id' => :'CreditNoteID', + :'contact_id' => :'ContactID', + :'invoice_id' => :'InvoiceID', + :'item_id' => :'ItemID', + :'purchase_order_id' => :'PurchaseOrderID' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'validation_errors' => :'Array', + :'batch_payment_id' => :'String', + :'bank_transaction_id' => :'String', + :'credit_note_id' => :'String', + :'contact_id' => :'String', + :'invoice_id' => :'String', + :'item_id' => :'String', + :'purchase_order_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Element` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Element`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'batch_payment_id') + self.batch_payment_id = attributes[:'batch_payment_id'] + end + + if attributes.key?(:'bank_transaction_id') + self.bank_transaction_id = attributes[:'bank_transaction_id'] + end + + if attributes.key?(:'credit_note_id') + self.credit_note_id = attributes[:'credit_note_id'] + end + + if attributes.key?(:'contact_id') + self.contact_id = attributes[:'contact_id'] + end + + if attributes.key?(:'invoice_id') + self.invoice_id = attributes[:'invoice_id'] + end + + if attributes.key?(:'item_id') + self.item_id = attributes[:'item_id'] + end + + if attributes.key?(:'purchase_order_id') + self.purchase_order_id = attributes[:'purchase_order_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + validation_errors == o.validation_errors && + batch_payment_id == o.batch_payment_id && + bank_transaction_id == o.bank_transaction_id && + credit_note_id == o.credit_note_id && + contact_id == o.contact_id && + invoice_id == o.invoice_id && + item_id == o.item_id && + purchase_order_id == o.purchase_order_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [validation_errors, batch_payment_id, bank_transaction_id, credit_note_id, contact_id, invoice_id, item_id, purchase_order_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/employee.rb b/lib/xero-ruby/models/accounting/employee.rb new file mode 100644 index 00000000..e79c9620 --- /dev/null +++ b/lib/xero-ruby/models/accounting/employee.rb @@ -0,0 +1,338 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Employee + # The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + attr_accessor :employee_id + + # Current status of an employee – see contact status types + attr_accessor :status + + # First name of an employee (max length = 255) + attr_accessor :first_name + + # Last name of an employee (max length = 255) + attr_accessor :last_name + + attr_accessor :external_link + + attr_accessor :updated_date_utc + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employee_id' => :'EmployeeID', + :'status' => :'Status', + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'external_link' => :'ExternalLink', + :'updated_date_utc' => :'UpdatedDateUTC', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employee_id' => :'String', + :'status' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'external_link' => :'ExternalLink', + :'updated_date_utc' => :'DateTime', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Employee` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Employee`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employee_id') + self.employee_id = attributes[:'employee_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'external_link') + self.external_link = attributes[:'external_link'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@first_name.nil? && @first_name.to_s.length > 255 + invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.') + end + + if !@last_name.nil? && @last_name.to_s.length > 255 + invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) + return false unless status_validator.valid?(@status) + return false if !@first_name.nil? && @first_name.to_s.length > 255 + return false if !@last_name.nil? && @last_name.to_s.length > 255 + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "GDPRREQUEST"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method with validation + # @param [Object] first_name Value to be assigned + def first_name=(first_name) + if !first_name.nil? && first_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "first_name", the character length must be smaller than or equal to 255.' + end + + @first_name = first_name + end + + # Custom attribute writer method with validation + # @param [Object] last_name Value to be assigned + def last_name=(last_name) + if !last_name.nil? && last_name.to_s.length > 255 + fail ArgumentError, 'invalid value for "last_name", the character length must be smaller than or equal to 255.' + end + + @last_name = last_name + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employee_id == o.employee_id && + status == o.status && + first_name == o.first_name && + last_name == o.last_name && + external_link == o.external_link && + updated_date_utc == o.updated_date_utc && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employee_id, status, first_name, last_name, external_link, updated_date_utc, status_attribute_string, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/employees.rb b/lib/xero-ruby/models/accounting/employees.rb new file mode 100644 index 00000000..5d21865e --- /dev/null +++ b/lib/xero-ruby/models/accounting/employees.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Employees + attr_accessor :employees + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'employees' => :'Employees' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'employees' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Employees` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Employees`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'employees') + if (value = attributes[:'employees']).is_a?(Array) + self.employees = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + employees == o.employees + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [employees].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/error.rb b/lib/xero-ruby/models/accounting/error.rb new file mode 100644 index 00000000..5e25fb8f --- /dev/null +++ b/lib/xero-ruby/models/accounting/error.rb @@ -0,0 +1,236 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Error + # Exception number + attr_accessor :error_number + + # Exception type + attr_accessor :type + + # Exception message + attr_accessor :message + + # Array of Elements of validation Errors + attr_accessor :elements + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'error_number' => :'ErrorNumber', + :'type' => :'Type', + :'message' => :'Message', + :'elements' => :'Elements' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'error_number' => :'Integer', + :'type' => :'String', + :'message' => :'String', + :'elements' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Error` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'error_number') + self.error_number = attributes[:'error_number'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'elements') + if (value = attributes[:'elements']).is_a?(Array) + self.elements = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + error_number == o.error_number && + type == o.type && + message == o.message && + elements == o.elements + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [error_number, type, message, elements].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/expense_claim.rb b/lib/xero-ruby/models/accounting/expense_claim.rb new file mode 100644 index 00000000..b7089e4d --- /dev/null +++ b/lib/xero-ruby/models/accounting/expense_claim.rb @@ -0,0 +1,350 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ExpenseClaim + # Xero generated unique identifier for an expense claim + attr_accessor :expense_claim_id + + # Current status of an expense claim – see status types + attr_accessor :status + + # See Payments + attr_accessor :payments + + attr_accessor :user + + attr_accessor :receipts + + # Last modified date UTC format + attr_accessor :updated_date_utc + + # The total of an expense claim being paid + attr_accessor :total + + # The amount due to be paid for an expense claim + attr_accessor :amount_due + + # The amount still to pay for an expense claim + attr_accessor :amount_paid + + # The date when the expense claim is due to be paid YYYY-MM-DD + attr_accessor :payment_due_date + + # The date the expense claim will be reported in Xero YYYY-MM-DD + attr_accessor :reporting_date + + # The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 + attr_accessor :receipt_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'expense_claim_id' => :'ExpenseClaimID', + :'status' => :'Status', + :'payments' => :'Payments', + :'user' => :'User', + :'receipts' => :'Receipts', + :'updated_date_utc' => :'UpdatedDateUTC', + :'total' => :'Total', + :'amount_due' => :'AmountDue', + :'amount_paid' => :'AmountPaid', + :'payment_due_date' => :'PaymentDueDate', + :'reporting_date' => :'ReportingDate', + :'receipt_id' => :'ReceiptID' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'expense_claim_id' => :'String', + :'status' => :'String', + :'payments' => :'Array', + :'user' => :'User', + :'receipts' => :'Array', + :'updated_date_utc' => :'DateTime', + :'total' => :'Float', + :'amount_due' => :'Float', + :'amount_paid' => :'Float', + :'payment_due_date' => :'Date', + :'reporting_date' => :'Date', + :'receipt_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ExpenseClaim` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ExpenseClaim`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'expense_claim_id') + self.expense_claim_id = attributes[:'expense_claim_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'payments') + if (value = attributes[:'payments']).is_a?(Array) + self.payments = value + end + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'receipts') + if (value = attributes[:'receipts']).is_a?(Array) + self.receipts = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'amount_due') + self.amount_due = attributes[:'amount_due'] + end + + if attributes.key?(:'amount_paid') + self.amount_paid = attributes[:'amount_paid'] + end + + if attributes.key?(:'payment_due_date') + self.payment_due_date = attributes[:'payment_due_date'] + end + + if attributes.key?(:'reporting_date') + self.reporting_date = attributes[:'reporting_date'] + end + + if attributes.key?(:'receipt_id') + self.receipt_id = attributes[:'receipt_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["SUBMITTED", "AUTHORISED", "PAID", "VOIDED", "DELETED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["SUBMITTED", "AUTHORISED", "PAID", "VOIDED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expense_claim_id == o.expense_claim_id && + status == o.status && + payments == o.payments && + user == o.user && + receipts == o.receipts && + updated_date_utc == o.updated_date_utc && + total == o.total && + amount_due == o.amount_due && + amount_paid == o.amount_paid && + payment_due_date == o.payment_due_date && + reporting_date == o.reporting_date && + receipt_id == o.receipt_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [expense_claim_id, status, payments, user, receipts, updated_date_utc, total, amount_due, amount_paid, payment_due_date, reporting_date, receipt_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/expense_claims.rb b/lib/xero-ruby/models/accounting/expense_claims.rb new file mode 100644 index 00000000..9f310844 --- /dev/null +++ b/lib/xero-ruby/models/accounting/expense_claims.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ExpenseClaims + attr_accessor :expense_claims + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'expense_claims' => :'ExpenseClaims' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'expense_claims' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ExpenseClaims` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ExpenseClaims`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'expense_claims') + if (value = attributes[:'expense_claims']).is_a?(Array) + self.expense_claims = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + expense_claims == o.expense_claims + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [expense_claims].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/external_link.rb b/lib/xero-ruby/models/accounting/external_link.rb new file mode 100644 index 00000000..eee67f1a --- /dev/null +++ b/lib/xero-ruby/models/accounting/external_link.rb @@ -0,0 +1,257 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ExternalLink + # See External link types + attr_accessor :link_type + + # URL for service e.g. http://twitter.com/xeroapi + attr_accessor :url + + attr_accessor :description + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'link_type' => :'LinkType', + :'url' => :'Url', + :'description' => :'Description' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'link_type' => :'String', + :'url' => :'String', + :'description' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ExternalLink` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ExternalLink`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'link_type') + self.link_type = attributes[:'link_type'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + link_type_validator = EnumAttributeValidator.new('String', ["Facebook", "GooglePlus", "LinkedIn", "Twitter", "Website"]) + return false unless link_type_validator.valid?(@link_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] link_type Object to be assigned + def link_type=(link_type) + validator = EnumAttributeValidator.new('String', ["Facebook", "GooglePlus", "LinkedIn", "Twitter", "Website"]) + unless validator.valid?(link_type) + fail ArgumentError, "invalid value for \"link_type\", must be one of #{validator.allowable_values}." + end + @link_type = link_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + link_type == o.link_type && + url == o.url && + description == o.description + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [link_type, url, description].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/history_record.rb b/lib/xero-ruby/models/accounting/history_record.rb new file mode 100644 index 00000000..6cb6ad84 --- /dev/null +++ b/lib/xero-ruby/models/accounting/history_record.rb @@ -0,0 +1,234 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class HistoryRecord + # details + attr_accessor :details + + # Name of branding theme + attr_accessor :changes + + # has a value of 0 + attr_accessor :user + + # UTC timestamp of creation date of branding theme + attr_accessor :date_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'details' => :'Details', + :'changes' => :'Changes', + :'user' => :'User', + :'date_utc' => :'DateUTC' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'details' => :'String', + :'changes' => :'String', + :'user' => :'String', + :'date_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::HistoryRecord` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::HistoryRecord`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'changes') + self.changes = attributes[:'changes'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'date_utc') + self.date_utc = attributes[:'date_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + details == o.details && + changes == o.changes && + user == o.user && + date_utc == o.date_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [details, changes, user, date_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/history_records.rb b/lib/xero-ruby/models/accounting/history_records.rb new file mode 100644 index 00000000..ea0f4a69 --- /dev/null +++ b/lib/xero-ruby/models/accounting/history_records.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class HistoryRecords + attr_accessor :history_records + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'history_records' => :'HistoryRecords' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'history_records' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::HistoryRecords` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::HistoryRecords`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'history_records') + if (value = attributes[:'history_records']).is_a?(Array) + self.history_records = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + history_records == o.history_records + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [history_records].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/invoice.rb b/lib/xero-ruby/models/accounting/invoice.rb new file mode 100644 index 00000000..678271dd --- /dev/null +++ b/lib/xero-ruby/models/accounting/invoice.rb @@ -0,0 +1,667 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Invoice + # See Invoice Types + attr_accessor :type + + attr_accessor :contact + + # See LineItems + attr_accessor :line_items + + # Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + attr_accessor :date + + # Date invoice is due – YYYY-MM-DD + attr_accessor :due_date + + attr_accessor :line_amount_types + + # ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) + attr_accessor :invoice_number + + # ACCREC only – additional reference number (max length = 255) + attr_accessor :reference + + # See BrandingThemes + attr_accessor :branding_theme_id + + # URL link to a source document – shown as “Go to [appName]” in the Xero app + attr_accessor :url + + attr_accessor :currency_code + + # The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) + attr_accessor :currency_rate + + # See Invoice Status Codes + attr_accessor :status + + # Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved + attr_accessor :sent_to_contact + + # Shown on sales invoices (Accounts Receivable) when this has been set + attr_accessor :expected_payment_date + + # Shown on bills (Accounts Payable) when this has been set + attr_accessor :planned_payment_date + + # CIS deduction for UK contractors + attr_accessor :cis_deduction + + # Total of invoice excluding taxes + attr_accessor :sub_total + + # Total tax on invoice + attr_accessor :total_tax + + # Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts + attr_accessor :total + + # Total of discounts applied on the invoice line items + attr_accessor :total_discount + + # Xero generated unique identifier for invoice + attr_accessor :invoice_id + + # boolean to indicate if an invoice has an attachment + attr_accessor :has_attachments + + # boolean to indicate if an invoice has a discount + attr_accessor :is_discounted + + # See Payments + attr_accessor :payments + + # See Prepayments + attr_accessor :prepayments + + # See Overpayments + attr_accessor :overpayments + + # Amount remaining to be paid on invoice + attr_accessor :amount_due + + # Sum of payments received for invoice + attr_accessor :amount_paid + + # The date the invoice was fully paid. Only returned on fully paid invoices + attr_accessor :fully_paid_on_date + + # Sum of all credit notes, over-payments and pre-payments applied to invoice + attr_accessor :amount_credited + + # Last modified date UTC format + attr_accessor :updated_date_utc + + # Details of credit notes that have been applied to an invoice + attr_accessor :credit_notes + + # Displays array of attachments from the API + attr_accessor :attachments + + # A boolean to indicate if a invoice has an validation errors + attr_accessor :has_errors + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Displays array of warning messages from the API + attr_accessor :warnings + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'Type', + :'contact' => :'Contact', + :'line_items' => :'LineItems', + :'date' => :'Date', + :'due_date' => :'DueDate', + :'line_amount_types' => :'LineAmountTypes', + :'invoice_number' => :'InvoiceNumber', + :'reference' => :'Reference', + :'branding_theme_id' => :'BrandingThemeID', + :'url' => :'Url', + :'currency_code' => :'CurrencyCode', + :'currency_rate' => :'CurrencyRate', + :'status' => :'Status', + :'sent_to_contact' => :'SentToContact', + :'expected_payment_date' => :'ExpectedPaymentDate', + :'planned_payment_date' => :'PlannedPaymentDate', + :'cis_deduction' => :'CISDeduction', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'total_discount' => :'TotalDiscount', + :'invoice_id' => :'InvoiceID', + :'has_attachments' => :'HasAttachments', + :'is_discounted' => :'IsDiscounted', + :'payments' => :'Payments', + :'prepayments' => :'Prepayments', + :'overpayments' => :'Overpayments', + :'amount_due' => :'AmountDue', + :'amount_paid' => :'AmountPaid', + :'fully_paid_on_date' => :'FullyPaidOnDate', + :'amount_credited' => :'AmountCredited', + :'updated_date_utc' => :'UpdatedDateUTC', + :'credit_notes' => :'CreditNotes', + :'attachments' => :'Attachments', + :'has_errors' => :'HasErrors', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors', + :'warnings' => :'Warnings' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'contact' => :'Contact', + :'line_items' => :'Array', + :'date' => :'Date', + :'due_date' => :'Date', + :'line_amount_types' => :'LineAmountTypes', + :'invoice_number' => :'String', + :'reference' => :'String', + :'branding_theme_id' => :'String', + :'url' => :'String', + :'currency_code' => :'CurrencyCode', + :'currency_rate' => :'Float', + :'status' => :'String', + :'sent_to_contact' => :'Boolean', + :'expected_payment_date' => :'Date', + :'planned_payment_date' => :'Date', + :'cis_deduction' => :'Float', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'total_discount' => :'Float', + :'invoice_id' => :'String', + :'has_attachments' => :'Boolean', + :'is_discounted' => :'Boolean', + :'payments' => :'Array', + :'prepayments' => :'Array', + :'overpayments' => :'Array', + :'amount_due' => :'Float', + :'amount_paid' => :'Float', + :'fully_paid_on_date' => :'Date', + :'amount_credited' => :'Float', + :'updated_date_utc' => :'DateTime', + :'credit_notes' => :'Array', + :'attachments' => :'Array', + :'has_errors' => :'Boolean', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array', + :'warnings' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Invoice` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Invoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'due_date') + self.due_date = attributes[:'due_date'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'invoice_number') + self.invoice_number = attributes[:'invoice_number'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'branding_theme_id') + self.branding_theme_id = attributes[:'branding_theme_id'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'sent_to_contact') + self.sent_to_contact = attributes[:'sent_to_contact'] + end + + if attributes.key?(:'expected_payment_date') + self.expected_payment_date = attributes[:'expected_payment_date'] + end + + if attributes.key?(:'planned_payment_date') + self.planned_payment_date = attributes[:'planned_payment_date'] + end + + if attributes.key?(:'cis_deduction') + self.cis_deduction = attributes[:'cis_deduction'] + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'total_discount') + self.total_discount = attributes[:'total_discount'] + end + + if attributes.key?(:'invoice_id') + self.invoice_id = attributes[:'invoice_id'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'is_discounted') + self.is_discounted = attributes[:'is_discounted'] + end + + if attributes.key?(:'payments') + if (value = attributes[:'payments']).is_a?(Array) + self.payments = value + end + end + + if attributes.key?(:'prepayments') + if (value = attributes[:'prepayments']).is_a?(Array) + self.prepayments = value + end + end + + if attributes.key?(:'overpayments') + if (value = attributes[:'overpayments']).is_a?(Array) + self.overpayments = value + end + end + + if attributes.key?(:'amount_due') + self.amount_due = attributes[:'amount_due'] + end + + if attributes.key?(:'amount_paid') + self.amount_paid = attributes[:'amount_paid'] + end + + if attributes.key?(:'fully_paid_on_date') + self.fully_paid_on_date = attributes[:'fully_paid_on_date'] + end + + if attributes.key?(:'amount_credited') + self.amount_credited = attributes[:'amount_credited'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'credit_notes') + if (value = attributes[:'credit_notes']).is_a?(Array) + self.credit_notes = value + end + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + + if attributes.key?(:'has_errors') + self.has_errors = attributes[:'has_errors'] + else + self.has_errors = false + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@invoice_number.nil? && @invoice_number.to_s.length > 255 + invalid_properties.push('invalid value for "invoice_number", the character length must be smaller than or equal to 255.') + end + + if !@reference.nil? && @reference.to_s.length > 255 + invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 255.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCPAYCREDIT", "APOVERPAYMENT", "APPREPAYMENT", "ACCREC", "ACCRECCREDIT", "AROVERPAYMENT", "ARPREPAYMENT"]) + return false unless type_validator.valid?(@type) + return false if !@invoice_number.nil? && @invoice_number.to_s.length > 255 + return false if !@reference.nil? && @reference.to_s.length > 255 + status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCPAYCREDIT", "APOVERPAYMENT", "APPREPAYMENT", "ACCREC", "ACCRECCREDIT", "AROVERPAYMENT", "ARPREPAYMENT"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method with validation + # @param [Object] invoice_number Value to be assigned + def invoice_number=(invoice_number) + if !invoice_number.nil? && invoice_number.to_s.length > 255 + fail ArgumentError, 'invalid value for "invoice_number", the character length must be smaller than or equal to 255.' + end + + @invoice_number = invoice_number + end + + # Custom attribute writer method with validation + # @param [Object] reference Value to be assigned + def reference=(reference) + if !reference.nil? && reference.to_s.length > 255 + fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 255.' + end + + @reference = reference + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "DELETED", "AUTHORISED", "PAID", "VOIDED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + contact == o.contact && + line_items == o.line_items && + date == o.date && + due_date == o.due_date && + line_amount_types == o.line_amount_types && + invoice_number == o.invoice_number && + reference == o.reference && + branding_theme_id == o.branding_theme_id && + url == o.url && + currency_code == o.currency_code && + currency_rate == o.currency_rate && + status == o.status && + sent_to_contact == o.sent_to_contact && + expected_payment_date == o.expected_payment_date && + planned_payment_date == o.planned_payment_date && + cis_deduction == o.cis_deduction && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + total_discount == o.total_discount && + invoice_id == o.invoice_id && + has_attachments == o.has_attachments && + is_discounted == o.is_discounted && + payments == o.payments && + prepayments == o.prepayments && + overpayments == o.overpayments && + amount_due == o.amount_due && + amount_paid == o.amount_paid && + fully_paid_on_date == o.fully_paid_on_date && + amount_credited == o.amount_credited && + updated_date_utc == o.updated_date_utc && + credit_notes == o.credit_notes && + attachments == o.attachments && + has_errors == o.has_errors && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors && + warnings == o.warnings + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, contact, line_items, date, due_date, line_amount_types, invoice_number, reference, branding_theme_id, url, currency_code, currency_rate, status, sent_to_contact, expected_payment_date, planned_payment_date, cis_deduction, sub_total, total_tax, total, total_discount, invoice_id, has_attachments, is_discounted, payments, prepayments, overpayments, amount_due, amount_paid, fully_paid_on_date, amount_credited, updated_date_utc, credit_notes, attachments, has_errors, status_attribute_string, validation_errors, warnings].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/invoice_reminder.rb b/lib/xero-ruby/models/accounting/invoice_reminder.rb new file mode 100644 index 00000000..7a452281 --- /dev/null +++ b/lib/xero-ruby/models/accounting/invoice_reminder.rb @@ -0,0 +1,204 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class InvoiceReminder + # setting for on or off + attr_accessor :enabled + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'enabled' => :'Enabled' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'enabled' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::InvoiceReminder` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::InvoiceReminder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + enabled == o.enabled + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [enabled].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/invoice_reminders.rb b/lib/xero-ruby/models/accounting/invoice_reminders.rb new file mode 100644 index 00000000..8143ad1f --- /dev/null +++ b/lib/xero-ruby/models/accounting/invoice_reminders.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class InvoiceReminders + attr_accessor :invoice_reminders + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'invoice_reminders' => :'InvoiceReminders' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'invoice_reminders' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::InvoiceReminders` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::InvoiceReminders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'invoice_reminders') + if (value = attributes[:'invoice_reminders']).is_a?(Array) + self.invoice_reminders = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + invoice_reminders == o.invoice_reminders + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [invoice_reminders].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/invoices.rb b/lib/xero-ruby/models/accounting/invoices.rb new file mode 100644 index 00000000..b7cdf9a6 --- /dev/null +++ b/lib/xero-ruby/models/accounting/invoices.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Invoices + attr_accessor :invoices + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'invoices' => :'Invoices' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'invoices' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Invoices` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Invoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'invoices') + if (value = attributes[:'invoices']).is_a?(Array) + self.invoices = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + invoices == o.invoices + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [invoices].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/item.rb b/lib/xero-ruby/models/accounting/item.rb new file mode 100644 index 00000000..6374e1f6 --- /dev/null +++ b/lib/xero-ruby/models/accounting/item.rb @@ -0,0 +1,423 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Item + # User defined item code (max length = 30) + attr_accessor :code + + # The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item + attr_accessor :inventory_asset_account_code + + # The name of the item (max length = 50) + attr_accessor :name + + # Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. + attr_accessor :is_sold + + # Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. + attr_accessor :is_purchased + + # The sales description of the item (max length = 4000) + attr_accessor :description + + # The purchase description of the item (max length = 4000) + attr_accessor :purchase_description + + attr_accessor :purchase_details + + attr_accessor :sales_details + + # True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. + attr_accessor :is_tracked_as_inventory + + # The value of the item on hand. Calculated using average cost accounting. + attr_accessor :total_cost_pool + + # The quantity of the item on hand + attr_accessor :quantity_on_hand + + # Last modified date in UTC format + attr_accessor :updated_date_utc + + # The Xero identifier for an Item + attr_accessor :item_id + + # Status of object + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'code' => :'Code', + :'inventory_asset_account_code' => :'InventoryAssetAccountCode', + :'name' => :'Name', + :'is_sold' => :'IsSold', + :'is_purchased' => :'IsPurchased', + :'description' => :'Description', + :'purchase_description' => :'PurchaseDescription', + :'purchase_details' => :'PurchaseDetails', + :'sales_details' => :'SalesDetails', + :'is_tracked_as_inventory' => :'IsTrackedAsInventory', + :'total_cost_pool' => :'TotalCostPool', + :'quantity_on_hand' => :'QuantityOnHand', + :'updated_date_utc' => :'UpdatedDateUTC', + :'item_id' => :'ItemID', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'code' => :'String', + :'inventory_asset_account_code' => :'String', + :'name' => :'String', + :'is_sold' => :'Boolean', + :'is_purchased' => :'Boolean', + :'description' => :'String', + :'purchase_description' => :'String', + :'purchase_details' => :'Purchase', + :'sales_details' => :'Purchase', + :'is_tracked_as_inventory' => :'Boolean', + :'total_cost_pool' => :'Float', + :'quantity_on_hand' => :'Float', + :'updated_date_utc' => :'DateTime', + :'item_id' => :'String', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Item` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Item`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'inventory_asset_account_code') + self.inventory_asset_account_code = attributes[:'inventory_asset_account_code'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'is_sold') + self.is_sold = attributes[:'is_sold'] + end + + if attributes.key?(:'is_purchased') + self.is_purchased = attributes[:'is_purchased'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'purchase_description') + self.purchase_description = attributes[:'purchase_description'] + end + + if attributes.key?(:'purchase_details') + self.purchase_details = attributes[:'purchase_details'] + end + + if attributes.key?(:'sales_details') + self.sales_details = attributes[:'sales_details'] + end + + if attributes.key?(:'is_tracked_as_inventory') + self.is_tracked_as_inventory = attributes[:'is_tracked_as_inventory'] + end + + if attributes.key?(:'total_cost_pool') + self.total_cost_pool = attributes[:'total_cost_pool'] + end + + if attributes.key?(:'quantity_on_hand') + self.quantity_on_hand = attributes[:'quantity_on_hand'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'item_id') + self.item_id = attributes[:'item_id'] + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @code.nil? + invalid_properties.push('invalid value for "code", code cannot be nil.') + end + + if @code.to_s.length > 30 + invalid_properties.push('invalid value for "code", the character length must be smaller than or equal to 30.') + end + + if !@name.nil? && @name.to_s.length > 50 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.') + end + + if !@description.nil? && @description.to_s.length > 4000 + invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 4000.') + end + + if !@purchase_description.nil? && @purchase_description.to_s.length > 4000 + invalid_properties.push('invalid value for "purchase_description", the character length must be smaller than or equal to 4000.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @code.nil? + return false if @code.to_s.length > 30 + return false if !@name.nil? && @name.to_s.length > 50 + return false if !@description.nil? && @description.to_s.length > 4000 + return false if !@purchase_description.nil? && @purchase_description.to_s.length > 4000 + true + end + + # Custom attribute writer method with validation + # @param [Object] code Value to be assigned + def code=(code) + if code.nil? + fail ArgumentError, 'code cannot be nil' + end + + if code.to_s.length > 30 + fail ArgumentError, 'invalid value for "code", the character length must be smaller than or equal to 30.' + end + + @code = code + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 50 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] description Value to be assigned + def description=(description) + if !description.nil? && description.to_s.length > 4000 + fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 4000.' + end + + @description = description + end + + # Custom attribute writer method with validation + # @param [Object] purchase_description Value to be assigned + def purchase_description=(purchase_description) + if !purchase_description.nil? && purchase_description.to_s.length > 4000 + fail ArgumentError, 'invalid value for "purchase_description", the character length must be smaller than or equal to 4000.' + end + + @purchase_description = purchase_description + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + inventory_asset_account_code == o.inventory_asset_account_code && + name == o.name && + is_sold == o.is_sold && + is_purchased == o.is_purchased && + description == o.description && + purchase_description == o.purchase_description && + purchase_details == o.purchase_details && + sales_details == o.sales_details && + is_tracked_as_inventory == o.is_tracked_as_inventory && + total_cost_pool == o.total_cost_pool && + quantity_on_hand == o.quantity_on_hand && + updated_date_utc == o.updated_date_utc && + item_id == o.item_id && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [code, inventory_asset_account_code, name, is_sold, is_purchased, description, purchase_description, purchase_details, sales_details, is_tracked_as_inventory, total_cost_pool, quantity_on_hand, updated_date_utc, item_id, status_attribute_string, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/items.rb b/lib/xero-ruby/models/accounting/items.rb new file mode 100644 index 00000000..a5e6ce9a --- /dev/null +++ b/lib/xero-ruby/models/accounting/items.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Items + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'items' => :'Items' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'items' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Items` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Items`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/journal.rb b/lib/xero-ruby/models/accounting/journal.rb new file mode 100644 index 00000000..13962deb --- /dev/null +++ b/lib/xero-ruby/models/accounting/journal.rb @@ -0,0 +1,310 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Journal + # Xero identifier + attr_accessor :journal_id + + # Date the journal was posted + attr_accessor :journal_date + + # Xero generated journal number + attr_accessor :journal_number + + # Created date UTC format + attr_accessor :created_date_utc + + # reference field for additional indetifying information + attr_accessor :reference + + # The identifier for the source transaction (e.g. InvoiceID) + attr_accessor :source_id + + # The journal source type. The type of transaction that created the journal + attr_accessor :source_type + + # See JournalLines + attr_accessor :journal_lines + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'journal_id' => :'JournalID', + :'journal_date' => :'JournalDate', + :'journal_number' => :'JournalNumber', + :'created_date_utc' => :'CreatedDateUTC', + :'reference' => :'Reference', + :'source_id' => :'SourceID', + :'source_type' => :'SourceType', + :'journal_lines' => :'JournalLines' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'journal_id' => :'String', + :'journal_date' => :'Date', + :'journal_number' => :'Integer', + :'created_date_utc' => :'DateTime', + :'reference' => :'String', + :'source_id' => :'String', + :'source_type' => :'String', + :'journal_lines' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Journal` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Journal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'journal_id') + self.journal_id = attributes[:'journal_id'] + end + + if attributes.key?(:'journal_date') + self.journal_date = attributes[:'journal_date'] + end + + if attributes.key?(:'journal_number') + self.journal_number = attributes[:'journal_number'] + end + + if attributes.key?(:'created_date_utc') + self.created_date_utc = attributes[:'created_date_utc'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'source_id') + self.source_id = attributes[:'source_id'] + end + + if attributes.key?(:'source_type') + self.source_type = attributes[:'source_type'] + end + + if attributes.key?(:'journal_lines') + if (value = attributes[:'journal_lines']).is_a?(Array) + self.journal_lines = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + source_type_validator = EnumAttributeValidator.new('String', ["ACCREC", "ACCPAY", "ACCRECCREDIT", "ACCPAYCREDIT", "ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "CASHREC", "CASHPAID", "TRANSFER", "ARPREPAYMENT", "APPREPAYMENT", "AROVERPAYMENT", "APOVERPAYMENT", "EXPCLAIM", "EXPPAYMENT", "MANJOURNAL", "PAYSLIP", "WAGEPAYABLE", "INTEGRATEDPAYROLLPE", "INTEGRATEDPAYROLLPT", "EXTERNALSPENDMONEY", "INTEGRATEDPAYROLLPTPAYMENT", "INTEGRATEDPAYROLLCN"]) + return false unless source_type_validator.valid?(@source_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] source_type Object to be assigned + def source_type=(source_type) + validator = EnumAttributeValidator.new('String', ["ACCREC", "ACCPAY", "ACCRECCREDIT", "ACCPAYCREDIT", "ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "CASHREC", "CASHPAID", "TRANSFER", "ARPREPAYMENT", "APPREPAYMENT", "AROVERPAYMENT", "APOVERPAYMENT", "EXPCLAIM", "EXPPAYMENT", "MANJOURNAL", "PAYSLIP", "WAGEPAYABLE", "INTEGRATEDPAYROLLPE", "INTEGRATEDPAYROLLPT", "EXTERNALSPENDMONEY", "INTEGRATEDPAYROLLPTPAYMENT", "INTEGRATEDPAYROLLCN"]) + unless validator.valid?(source_type) + fail ArgumentError, "invalid value for \"source_type\", must be one of #{validator.allowable_values}." + end + @source_type = source_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + journal_id == o.journal_id && + journal_date == o.journal_date && + journal_number == o.journal_number && + created_date_utc == o.created_date_utc && + reference == o.reference && + source_id == o.source_id && + source_type == o.source_type && + journal_lines == o.journal_lines + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [journal_id, journal_date, journal_number, created_date_utc, reference, source_id, source_type, journal_lines].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/journal_line.rb b/lib/xero-ruby/models/accounting/journal_line.rb new file mode 100644 index 00000000..7e593eb4 --- /dev/null +++ b/lib/xero-ruby/models/accounting/journal_line.rb @@ -0,0 +1,315 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class JournalLine + # Xero identifier for Journal + attr_accessor :journal_line_id + + # See Accounts + attr_accessor :account_id + + # See Accounts + attr_accessor :account_code + + attr_accessor :account_type + + # See AccountCodes + attr_accessor :account_name + + # The description from the source transaction line item. Only returned if populated. + attr_accessor :description + + # Net amount of journal line. This will be a positive value for a debit and negative for a credit + attr_accessor :net_amount + + # Gross amount of journal line (NetAmount + TaxAmount). + attr_accessor :gross_amount + + # Total tax on a journal line + attr_accessor :tax_amount + + # The tax type from TaxRates + attr_accessor :tax_type + + # see TaxRates + attr_accessor :tax_name + + # Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements. + attr_accessor :tracking_categories + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'journal_line_id' => :'JournalLineID', + :'account_id' => :'AccountID', + :'account_code' => :'AccountCode', + :'account_type' => :'AccountType', + :'account_name' => :'AccountName', + :'description' => :'Description', + :'net_amount' => :'NetAmount', + :'gross_amount' => :'GrossAmount', + :'tax_amount' => :'TaxAmount', + :'tax_type' => :'TaxType', + :'tax_name' => :'TaxName', + :'tracking_categories' => :'TrackingCategories' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'journal_line_id' => :'String', + :'account_id' => :'String', + :'account_code' => :'String', + :'account_type' => :'AccountType', + :'account_name' => :'String', + :'description' => :'String', + :'net_amount' => :'Float', + :'gross_amount' => :'Float', + :'tax_amount' => :'Float', + :'tax_type' => :'String', + :'tax_name' => :'String', + :'tracking_categories' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::JournalLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::JournalLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'journal_line_id') + self.journal_line_id = attributes[:'journal_line_id'] + end + + if attributes.key?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'account_code') + self.account_code = attributes[:'account_code'] + end + + if attributes.key?(:'account_type') + self.account_type = attributes[:'account_type'] + end + + if attributes.key?(:'account_name') + self.account_name = attributes[:'account_name'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'net_amount') + self.net_amount = attributes[:'net_amount'] + end + + if attributes.key?(:'gross_amount') + self.gross_amount = attributes[:'gross_amount'] + end + + if attributes.key?(:'tax_amount') + self.tax_amount = attributes[:'tax_amount'] + end + + if attributes.key?(:'tax_type') + self.tax_type = attributes[:'tax_type'] + end + + if attributes.key?(:'tax_name') + self.tax_name = attributes[:'tax_name'] + end + + if attributes.key?(:'tracking_categories') + if (value = attributes[:'tracking_categories']).is_a?(Array) + self.tracking_categories = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + journal_line_id == o.journal_line_id && + account_id == o.account_id && + account_code == o.account_code && + account_type == o.account_type && + account_name == o.account_name && + description == o.description && + net_amount == o.net_amount && + gross_amount == o.gross_amount && + tax_amount == o.tax_amount && + tax_type == o.tax_type && + tax_name == o.tax_name && + tracking_categories == o.tracking_categories + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [journal_line_id, account_id, account_code, account_type, account_name, description, net_amount, gross_amount, tax_amount, tax_type, tax_name, tracking_categories].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/journals.rb b/lib/xero-ruby/models/accounting/journals.rb new file mode 100644 index 00000000..985c24a7 --- /dev/null +++ b/lib/xero-ruby/models/accounting/journals.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Journals + attr_accessor :journals + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'journals' => :'Journals' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'journals' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Journals` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Journals`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'journals') + if (value = attributes[:'journals']).is_a?(Array) + self.journals = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + journals == o.journals + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [journals].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/line_amount_types.rb b/lib/xero-ruby/models/accounting/line_amount_types.rb new file mode 100644 index 00000000..84264448 --- /dev/null +++ b/lib/xero-ruby/models/accounting/line_amount_types.rb @@ -0,0 +1,38 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class LineAmountTypes + EXCLUSIVE = "Exclusive".freeze + INCLUSIVE = "Inclusive".freeze + NO_TAX = "NoTax".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = LineAmountTypes.constants.select { |c| LineAmountTypes::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #LineAmountTypes" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/line_item.rb b/lib/xero-ruby/models/accounting/line_item.rb new file mode 100644 index 00000000..92ef489d --- /dev/null +++ b/lib/xero-ruby/models/accounting/line_item.rb @@ -0,0 +1,326 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class LineItem + # LineItem unique ID + attr_accessor :line_item_id + + # Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character + attr_accessor :description + + # LineItem Quantity + attr_accessor :quantity + + # LineItem Unit Amount + attr_accessor :unit_amount + + # See Items + attr_accessor :item_code + + # See Accounts + attr_accessor :account_code + + # The tax type from TaxRates + attr_accessor :tax_type + + # The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. + attr_accessor :tax_amount + + # If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) + attr_accessor :line_amount + + # Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 elements. + attr_accessor :tracking + + # Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts + attr_accessor :discount_rate + + # Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. + attr_accessor :discount_amount + + # The Xero identifier for a Repeating Invoice + attr_accessor :repeating_invoice_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'line_item_id' => :'LineItemID', + :'description' => :'Description', + :'quantity' => :'Quantity', + :'unit_amount' => :'UnitAmount', + :'item_code' => :'ItemCode', + :'account_code' => :'AccountCode', + :'tax_type' => :'TaxType', + :'tax_amount' => :'TaxAmount', + :'line_amount' => :'LineAmount', + :'tracking' => :'Tracking', + :'discount_rate' => :'DiscountRate', + :'discount_amount' => :'DiscountAmount', + :'repeating_invoice_id' => :'RepeatingInvoiceID' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'line_item_id' => :'String', + :'description' => :'String', + :'quantity' => :'Float', + :'unit_amount' => :'Float', + :'item_code' => :'String', + :'account_code' => :'String', + :'tax_type' => :'String', + :'tax_amount' => :'Float', + :'line_amount' => :'Float', + :'tracking' => :'Array', + :'discount_rate' => :'Float', + :'discount_amount' => :'Float', + :'repeating_invoice_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LineItem` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LineItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'line_item_id') + self.line_item_id = attributes[:'line_item_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'quantity') + self.quantity = attributes[:'quantity'] + end + + if attributes.key?(:'unit_amount') + self.unit_amount = attributes[:'unit_amount'] + end + + if attributes.key?(:'item_code') + self.item_code = attributes[:'item_code'] + end + + if attributes.key?(:'account_code') + self.account_code = attributes[:'account_code'] + end + + if attributes.key?(:'tax_type') + self.tax_type = attributes[:'tax_type'] + end + + if attributes.key?(:'tax_amount') + self.tax_amount = attributes[:'tax_amount'] + end + + if attributes.key?(:'line_amount') + self.line_amount = attributes[:'line_amount'] + end + + if attributes.key?(:'tracking') + if (value = attributes[:'tracking']).is_a?(Array) + self.tracking = value + end + end + + if attributes.key?(:'discount_rate') + self.discount_rate = attributes[:'discount_rate'] + end + + if attributes.key?(:'discount_amount') + self.discount_amount = attributes[:'discount_amount'] + end + + if attributes.key?(:'repeating_invoice_id') + self.repeating_invoice_id = attributes[:'repeating_invoice_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + line_item_id == o.line_item_id && + description == o.description && + quantity == o.quantity && + unit_amount == o.unit_amount && + item_code == o.item_code && + account_code == o.account_code && + tax_type == o.tax_type && + tax_amount == o.tax_amount && + line_amount == o.line_amount && + tracking == o.tracking && + discount_rate == o.discount_rate && + discount_amount == o.discount_amount && + repeating_invoice_id == o.repeating_invoice_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [line_item_id, description, quantity, unit_amount, item_code, account_code, tax_type, tax_amount, line_amount, tracking, discount_rate, discount_amount, repeating_invoice_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/line_item_tracking.rb b/lib/xero-ruby/models/accounting/line_item_tracking.rb new file mode 100644 index 00000000..e865ec9c --- /dev/null +++ b/lib/xero-ruby/models/accounting/line_item_tracking.rb @@ -0,0 +1,249 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class LineItemTracking + # The Xero identifier for a tracking category + attr_accessor :tracking_category_id + + # The Xero identifier for a tracking category option + attr_accessor :tracking_option_id + + # The name of the tracking category + attr_accessor :name + + # See Tracking Options + attr_accessor :option + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tracking_category_id' => :'TrackingCategoryID', + :'tracking_option_id' => :'TrackingOptionID', + :'name' => :'Name', + :'option' => :'Option' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tracking_category_id' => :'String', + :'tracking_option_id' => :'String', + :'name' => :'String', + :'option' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LineItemTracking` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LineItemTracking`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tracking_category_id') + self.tracking_category_id = attributes[:'tracking_category_id'] + end + + if attributes.key?(:'tracking_option_id') + self.tracking_option_id = attributes[:'tracking_option_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'option') + self.option = attributes[:'option'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 100 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length > 100 + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + + @name = name + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tracking_category_id == o.tracking_category_id && + tracking_option_id == o.tracking_option_id && + name == o.name && + option == o.option + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tracking_category_id, tracking_option_id, name, option].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/linked_transaction.rb b/lib/xero-ruby/models/accounting/linked_transaction.rb new file mode 100644 index 00000000..649de7c1 --- /dev/null +++ b/lib/xero-ruby/models/accounting/linked_transaction.rb @@ -0,0 +1,364 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class LinkedTransaction + # Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice + attr_accessor :source_transaction_id + + # The line item identifier from the source transaction. + attr_accessor :source_line_item_id + + # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. + attr_accessor :contact_id + + # Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice + attr_accessor :target_transaction_id + + # The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. + attr_accessor :target_line_item_id + + # The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 + attr_accessor :linked_transaction_id + + # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. + attr_accessor :status + + # This will always be BILLABLEEXPENSE. More types may be added in future. + attr_accessor :type + + # The last modified date in UTC format + attr_accessor :updated_date_utc + + # The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. + attr_accessor :source_transaction_type_code + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'source_transaction_id' => :'SourceTransactionID', + :'source_line_item_id' => :'SourceLineItemID', + :'contact_id' => :'ContactID', + :'target_transaction_id' => :'TargetTransactionID', + :'target_line_item_id' => :'TargetLineItemID', + :'linked_transaction_id' => :'LinkedTransactionID', + :'status' => :'Status', + :'type' => :'Type', + :'updated_date_utc' => :'UpdatedDateUTC', + :'source_transaction_type_code' => :'SourceTransactionTypeCode', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'source_transaction_id' => :'String', + :'source_line_item_id' => :'String', + :'contact_id' => :'String', + :'target_transaction_id' => :'String', + :'target_line_item_id' => :'String', + :'linked_transaction_id' => :'String', + :'status' => :'String', + :'type' => :'String', + :'updated_date_utc' => :'DateTime', + :'source_transaction_type_code' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LinkedTransaction` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LinkedTransaction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'source_transaction_id') + self.source_transaction_id = attributes[:'source_transaction_id'] + end + + if attributes.key?(:'source_line_item_id') + self.source_line_item_id = attributes[:'source_line_item_id'] + end + + if attributes.key?(:'contact_id') + self.contact_id = attributes[:'contact_id'] + end + + if attributes.key?(:'target_transaction_id') + self.target_transaction_id = attributes[:'target_transaction_id'] + end + + if attributes.key?(:'target_line_item_id') + self.target_line_item_id = attributes[:'target_line_item_id'] + end + + if attributes.key?(:'linked_transaction_id') + self.linked_transaction_id = attributes[:'linked_transaction_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'source_transaction_type_code') + self.source_transaction_type_code = attributes[:'source_transaction_type_code'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["APPROVED", "DRAFT", "ONDRAFT", "BILLED", "VOIDED"]) + return false unless status_validator.valid?(@status) + type_validator = EnumAttributeValidator.new('String', ["BILLABLEEXPENSE"]) + return false unless type_validator.valid?(@type) + source_transaction_type_code_validator = EnumAttributeValidator.new('String', ["ACCPAY", "SPEND"]) + return false unless source_transaction_type_code_validator.valid?(@source_transaction_type_code) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["APPROVED", "DRAFT", "ONDRAFT", "BILLED", "VOIDED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["BILLABLEEXPENSE"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] source_transaction_type_code Object to be assigned + def source_transaction_type_code=(source_transaction_type_code) + validator = EnumAttributeValidator.new('String', ["ACCPAY", "SPEND"]) + unless validator.valid?(source_transaction_type_code) + fail ArgumentError, "invalid value for \"source_transaction_type_code\", must be one of #{validator.allowable_values}." + end + @source_transaction_type_code = source_transaction_type_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + source_transaction_id == o.source_transaction_id && + source_line_item_id == o.source_line_item_id && + contact_id == o.contact_id && + target_transaction_id == o.target_transaction_id && + target_line_item_id == o.target_line_item_id && + linked_transaction_id == o.linked_transaction_id && + status == o.status && + type == o.type && + updated_date_utc == o.updated_date_utc && + source_transaction_type_code == o.source_transaction_type_code && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [source_transaction_id, source_line_item_id, contact_id, target_transaction_id, target_line_item_id, linked_transaction_id, status, type, updated_date_utc, source_transaction_type_code, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/linked_transactions.rb b/lib/xero-ruby/models/accounting/linked_transactions.rb new file mode 100644 index 00000000..86c6e701 --- /dev/null +++ b/lib/xero-ruby/models/accounting/linked_transactions.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class LinkedTransactions + attr_accessor :linked_transactions + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'linked_transactions' => :'LinkedTransactions' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'linked_transactions' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::LinkedTransactions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::LinkedTransactions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'linked_transactions') + if (value = attributes[:'linked_transactions']).is_a?(Array) + self.linked_transactions = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + linked_transactions == o.linked_transactions + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [linked_transactions].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/manual_journal.rb b/lib/xero-ruby/models/accounting/manual_journal.rb new file mode 100644 index 00000000..0be61478 --- /dev/null +++ b/lib/xero-ruby/models/accounting/manual_journal.rb @@ -0,0 +1,382 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ManualJournal + # Description of journal being posted + attr_accessor :narration + + # See JournalLines + attr_accessor :journal_lines + + # Date journal was posted – YYYY-MM-DD + attr_accessor :date + + attr_accessor :line_amount_types + + # See Manual Journal Status Codes + attr_accessor :status + + # Url link to a source document – shown as “Go to [appName]” in the Xero app + attr_accessor :url + + # Boolean – default is true if not specified + attr_accessor :show_on_cash_basis_reports + + # Boolean to indicate if a manual journal has an attachment + attr_accessor :has_attachments + + # Last modified date UTC format + attr_accessor :updated_date_utc + + # The Xero identifier for a Manual Journal + attr_accessor :manual_journal_id + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of warning messages from the API + attr_accessor :warnings + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Displays array of attachments from the API + attr_accessor :attachments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'narration' => :'Narration', + :'journal_lines' => :'JournalLines', + :'date' => :'Date', + :'line_amount_types' => :'LineAmountTypes', + :'status' => :'Status', + :'url' => :'Url', + :'show_on_cash_basis_reports' => :'ShowOnCashBasisReports', + :'has_attachments' => :'HasAttachments', + :'updated_date_utc' => :'UpdatedDateUTC', + :'manual_journal_id' => :'ManualJournalID', + :'status_attribute_string' => :'StatusAttributeString', + :'warnings' => :'Warnings', + :'validation_errors' => :'ValidationErrors', + :'attachments' => :'Attachments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'narration' => :'String', + :'journal_lines' => :'Array', + :'date' => :'Date', + :'line_amount_types' => :'LineAmountTypes', + :'status' => :'String', + :'url' => :'String', + :'show_on_cash_basis_reports' => :'Boolean', + :'has_attachments' => :'Boolean', + :'updated_date_utc' => :'DateTime', + :'manual_journal_id' => :'String', + :'status_attribute_string' => :'String', + :'warnings' => :'Array', + :'validation_errors' => :'Array', + :'attachments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ManualJournal` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ManualJournal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'narration') + self.narration = attributes[:'narration'] + end + + if attributes.key?(:'journal_lines') + if (value = attributes[:'journal_lines']).is_a?(Array) + self.journal_lines = value + end + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'show_on_cash_basis_reports') + self.show_on_cash_basis_reports = attributes[:'show_on_cash_basis_reports'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'manual_journal_id') + self.manual_journal_id = attributes[:'manual_journal_id'] + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @narration.nil? + invalid_properties.push('invalid value for "narration", narration cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @narration.nil? + status_validator = EnumAttributeValidator.new('String', ["DRAFT", "POSTED", "DELETED", "VOIDED", "ARCHIVED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["DRAFT", "POSTED", "DELETED", "VOIDED", "ARCHIVED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + narration == o.narration && + journal_lines == o.journal_lines && + date == o.date && + line_amount_types == o.line_amount_types && + status == o.status && + url == o.url && + show_on_cash_basis_reports == o.show_on_cash_basis_reports && + has_attachments == o.has_attachments && + updated_date_utc == o.updated_date_utc && + manual_journal_id == o.manual_journal_id && + status_attribute_string == o.status_attribute_string && + warnings == o.warnings && + validation_errors == o.validation_errors && + attachments == o.attachments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [narration, journal_lines, date, line_amount_types, status, url, show_on_cash_basis_reports, has_attachments, updated_date_utc, manual_journal_id, status_attribute_string, warnings, validation_errors, attachments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/manual_journal_line.rb b/lib/xero-ruby/models/accounting/manual_journal_line.rb new file mode 100644 index 00000000..cc790c63 --- /dev/null +++ b/lib/xero-ruby/models/accounting/manual_journal_line.rb @@ -0,0 +1,266 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ManualJournalLine + # total for line. Debits are positive, credits are negative value + attr_accessor :line_amount + + # See Accounts + attr_accessor :account_code + + # Description for journal line + attr_accessor :description + + # The tax type from TaxRates + attr_accessor :tax_type + + # Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements. + attr_accessor :tracking + + # The calculated tax amount based on the TaxType and LineAmount + attr_accessor :tax_amount + + # is the line blank + attr_accessor :is_blank + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'line_amount' => :'LineAmount', + :'account_code' => :'AccountCode', + :'description' => :'Description', + :'tax_type' => :'TaxType', + :'tracking' => :'Tracking', + :'tax_amount' => :'TaxAmount', + :'is_blank' => :'IsBlank' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'line_amount' => :'Float', + :'account_code' => :'String', + :'description' => :'String', + :'tax_type' => :'String', + :'tracking' => :'Array', + :'tax_amount' => :'Float', + :'is_blank' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ManualJournalLine` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ManualJournalLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'line_amount') + self.line_amount = attributes[:'line_amount'] + end + + if attributes.key?(:'account_code') + self.account_code = attributes[:'account_code'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'tax_type') + self.tax_type = attributes[:'tax_type'] + end + + if attributes.key?(:'tracking') + if (value = attributes[:'tracking']).is_a?(Array) + self.tracking = value + end + end + + if attributes.key?(:'tax_amount') + self.tax_amount = attributes[:'tax_amount'] + end + + if attributes.key?(:'is_blank') + self.is_blank = attributes[:'is_blank'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + line_amount == o.line_amount && + account_code == o.account_code && + description == o.description && + tax_type == o.tax_type && + tracking == o.tracking && + tax_amount == o.tax_amount && + is_blank == o.is_blank + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [line_amount, account_code, description, tax_type, tracking, tax_amount, is_blank].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/manual_journals.rb b/lib/xero-ruby/models/accounting/manual_journals.rb new file mode 100644 index 00000000..522708aa --- /dev/null +++ b/lib/xero-ruby/models/accounting/manual_journals.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ManualJournals + attr_accessor :manual_journals + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'manual_journals' => :'ManualJournals' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'manual_journals' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ManualJournals` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ManualJournals`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'manual_journals') + if (value = attributes[:'manual_journals']).is_a?(Array) + self.manual_journals = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + manual_journals == o.manual_journals + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [manual_journals].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/online_invoice.rb b/lib/xero-ruby/models/accounting/online_invoice.rb new file mode 100644 index 00000000..9e4aeba7 --- /dev/null +++ b/lib/xero-ruby/models/accounting/online_invoice.rb @@ -0,0 +1,204 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class OnlineInvoice + # the URL to an online invoice + attr_accessor :online_invoice_url + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'online_invoice_url' => :'OnlineInvoiceUrl' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'online_invoice_url' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::OnlineInvoice` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::OnlineInvoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'online_invoice_url') + self.online_invoice_url = attributes[:'online_invoice_url'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + online_invoice_url == o.online_invoice_url + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [online_invoice_url].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/online_invoices.rb b/lib/xero-ruby/models/accounting/online_invoices.rb new file mode 100644 index 00000000..e1835fd4 --- /dev/null +++ b/lib/xero-ruby/models/accounting/online_invoices.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class OnlineInvoices + attr_accessor :online_invoices + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'online_invoices' => :'OnlineInvoices' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'online_invoices' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::OnlineInvoices` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::OnlineInvoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'online_invoices') + if (value = attributes[:'online_invoices']).is_a?(Array) + self.online_invoices = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + online_invoices == o.online_invoices + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [online_invoices].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb new file mode 100644 index 00000000..72d39c67 --- /dev/null +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -0,0 +1,632 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Organisation + # Unique Xero identifier + attr_accessor :organisation_id + + # Display a unique key used for Xero-to-Xero transactions + attr_accessor :api_key + + # Display name of organisation shown in Xero + attr_accessor :name + + # Organisation name shown on Reports + attr_accessor :legal_name + + # Boolean to describe if organisation is registered with a local tax authority i.e. true, false + attr_accessor :pays_tax + + # See Version Types + attr_accessor :version + + # Organisation Type + attr_accessor :organisation_type + + attr_accessor :base_currency + + attr_accessor :country_code + + # Boolean to describe if organisation is a demo company. + attr_accessor :is_demo_company + + # Will be set to ACTIVE if you can connect to organisation via the Xero API + attr_accessor :organisation_status + + # Shows for New Zealand, Australian and UK organisations + attr_accessor :registration_number + + # Shown if set. US Only. + attr_accessor :employer_identification_number + + # Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). + attr_accessor :tax_number + + # Calendar day e.g. 0-31 + attr_accessor :financial_year_end_day + + # Calendar Month e.g. 1-12 + attr_accessor :financial_year_end_month + + # The accounting basis used for tax returns. See Sales Tax Basis + attr_accessor :sales_tax_basis + + # The frequency with which tax returns are processed. See Sales Tax Period + attr_accessor :sales_tax_period + + # The default for LineAmountTypes on sales transactions + attr_accessor :default_sales_tax + + # The default for LineAmountTypes on purchase transactions + attr_accessor :default_purchases_tax + + # Shown if set. See lock dates + attr_accessor :period_lock_date + + # Shown if set. See lock dates + attr_accessor :end_of_year_lock_date + + # Timestamp when the organisation was created in Xero + attr_accessor :created_date_utc + + attr_accessor :timezone + + # Organisation Type + attr_accessor :organisation_entity_type + + # A unique identifier for the organisation. Potential uses. + attr_accessor :short_code + + # Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) + attr_accessor :_class + + # BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) + attr_accessor :edition + + # Description of business type as defined in Organisation settings + attr_accessor :line_of_business + + # Address details for organisation – see Addresses + attr_accessor :addresses + + # Phones details for organisation – see Phones + attr_accessor :phones + + # Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below + attr_accessor :external_links + + attr_accessor :payment_terms + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organisation_id' => :'OrganisationID', + :'api_key' => :'APIKey', + :'name' => :'Name', + :'legal_name' => :'LegalName', + :'pays_tax' => :'PaysTax', + :'version' => :'Version', + :'organisation_type' => :'OrganisationType', + :'base_currency' => :'BaseCurrency', + :'country_code' => :'CountryCode', + :'is_demo_company' => :'IsDemoCompany', + :'organisation_status' => :'OrganisationStatus', + :'registration_number' => :'RegistrationNumber', + :'employer_identification_number' => :'EmployerIdentificationNumber', + :'tax_number' => :'TaxNumber', + :'financial_year_end_day' => :'FinancialYearEndDay', + :'financial_year_end_month' => :'FinancialYearEndMonth', + :'sales_tax_basis' => :'SalesTaxBasis', + :'sales_tax_period' => :'SalesTaxPeriod', + :'default_sales_tax' => :'DefaultSalesTax', + :'default_purchases_tax' => :'DefaultPurchasesTax', + :'period_lock_date' => :'PeriodLockDate', + :'end_of_year_lock_date' => :'EndOfYearLockDate', + :'created_date_utc' => :'CreatedDateUTC', + :'timezone' => :'Timezone', + :'organisation_entity_type' => :'OrganisationEntityType', + :'short_code' => :'ShortCode', + :'_class' => :'Class', + :'edition' => :'Edition', + :'line_of_business' => :'LineOfBusiness', + :'addresses' => :'Addresses', + :'phones' => :'Phones', + :'external_links' => :'ExternalLinks', + :'payment_terms' => :'PaymentTerms' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organisation_id' => :'String', + :'api_key' => :'String', + :'name' => :'String', + :'legal_name' => :'String', + :'pays_tax' => :'Boolean', + :'version' => :'String', + :'organisation_type' => :'String', + :'base_currency' => :'CurrencyCode', + :'country_code' => :'CountryCode', + :'is_demo_company' => :'Boolean', + :'organisation_status' => :'String', + :'registration_number' => :'String', + :'employer_identification_number' => :'String', + :'tax_number' => :'String', + :'financial_year_end_day' => :'Integer', + :'financial_year_end_month' => :'Integer', + :'sales_tax_basis' => :'String', + :'sales_tax_period' => :'String', + :'default_sales_tax' => :'String', + :'default_purchases_tax' => :'String', + :'period_lock_date' => :'Date', + :'end_of_year_lock_date' => :'Date', + :'created_date_utc' => :'DateTime', + :'timezone' => :'TimeZone', + :'organisation_entity_type' => :'String', + :'short_code' => :'String', + :'_class' => :'String', + :'edition' => :'String', + :'line_of_business' => :'String', + :'addresses' => :'Array
', + :'phones' => :'Array', + :'external_links' => :'Array', + :'payment_terms' => :'PaymentTerm' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Organisation` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Organisation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organisation_id') + self.organisation_id = attributes[:'organisation_id'] + end + + if attributes.key?(:'api_key') + self.api_key = attributes[:'api_key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'legal_name') + self.legal_name = attributes[:'legal_name'] + end + + if attributes.key?(:'pays_tax') + self.pays_tax = attributes[:'pays_tax'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + + if attributes.key?(:'organisation_type') + self.organisation_type = attributes[:'organisation_type'] + end + + if attributes.key?(:'base_currency') + self.base_currency = attributes[:'base_currency'] + end + + if attributes.key?(:'country_code') + self.country_code = attributes[:'country_code'] + end + + if attributes.key?(:'is_demo_company') + self.is_demo_company = attributes[:'is_demo_company'] + end + + if attributes.key?(:'organisation_status') + self.organisation_status = attributes[:'organisation_status'] + end + + if attributes.key?(:'registration_number') + self.registration_number = attributes[:'registration_number'] + end + + if attributes.key?(:'employer_identification_number') + self.employer_identification_number = attributes[:'employer_identification_number'] + end + + if attributes.key?(:'tax_number') + self.tax_number = attributes[:'tax_number'] + end + + if attributes.key?(:'financial_year_end_day') + self.financial_year_end_day = attributes[:'financial_year_end_day'] + end + + if attributes.key?(:'financial_year_end_month') + self.financial_year_end_month = attributes[:'financial_year_end_month'] + end + + if attributes.key?(:'sales_tax_basis') + self.sales_tax_basis = attributes[:'sales_tax_basis'] + end + + if attributes.key?(:'sales_tax_period') + self.sales_tax_period = attributes[:'sales_tax_period'] + end + + if attributes.key?(:'default_sales_tax') + self.default_sales_tax = attributes[:'default_sales_tax'] + end + + if attributes.key?(:'default_purchases_tax') + self.default_purchases_tax = attributes[:'default_purchases_tax'] + end + + if attributes.key?(:'period_lock_date') + self.period_lock_date = attributes[:'period_lock_date'] + end + + if attributes.key?(:'end_of_year_lock_date') + self.end_of_year_lock_date = attributes[:'end_of_year_lock_date'] + end + + if attributes.key?(:'created_date_utc') + self.created_date_utc = attributes[:'created_date_utc'] + end + + if attributes.key?(:'timezone') + self.timezone = attributes[:'timezone'] + end + + if attributes.key?(:'organisation_entity_type') + self.organisation_entity_type = attributes[:'organisation_entity_type'] + end + + if attributes.key?(:'short_code') + self.short_code = attributes[:'short_code'] + end + + if attributes.key?(:'_class') + self._class = attributes[:'_class'] + end + + if attributes.key?(:'edition') + self.edition = attributes[:'edition'] + end + + if attributes.key?(:'line_of_business') + self.line_of_business = attributes[:'line_of_business'] + end + + if attributes.key?(:'addresses') + if (value = attributes[:'addresses']).is_a?(Array) + self.addresses = value + end + end + + if attributes.key?(:'phones') + if (value = attributes[:'phones']).is_a?(Array) + self.phones = value + end + end + + if attributes.key?(:'external_links') + if (value = attributes[:'external_links']).is_a?(Array) + self.external_links = value + end + end + + if attributes.key?(:'payment_terms') + self.payment_terms = attributes[:'payment_terms'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + version_validator = EnumAttributeValidator.new('String', ["AU", "NZ", "GLOBAL", "UK", "US", "AUONRAMP", "NZONRAMP", "GLOBALONRAMP", "UKONRAMP", "USONRAMP"]) + return false unless version_validator.valid?(@version) + organisation_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) + return false unless organisation_type_validator.valid?(@organisation_type) + sales_tax_basis_validator = EnumAttributeValidator.new('String', ["PAYMENTS", "INVOICE", "NONE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS"]) + return false unless sales_tax_basis_validator.valid?(@sales_tax_basis) + sales_tax_period_validator = EnumAttributeValidator.new('String', ["MONTHLY", "QUARTERLY1", "QUARTERLY2", "QUARTERLY3", "ANNUALLY", "ONEMONTHS", "TWOMONTHS", "SIXMONTHS", "1MONTHLY", "2MONTHLY", "3MONTHLY", "6MONTHLY", "QUARTERLY", "YEARLY", "NONE"]) + return false unless sales_tax_period_validator.valid?(@sales_tax_period) + organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) + return false unless organisation_entity_type_validator.valid?(@organisation_entity_type) + _class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK"]) + return false unless _class_validator.valid?(@_class) + edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"]) + return false unless edition_validator.valid?(@edition) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] version Object to be assigned + def version=(version) + validator = EnumAttributeValidator.new('String', ["AU", "NZ", "GLOBAL", "UK", "US", "AUONRAMP", "NZONRAMP", "GLOBALONRAMP", "UKONRAMP", "USONRAMP"]) + unless validator.valid?(version) + fail ArgumentError, "invalid value for \"version\", must be one of #{validator.allowable_values}." + end + @version = version + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] organisation_type Object to be assigned + def organisation_type=(organisation_type) + validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) + unless validator.valid?(organisation_type) + fail ArgumentError, "invalid value for \"organisation_type\", must be one of #{validator.allowable_values}." + end + @organisation_type = organisation_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] sales_tax_basis Object to be assigned + def sales_tax_basis=(sales_tax_basis) + validator = EnumAttributeValidator.new('String', ["PAYMENTS", "INVOICE", "NONE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS"]) + unless validator.valid?(sales_tax_basis) + fail ArgumentError, "invalid value for \"sales_tax_basis\", must be one of #{validator.allowable_values}." + end + @sales_tax_basis = sales_tax_basis + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] sales_tax_period Object to be assigned + def sales_tax_period=(sales_tax_period) + validator = EnumAttributeValidator.new('String', ["MONTHLY", "QUARTERLY1", "QUARTERLY2", "QUARTERLY3", "ANNUALLY", "ONEMONTHS", "TWOMONTHS", "SIXMONTHS", "1MONTHLY", "2MONTHLY", "3MONTHLY", "6MONTHLY", "QUARTERLY", "YEARLY", "NONE"]) + unless validator.valid?(sales_tax_period) + fail ArgumentError, "invalid value for \"sales_tax_period\", must be one of #{validator.allowable_values}." + end + @sales_tax_period = sales_tax_period + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] organisation_entity_type Object to be assigned + def organisation_entity_type=(organisation_entity_type) + validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) + unless validator.valid?(organisation_entity_type) + fail ArgumentError, "invalid value for \"organisation_entity_type\", must be one of #{validator.allowable_values}." + end + @organisation_entity_type = organisation_entity_type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] _class Object to be assigned + def _class=(_class) + validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK"]) + unless validator.valid?(_class) + fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}." + end + @_class = _class + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] edition Object to be assigned + def edition=(edition) + validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"]) + unless validator.valid?(edition) + fail ArgumentError, "invalid value for \"edition\", must be one of #{validator.allowable_values}." + end + @edition = edition + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organisation_id == o.organisation_id && + api_key == o.api_key && + name == o.name && + legal_name == o.legal_name && + pays_tax == o.pays_tax && + version == o.version && + organisation_type == o.organisation_type && + base_currency == o.base_currency && + country_code == o.country_code && + is_demo_company == o.is_demo_company && + organisation_status == o.organisation_status && + registration_number == o.registration_number && + employer_identification_number == o.employer_identification_number && + tax_number == o.tax_number && + financial_year_end_day == o.financial_year_end_day && + financial_year_end_month == o.financial_year_end_month && + sales_tax_basis == o.sales_tax_basis && + sales_tax_period == o.sales_tax_period && + default_sales_tax == o.default_sales_tax && + default_purchases_tax == o.default_purchases_tax && + period_lock_date == o.period_lock_date && + end_of_year_lock_date == o.end_of_year_lock_date && + created_date_utc == o.created_date_utc && + timezone == o.timezone && + organisation_entity_type == o.organisation_entity_type && + short_code == o.short_code && + _class == o._class && + edition == o.edition && + line_of_business == o.line_of_business && + addresses == o.addresses && + phones == o.phones && + external_links == o.external_links && + payment_terms == o.payment_terms + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organisation_id, api_key, name, legal_name, pays_tax, version, organisation_type, base_currency, country_code, is_demo_company, organisation_status, registration_number, employer_identification_number, tax_number, financial_year_end_day, financial_year_end_month, sales_tax_basis, sales_tax_period, default_sales_tax, default_purchases_tax, period_lock_date, end_of_year_lock_date, created_date_utc, timezone, organisation_entity_type, short_code, _class, edition, line_of_business, addresses, phones, external_links, payment_terms].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/organisations.rb b/lib/xero-ruby/models/accounting/organisations.rb new file mode 100644 index 00000000..97e2fa0f --- /dev/null +++ b/lib/xero-ruby/models/accounting/organisations.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Organisations + attr_accessor :organisations + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'organisations' => :'Organisations' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'organisations' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Organisations` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Organisations`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'organisations') + if (value = attributes[:'organisations']).is_a?(Array) + self.organisations = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + organisations == o.organisations + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [organisations].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/overpayment.rb b/lib/xero-ruby/models/accounting/overpayment.rb new file mode 100644 index 00000000..a796bba2 --- /dev/null +++ b/lib/xero-ruby/models/accounting/overpayment.rb @@ -0,0 +1,437 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Overpayment + # See Overpayment Types + attr_accessor :type + + attr_accessor :contact + + # The date the overpayment is created YYYY-MM-DD + attr_accessor :date + + # See Overpayment Status Codes + attr_accessor :status + + attr_accessor :line_amount_types + + # See Overpayment Line Items + attr_accessor :line_items + + # The subtotal of the overpayment excluding taxes + attr_accessor :sub_total + + # The total tax on the overpayment + attr_accessor :total_tax + + # The total of the overpayment (subtotal + total tax) + attr_accessor :total + + # UTC timestamp of last update to the overpayment + attr_accessor :updated_date_utc + + attr_accessor :currency_code + + # Xero generated unique identifier + attr_accessor :overpayment_id + + # The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used + attr_accessor :currency_rate + + # The remaining credit balance on the overpayment + attr_accessor :remaining_credit + + # See Allocations + attr_accessor :allocations + + # The amount of applied to an invoice + attr_accessor :applied_amount + + # See Payments + attr_accessor :payments + + # boolean to indicate if a overpayment has an attachment + attr_accessor :has_attachments + + # See Attachments + attr_accessor :attachments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'Type', + :'contact' => :'Contact', + :'date' => :'Date', + :'status' => :'Status', + :'line_amount_types' => :'LineAmountTypes', + :'line_items' => :'LineItems', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'updated_date_utc' => :'UpdatedDateUTC', + :'currency_code' => :'CurrencyCode', + :'overpayment_id' => :'OverpaymentID', + :'currency_rate' => :'CurrencyRate', + :'remaining_credit' => :'RemainingCredit', + :'allocations' => :'Allocations', + :'applied_amount' => :'AppliedAmount', + :'payments' => :'Payments', + :'has_attachments' => :'HasAttachments', + :'attachments' => :'Attachments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'contact' => :'Contact', + :'date' => :'Date', + :'status' => :'String', + :'line_amount_types' => :'LineAmountTypes', + :'line_items' => :'Array', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'updated_date_utc' => :'DateTime', + :'currency_code' => :'CurrencyCode', + :'overpayment_id' => :'String', + :'currency_rate' => :'Float', + :'remaining_credit' => :'Float', + :'allocations' => :'Array', + :'applied_amount' => :'Float', + :'payments' => :'Array', + :'has_attachments' => :'Boolean', + :'attachments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Overpayment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Overpayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'overpayment_id') + self.overpayment_id = attributes[:'overpayment_id'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'remaining_credit') + self.remaining_credit = attributes[:'remaining_credit'] + end + + if attributes.key?(:'allocations') + if (value = attributes[:'allocations']).is_a?(Array) + self.allocations = value + end + end + + if attributes.key?(:'applied_amount') + self.applied_amount = attributes[:'applied_amount'] + end + + if attributes.key?(:'payments') + if (value = attributes[:'payments']).is_a?(Array) + self.payments = value + end + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["RECEIVE-OVERPAYMENT", "SPEND-OVERPAYMENT", "AROVERPAYMENT"]) + return false unless type_validator.valid?(@type) + status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["RECEIVE-OVERPAYMENT", "SPEND-OVERPAYMENT", "AROVERPAYMENT"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + contact == o.contact && + date == o.date && + status == o.status && + line_amount_types == o.line_amount_types && + line_items == o.line_items && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + updated_date_utc == o.updated_date_utc && + currency_code == o.currency_code && + overpayment_id == o.overpayment_id && + currency_rate == o.currency_rate && + remaining_credit == o.remaining_credit && + allocations == o.allocations && + applied_amount == o.applied_amount && + payments == o.payments && + has_attachments == o.has_attachments && + attachments == o.attachments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [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 + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/overpayments.rb b/lib/xero-ruby/models/accounting/overpayments.rb new file mode 100644 index 00000000..b7fa83a6 --- /dev/null +++ b/lib/xero-ruby/models/accounting/overpayments.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Overpayments + attr_accessor :overpayments + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'overpayments' => :'Overpayments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'overpayments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Overpayments` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Overpayments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'overpayments') + if (value = attributes[:'overpayments']).is_a?(Array) + self.overpayments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + overpayments == o.overpayments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [overpayments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/payment.rb b/lib/xero-ruby/models/accounting/payment.rb new file mode 100644 index 00000000..bcba190e --- /dev/null +++ b/lib/xero-ruby/models/accounting/payment.rb @@ -0,0 +1,481 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Payment + attr_accessor :invoice + + attr_accessor :credit_note + + attr_accessor :prepayment + + attr_accessor :overpayment + + # Number of invoice or credit note you are applying payment to e.g.INV-4003 + attr_accessor :invoice_number + + # Number of invoice or credit note you are applying payment to e.g. INV-4003 + attr_accessor :credit_note_number + + attr_accessor :account + + # Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) + attr_accessor :code + + # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 + attr_accessor :date + + # Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 + attr_accessor :currency_rate + + # The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 + attr_accessor :amount + + # An optional description for the payment e.g. Direct Debit + attr_accessor :reference + + # An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET + attr_accessor :is_reconciled + + # The status of the payment. + attr_accessor :status + + # See Payment Types. + attr_accessor :payment_type + + # UTC timestamp of last update to the payment + attr_accessor :updated_date_utc + + # The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + attr_accessor :payment_id + + # The suppliers bank account number the payment is being made to + attr_accessor :bank_account_number + + # The suppliers bank account number the payment is being made to + attr_accessor :particulars + + # The information to appear on the supplier's bank account + attr_accessor :details + + # A boolean to indicate if a contact has an validation errors + attr_accessor :has_account + + # A boolean to indicate if a contact has an validation errors + attr_accessor :has_validation_errors + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'invoice' => :'Invoice', + :'credit_note' => :'CreditNote', + :'prepayment' => :'Prepayment', + :'overpayment' => :'Overpayment', + :'invoice_number' => :'InvoiceNumber', + :'credit_note_number' => :'CreditNoteNumber', + :'account' => :'Account', + :'code' => :'Code', + :'date' => :'Date', + :'currency_rate' => :'CurrencyRate', + :'amount' => :'Amount', + :'reference' => :'Reference', + :'is_reconciled' => :'IsReconciled', + :'status' => :'Status', + :'payment_type' => :'PaymentType', + :'updated_date_utc' => :'UpdatedDateUTC', + :'payment_id' => :'PaymentID', + :'bank_account_number' => :'BankAccountNumber', + :'particulars' => :'Particulars', + :'details' => :'Details', + :'has_account' => :'HasAccount', + :'has_validation_errors' => :'HasValidationErrors', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'invoice' => :'Invoice', + :'credit_note' => :'CreditNote', + :'prepayment' => :'Prepayment', + :'overpayment' => :'Overpayment', + :'invoice_number' => :'String', + :'credit_note_number' => :'String', + :'account' => :'Account', + :'code' => :'String', + :'date' => :'Date', + :'currency_rate' => :'Float', + :'amount' => :'Float', + :'reference' => :'String', + :'is_reconciled' => :'Boolean', + :'status' => :'String', + :'payment_type' => :'String', + :'updated_date_utc' => :'DateTime', + :'payment_id' => :'String', + :'bank_account_number' => :'String', + :'particulars' => :'String', + :'details' => :'String', + :'has_account' => :'Boolean', + :'has_validation_errors' => :'Boolean', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Payment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Payment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'invoice') + self.invoice = attributes[:'invoice'] + end + + if attributes.key?(:'credit_note') + self.credit_note = attributes[:'credit_note'] + end + + if attributes.key?(:'prepayment') + self.prepayment = attributes[:'prepayment'] + end + + if attributes.key?(:'overpayment') + self.overpayment = attributes[:'overpayment'] + end + + if attributes.key?(:'invoice_number') + self.invoice_number = attributes[:'invoice_number'] + end + + if attributes.key?(:'credit_note_number') + self.credit_note_number = attributes[:'credit_note_number'] + end + + if attributes.key?(:'account') + self.account = attributes[:'account'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'amount') + self.amount = attributes[:'amount'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'is_reconciled') + self.is_reconciled = attributes[:'is_reconciled'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'payment_type') + self.payment_type = attributes[:'payment_type'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'payment_id') + self.payment_id = attributes[:'payment_id'] + end + + if attributes.key?(:'bank_account_number') + self.bank_account_number = attributes[:'bank_account_number'] + end + + if attributes.key?(:'particulars') + self.particulars = attributes[:'particulars'] + end + + if attributes.key?(:'details') + self.details = attributes[:'details'] + end + + if attributes.key?(:'has_account') + self.has_account = attributes[:'has_account'] + else + self.has_account = false + end + + if attributes.key?(:'has_validation_errors') + self.has_validation_errors = attributes[:'has_validation_errors'] + else + self.has_validation_errors = false + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) + return false unless status_validator.valid?(@status) + payment_type_validator = EnumAttributeValidator.new('String', ["ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "AROVERPAYMENTPAYMENT", "ARPREPAYMENTPAYMENT", "APPREPAYMENTPAYMENT", "APOVERPAYMENTPAYMENT"]) + return false unless payment_type_validator.valid?(@payment_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["AUTHORISED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] payment_type Object to be assigned + def payment_type=(payment_type) + validator = EnumAttributeValidator.new('String', ["ACCRECPAYMENT", "ACCPAYPAYMENT", "ARCREDITPAYMENT", "APCREDITPAYMENT", "AROVERPAYMENTPAYMENT", "ARPREPAYMENTPAYMENT", "APPREPAYMENTPAYMENT", "APOVERPAYMENTPAYMENT"]) + unless validator.valid?(payment_type) + fail ArgumentError, "invalid value for \"payment_type\", must be one of #{validator.allowable_values}." + end + @payment_type = payment_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + invoice == o.invoice && + credit_note == o.credit_note && + prepayment == o.prepayment && + overpayment == o.overpayment && + invoice_number == o.invoice_number && + credit_note_number == o.credit_note_number && + account == o.account && + code == o.code && + date == o.date && + currency_rate == o.currency_rate && + amount == o.amount && + reference == o.reference && + is_reconciled == o.is_reconciled && + status == o.status && + payment_type == o.payment_type && + updated_date_utc == o.updated_date_utc && + payment_id == o.payment_id && + bank_account_number == o.bank_account_number && + particulars == o.particulars && + details == o.details && + has_account == o.has_account && + has_validation_errors == o.has_validation_errors && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, account, code, date, currency_rate, amount, reference, is_reconciled, status, payment_type, updated_date_utc, payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/payment_delete.rb b/lib/xero-ruby/models/accounting/payment_delete.rb new file mode 100644 index 00000000..5b6fab3b --- /dev/null +++ b/lib/xero-ruby/models/accounting/payment_delete.rb @@ -0,0 +1,211 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class PaymentDelete + # The status of the payment. + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'Status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentDelete` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentDelete`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + else + self.status = 'DELETED' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @status.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/payment_service.rb b/lib/xero-ruby/models/accounting/payment_service.rb new file mode 100644 index 00000000..ea8fa2d8 --- /dev/null +++ b/lib/xero-ruby/models/accounting/payment_service.rb @@ -0,0 +1,256 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class PaymentService + # Xero identifier + attr_accessor :payment_service_id + + # Name of payment service + attr_accessor :payment_service_name + + # The custom payment URL + attr_accessor :payment_service_url + + # The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card + attr_accessor :pay_now_text + + # This will always be CUSTOM for payment services created via the API. + attr_accessor :payment_service_type + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payment_service_id' => :'PaymentServiceID', + :'payment_service_name' => :'PaymentServiceName', + :'payment_service_url' => :'PaymentServiceUrl', + :'pay_now_text' => :'PayNowText', + :'payment_service_type' => :'PaymentServiceType', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payment_service_id' => :'String', + :'payment_service_name' => :'String', + :'payment_service_url' => :'String', + :'pay_now_text' => :'String', + :'payment_service_type' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentService` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentService`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payment_service_id') + self.payment_service_id = attributes[:'payment_service_id'] + end + + if attributes.key?(:'payment_service_name') + self.payment_service_name = attributes[:'payment_service_name'] + end + + if attributes.key?(:'payment_service_url') + self.payment_service_url = attributes[:'payment_service_url'] + end + + if attributes.key?(:'pay_now_text') + self.pay_now_text = attributes[:'pay_now_text'] + end + + if attributes.key?(:'payment_service_type') + self.payment_service_type = attributes[:'payment_service_type'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payment_service_id == o.payment_service_id && + payment_service_name == o.payment_service_name && + payment_service_url == o.payment_service_url && + pay_now_text == o.pay_now_text && + payment_service_type == o.payment_service_type && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payment_service_id, payment_service_name, payment_service_url, pay_now_text, payment_service_type, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/payment_services.rb b/lib/xero-ruby/models/accounting/payment_services.rb new file mode 100644 index 00000000..7c6153f3 --- /dev/null +++ b/lib/xero-ruby/models/accounting/payment_services.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class PaymentServices + attr_accessor :payment_services + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payment_services' => :'PaymentServices' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payment_services' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentServices` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentServices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payment_services') + if (value = attributes[:'payment_services']).is_a?(Array) + self.payment_services = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payment_services == o.payment_services + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payment_services].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/payment_term.rb b/lib/xero-ruby/models/accounting/payment_term.rb new file mode 100644 index 00000000..ec71976e --- /dev/null +++ b/lib/xero-ruby/models/accounting/payment_term.rb @@ -0,0 +1,212 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class PaymentTerm + attr_accessor :bills + + attr_accessor :sales + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'bills' => :'Bills', + :'sales' => :'Sales' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'bills' => :'Bill', + :'sales' => :'Bill' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PaymentTerm` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PaymentTerm`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'bills') + self.bills = attributes[:'bills'] + end + + if attributes.key?(:'sales') + self.sales = attributes[:'sales'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + bills == o.bills && + sales == o.sales + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [bills, sales].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/payment_term_type.rb b/lib/xero-ruby/models/accounting/payment_term_type.rb new file mode 100644 index 00000000..9ce43bda --- /dev/null +++ b/lib/xero-ruby/models/accounting/payment_term_type.rb @@ -0,0 +1,39 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class PaymentTermType + DAYSAFTERBILLDATE = "DAYSAFTERBILLDATE".freeze + DAYSAFTERBILLMONTH = "DAYSAFTERBILLMONTH".freeze + OFCURRENTMONTH = "OFCURRENTMONTH".freeze + OFFOLLOWINGMONTH = "OFFOLLOWINGMONTH".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = PaymentTermType.constants.select { |c| PaymentTermType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #PaymentTermType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/payments.rb b/lib/xero-ruby/models/accounting/payments.rb new file mode 100644 index 00000000..540723f3 --- /dev/null +++ b/lib/xero-ruby/models/accounting/payments.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Payments + attr_accessor :payments + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'payments' => :'Payments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'payments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Payments` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Payments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'payments') + if (value = attributes[:'payments']).is_a?(Array) + self.payments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + payments == o.payments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [payments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/phone.rb b/lib/xero-ruby/models/accounting/phone.rb new file mode 100644 index 00000000..18fd6552 --- /dev/null +++ b/lib/xero-ruby/models/accounting/phone.rb @@ -0,0 +1,312 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Phone + attr_accessor :phone_type + + # max length = 50 + attr_accessor :phone_number + + # max length = 10 + attr_accessor :phone_area_code + + # max length = 20 + attr_accessor :phone_country_code + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'phone_type' => :'PhoneType', + :'phone_number' => :'PhoneNumber', + :'phone_area_code' => :'PhoneAreaCode', + :'phone_country_code' => :'PhoneCountryCode' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'phone_type' => :'String', + :'phone_number' => :'String', + :'phone_area_code' => :'String', + :'phone_country_code' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Phone` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Phone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'phone_type') + self.phone_type = attributes[:'phone_type'] + end + + if attributes.key?(:'phone_number') + self.phone_number = attributes[:'phone_number'] + end + + if attributes.key?(:'phone_area_code') + self.phone_area_code = attributes[:'phone_area_code'] + end + + if attributes.key?(:'phone_country_code') + self.phone_country_code = attributes[:'phone_country_code'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@phone_number.nil? && @phone_number.to_s.length > 50 + invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 50.') + end + + if !@phone_area_code.nil? && @phone_area_code.to_s.length > 10 + invalid_properties.push('invalid value for "phone_area_code", the character length must be smaller than or equal to 10.') + end + + if !@phone_country_code.nil? && @phone_country_code.to_s.length > 20 + invalid_properties.push('invalid value for "phone_country_code", the character length must be smaller than or equal to 20.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + phone_type_validator = EnumAttributeValidator.new('String', ["DEFAULT", "DDI", "MOBILE", "FAX", "OFFICE"]) + return false unless phone_type_validator.valid?(@phone_type) + return false if !@phone_number.nil? && @phone_number.to_s.length > 50 + return false if !@phone_area_code.nil? && @phone_area_code.to_s.length > 10 + return false if !@phone_country_code.nil? && @phone_country_code.to_s.length > 20 + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] phone_type Object to be assigned + def phone_type=(phone_type) + validator = EnumAttributeValidator.new('String', ["DEFAULT", "DDI", "MOBILE", "FAX", "OFFICE"]) + unless validator.valid?(phone_type) + fail ArgumentError, "invalid value for \"phone_type\", must be one of #{validator.allowable_values}." + end + @phone_type = phone_type + end + + # Custom attribute writer method with validation + # @param [Object] phone_number Value to be assigned + def phone_number=(phone_number) + if !phone_number.nil? && phone_number.to_s.length > 50 + fail ArgumentError, 'invalid value for "phone_number", the character length must be smaller than or equal to 50.' + end + + @phone_number = phone_number + end + + # Custom attribute writer method with validation + # @param [Object] phone_area_code Value to be assigned + def phone_area_code=(phone_area_code) + if !phone_area_code.nil? && phone_area_code.to_s.length > 10 + fail ArgumentError, 'invalid value for "phone_area_code", the character length must be smaller than or equal to 10.' + end + + @phone_area_code = phone_area_code + end + + # Custom attribute writer method with validation + # @param [Object] phone_country_code Value to be assigned + def phone_country_code=(phone_country_code) + if !phone_country_code.nil? && phone_country_code.to_s.length > 20 + fail ArgumentError, 'invalid value for "phone_country_code", the character length must be smaller than or equal to 20.' + end + + @phone_country_code = phone_country_code + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + phone_type == o.phone_type && + phone_number == o.phone_number && + phone_area_code == o.phone_area_code && + phone_country_code == o.phone_country_code + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [phone_type, phone_number, phone_area_code, phone_country_code].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/prepayment.rb b/lib/xero-ruby/models/accounting/prepayment.rb new file mode 100644 index 00000000..d89ebf5c --- /dev/null +++ b/lib/xero-ruby/models/accounting/prepayment.rb @@ -0,0 +1,435 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Prepayment + # See Prepayment Types + attr_accessor :type + + attr_accessor :contact + + # The date the prepayment is created YYYY-MM-DD + attr_accessor :date + + # See Prepayment Status Codes + attr_accessor :status + + attr_accessor :line_amount_types + + # See Prepayment Line Items + attr_accessor :line_items + + # The subtotal of the prepayment excluding taxes + attr_accessor :sub_total + + # The total tax on the prepayment + attr_accessor :total_tax + + # The total of the prepayment(subtotal + total tax) + attr_accessor :total + + # Returns Invoice number field. Reference field isn't available. + attr_accessor :reference + + # UTC timestamp of last update to the prepayment + attr_accessor :updated_date_utc + + attr_accessor :currency_code + + # Xero generated unique identifier + attr_accessor :prepayment_id + + # The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used + attr_accessor :currency_rate + + # The remaining credit balance on the prepayment + attr_accessor :remaining_credit + + # See Allocations + attr_accessor :allocations + + # The amount of applied to an invoice + attr_accessor :applied_amount + + # boolean to indicate if a prepayment has an attachment + attr_accessor :has_attachments + + # See Attachments + attr_accessor :attachments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'Type', + :'contact' => :'Contact', + :'date' => :'Date', + :'status' => :'Status', + :'line_amount_types' => :'LineAmountTypes', + :'line_items' => :'LineItems', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'reference' => :'Reference', + :'updated_date_utc' => :'UpdatedDateUTC', + :'currency_code' => :'CurrencyCode', + :'prepayment_id' => :'PrepaymentID', + :'currency_rate' => :'CurrencyRate', + :'remaining_credit' => :'RemainingCredit', + :'allocations' => :'Allocations', + :'applied_amount' => :'AppliedAmount', + :'has_attachments' => :'HasAttachments', + :'attachments' => :'Attachments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'contact' => :'Contact', + :'date' => :'Date', + :'status' => :'String', + :'line_amount_types' => :'LineAmountTypes', + :'line_items' => :'Array', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'reference' => :'String', + :'updated_date_utc' => :'DateTime', + :'currency_code' => :'CurrencyCode', + :'prepayment_id' => :'String', + :'currency_rate' => :'Float', + :'remaining_credit' => :'Float', + :'allocations' => :'Array', + :'applied_amount' => :'Float', + :'has_attachments' => :'Boolean', + :'attachments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Prepayment` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Prepayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'prepayment_id') + self.prepayment_id = attributes[:'prepayment_id'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'remaining_credit') + self.remaining_credit = attributes[:'remaining_credit'] + end + + if attributes.key?(:'allocations') + if (value = attributes[:'allocations']).is_a?(Array) + self.allocations = value + end + end + + if attributes.key?(:'applied_amount') + self.applied_amount = attributes[:'applied_amount'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["RECEIVE-PREPAYMENT", "SPEND-PREPAYMENT", "ARPREPAYMENT", "APPREPAYMENT"]) + return false unless type_validator.valid?(@type) + status_validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["RECEIVE-PREPAYMENT", "SPEND-PREPAYMENT", "ARPREPAYMENT", "APPREPAYMENT"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["AUTHORISED", "PAID", "VOIDED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + contact == o.contact && + date == o.date && + status == o.status && + line_amount_types == o.line_amount_types && + line_items == o.line_items && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + reference == o.reference && + updated_date_utc == o.updated_date_utc && + currency_code == o.currency_code && + prepayment_id == o.prepayment_id && + currency_rate == o.currency_rate && + remaining_credit == o.remaining_credit && + allocations == o.allocations && + applied_amount == o.applied_amount && + has_attachments == o.has_attachments && + attachments == o.attachments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [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, applied_amount, has_attachments, attachments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/prepayments.rb b/lib/xero-ruby/models/accounting/prepayments.rb new file mode 100644 index 00000000..35afec98 --- /dev/null +++ b/lib/xero-ruby/models/accounting/prepayments.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Prepayments + attr_accessor :prepayments + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'prepayments' => :'Prepayments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'prepayments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Prepayments` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Prepayments`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'prepayments') + if (value = attributes[:'prepayments']).is_a?(Array) + self.prepayments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + prepayments == o.prepayments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [prepayments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/purchase.rb b/lib/xero-ruby/models/accounting/purchase.rb new file mode 100644 index 00000000..7bde8095 --- /dev/null +++ b/lib/xero-ruby/models/accounting/purchase.rb @@ -0,0 +1,234 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Purchase + # Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. + attr_accessor :unit_price + + # Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items + attr_accessor :account_code + + # Cost of goods sold account. Only applicable to the purchase details of tracked items. + attr_accessor :cogs_account_code + + # The tax type from TaxRates + attr_accessor :tax_type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'unit_price' => :'UnitPrice', + :'account_code' => :'AccountCode', + :'cogs_account_code' => :'COGSAccountCode', + :'tax_type' => :'TaxType' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'unit_price' => :'Float', + :'account_code' => :'String', + :'cogs_account_code' => :'String', + :'tax_type' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Purchase` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Purchase`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'unit_price') + self.unit_price = attributes[:'unit_price'] + end + + if attributes.key?(:'account_code') + self.account_code = attributes[:'account_code'] + end + + if attributes.key?(:'cogs_account_code') + self.cogs_account_code = attributes[:'cogs_account_code'] + end + + if attributes.key?(:'tax_type') + self.tax_type = attributes[:'tax_type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + unit_price == o.unit_price && + account_code == o.account_code && + cogs_account_code == o.cogs_account_code && + tax_type == o.tax_type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [unit_price, account_code, cogs_account_code, tax_type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/purchase_order.rb b/lib/xero-ruby/models/accounting/purchase_order.rb new file mode 100644 index 00000000..6a919d7b --- /dev/null +++ b/lib/xero-ruby/models/accounting/purchase_order.rb @@ -0,0 +1,515 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class PurchaseOrder + attr_accessor :contact + + # See LineItems + attr_accessor :line_items + + # Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation + attr_accessor :date + + # Date the goods are to be delivered – YYYY-MM-DD + attr_accessor :delivery_date + + attr_accessor :line_amount_types + + # Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) + attr_accessor :purchase_order_number + + # Additional reference number + attr_accessor :reference + + # See BrandingThemes + attr_accessor :branding_theme_id + + attr_accessor :currency_code + + # See Purchase Order Status Codes + attr_accessor :status + + # Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed + attr_accessor :sent_to_contact + + # The address the goods are to be delivered to + attr_accessor :delivery_address + + # The person that the delivery is going to + attr_accessor :attention_to + + # The phone number for the person accepting the delivery + attr_accessor :telephone + + # A free text feild for instructions (500 characters max) + attr_accessor :delivery_instructions + + # The date the goods are expected to arrive. + attr_accessor :expected_arrival_date + + # Xero generated unique identifier for purchase order + attr_accessor :purchase_order_id + + # The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. + attr_accessor :currency_rate + + # Total of purchase order excluding taxes + attr_accessor :sub_total + + # Total tax on purchase order + attr_accessor :total_tax + + # Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) + attr_accessor :total + + # Total of discounts applied on the purchase order line items + attr_accessor :total_discount + + # boolean to indicate if a purchase order has an attachment + attr_accessor :has_attachments + + # Last modified date UTC format + attr_accessor :updated_date_utc + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Displays array of warning messages from the API + attr_accessor :warnings + + # Displays array of attachments from the API + attr_accessor :attachments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'contact' => :'Contact', + :'line_items' => :'LineItems', + :'date' => :'Date', + :'delivery_date' => :'DeliveryDate', + :'line_amount_types' => :'LineAmountTypes', + :'purchase_order_number' => :'PurchaseOrderNumber', + :'reference' => :'Reference', + :'branding_theme_id' => :'BrandingThemeID', + :'currency_code' => :'CurrencyCode', + :'status' => :'Status', + :'sent_to_contact' => :'SentToContact', + :'delivery_address' => :'DeliveryAddress', + :'attention_to' => :'AttentionTo', + :'telephone' => :'Telephone', + :'delivery_instructions' => :'DeliveryInstructions', + :'expected_arrival_date' => :'ExpectedArrivalDate', + :'purchase_order_id' => :'PurchaseOrderID', + :'currency_rate' => :'CurrencyRate', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'total_discount' => :'TotalDiscount', + :'has_attachments' => :'HasAttachments', + :'updated_date_utc' => :'UpdatedDateUTC', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors', + :'warnings' => :'Warnings', + :'attachments' => :'Attachments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'contact' => :'Contact', + :'line_items' => :'Array', + :'date' => :'Date', + :'delivery_date' => :'Date', + :'line_amount_types' => :'LineAmountTypes', + :'purchase_order_number' => :'String', + :'reference' => :'String', + :'branding_theme_id' => :'String', + :'currency_code' => :'CurrencyCode', + :'status' => :'String', + :'sent_to_contact' => :'Boolean', + :'delivery_address' => :'String', + :'attention_to' => :'String', + :'telephone' => :'String', + :'delivery_instructions' => :'String', + :'expected_arrival_date' => :'Date', + :'purchase_order_id' => :'String', + :'currency_rate' => :'Float', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'total_discount' => :'Float', + :'has_attachments' => :'Boolean', + :'updated_date_utc' => :'DateTime', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array', + :'warnings' => :'Array', + :'attachments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PurchaseOrder` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PurchaseOrder`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'delivery_date') + self.delivery_date = attributes[:'delivery_date'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'purchase_order_number') + self.purchase_order_number = attributes[:'purchase_order_number'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'branding_theme_id') + self.branding_theme_id = attributes[:'branding_theme_id'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'sent_to_contact') + self.sent_to_contact = attributes[:'sent_to_contact'] + end + + if attributes.key?(:'delivery_address') + self.delivery_address = attributes[:'delivery_address'] + end + + if attributes.key?(:'attention_to') + self.attention_to = attributes[:'attention_to'] + end + + if attributes.key?(:'telephone') + self.telephone = attributes[:'telephone'] + end + + if attributes.key?(:'delivery_instructions') + self.delivery_instructions = attributes[:'delivery_instructions'] + end + + if attributes.key?(:'expected_arrival_date') + self.expected_arrival_date = attributes[:'expected_arrival_date'] + end + + if attributes.key?(:'purchase_order_id') + self.purchase_order_id = attributes[:'purchase_order_id'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'total_discount') + self.total_discount = attributes[:'total_discount'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "BILLED", "DELETED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "BILLED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + contact == o.contact && + line_items == o.line_items && + date == o.date && + delivery_date == o.delivery_date && + line_amount_types == o.line_amount_types && + purchase_order_number == o.purchase_order_number && + reference == o.reference && + branding_theme_id == o.branding_theme_id && + currency_code == o.currency_code && + status == o.status && + sent_to_contact == o.sent_to_contact && + delivery_address == o.delivery_address && + attention_to == o.attention_to && + telephone == o.telephone && + delivery_instructions == o.delivery_instructions && + expected_arrival_date == o.expected_arrival_date && + purchase_order_id == o.purchase_order_id && + currency_rate == o.currency_rate && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + total_discount == o.total_discount && + has_attachments == o.has_attachments && + updated_date_utc == o.updated_date_utc && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors && + warnings == o.warnings && + attachments == o.attachments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [contact, line_items, date, delivery_date, line_amount_types, purchase_order_number, reference, branding_theme_id, currency_code, status, sent_to_contact, delivery_address, attention_to, telephone, delivery_instructions, expected_arrival_date, purchase_order_id, currency_rate, sub_total, total_tax, total, total_discount, has_attachments, updated_date_utc, status_attribute_string, validation_errors, warnings, attachments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/purchase_orders.rb b/lib/xero-ruby/models/accounting/purchase_orders.rb new file mode 100644 index 00000000..9d74acc0 --- /dev/null +++ b/lib/xero-ruby/models/accounting/purchase_orders.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class PurchaseOrders + attr_accessor :purchase_orders + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'purchase_orders' => :'PurchaseOrders' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'purchase_orders' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::PurchaseOrders` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::PurchaseOrders`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'purchase_orders') + if (value = attributes[:'purchase_orders']).is_a?(Array) + self.purchase_orders = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + purchase_orders == o.purchase_orders + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [purchase_orders].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/quote.rb b/lib/xero-ruby/models/accounting/quote.rb new file mode 100644 index 00000000..a8f1b94c --- /dev/null +++ b/lib/xero-ruby/models/accounting/quote.rb @@ -0,0 +1,509 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Quote + # QuoteID GUID is automatically generated and is returned after create or GET. + attr_accessor :quote_id + + # Unique alpha numeric code identifying a quote (Max Length = 255) + attr_accessor :quote_number + + # Additional reference number + attr_accessor :reference + + # Terms of the quote + attr_accessor :terms + + attr_accessor :contact + + # See LineItems + attr_accessor :line_items + + # Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation + attr_accessor :date + + # Date the quote was issued (YYYY-MM-DD) + attr_accessor :date_string + + # Date the quote expires – YYYY-MM-DD. + attr_accessor :expiry_date + + # Date the quote expires – YYYY-MM-DD. + attr_accessor :expiry_date_string + + attr_accessor :status + + attr_accessor :currency_code + + # The currency rate for a multicurrency quote + attr_accessor :currency_rate + + # Total of quote excluding taxes. + attr_accessor :sub_total + + # Total tax on quote + attr_accessor :total_tax + + # Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts + attr_accessor :total + + # Total of discounts applied on the quote line items + attr_accessor :total_discount + + # Title text for the quote + attr_accessor :title + + # Summary text for the quote + attr_accessor :summary + + # See BrandingThemes + attr_accessor :branding_theme_id + + # Last modified date UTC format + attr_accessor :updated_date_utc + + attr_accessor :line_amount_types + + # A string to indicate if a invoice status + attr_accessor :status_attribute_string + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'quote_id' => :'QuoteID', + :'quote_number' => :'QuoteNumber', + :'reference' => :'Reference', + :'terms' => :'Terms', + :'contact' => :'Contact', + :'line_items' => :'LineItems', + :'date' => :'Date', + :'date_string' => :'DateString', + :'expiry_date' => :'ExpiryDate', + :'expiry_date_string' => :'ExpiryDateString', + :'status' => :'Status', + :'currency_code' => :'CurrencyCode', + :'currency_rate' => :'CurrencyRate', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'total_discount' => :'TotalDiscount', + :'title' => :'Title', + :'summary' => :'Summary', + :'branding_theme_id' => :'BrandingThemeID', + :'updated_date_utc' => :'UpdatedDateUTC', + :'line_amount_types' => :'LineAmountTypes', + :'status_attribute_string' => :'StatusAttributeString', + :'validation_errors' => :'ValidationErrors' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'quote_id' => :'String', + :'quote_number' => :'String', + :'reference' => :'String', + :'terms' => :'String', + :'contact' => :'Contact', + :'line_items' => :'Array', + :'date' => :'Date', + :'date_string' => :'String', + :'expiry_date' => :'Date', + :'expiry_date_string' => :'String', + :'status' => :'QuoteStatusCodes', + :'currency_code' => :'CurrencyCode', + :'currency_rate' => :'Float', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'total_discount' => :'Float', + :'title' => :'String', + :'summary' => :'String', + :'branding_theme_id' => :'String', + :'updated_date_utc' => :'DateTime', + :'line_amount_types' => :'QuoteLineAmountTypes', + :'status_attribute_string' => :'String', + :'validation_errors' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Quote` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Quote`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'quote_id') + self.quote_id = attributes[:'quote_id'] + end + + if attributes.key?(:'quote_number') + self.quote_number = attributes[:'quote_number'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'terms') + self.terms = attributes[:'terms'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'date_string') + self.date_string = attributes[:'date_string'] + end + + if attributes.key?(:'expiry_date') + self.expiry_date = attributes[:'expiry_date'] + end + + if attributes.key?(:'expiry_date_string') + self.expiry_date_string = attributes[:'expiry_date_string'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'currency_rate') + self.currency_rate = attributes[:'currency_rate'] + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'total_discount') + self.total_discount = attributes[:'total_discount'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'summary') + self.summary = attributes[:'summary'] + end + + if attributes.key?(:'branding_theme_id') + self.branding_theme_id = attributes[:'branding_theme_id'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'status_attribute_string') + self.status_attribute_string = attributes[:'status_attribute_string'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@quote_number.nil? && @quote_number.to_s.length > 255 + invalid_properties.push('invalid value for "quote_number", the character length must be smaller than or equal to 255.') + end + + if !@reference.nil? && @reference.to_s.length > 4000 + invalid_properties.push('invalid value for "reference", the character length must be smaller than or equal to 4000.') + end + + if !@terms.nil? && @terms.to_s.length > 4000 + invalid_properties.push('invalid value for "terms", the character length must be smaller than or equal to 4000.') + end + + if !@title.nil? && @title.to_s.length > 100 + invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 100.') + end + + if !@summary.nil? && @summary.to_s.length > 3000 + invalid_properties.push('invalid value for "summary", the character length must be smaller than or equal to 3000.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@quote_number.nil? && @quote_number.to_s.length > 255 + return false if !@reference.nil? && @reference.to_s.length > 4000 + return false if !@terms.nil? && @terms.to_s.length > 4000 + return false if !@title.nil? && @title.to_s.length > 100 + return false if !@summary.nil? && @summary.to_s.length > 3000 + true + end + + # Custom attribute writer method with validation + # @param [Object] quote_number Value to be assigned + def quote_number=(quote_number) + if !quote_number.nil? && quote_number.to_s.length > 255 + fail ArgumentError, 'invalid value for "quote_number", the character length must be smaller than or equal to 255.' + end + + @quote_number = quote_number + end + + # Custom attribute writer method with validation + # @param [Object] reference Value to be assigned + def reference=(reference) + if !reference.nil? && reference.to_s.length > 4000 + fail ArgumentError, 'invalid value for "reference", the character length must be smaller than or equal to 4000.' + end + + @reference = reference + end + + # Custom attribute writer method with validation + # @param [Object] terms Value to be assigned + def terms=(terms) + if !terms.nil? && terms.to_s.length > 4000 + fail ArgumentError, 'invalid value for "terms", the character length must be smaller than or equal to 4000.' + end + + @terms = terms + end + + # Custom attribute writer method with validation + # @param [Object] title Value to be assigned + def title=(title) + if !title.nil? && title.to_s.length > 100 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 100.' + end + + @title = title + end + + # Custom attribute writer method with validation + # @param [Object] summary Value to be assigned + def summary=(summary) + if !summary.nil? && summary.to_s.length > 3000 + fail ArgumentError, 'invalid value for "summary", the character length must be smaller than or equal to 3000.' + end + + @summary = summary + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + quote_id == o.quote_id && + quote_number == o.quote_number && + reference == o.reference && + terms == o.terms && + contact == o.contact && + line_items == o.line_items && + date == o.date && + date_string == o.date_string && + expiry_date == o.expiry_date && + expiry_date_string == o.expiry_date_string && + status == o.status && + currency_code == o.currency_code && + currency_rate == o.currency_rate && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + total_discount == o.total_discount && + title == o.title && + summary == o.summary && + branding_theme_id == o.branding_theme_id && + updated_date_utc == o.updated_date_utc && + line_amount_types == o.line_amount_types && + status_attribute_string == o.status_attribute_string && + validation_errors == o.validation_errors + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [quote_id, quote_number, reference, terms, contact, line_items, date, date_string, expiry_date, expiry_date_string, status, currency_code, currency_rate, sub_total, total_tax, total, total_discount, title, summary, branding_theme_id, updated_date_utc, line_amount_types, status_attribute_string, validation_errors].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb new file mode 100644 index 00000000..19a37818 --- /dev/null +++ b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb @@ -0,0 +1,38 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class QuoteLineAmountTypes + EXCLUSIVE = "EXCLUSIVE".freeze + INCLUSIVE = "INCLUSIVE".freeze + NOTAX = "NOTAX".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = QuoteLineAmountTypes.constants.select { |c| QuoteLineAmountTypes::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #QuoteLineAmountTypes" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/quote_status_codes.rb b/lib/xero-ruby/models/accounting/quote_status_codes.rb new file mode 100644 index 00000000..40801dd7 --- /dev/null +++ b/lib/xero-ruby/models/accounting/quote_status_codes.rb @@ -0,0 +1,40 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class QuoteStatusCodes + DRAFT = "DRAFT".freeze + SENT = "SENT".freeze + DECLINED = "DECLINED".freeze + ACCEPTED = "ACCEPTED".freeze + INVOICED = "INVOICED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = QuoteStatusCodes.constants.select { |c| QuoteStatusCodes::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #QuoteStatusCodes" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/quotes.rb b/lib/xero-ruby/models/accounting/quotes.rb new file mode 100644 index 00000000..70a56a46 --- /dev/null +++ b/lib/xero-ruby/models/accounting/quotes.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Quotes + attr_accessor :quotes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'quotes' => :'Quotes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'quotes' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Quotes` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Quotes`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'quotes') + if (value = attributes[:'quotes']).is_a?(Array) + self.quotes = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + quotes == o.quotes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [quotes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/receipt.rb b/lib/xero-ruby/models/accounting/receipt.rb new file mode 100644 index 00000000..3761297f --- /dev/null +++ b/lib/xero-ruby/models/accounting/receipt.rb @@ -0,0 +1,414 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Receipt + # Date of receipt – YYYY-MM-DD + attr_accessor :date + + attr_accessor :contact + + attr_accessor :line_items + + attr_accessor :user + + # Additional reference number + attr_accessor :reference + + attr_accessor :line_amount_types + + # Total of receipt excluding taxes + attr_accessor :sub_total + + # Total tax on receipt + attr_accessor :total_tax + + # Total of receipt tax inclusive (i.e. SubTotal + TotalTax) + attr_accessor :total + + # Xero generated unique identifier for receipt + attr_accessor :receipt_id + + # Current status of receipt – see status types + attr_accessor :status + + # Xero generated sequence number for receipt in current claim for a given user + attr_accessor :receipt_number + + # Last modified date UTC format + attr_accessor :updated_date_utc + + # boolean to indicate if a receipt has an attachment + attr_accessor :has_attachments + + # URL link to a source document – shown as “Go to [appName]” in the Xero app + attr_accessor :url + + # Displays array of validation error messages from the API + attr_accessor :validation_errors + + # Displays array of warning messages from the API + attr_accessor :warnings + + # Displays array of attachments from the API + attr_accessor :attachments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'date' => :'Date', + :'contact' => :'Contact', + :'line_items' => :'LineItems', + :'user' => :'User', + :'reference' => :'Reference', + :'line_amount_types' => :'LineAmountTypes', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'receipt_id' => :'ReceiptID', + :'status' => :'Status', + :'receipt_number' => :'ReceiptNumber', + :'updated_date_utc' => :'UpdatedDateUTC', + :'has_attachments' => :'HasAttachments', + :'url' => :'Url', + :'validation_errors' => :'ValidationErrors', + :'warnings' => :'Warnings', + :'attachments' => :'Attachments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'date' => :'Date', + :'contact' => :'Contact', + :'line_items' => :'Array', + :'user' => :'User', + :'reference' => :'String', + :'line_amount_types' => :'LineAmountTypes', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'receipt_id' => :'String', + :'status' => :'String', + :'receipt_number' => :'String', + :'updated_date_utc' => :'DateTime', + :'has_attachments' => :'Boolean', + :'url' => :'String', + :'validation_errors' => :'Array', + :'warnings' => :'Array', + :'attachments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Receipt` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Receipt`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'date') + self.date = attributes[:'date'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'receipt_id') + self.receipt_id = attributes[:'receipt_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'receipt_number') + self.receipt_number = attributes[:'receipt_number'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'validation_errors') + if (value = attributes[:'validation_errors']).is_a?(Array) + self.validation_errors = value + end + end + + if attributes.key?(:'warnings') + if (value = attributes[:'warnings']).is_a?(Array) + self.warnings = value + end + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED", "VOIDED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["DRAFT", "SUBMITTED", "AUTHORISED", "DECLINED", "VOIDED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + date == o.date && + contact == o.contact && + line_items == o.line_items && + user == o.user && + reference == o.reference && + line_amount_types == o.line_amount_types && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + receipt_id == o.receipt_id && + status == o.status && + receipt_number == o.receipt_number && + updated_date_utc == o.updated_date_utc && + has_attachments == o.has_attachments && + url == o.url && + validation_errors == o.validation_errors && + warnings == o.warnings && + attachments == o.attachments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [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 + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/receipts.rb b/lib/xero-ruby/models/accounting/receipts.rb new file mode 100644 index 00000000..d7801db7 --- /dev/null +++ b/lib/xero-ruby/models/accounting/receipts.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Receipts + attr_accessor :receipts + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'receipts' => :'Receipts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'receipts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Receipts` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Receipts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'receipts') + if (value = attributes[:'receipts']).is_a?(Array) + self.receipts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + receipts == o.receipts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [receipts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/repeating_invoice.rb b/lib/xero-ruby/models/accounting/repeating_invoice.rb new file mode 100644 index 00000000..ad1f32f3 --- /dev/null +++ b/lib/xero-ruby/models/accounting/repeating_invoice.rb @@ -0,0 +1,402 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class RepeatingInvoice + # See Invoice Types + attr_accessor :type + + attr_accessor :contact + + attr_accessor :schedule + + # See LineItems + attr_accessor :line_items + + attr_accessor :line_amount_types + + # ACCREC only – additional reference number + attr_accessor :reference + + # See BrandingThemes + attr_accessor :branding_theme_id + + attr_accessor :currency_code + + # One of the following - DRAFT or AUTHORISED – See Invoice Status Codes + attr_accessor :status + + # Total of invoice excluding taxes + attr_accessor :sub_total + + # Total tax on invoice + attr_accessor :total_tax + + # Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) + attr_accessor :total + + # Xero generated unique identifier for repeating invoice template + attr_accessor :repeating_invoice_id + + # Xero generated unique identifier for repeating invoice template + attr_accessor :id + + # boolean to indicate if an invoice has an attachment + attr_accessor :has_attachments + + # Displays array of attachments from the API + attr_accessor :attachments + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'type' => :'Type', + :'contact' => :'Contact', + :'schedule' => :'Schedule', + :'line_items' => :'LineItems', + :'line_amount_types' => :'LineAmountTypes', + :'reference' => :'Reference', + :'branding_theme_id' => :'BrandingThemeID', + :'currency_code' => :'CurrencyCode', + :'status' => :'Status', + :'sub_total' => :'SubTotal', + :'total_tax' => :'TotalTax', + :'total' => :'Total', + :'repeating_invoice_id' => :'RepeatingInvoiceID', + :'id' => :'ID', + :'has_attachments' => :'HasAttachments', + :'attachments' => :'Attachments' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'type' => :'String', + :'contact' => :'Contact', + :'schedule' => :'Schedule', + :'line_items' => :'Array', + :'line_amount_types' => :'LineAmountTypes', + :'reference' => :'String', + :'branding_theme_id' => :'String', + :'currency_code' => :'CurrencyCode', + :'status' => :'String', + :'sub_total' => :'Float', + :'total_tax' => :'Float', + :'total' => :'Float', + :'repeating_invoice_id' => :'String', + :'id' => :'String', + :'has_attachments' => :'Boolean', + :'attachments' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::RepeatingInvoice` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::RepeatingInvoice`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'contact') + self.contact = attributes[:'contact'] + end + + if attributes.key?(:'schedule') + self.schedule = attributes[:'schedule'] + end + + if attributes.key?(:'line_items') + if (value = attributes[:'line_items']).is_a?(Array) + self.line_items = value + end + end + + if attributes.key?(:'line_amount_types') + self.line_amount_types = attributes[:'line_amount_types'] + end + + if attributes.key?(:'reference') + self.reference = attributes[:'reference'] + end + + if attributes.key?(:'branding_theme_id') + self.branding_theme_id = attributes[:'branding_theme_id'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'sub_total') + self.sub_total = attributes[:'sub_total'] + end + + if attributes.key?(:'total_tax') + self.total_tax = attributes[:'total_tax'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + end + + if attributes.key?(:'repeating_invoice_id') + self.repeating_invoice_id = attributes[:'repeating_invoice_id'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'has_attachments') + self.has_attachments = attributes[:'has_attachments'] + else + self.has_attachments = false + end + + if attributes.key?(:'attachments') + if (value = attributes[:'attachments']).is_a?(Array) + self.attachments = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + type_validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCREC"]) + return false unless type_validator.valid?(@type) + status_validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED", "DELETED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] type Object to be assigned + def type=(type) + validator = EnumAttributeValidator.new('String', ["ACCPAY", "ACCREC"]) + unless validator.valid?(type) + fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + end + @type = type + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["DRAFT", "AUTHORISED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + contact == o.contact && + schedule == o.schedule && + line_items == o.line_items && + line_amount_types == o.line_amount_types && + reference == o.reference && + branding_theme_id == o.branding_theme_id && + currency_code == o.currency_code && + status == o.status && + sub_total == o.sub_total && + total_tax == o.total_tax && + total == o.total && + repeating_invoice_id == o.repeating_invoice_id && + id == o.id && + has_attachments == o.has_attachments && + attachments == o.attachments + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [type, contact, schedule, line_items, line_amount_types, reference, branding_theme_id, currency_code, status, sub_total, total_tax, total, repeating_invoice_id, id, has_attachments, attachments].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/repeating_invoices.rb b/lib/xero-ruby/models/accounting/repeating_invoices.rb new file mode 100644 index 00000000..16e12d86 --- /dev/null +++ b/lib/xero-ruby/models/accounting/repeating_invoices.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class RepeatingInvoices + attr_accessor :repeating_invoices + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'repeating_invoices' => :'RepeatingInvoices' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'repeating_invoices' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::RepeatingInvoices` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::RepeatingInvoices`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'repeating_invoices') + if (value = attributes[:'repeating_invoices']).is_a?(Array) + self.repeating_invoices = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + repeating_invoices == o.repeating_invoices + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [repeating_invoices].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report.rb b/lib/xero-ruby/models/accounting/report.rb new file mode 100644 index 00000000..196567fd --- /dev/null +++ b/lib/xero-ruby/models/accounting/report.rb @@ -0,0 +1,299 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Report + # See Prepayment Types + attr_accessor :report_id + + # See Prepayment Types + attr_accessor :report_name + + # See Prepayment Types + attr_accessor :report_type + + # See Prepayment Types + attr_accessor :report_title + + # Date of report + attr_accessor :report_date + + # Updated Date + attr_accessor :updated_date_utc + + attr_accessor :contacts + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'report_id' => :'ReportID', + :'report_name' => :'ReportName', + :'report_type' => :'ReportType', + :'report_title' => :'ReportTitle', + :'report_date' => :'ReportDate', + :'updated_date_utc' => :'UpdatedDateUTC', + :'contacts' => :'Contacts' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'report_id' => :'String', + :'report_name' => :'String', + :'report_type' => :'String', + :'report_title' => :'String', + :'report_date' => :'String', + :'updated_date_utc' => :'DateTime', + :'contacts' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Report` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Report`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'report_id') + self.report_id = attributes[:'report_id'] + end + + if attributes.key?(:'report_name') + self.report_name = attributes[:'report_name'] + end + + if attributes.key?(:'report_type') + self.report_type = attributes[:'report_type'] + end + + if attributes.key?(:'report_title') + self.report_title = attributes[:'report_title'] + end + + if attributes.key?(:'report_date') + self.report_date = attributes[:'report_date'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'contacts') + if (value = attributes[:'contacts']).is_a?(Array) + self.contacts = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + report_type_validator = EnumAttributeValidator.new('String', ["AgedPayablesByContact"]) + return false unless report_type_validator.valid?(@report_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] report_type Object to be assigned + def report_type=(report_type) + validator = EnumAttributeValidator.new('String', ["AgedPayablesByContact"]) + unless validator.valid?(report_type) + fail ArgumentError, "invalid value for \"report_type\", must be one of #{validator.allowable_values}." + end + @report_type = report_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + report_id == o.report_id && + report_name == o.report_name && + report_type == o.report_type && + report_title == o.report_title && + report_date == o.report_date && + updated_date_utc == o.updated_date_utc && + contacts == o.contacts + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [report_id, report_name, report_type, report_title, report_date, updated_date_utc, contacts].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report_attribute.rb b/lib/xero-ruby/models/accounting/report_attribute.rb new file mode 100644 index 00000000..a9baa80e --- /dev/null +++ b/lib/xero-ruby/models/accounting/report_attribute.rb @@ -0,0 +1,212 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ReportAttribute + attr_accessor :id + + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'id' => :'Id', + :'value' => :'Value' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'id' => :'String', + :'value' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportAttribute` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportAttribute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [id, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report_cell.rb b/lib/xero-ruby/models/accounting/report_cell.rb new file mode 100644 index 00000000..7b4ea394 --- /dev/null +++ b/lib/xero-ruby/models/accounting/report_cell.rb @@ -0,0 +1,214 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ReportCell + attr_accessor :value + + attr_accessor :attributes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'value' => :'Value', + :'attributes' => :'Attributes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'value' => :'String', + :'attributes' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportCell` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportCell`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + + if attributes.key?(:'attributes') + if (value = attributes[:'attributes']).is_a?(Array) + self.attributes = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + value == o.value && + attributes == o.attributes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [value, attributes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report_fields.rb b/lib/xero-ruby/models/accounting/report_fields.rb new file mode 100644 index 00000000..e2d9b315 --- /dev/null +++ b/lib/xero-ruby/models/accounting/report_fields.rb @@ -0,0 +1,221 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ReportFields + attr_accessor :field_id + + attr_accessor :description + + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'field_id' => :'FieldID', + :'description' => :'Description', + :'value' => :'Value' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'field_id' => :'String', + :'description' => :'String', + :'value' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportFields` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportFields`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'field_id') + self.field_id = attributes[:'field_id'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + field_id == o.field_id && + description == o.description && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [field_id, description, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report_row.rb b/lib/xero-ruby/models/accounting/report_row.rb new file mode 100644 index 00000000..d7dfef58 --- /dev/null +++ b/lib/xero-ruby/models/accounting/report_row.rb @@ -0,0 +1,223 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ReportRow + attr_accessor :row_type + + attr_accessor :title + + attr_accessor :cells + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'row_type' => :'RowType', + :'title' => :'Title', + :'cells' => :'Cells' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'row_type' => :'RowType', + :'title' => :'String', + :'cells' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportRow` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportRow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'row_type') + self.row_type = attributes[:'row_type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'cells') + if (value = attributes[:'cells']).is_a?(Array) + self.cells = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + row_type == o.row_type && + title == o.title && + cells == o.cells + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [row_type, title, cells].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report_rows.rb b/lib/xero-ruby/models/accounting/report_rows.rb new file mode 100644 index 00000000..99a4cd4a --- /dev/null +++ b/lib/xero-ruby/models/accounting/report_rows.rb @@ -0,0 +1,234 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ReportRows + attr_accessor :row_type + + attr_accessor :title + + attr_accessor :cells + + attr_accessor :rows + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'row_type' => :'RowType', + :'title' => :'Title', + :'cells' => :'Cells', + :'rows' => :'Rows' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'row_type' => :'RowType', + :'title' => :'String', + :'cells' => :'Array', + :'rows' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportRows` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportRows`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'row_type') + self.row_type = attributes[:'row_type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'cells') + if (value = attributes[:'cells']).is_a?(Array) + self.cells = value + end + end + + if attributes.key?(:'rows') + if (value = attributes[:'rows']).is_a?(Array) + self.rows = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + row_type == o.row_type && + title == o.title && + cells == o.cells && + rows == o.rows + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [row_type, title, cells, rows].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report_with_row.rb b/lib/xero-ruby/models/accounting/report_with_row.rb new file mode 100644 index 00000000..6dfab044 --- /dev/null +++ b/lib/xero-ruby/models/accounting/report_with_row.rb @@ -0,0 +1,288 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ReportWithRow + # Report id + attr_accessor :report_id + + # Name of the report + attr_accessor :report_name + + # Title of the report + attr_accessor :report_title + + # The type of report (BalanceSheet,ProfitLoss, etc) + attr_accessor :report_type + + # Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) + attr_accessor :report_titles + + # Date of report + attr_accessor :report_date + + attr_accessor :rows + + # Updated Date + attr_accessor :updated_date_utc + + attr_accessor :fields + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'report_id' => :'ReportID', + :'report_name' => :'ReportName', + :'report_title' => :'ReportTitle', + :'report_type' => :'ReportType', + :'report_titles' => :'ReportTitles', + :'report_date' => :'ReportDate', + :'rows' => :'Rows', + :'updated_date_utc' => :'UpdatedDateUTC', + :'fields' => :'Fields' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'report_id' => :'String', + :'report_name' => :'String', + :'report_title' => :'String', + :'report_type' => :'String', + :'report_titles' => :'Array', + :'report_date' => :'String', + :'rows' => :'Array', + :'updated_date_utc' => :'DateTime', + :'fields' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportWithRow` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportWithRow`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'report_id') + self.report_id = attributes[:'report_id'] + end + + if attributes.key?(:'report_name') + self.report_name = attributes[:'report_name'] + end + + if attributes.key?(:'report_title') + self.report_title = attributes[:'report_title'] + end + + if attributes.key?(:'report_type') + self.report_type = attributes[:'report_type'] + end + + if attributes.key?(:'report_titles') + if (value = attributes[:'report_titles']).is_a?(Array) + self.report_titles = value + end + end + + if attributes.key?(:'report_date') + self.report_date = attributes[:'report_date'] + end + + if attributes.key?(:'rows') + if (value = attributes[:'rows']).is_a?(Array) + self.rows = value + end + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'fields') + if (value = attributes[:'fields']).is_a?(Array) + self.fields = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + report_id == o.report_id && + report_name == o.report_name && + report_title == o.report_title && + report_type == o.report_type && + report_titles == o.report_titles && + report_date == o.report_date && + rows == o.rows && + updated_date_utc == o.updated_date_utc && + fields == o.fields + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [report_id, report_name, report_title, report_type, report_titles, report_date, rows, updated_date_utc, fields].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/report_with_rows.rb b/lib/xero-ruby/models/accounting/report_with_rows.rb new file mode 100644 index 00000000..c34ba685 --- /dev/null +++ b/lib/xero-ruby/models/accounting/report_with_rows.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ReportWithRows + attr_accessor :reports + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reports' => :'Reports' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reports' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ReportWithRows` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ReportWithRows`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reports') + if (value = attributes[:'reports']).is_a?(Array) + self.reports = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reports == o.reports + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reports].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/reports.rb b/lib/xero-ruby/models/accounting/reports.rb new file mode 100644 index 00000000..7a573aea --- /dev/null +++ b/lib/xero-ruby/models/accounting/reports.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Reports + attr_accessor :reports + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'reports' => :'Reports' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'reports' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Reports` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Reports`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'reports') + if (value = attributes[:'reports']).is_a?(Array) + self.reports = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reports == o.reports + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [reports].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/request_empty.rb b/lib/xero-ruby/models/accounting/request_empty.rb new file mode 100644 index 00000000..0139762b --- /dev/null +++ b/lib/xero-ruby/models/accounting/request_empty.rb @@ -0,0 +1,204 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class RequestEmpty + # Need at least one field to create an empty JSON payload + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'Status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::RequestEmpty` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::RequestEmpty`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/row_type.rb b/lib/xero-ruby/models/accounting/row_type.rb new file mode 100644 index 00000000..87c0a6fa --- /dev/null +++ b/lib/xero-ruby/models/accounting/row_type.rb @@ -0,0 +1,39 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class RowType + HEADER = "Header".freeze + SECTION = "Section".freeze + ROW = "Row".freeze + SUMMARY_ROW = "SummaryRow".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = RowType.constants.select { |c| RowType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #RowType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/sales_tracking_category.rb b/lib/xero-ruby/models/accounting/sales_tracking_category.rb new file mode 100644 index 00000000..177fd8df --- /dev/null +++ b/lib/xero-ruby/models/accounting/sales_tracking_category.rb @@ -0,0 +1,214 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class SalesTrackingCategory + # The default sales tracking category name for contacts + attr_accessor :tracking_category_name + + # The default purchase tracking category name for contacts + attr_accessor :tracking_option_name + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tracking_category_name' => :'TrackingCategoryName', + :'tracking_option_name' => :'TrackingOptionName' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tracking_category_name' => :'String', + :'tracking_option_name' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::SalesTrackingCategory` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::SalesTrackingCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tracking_category_name') + self.tracking_category_name = attributes[:'tracking_category_name'] + end + + if attributes.key?(:'tracking_option_name') + self.tracking_option_name = attributes[:'tracking_option_name'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tracking_category_name == o.tracking_category_name && + tracking_option_name == o.tracking_option_name + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tracking_category_name, tracking_option_name].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/schedule.rb b/lib/xero-ruby/models/accounting/schedule.rb new file mode 100644 index 00000000..5fe4b23c --- /dev/null +++ b/lib/xero-ruby/models/accounting/schedule.rb @@ -0,0 +1,310 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Schedule + # Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) + attr_accessor :period + + # One of the following - WEEKLY or MONTHLY + attr_accessor :unit + + # Integer used with due date type e.g 20 (of following month), 31 (of current month) + attr_accessor :due_date + + # the payment terms + attr_accessor :due_date_type + + # Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) + attr_accessor :start_date + + # The calendar date of the next invoice in the schedule to be generated + attr_accessor :next_scheduled_date + + # Invoice end date – only returned if the template has an end date set + attr_accessor :end_date + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'period' => :'Period', + :'unit' => :'Unit', + :'due_date' => :'DueDate', + :'due_date_type' => :'DueDateType', + :'start_date' => :'StartDate', + :'next_scheduled_date' => :'NextScheduledDate', + :'end_date' => :'EndDate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'period' => :'Integer', + :'unit' => :'String', + :'due_date' => :'Integer', + :'due_date_type' => :'String', + :'start_date' => :'Date', + :'next_scheduled_date' => :'Date', + :'end_date' => :'Date' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Schedule` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Schedule`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'period') + self.period = attributes[:'period'] + end + + if attributes.key?(:'unit') + self.unit = attributes[:'unit'] + end + + if attributes.key?(:'due_date') + self.due_date = attributes[:'due_date'] + end + + if attributes.key?(:'due_date_type') + self.due_date_type = attributes[:'due_date_type'] + end + + if attributes.key?(:'start_date') + self.start_date = attributes[:'start_date'] + end + + if attributes.key?(:'next_scheduled_date') + self.next_scheduled_date = attributes[:'next_scheduled_date'] + end + + if attributes.key?(:'end_date') + self.end_date = attributes[:'end_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + unit_validator = EnumAttributeValidator.new('String', ["WEEKLY", "MONTHLY"]) + return false unless unit_validator.valid?(@unit) + due_date_type_validator = EnumAttributeValidator.new('String', ["DAYSAFTERBILLDATE", "DAYSAFTERBILLMONTH", "DAYSAFTERINVOICEDATE", "DAYSAFTERINVOICEMONTH", "OFCURRENTMONTH", "OFFOLLOWINGMONTH"]) + return false unless due_date_type_validator.valid?(@due_date_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] unit Object to be assigned + def unit=(unit) + validator = EnumAttributeValidator.new('String', ["WEEKLY", "MONTHLY"]) + unless validator.valid?(unit) + fail ArgumentError, "invalid value for \"unit\", must be one of #{validator.allowable_values}." + end + @unit = unit + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] due_date_type Object to be assigned + def due_date_type=(due_date_type) + validator = EnumAttributeValidator.new('String', ["DAYSAFTERBILLDATE", "DAYSAFTERBILLMONTH", "DAYSAFTERINVOICEDATE", "DAYSAFTERINVOICEMONTH", "OFCURRENTMONTH", "OFFOLLOWINGMONTH"]) + unless validator.valid?(due_date_type) + fail ArgumentError, "invalid value for \"due_date_type\", must be one of #{validator.allowable_values}." + end + @due_date_type = due_date_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + period == o.period && + unit == o.unit && + due_date == o.due_date && + due_date_type == o.due_date_type && + start_date == o.start_date && + next_scheduled_date == o.next_scheduled_date && + end_date == o.end_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [period, unit, due_date, due_date_type, start_date, next_scheduled_date, end_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/tax_component.rb b/lib/xero-ruby/models/accounting/tax_component.rb new file mode 100644 index 00000000..9d8f8e60 --- /dev/null +++ b/lib/xero-ruby/models/accounting/tax_component.rb @@ -0,0 +1,234 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TaxComponent + # Name of Tax Component + attr_accessor :name + + # Tax Rate (up to 4dp) + attr_accessor :rate + + # Boolean to describe if Tax rate is compounded. + attr_accessor :is_compound + + # Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations + attr_accessor :is_non_recoverable + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'rate' => :'Rate', + :'is_compound' => :'IsCompound', + :'is_non_recoverable' => :'IsNonRecoverable' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'rate' => :'Float', + :'is_compound' => :'Boolean', + :'is_non_recoverable' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TaxComponent` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TaxComponent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rate') + self.rate = attributes[:'rate'] + end + + if attributes.key?(:'is_compound') + self.is_compound = attributes[:'is_compound'] + end + + if attributes.key?(:'is_non_recoverable') + self.is_non_recoverable = attributes[:'is_non_recoverable'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + rate == o.rate && + is_compound == o.is_compound && + is_non_recoverable == o.is_non_recoverable + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, rate, is_compound, is_non_recoverable].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/tax_rate.rb b/lib/xero-ruby/models/accounting/tax_rate.rb new file mode 100644 index 00000000..eb1e5e5b --- /dev/null +++ b/lib/xero-ruby/models/accounting/tax_rate.rb @@ -0,0 +1,362 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TaxRate + # Name of tax rate + attr_accessor :name + + # The tax type + attr_accessor :tax_type + + # See TaxComponents + attr_accessor :tax_components + + # See Status Codes + attr_accessor :status + + # See ReportTaxTypes + attr_accessor :report_tax_type + + # Boolean to describe if tax rate can be used for asset accounts i.e. true,false + attr_accessor :can_apply_to_assets + + # Boolean to describe if tax rate can be used for equity accounts i.e true,false + attr_accessor :can_apply_to_equity + + # Boolean to describe if tax rate can be used for expense accounts i.e. true,false + attr_accessor :can_apply_to_expenses + + # Boolean to describe if tax rate can be used for liability accounts i.e. true,false + attr_accessor :can_apply_to_liabilities + + # Boolean to describe if tax rate can be used for revenue accounts i.e. true,false + attr_accessor :can_apply_to_revenue + + # Tax Rate (decimal to 4dp) e.g 12.5000 + attr_accessor :display_tax_rate + + # Effective Tax Rate (decimal to 4dp) e.g 12.5000 + attr_accessor :effective_rate + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'Name', + :'tax_type' => :'TaxType', + :'tax_components' => :'TaxComponents', + :'status' => :'Status', + :'report_tax_type' => :'ReportTaxType', + :'can_apply_to_assets' => :'CanApplyToAssets', + :'can_apply_to_equity' => :'CanApplyToEquity', + :'can_apply_to_expenses' => :'CanApplyToExpenses', + :'can_apply_to_liabilities' => :'CanApplyToLiabilities', + :'can_apply_to_revenue' => :'CanApplyToRevenue', + :'display_tax_rate' => :'DisplayTaxRate', + :'effective_rate' => :'EffectiveRate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'tax_type' => :'String', + :'tax_components' => :'Array', + :'status' => :'String', + :'report_tax_type' => :'String', + :'can_apply_to_assets' => :'Boolean', + :'can_apply_to_equity' => :'Boolean', + :'can_apply_to_expenses' => :'Boolean', + :'can_apply_to_liabilities' => :'Boolean', + :'can_apply_to_revenue' => :'Boolean', + :'display_tax_rate' => :'Float', + :'effective_rate' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TaxRate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TaxRate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tax_type') + self.tax_type = attributes[:'tax_type'] + end + + if attributes.key?(:'tax_components') + if (value = attributes[:'tax_components']).is_a?(Array) + self.tax_components = value + end + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'report_tax_type') + self.report_tax_type = attributes[:'report_tax_type'] + end + + if attributes.key?(:'can_apply_to_assets') + self.can_apply_to_assets = attributes[:'can_apply_to_assets'] + end + + if attributes.key?(:'can_apply_to_equity') + self.can_apply_to_equity = attributes[:'can_apply_to_equity'] + end + + if attributes.key?(:'can_apply_to_expenses') + self.can_apply_to_expenses = attributes[:'can_apply_to_expenses'] + end + + if attributes.key?(:'can_apply_to_liabilities') + self.can_apply_to_liabilities = attributes[:'can_apply_to_liabilities'] + end + + if attributes.key?(:'can_apply_to_revenue') + self.can_apply_to_revenue = attributes[:'can_apply_to_revenue'] + end + + if attributes.key?(:'display_tax_rate') + self.display_tax_rate = attributes[:'display_tax_rate'] + end + + if attributes.key?(:'effective_rate') + self.effective_rate = attributes[:'effective_rate'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED", "ARCHIVED", "PENDING"]) + return false unless status_validator.valid?(@status) + report_tax_type_validator = EnumAttributeValidator.new('String', ["AVALARA", "BASEXCLUDED", "CAPITALSALESOUTPUT", "CAPITALEXPENSESINPUT", "ECOUTPUT", "ECOUTPUTSERVICES", "ECINPUT", "ECACQUISITIONS", "EXEMPTEXPENSES", "EXEMPTINPUT", "EXEMPTOUTPUT", "GSTONIMPORTS", "INPUT", "INPUTTAXED", "MOSSSALES", "NONE", "NONEOUTPUT", "OUTPUT", "PURCHASESINPUT", "SALESOUTPUT", "EXEMPTCAPITAL", "EXEMPTEXPORT", "CAPITALEXINPUT", "GSTONCAPIMPORTS", "GSTONCAPITALIMPORTS", "REVERSECHARGES", "PAYMENTS", "INVOICE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS", "TXCA", "SRCAS", "DSOUTPUT", "BLINPUT2", "EPINPUT", "IMINPUT2", "MEINPUT", "IGDSINPUT2", "ESN33OUTPUT", "OPINPUT", "OSOUTPUT", "TXN33INPUT", "TXESSINPUT", "TXREINPUT", "TXPETINPUT", "NRINPUT", "ES33OUTPUT", "ZERORATEDINPUT", "ZERORATEDOUTPUT", "DRCHARGESUPPLY", "DRCHARGE", "CAPINPUT", "CAPIMPORTS", "IMINPUT", "INPUT2", "CIUINPUT", "SRINPUT", "OUTPUT2", "SROUTPUT", "CAPOUTPUT", "SROUTPUT2", "CIUOUTPUT", "ZROUTPUT", "ZREXPORT", "ACC28PLUS", "ACCUPTO28", "OTHEROUTPUT", "SHOUTPUT", "ZRINPUT", "BADDEBT", "OTHERINPUT"]) + return false unless report_tax_type_validator.valid?(@report_tax_type) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "DELETED", "ARCHIVED", "PENDING"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] report_tax_type Object to be assigned + def report_tax_type=(report_tax_type) + validator = EnumAttributeValidator.new('String', ["AVALARA", "BASEXCLUDED", "CAPITALSALESOUTPUT", "CAPITALEXPENSESINPUT", "ECOUTPUT", "ECOUTPUTSERVICES", "ECINPUT", "ECACQUISITIONS", "EXEMPTEXPENSES", "EXEMPTINPUT", "EXEMPTOUTPUT", "GSTONIMPORTS", "INPUT", "INPUTTAXED", "MOSSSALES", "NONE", "NONEOUTPUT", "OUTPUT", "PURCHASESINPUT", "SALESOUTPUT", "EXEMPTCAPITAL", "EXEMPTEXPORT", "CAPITALEXINPUT", "GSTONCAPIMPORTS", "GSTONCAPITALIMPORTS", "REVERSECHARGES", "PAYMENTS", "INVOICE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS", "TXCA", "SRCAS", "DSOUTPUT", "BLINPUT2", "EPINPUT", "IMINPUT2", "MEINPUT", "IGDSINPUT2", "ESN33OUTPUT", "OPINPUT", "OSOUTPUT", "TXN33INPUT", "TXESSINPUT", "TXREINPUT", "TXPETINPUT", "NRINPUT", "ES33OUTPUT", "ZERORATEDINPUT", "ZERORATEDOUTPUT", "DRCHARGESUPPLY", "DRCHARGE", "CAPINPUT", "CAPIMPORTS", "IMINPUT", "INPUT2", "CIUINPUT", "SRINPUT", "OUTPUT2", "SROUTPUT", "CAPOUTPUT", "SROUTPUT2", "CIUOUTPUT", "ZROUTPUT", "ZREXPORT", "ACC28PLUS", "ACCUPTO28", "OTHEROUTPUT", "SHOUTPUT", "ZRINPUT", "BADDEBT", "OTHERINPUT"]) + unless validator.valid?(report_tax_type) + fail ArgumentError, "invalid value for \"report_tax_type\", must be one of #{validator.allowable_values}." + end + @report_tax_type = report_tax_type + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + tax_type == o.tax_type && + tax_components == o.tax_components && + status == o.status && + report_tax_type == o.report_tax_type && + can_apply_to_assets == o.can_apply_to_assets && + can_apply_to_equity == o.can_apply_to_equity && + can_apply_to_expenses == o.can_apply_to_expenses && + can_apply_to_liabilities == o.can_apply_to_liabilities && + can_apply_to_revenue == o.can_apply_to_revenue && + display_tax_rate == o.display_tax_rate && + effective_rate == o.effective_rate + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, tax_type, tax_components, status, report_tax_type, can_apply_to_assets, can_apply_to_equity, can_apply_to_expenses, can_apply_to_liabilities, can_apply_to_revenue, display_tax_rate, effective_rate].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/tax_rates.rb b/lib/xero-ruby/models/accounting/tax_rates.rb new file mode 100644 index 00000000..7a55b9e7 --- /dev/null +++ b/lib/xero-ruby/models/accounting/tax_rates.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TaxRates + attr_accessor :tax_rates + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tax_rates' => :'TaxRates' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tax_rates' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TaxRates` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TaxRates`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tax_rates') + if (value = attributes[:'tax_rates']).is_a?(Array) + self.tax_rates = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tax_rates == o.tax_rates + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tax_rates].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/tax_type.rb b/lib/xero-ruby/models/accounting/tax_type.rb new file mode 100644 index 00000000..673c0af3 --- /dev/null +++ b/lib/xero-ruby/models/accounting/tax_type.rb @@ -0,0 +1,94 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TaxType + OUTPUT = "OUTPUT".freeze + INPUT = "INPUT".freeze + CAPEXINPUT = "CAPEXINPUT".freeze + EXEMPTEXPORT = "EXEMPTEXPORT".freeze + EXEMPTEXPENSES = "EXEMPTEXPENSES".freeze + EXEMPTCAPITAL = "EXEMPTCAPITAL".freeze + EXEMPTOUTPUT = "EXEMPTOUTPUT".freeze + INPUTTAXED = "INPUTTAXED".freeze + BASEXCLUDED = "BASEXCLUDED".freeze + GSTONCAPIMPORTS = "GSTONCAPIMPORTS".freeze + GSTONIMPORTS = "GSTONIMPORTS".freeze + NONE = "NONE".freeze + INPUT2 = "INPUT2".freeze + ZERORATED = "ZERORATED".freeze + OUTPUT2 = "OUTPUT2".freeze + CAPEXINPUT2 = "CAPEXINPUT2".freeze + CAPEXOUTPUT = "CAPEXOUTPUT".freeze + CAPEXOUTPUT2 = "CAPEXOUTPUT2".freeze + CAPEXSRINPUT = "CAPEXSRINPUT".freeze + CAPEXSROUTPUT = "CAPEXSROUTPUT".freeze + ECACQUISITIONS = "ECACQUISITIONS".freeze + ECZRINPUT = "ECZRINPUT".freeze + ECZROUTPUT = "ECZROUTPUT".freeze + ECZROUTPUTSERVICES = "ECZROUTPUTSERVICES".freeze + EXEMPTINPUT = "EXEMPTINPUT".freeze + REVERSECHARGES = "REVERSECHARGES".freeze + RRINPUT = "RRINPUT".freeze + RROUTPUT = "RROUTPUT".freeze + SRINPUT = "SRINPUT".freeze + SROUTPUT = "SROUTPUT".freeze + ZERORATEDINPUT = "ZERORATEDINPUT".freeze + ZERORATEDOUTPUT = "ZERORATEDOUTPUT".freeze + BLINPUT = "BLINPUT".freeze + DSOUTPUT = "DSOUTPUT".freeze + EPINPUT = "EPINPUT".freeze + ES33_OUTPUT = "ES33OUTPUT".freeze + ESN33_OUTPUT = "ESN33OUTPUT".freeze + IGDSINPUT2 = "IGDSINPUT2".freeze + IMINPUT2 = "IMINPUT2".freeze + MEINPUT = "MEINPUT".freeze + NRINPUT = "NRINPUT".freeze + OPINPUT = "OPINPUT".freeze + OSOUTPUT = "OSOUTPUT".freeze + TXESSINPUT = "TXESSINPUT".freeze + TXN33_INPUT = "TXN33INPUT".freeze + TXPETINPUT = "TXPETINPUT".freeze + TXREINPUT = "TXREINPUT".freeze + INPUT3 = "INPUT3".freeze + INPUT4 = "INPUT4".freeze + OUTPUT3 = "OUTPUT3".freeze + OUTPUT4 = "OUTPUT4".freeze + SROUTPUT2 = "SROUTPUT2".freeze + TXCA = "TXCA".freeze + SRCAS = "SRCAS".freeze + BLINPUT2 = "BLINPUT2".freeze + DRCHARGESUPPLY20 = "DRCHARGESUPPLY20".freeze + DRCHARGE20 = "DRCHARGE20".freeze + DRCHARGESUPPLY5 = "DRCHARGESUPPLY5".freeze + DRCHARGE5 = "DRCHARGE5".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TaxType.constants.select { |c| TaxType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TaxType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb b/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb new file mode 100644 index 00000000..d2e4d6a8 --- /dev/null +++ b/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb @@ -0,0 +1,414 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TenNinteyNineContact + # Box 1 on 1099 Form + attr_accessor :box1 + + # Box 2 on 1099 Form + attr_accessor :box2 + + # Box 3 on 1099 Form + attr_accessor :box3 + + # Box 4 on 1099 Form + attr_accessor :box4 + + # Box 5 on 1099 Form + attr_accessor :box5 + + # Box 6 on 1099 Form + attr_accessor :box6 + + # Box 7 on 1099 Form + attr_accessor :box7 + + # Box 8 on 1099 Form + attr_accessor :box8 + + # Box 9 on 1099 Form + attr_accessor :box9 + + # Box 10 on 1099 Form + attr_accessor :box10 + + # Box 11 on 1099 Form + attr_accessor :box11 + + # Box 13 on 1099 Form + attr_accessor :box13 + + # Box 14 on 1099 Form + attr_accessor :box14 + + # Contact name on 1099 Form + attr_accessor :name + + # Contact Fed Tax ID type + attr_accessor :federal_tax_id_type + + # Contact city on 1099 Form + attr_accessor :city + + # Contact zip on 1099 Form + attr_accessor :zip + + # Contact State on 1099 Form + attr_accessor :state + + # Contact email on 1099 Form + attr_accessor :email + + # Contact address on 1099 Form + attr_accessor :street_address + + # Contact tax id on 1099 Form + attr_accessor :tax_id + + # Contact contact id + attr_accessor :contact_id + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'box1' => :'Box1', + :'box2' => :'Box2', + :'box3' => :'Box3', + :'box4' => :'Box4', + :'box5' => :'Box5', + :'box6' => :'Box6', + :'box7' => :'Box7', + :'box8' => :'Box8', + :'box9' => :'Box9', + :'box10' => :'Box10', + :'box11' => :'Box11', + :'box13' => :'Box13', + :'box14' => :'Box14', + :'name' => :'Name', + :'federal_tax_id_type' => :'FederalTaxIDType', + :'city' => :'City', + :'zip' => :'Zip', + :'state' => :'State', + :'email' => :'Email', + :'street_address' => :'StreetAddress', + :'tax_id' => :'TaxID', + :'contact_id' => :'ContactId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'box1' => :'Float', + :'box2' => :'Float', + :'box3' => :'Float', + :'box4' => :'Float', + :'box5' => :'Float', + :'box6' => :'Float', + :'box7' => :'Float', + :'box8' => :'Float', + :'box9' => :'Float', + :'box10' => :'Float', + :'box11' => :'Float', + :'box13' => :'Float', + :'box14' => :'Float', + :'name' => :'String', + :'federal_tax_id_type' => :'String', + :'city' => :'String', + :'zip' => :'String', + :'state' => :'String', + :'email' => :'String', + :'street_address' => :'String', + :'tax_id' => :'String', + :'contact_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TenNinteyNineContact` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TenNinteyNineContact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'box1') + self.box1 = attributes[:'box1'] + end + + if attributes.key?(:'box2') + self.box2 = attributes[:'box2'] + end + + if attributes.key?(:'box3') + self.box3 = attributes[:'box3'] + end + + if attributes.key?(:'box4') + self.box4 = attributes[:'box4'] + end + + if attributes.key?(:'box5') + self.box5 = attributes[:'box5'] + end + + if attributes.key?(:'box6') + self.box6 = attributes[:'box6'] + end + + if attributes.key?(:'box7') + self.box7 = attributes[:'box7'] + end + + if attributes.key?(:'box8') + self.box8 = attributes[:'box8'] + end + + if attributes.key?(:'box9') + self.box9 = attributes[:'box9'] + end + + if attributes.key?(:'box10') + self.box10 = attributes[:'box10'] + end + + if attributes.key?(:'box11') + self.box11 = attributes[:'box11'] + end + + if attributes.key?(:'box13') + self.box13 = attributes[:'box13'] + end + + if attributes.key?(:'box14') + self.box14 = attributes[:'box14'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'federal_tax_id_type') + self.federal_tax_id_type = attributes[:'federal_tax_id_type'] + end + + if attributes.key?(:'city') + self.city = attributes[:'city'] + end + + if attributes.key?(:'zip') + self.zip = attributes[:'zip'] + end + + if attributes.key?(:'state') + self.state = attributes[:'state'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'street_address') + self.street_address = attributes[:'street_address'] + end + + if attributes.key?(:'tax_id') + self.tax_id = attributes[:'tax_id'] + end + + if attributes.key?(:'contact_id') + self.contact_id = attributes[:'contact_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + box1 == o.box1 && + box2 == o.box2 && + box3 == o.box3 && + box4 == o.box4 && + box5 == o.box5 && + box6 == o.box6 && + box7 == o.box7 && + box8 == o.box8 && + box9 == o.box9 && + box10 == o.box10 && + box11 == o.box11 && + box13 == o.box13 && + box14 == o.box14 && + name == o.name && + federal_tax_id_type == o.federal_tax_id_type && + city == o.city && + zip == o.zip && + state == o.state && + email == o.email && + street_address == o.street_address && + tax_id == o.tax_id && + contact_id == o.contact_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [box1, box2, box3, box4, box5, box6, box7, box8, box9, box10, box11, box13, box14, name, federal_tax_id_type, city, zip, state, email, street_address, tax_id, contact_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/time_zone.rb b/lib/xero-ruby/models/accounting/time_zone.rb new file mode 100644 index 00000000..19a4f9fb --- /dev/null +++ b/lib/xero-ruby/models/accounting/time_zone.rb @@ -0,0 +1,142 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TimeZone + MOROCCOSTANDARDTIME = "MOROCCOSTANDARDTIME".freeze + UTC = "UTC".freeze + GMTSTANDARDTIME = "GMTSTANDARDTIME".freeze + GREENWICHSTANDARDTIME = "GREENWICHSTANDARDTIME".freeze + WEUROPESTANDARDTIME = "WEUROPESTANDARDTIME".freeze + CENTRALEUROPESTANDARDTIME = "CENTRALEUROPESTANDARDTIME".freeze + ROMANCESTANDARDTIME = "ROMANCESTANDARDTIME".freeze + CENTRALEUROPEANSTANDARDTIME = "CENTRALEUROPEANSTANDARDTIME".freeze + WCENTRALAFRICASTANDARDTIME = "WCENTRALAFRICASTANDARDTIME".freeze + NAMIBIASTANDARDTIME = "NAMIBIASTANDARDTIME".freeze + JORDANSTANDARDTIME = "JORDANSTANDARDTIME".freeze + GTBSTANDARDTIME = "GTBSTANDARDTIME".freeze + MIDDLEEASTSTANDARDTIME = "MIDDLEEASTSTANDARDTIME".freeze + EGYPTSTANDARDTIME = "EGYPTSTANDARDTIME".freeze + SYRIASTANDARDTIME = "SYRIASTANDARDTIME".freeze + EEUROPESTANDARDTIME = "EEUROPESTANDARDTIME".freeze + SOUTHAFRICASTANDARDTIME = "SOUTHAFRICASTANDARDTIME".freeze + FLESTANDARDTIME = "FLESTANDARDTIME".freeze + TURKEYSTANDARDTIME = "TURKEYSTANDARDTIME".freeze + ISRAELSTANDARDTIME = "ISRAELSTANDARDTIME".freeze + KALININGRADSTANDARDTIME = "KALININGRADSTANDARDTIME".freeze + LIBYASTANDARDTIME = "LIBYASTANDARDTIME".freeze + ARABICSTANDARDTIME = "ARABICSTANDARDTIME".freeze + ARABSTANDARDTIME = "ARABSTANDARDTIME".freeze + BELARUSSTANDARDTIME = "BELARUSSTANDARDTIME".freeze + RUSSIANSTANDARDTIME = "RUSSIANSTANDARDTIME".freeze + EAFRICASTANDARDTIME = "EAFRICASTANDARDTIME".freeze + IRANSTANDARDTIME = "IRANSTANDARDTIME".freeze + ARABIANSTANDARDTIME = "ARABIANSTANDARDTIME".freeze + AZERBAIJANSTANDARDTIME = "AZERBAIJANSTANDARDTIME".freeze + RUSSIATIMEZONE3 = "RUSSIATIMEZONE3".freeze + MAURITIUSSTANDARDTIME = "MAURITIUSSTANDARDTIME".freeze + GEORGIANSTANDARDTIME = "GEORGIANSTANDARDTIME".freeze + CAUCASUSSTANDARDTIME = "CAUCASUSSTANDARDTIME".freeze + AFGHANISTANSTANDARDTIME = "AFGHANISTANSTANDARDTIME".freeze + WESTASIASTANDARDTIME = "WESTASIASTANDARDTIME".freeze + EKATERINBURGSTANDARDTIME = "EKATERINBURGSTANDARDTIME".freeze + PAKISTANSTANDARDTIME = "PAKISTANSTANDARDTIME".freeze + INDIASTANDARDTIME = "INDIASTANDARDTIME".freeze + SRILANKASTANDARDTIME = "SRILANKASTANDARDTIME".freeze + NEPALSTANDARDTIME = "NEPALSTANDARDTIME".freeze + CENTRALASIASTANDARDTIME = "CENTRALASIASTANDARDTIME".freeze + BANGLADESHSTANDARDTIME = "BANGLADESHSTANDARDTIME".freeze + NCENTRALASIASTANDARDTIME = "NCENTRALASIASTANDARDTIME".freeze + MYANMARSTANDARDTIME = "MYANMARSTANDARDTIME".freeze + SEASIASTANDARDTIME = "SEASIASTANDARDTIME".freeze + NORTHASIASTANDARDTIME = "NORTHASIASTANDARDTIME".freeze + CHINASTANDARDTIME = "CHINASTANDARDTIME".freeze + NORTHASIAEASTSTANDARDTIME = "NORTHASIAEASTSTANDARDTIME".freeze + SINGAPORESTANDARDTIME = "SINGAPORESTANDARDTIME".freeze + WAUSTRALIASTANDARDTIME = "WAUSTRALIASTANDARDTIME".freeze + TAIPEISTANDARDTIME = "TAIPEISTANDARDTIME".freeze + ULAANBAATARSTANDARDTIME = "ULAANBAATARSTANDARDTIME".freeze + TOKYOSTANDARDTIME = "TOKYOSTANDARDTIME".freeze + KOREASTANDARDTIME = "KOREASTANDARDTIME".freeze + YAKUTSKSTANDARDTIME = "YAKUTSKSTANDARDTIME".freeze + CENAUSTRALIASTANDARDTIME = "CENAUSTRALIASTANDARDTIME".freeze + AUSCENTRALSTANDARDTIME = "AUSCENTRALSTANDARDTIME".freeze + EAUSTRALIASTANDARDTIME = "EAUSTRALIASTANDARDTIME".freeze + AUSEASTERNSTANDARDTIME = "AUSEASTERNSTANDARDTIME".freeze + WESTPACIFICSTANDARDTIME = "WESTPACIFICSTANDARDTIME".freeze + TASMANIASTANDARDTIME = "TASMANIASTANDARDTIME".freeze + MAGADANSTANDARDTIME = "MAGADANSTANDARDTIME".freeze + VLADIVOSTOKSTANDARDTIME = "VLADIVOSTOKSTANDARDTIME".freeze + RUSSIATIMEZONE10 = "RUSSIATIMEZONE10".freeze + CENTRALPACIFICSTANDARDTIME = "CENTRALPACIFICSTANDARDTIME".freeze + RUSSIATIMEZONE11 = "RUSSIATIMEZONE11".freeze + NEWZEALANDSTANDARDTIME = "NEWZEALANDSTANDARDTIME".freeze + UTC12 = "UTC+12".freeze + FIJISTANDARDTIME = "FIJISTANDARDTIME".freeze + KAMCHATKASTANDARDTIME = "KAMCHATKASTANDARDTIME".freeze + TONGASTANDARDTIME = "TONGASTANDARDTIME".freeze + SAMOASTANDARDTIME = "SAMOASTANDARDTIME".freeze + LINEISLANDSSTANDARDTIME = "LINEISLANDSSTANDARDTIME".freeze + AZORESSTANDARDTIME = "AZORESSTANDARDTIME".freeze + CAPEVERDESTANDARDTIME = "CAPEVERDESTANDARDTIME".freeze + UTC02 = "UTC02".freeze + MIDATLANTICSTANDARDTIME = "MIDATLANTICSTANDARDTIME".freeze + ESOUTHAMERICASTANDARDTIME = "ESOUTHAMERICASTANDARDTIME".freeze + ARGENTINASTANDARDTIME = "ARGENTINASTANDARDTIME".freeze + SAEASTERNSTANDARDTIME = "SAEASTERNSTANDARDTIME".freeze + GREENLANDSTANDARDTIME = "GREENLANDSTANDARDTIME".freeze + MONTEVIDEOSTANDARDTIME = "MONTEVIDEOSTANDARDTIME".freeze + BAHIASTANDARDTIME = "BAHIASTANDARDTIME".freeze + NEWFOUNDLANDSTANDARDTIME = "NEWFOUNDLANDSTANDARDTIME".freeze + PARAGUAYSTANDARDTIME = "PARAGUAYSTANDARDTIME".freeze + ATLANTICSTANDARDTIME = "ATLANTICSTANDARDTIME".freeze + CENTRALBRAZILIANSTANDARDTIME = "CENTRALBRAZILIANSTANDARDTIME".freeze + SAWESTERNSTANDARDTIME = "SAWESTERNSTANDARDTIME".freeze + PACIFICSASTANDARDTIME = "PACIFICSASTANDARDTIME".freeze + VENEZUELASTANDARDTIME = "VENEZUELASTANDARDTIME".freeze + SAPACIFICSTANDARDTIME = "SAPACIFICSTANDARDTIME".freeze + EASTERNSTANDARDTIME = "EASTERNSTANDARDTIME".freeze + USEASTERNSTANDARDTIME = "USEASTERNSTANDARDTIME".freeze + CENTRALAMERICASTANDARDTIME = "CENTRALAMERICASTANDARDTIME".freeze + CENTRALSTANDARDTIME = "CENTRALSTANDARDTIME".freeze + CENTRALSTANDARDTIME_MEXICO = "CENTRALSTANDARDTIME(MEXICO)".freeze + CANADACENTRALSTANDARDTIME = "CANADACENTRALSTANDARDTIME".freeze + USMOUNTAINSTANDARDTIME = "USMOUNTAINSTANDARDTIME".freeze + MOUNTAINSTANDARDTIME_MEXICO = "MOUNTAINSTANDARDTIME(MEXICO)".freeze + MOUNTAINSTANDARDTIME = "MOUNTAINSTANDARDTIME".freeze + PACIFICSTANDARDTIME_MEXICO = "PACIFICSTANDARDTIME(MEXICO)".freeze + PACIFICSTANDARDTIME = "PACIFICSTANDARDTIME".freeze + ALASKANSTANDARDTIME = "ALASKANSTANDARDTIME".freeze + HAWAIIANSTANDARDTIME = "HAWAIIANSTANDARDTIME".freeze + UTC11 = "UTC11".freeze + DATELINESTANDARDTIME = "DATELINESTANDARDTIME".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = TimeZone.constants.select { |c| TimeZone::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #TimeZone" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/accounting/tracking_categories.rb b/lib/xero-ruby/models/accounting/tracking_categories.rb new file mode 100644 index 00000000..3e494d29 --- /dev/null +++ b/lib/xero-ruby/models/accounting/tracking_categories.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TrackingCategories + attr_accessor :tracking_categories + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tracking_categories' => :'TrackingCategories' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tracking_categories' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingCategories` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingCategories`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tracking_categories') + if (value = attributes[:'tracking_categories']).is_a?(Array) + self.tracking_categories = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tracking_categories == o.tracking_categories + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tracking_categories].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/tracking_category.rb b/lib/xero-ruby/models/accounting/tracking_category.rb new file mode 100644 index 00000000..4a588f72 --- /dev/null +++ b/lib/xero-ruby/models/accounting/tracking_category.rb @@ -0,0 +1,320 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TrackingCategory + # The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + attr_accessor :tracking_category_id + + # The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f + attr_accessor :tracking_option_id + + # The name of the tracking category e.g. Department, Region (max length = 100) + attr_accessor :name + + # The option name of the tracking option e.g. East, West (max length = 100) + attr_accessor :option + + # The status of a tracking category + attr_accessor :status + + # See Tracking Options + attr_accessor :options + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tracking_category_id' => :'TrackingCategoryID', + :'tracking_option_id' => :'TrackingOptionID', + :'name' => :'Name', + :'option' => :'Option', + :'status' => :'Status', + :'options' => :'Options' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tracking_category_id' => :'String', + :'tracking_option_id' => :'String', + :'name' => :'String', + :'option' => :'String', + :'status' => :'String', + :'options' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingCategory` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingCategory`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tracking_category_id') + self.tracking_category_id = attributes[:'tracking_category_id'] + end + + if attributes.key?(:'tracking_option_id') + self.tracking_option_id = attributes[:'tracking_option_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'option') + self.option = attributes[:'option'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'options') + if (value = attributes[:'options']).is_a?(Array) + self.options = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 100 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.') + end + + if !@option.nil? && @option.to_s.length > 100 + invalid_properties.push('invalid value for "option", the character length must be smaller than or equal to 100.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length > 100 + return false if !@option.nil? && @option.to_s.length > 100 + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 100 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 100.' + end + + @name = name + end + + # Custom attribute writer method with validation + # @param [Object] option Value to be assigned + def option=(option) + if !option.nil? && option.to_s.length > 100 + fail ArgumentError, 'invalid value for "option", the character length must be smaller than or equal to 100.' + end + + @option = option + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tracking_category_id == o.tracking_category_id && + tracking_option_id == o.tracking_option_id && + name == o.name && + option == o.option && + status == o.status && + options == o.options + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tracking_category_id, tracking_option_id, name, option, status, options].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/tracking_option.rb b/lib/xero-ruby/models/accounting/tracking_option.rb new file mode 100644 index 00000000..c3e746ad --- /dev/null +++ b/lib/xero-ruby/models/accounting/tracking_option.rb @@ -0,0 +1,283 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TrackingOption + # The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a + attr_accessor :tracking_option_id + + # The name of the tracking option e.g. Marketing, East (max length = 50) + attr_accessor :name + + # The status of a tracking option + attr_accessor :status + + # Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 + attr_accessor :tracking_category_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'tracking_option_id' => :'TrackingOptionID', + :'name' => :'Name', + :'status' => :'Status', + :'tracking_category_id' => :'TrackingCategoryID' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'tracking_option_id' => :'String', + :'name' => :'String', + :'status' => :'String', + :'tracking_category_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingOption` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingOption`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'tracking_option_id') + self.tracking_option_id = attributes[:'tracking_option_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'tracking_category_id') + self.tracking_category_id = attributes[:'tracking_category_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if !@name.nil? && @name.to_s.length > 50 + invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 50.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if !@name.nil? && @name.to_s.length > 50 + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method with validation + # @param [Object] name Value to be assigned + def name=(name) + if !name.nil? && name.to_s.length > 50 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 50.' + end + + @name = name + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "ARCHIVED", "DELETED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + tracking_option_id == o.tracking_option_id && + name == o.name && + status == o.status && + tracking_category_id == o.tracking_category_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [tracking_option_id, name, status, tracking_category_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/tracking_options.rb b/lib/xero-ruby/models/accounting/tracking_options.rb new file mode 100644 index 00000000..8e7e0283 --- /dev/null +++ b/lib/xero-ruby/models/accounting/tracking_options.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class TrackingOptions + attr_accessor :options + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'options' => :'Options' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'options' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::TrackingOptions` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::TrackingOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'options') + if (value = attributes[:'options']).is_a?(Array) + self.options = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + options == o.options + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [options].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/user.rb b/lib/xero-ruby/models/accounting/user.rb new file mode 100644 index 00000000..0518516c --- /dev/null +++ b/lib/xero-ruby/models/accounting/user.rb @@ -0,0 +1,298 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class User + # Xero identifier + attr_accessor :user_id + + # Email address of user + attr_accessor :email_address + + # First name of user + attr_accessor :first_name + + # Last name of user + attr_accessor :last_name + + # Timestamp of last change to user + attr_accessor :updated_date_utc + + # Boolean to indicate if user is the subscriber + attr_accessor :is_subscriber + + # User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) + attr_accessor :organisation_role + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'UserID', + :'email_address' => :'EmailAddress', + :'first_name' => :'FirstName', + :'last_name' => :'LastName', + :'updated_date_utc' => :'UpdatedDateUTC', + :'is_subscriber' => :'IsSubscriber', + :'organisation_role' => :'OrganisationRole' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'email_address' => :'String', + :'first_name' => :'String', + :'last_name' => :'String', + :'updated_date_utc' => :'DateTime', + :'is_subscriber' => :'Boolean', + :'organisation_role' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::User` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'email_address') + self.email_address = attributes[:'email_address'] + end + + if attributes.key?(:'first_name') + self.first_name = attributes[:'first_name'] + end + + if attributes.key?(:'last_name') + self.last_name = attributes[:'last_name'] + end + + if attributes.key?(:'updated_date_utc') + self.updated_date_utc = attributes[:'updated_date_utc'] + end + + if attributes.key?(:'is_subscriber') + self.is_subscriber = attributes[:'is_subscriber'] + end + + if attributes.key?(:'organisation_role') + self.organisation_role = attributes[:'organisation_role'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + organisation_role_validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN"]) + return false unless organisation_role_validator.valid?(@organisation_role) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] organisation_role Object to be assigned + def organisation_role=(organisation_role) + validator = EnumAttributeValidator.new('String', ["READONLY", "INVOICEONLY", "STANDARD", "FINANCIALADVISER", "MANAGEDCLIENT", "CASHBOOKCLIENT", "UNKNOWN"]) + unless validator.valid?(organisation_role) + fail ArgumentError, "invalid value for \"organisation_role\", must be one of #{validator.allowable_values}." + end + @organisation_role = organisation_role + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + email_address == o.email_address && + first_name == o.first_name && + last_name == o.last_name && + updated_date_utc == o.updated_date_utc && + is_subscriber == o.is_subscriber && + organisation_role == o.organisation_role + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, email_address, first_name, last_name, updated_date_utc, is_subscriber, organisation_role].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/users.rb b/lib/xero-ruby/models/accounting/users.rb new file mode 100644 index 00000000..30096699 --- /dev/null +++ b/lib/xero-ruby/models/accounting/users.rb @@ -0,0 +1,205 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class Users + attr_accessor :users + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'users' => :'Users' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'users' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::Users` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::Users`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'users') + if (value = attributes[:'users']).is_a?(Array) + self.users = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + users == o.users + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [users].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/accounting/validation_error.rb b/lib/xero-ruby/models/accounting/validation_error.rb new file mode 100644 index 00000000..cba323e3 --- /dev/null +++ b/lib/xero-ruby/models/accounting/validation_error.rb @@ -0,0 +1,204 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Accounting + class ValidationError + # Validation error message + attr_accessor :message + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'Message' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::ValidationError` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::ValidationError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Accounting.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/asset.rb b/lib/xero-ruby/models/assets/asset.rb new file mode 100644 index 00000000..df93bbed --- /dev/null +++ b/lib/xero-ruby/models/assets/asset.rb @@ -0,0 +1,346 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class Asset + # The Xero-generated Id for the asset + attr_accessor :asset_id + + # The name of the asset + attr_accessor :asset_name + + # The Xero-generated Id for the asset type + attr_accessor :asset_type_id + + # Must be unique. + attr_accessor :asset_number + + # The date the asset was purchased YYYY-MM-DD + attr_accessor :purchase_date + + # The purchase price of the asset + attr_accessor :purchase_price + + # The price the asset was disposed at + attr_accessor :disposal_price + + attr_accessor :asset_status + + # The date the asset’s warranty expires (if needed) YYYY-MM-DD + attr_accessor :warranty_expiry_date + + # The asset's serial number + attr_accessor :serial_number + + attr_accessor :book_depreciation_setting + + attr_accessor :book_depreciation_detail + + # Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. + attr_accessor :can_rollback + + # The accounting value of the asset + attr_accessor :accounting_book_value + + # Boolean to indicate whether delete is enabled + attr_accessor :is_delete_enabled_for_date + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'asset_id' => :'assetId', + :'asset_name' => :'assetName', + :'asset_type_id' => :'assetTypeId', + :'asset_number' => :'assetNumber', + :'purchase_date' => :'purchaseDate', + :'purchase_price' => :'purchasePrice', + :'disposal_price' => :'disposalPrice', + :'asset_status' => :'assetStatus', + :'warranty_expiry_date' => :'warrantyExpiryDate', + :'serial_number' => :'serialNumber', + :'book_depreciation_setting' => :'bookDepreciationSetting', + :'book_depreciation_detail' => :'bookDepreciationDetail', + :'can_rollback' => :'canRollback', + :'accounting_book_value' => :'accountingBookValue', + :'is_delete_enabled_for_date' => :'isDeleteEnabledForDate' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'asset_id' => :'String', + :'asset_name' => :'String', + :'asset_type_id' => :'String', + :'asset_number' => :'String', + :'purchase_date' => :'Date', + :'purchase_price' => :'Float', + :'disposal_price' => :'Float', + :'asset_status' => :'AssetStatus', + :'warranty_expiry_date' => :'String', + :'serial_number' => :'String', + :'book_depreciation_setting' => :'BookDepreciationSetting', + :'book_depreciation_detail' => :'BookDepreciationDetail', + :'can_rollback' => :'Boolean', + :'accounting_book_value' => :'Float', + :'is_delete_enabled_for_date' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Asset` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Asset`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'asset_id') + self.asset_id = attributes[:'asset_id'] + end + + if attributes.key?(:'asset_name') + self.asset_name = attributes[:'asset_name'] + end + + if attributes.key?(:'asset_type_id') + self.asset_type_id = attributes[:'asset_type_id'] + end + + if attributes.key?(:'asset_number') + self.asset_number = attributes[:'asset_number'] + end + + if attributes.key?(:'purchase_date') + self.purchase_date = attributes[:'purchase_date'] + end + + if attributes.key?(:'purchase_price') + self.purchase_price = attributes[:'purchase_price'] + end + + if attributes.key?(:'disposal_price') + self.disposal_price = attributes[:'disposal_price'] + end + + if attributes.key?(:'asset_status') + self.asset_status = attributes[:'asset_status'] + end + + if attributes.key?(:'warranty_expiry_date') + self.warranty_expiry_date = attributes[:'warranty_expiry_date'] + end + + if attributes.key?(:'serial_number') + self.serial_number = attributes[:'serial_number'] + end + + if attributes.key?(:'book_depreciation_setting') + self.book_depreciation_setting = attributes[:'book_depreciation_setting'] + end + + if attributes.key?(:'book_depreciation_detail') + self.book_depreciation_detail = attributes[:'book_depreciation_detail'] + end + + if attributes.key?(:'can_rollback') + self.can_rollback = attributes[:'can_rollback'] + end + + if attributes.key?(:'accounting_book_value') + self.accounting_book_value = attributes[:'accounting_book_value'] + end + + if attributes.key?(:'is_delete_enabled_for_date') + self.is_delete_enabled_for_date = attributes[:'is_delete_enabled_for_date'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @asset_name.nil? + invalid_properties.push('invalid value for "asset_name", asset_name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @asset_name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + asset_id == o.asset_id && + asset_name == o.asset_name && + asset_type_id == o.asset_type_id && + asset_number == o.asset_number && + purchase_date == o.purchase_date && + purchase_price == o.purchase_price && + disposal_price == o.disposal_price && + asset_status == o.asset_status && + warranty_expiry_date == o.warranty_expiry_date && + serial_number == o.serial_number && + book_depreciation_setting == o.book_depreciation_setting && + book_depreciation_detail == o.book_depreciation_detail && + can_rollback == o.can_rollback && + accounting_book_value == o.accounting_book_value && + is_delete_enabled_for_date == o.is_delete_enabled_for_date + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [asset_id, asset_name, asset_type_id, asset_number, purchase_date, purchase_price, disposal_price, asset_status, warranty_expiry_date, serial_number, book_depreciation_setting, book_depreciation_detail, can_rollback, accounting_book_value, is_delete_enabled_for_date].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/asset_status.rb b/lib/xero-ruby/models/assets/asset_status.rb new file mode 100644 index 00000000..705a2624 --- /dev/null +++ b/lib/xero-ruby/models/assets/asset_status.rb @@ -0,0 +1,38 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class AssetStatus + DRAFT = "Draft".freeze + REGISTERED = "Registered".freeze + DISPOSED = "Disposed".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AssetStatus.constants.select { |c| AssetStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AssetStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/assets/asset_status_query_param.rb b/lib/xero-ruby/models/assets/asset_status_query_param.rb new file mode 100644 index 00000000..307dcd14 --- /dev/null +++ b/lib/xero-ruby/models/assets/asset_status_query_param.rb @@ -0,0 +1,38 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class AssetStatusQueryParam + DRAFT = "DRAFT".freeze + REGISTERED = "REGISTERED".freeze + DISPOSED = "DISPOSED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = AssetStatusQueryParam.constants.select { |c| AssetStatusQueryParam::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #AssetStatusQueryParam" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/assets/asset_type.rb b/lib/xero-ruby/models/assets/asset_type.rb new file mode 100644 index 00000000..de589eb5 --- /dev/null +++ b/lib/xero-ruby/models/assets/asset_type.rb @@ -0,0 +1,278 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class AssetType + # Xero generated unique identifier for asset types + attr_accessor :asset_type_id + + # The name of the asset type + attr_accessor :asset_type_name + + # The asset account for fixed assets of this type + attr_accessor :fixed_asset_account_id + + # The expense account for the depreciation of fixed assets of this type + attr_accessor :depreciation_expense_account_id + + # The account for accumulated depreciation of fixed assets of this type + attr_accessor :accumulated_depreciation_account_id + + attr_accessor :book_depreciation_setting + + # All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. + attr_accessor :locks + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'asset_type_id' => :'assetTypeId', + :'asset_type_name' => :'assetTypeName', + :'fixed_asset_account_id' => :'fixedAssetAccountId', + :'depreciation_expense_account_id' => :'depreciationExpenseAccountId', + :'accumulated_depreciation_account_id' => :'accumulatedDepreciationAccountId', + :'book_depreciation_setting' => :'bookDepreciationSetting', + :'locks' => :'locks' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'asset_type_id' => :'String', + :'asset_type_name' => :'String', + :'fixed_asset_account_id' => :'String', + :'depreciation_expense_account_id' => :'String', + :'accumulated_depreciation_account_id' => :'String', + :'book_depreciation_setting' => :'BookDepreciationSetting', + :'locks' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::AssetType` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::AssetType`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'asset_type_id') + self.asset_type_id = attributes[:'asset_type_id'] + end + + if attributes.key?(:'asset_type_name') + self.asset_type_name = attributes[:'asset_type_name'] + end + + if attributes.key?(:'fixed_asset_account_id') + self.fixed_asset_account_id = attributes[:'fixed_asset_account_id'] + end + + if attributes.key?(:'depreciation_expense_account_id') + self.depreciation_expense_account_id = attributes[:'depreciation_expense_account_id'] + end + + if attributes.key?(:'accumulated_depreciation_account_id') + self.accumulated_depreciation_account_id = attributes[:'accumulated_depreciation_account_id'] + end + + if attributes.key?(:'book_depreciation_setting') + self.book_depreciation_setting = attributes[:'book_depreciation_setting'] + end + + if attributes.key?(:'locks') + self.locks = attributes[:'locks'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @asset_type_id.nil? + invalid_properties.push('invalid value for "asset_type_id", asset_type_id cannot be nil.') + end + + if @asset_type_name.nil? + invalid_properties.push('invalid value for "asset_type_name", asset_type_name cannot be nil.') + end + + if @book_depreciation_setting.nil? + invalid_properties.push('invalid value for "book_depreciation_setting", book_depreciation_setting cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @asset_type_id.nil? + return false if @asset_type_name.nil? + return false if @book_depreciation_setting.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + asset_type_id == o.asset_type_id && + asset_type_name == o.asset_type_name && + fixed_asset_account_id == o.fixed_asset_account_id && + depreciation_expense_account_id == o.depreciation_expense_account_id && + accumulated_depreciation_account_id == o.accumulated_depreciation_account_id && + book_depreciation_setting == o.book_depreciation_setting && + locks == o.locks + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [asset_type_id, asset_type_name, fixed_asset_account_id, depreciation_expense_account_id, accumulated_depreciation_account_id, book_depreciation_setting, locks].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/assets.rb b/lib/xero-ruby/models/assets/assets.rb new file mode 100644 index 00000000..6b57495a --- /dev/null +++ b/lib/xero-ruby/models/assets/assets.rb @@ -0,0 +1,214 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class Assets + attr_accessor :pagination + + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'items' => :'items' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'items' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Assets` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Assets`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/book_depreciation_detail.rb b/lib/xero-ruby/models/assets/book_depreciation_detail.rb new file mode 100644 index 00000000..264177f5 --- /dev/null +++ b/lib/xero-ruby/models/assets/book_depreciation_detail.rb @@ -0,0 +1,264 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class BookDepreciationDetail + # When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. + attr_accessor :current_capital_gain + + # When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. + attr_accessor :current_gain_loss + + # YYYY-MM-DD + attr_accessor :depreciation_start_date + + # The value of the asset you want to depreciate, if this is less than the cost of the asset. + attr_accessor :cost_limit + + # The value of the asset remaining when you've fully depreciated it. + attr_accessor :residual_value + + # All depreciation prior to the current financial year. + attr_accessor :prior_accum_depreciation_amount + + # All depreciation occurring in the current financial year. + attr_accessor :current_accum_depreciation_amount + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'current_capital_gain' => :'currentCapitalGain', + :'current_gain_loss' => :'currentGainLoss', + :'depreciation_start_date' => :'depreciationStartDate', + :'cost_limit' => :'costLimit', + :'residual_value' => :'residualValue', + :'prior_accum_depreciation_amount' => :'priorAccumDepreciationAmount', + :'current_accum_depreciation_amount' => :'currentAccumDepreciationAmount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'current_capital_gain' => :'Float', + :'current_gain_loss' => :'Float', + :'depreciation_start_date' => :'Date', + :'cost_limit' => :'Float', + :'residual_value' => :'Float', + :'prior_accum_depreciation_amount' => :'Float', + :'current_accum_depreciation_amount' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::BookDepreciationDetail` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::BookDepreciationDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'current_capital_gain') + self.current_capital_gain = attributes[:'current_capital_gain'] + end + + if attributes.key?(:'current_gain_loss') + self.current_gain_loss = attributes[:'current_gain_loss'] + end + + if attributes.key?(:'depreciation_start_date') + self.depreciation_start_date = attributes[:'depreciation_start_date'] + end + + if attributes.key?(:'cost_limit') + self.cost_limit = attributes[:'cost_limit'] + end + + if attributes.key?(:'residual_value') + self.residual_value = attributes[:'residual_value'] + end + + if attributes.key?(:'prior_accum_depreciation_amount') + self.prior_accum_depreciation_amount = attributes[:'prior_accum_depreciation_amount'] + end + + if attributes.key?(:'current_accum_depreciation_amount') + self.current_accum_depreciation_amount = attributes[:'current_accum_depreciation_amount'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + current_capital_gain == o.current_capital_gain && + current_gain_loss == o.current_gain_loss && + depreciation_start_date == o.depreciation_start_date && + cost_limit == o.cost_limit && + residual_value == o.residual_value && + prior_accum_depreciation_amount == o.prior_accum_depreciation_amount && + current_accum_depreciation_amount == o.current_accum_depreciation_amount + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [current_capital_gain, current_gain_loss, depreciation_start_date, cost_limit, residual_value, prior_accum_depreciation_amount, current_accum_depreciation_amount].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/book_depreciation_setting.rb b/lib/xero-ruby/models/assets/book_depreciation_setting.rb new file mode 100644 index 00000000..5e2e1473 --- /dev/null +++ b/lib/xero-ruby/models/assets/book_depreciation_setting.rb @@ -0,0 +1,332 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class BookDepreciationSetting + # The method of depreciation applied to this asset. See Depreciation Methods + attr_accessor :depreciation_method + + # The method of averaging applied to this asset. See Averaging Methods + attr_accessor :averaging_method + + # The rate of depreciation (e.g. 0.05) + attr_accessor :depreciation_rate + + # Effective life of the asset in years (e.g. 5) + attr_accessor :effective_life_years + + # See Depreciation Calculation Methods + attr_accessor :depreciation_calculation_method + + # Unique Xero identifier for the depreciable object + attr_accessor :depreciable_object_id + + # The type of asset object + attr_accessor :depreciable_object_type + + # Unique Xero identifier for the effective date change + attr_accessor :book_effective_date_of_change_id + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'depreciation_method' => :'depreciationMethod', + :'averaging_method' => :'averagingMethod', + :'depreciation_rate' => :'depreciationRate', + :'effective_life_years' => :'effectiveLifeYears', + :'depreciation_calculation_method' => :'depreciationCalculationMethod', + :'depreciable_object_id' => :'depreciableObjectId', + :'depreciable_object_type' => :'depreciableObjectType', + :'book_effective_date_of_change_id' => :'bookEffectiveDateOfChangeId' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'depreciation_method' => :'String', + :'averaging_method' => :'String', + :'depreciation_rate' => :'Float', + :'effective_life_years' => :'Integer', + :'depreciation_calculation_method' => :'String', + :'depreciable_object_id' => :'String', + :'depreciable_object_type' => :'String', + :'book_effective_date_of_change_id' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::BookDepreciationSetting` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::BookDepreciationSetting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'depreciation_method') + self.depreciation_method = attributes[:'depreciation_method'] + end + + if attributes.key?(:'averaging_method') + self.averaging_method = attributes[:'averaging_method'] + end + + if attributes.key?(:'depreciation_rate') + self.depreciation_rate = attributes[:'depreciation_rate'] + end + + if attributes.key?(:'effective_life_years') + self.effective_life_years = attributes[:'effective_life_years'] + end + + if attributes.key?(:'depreciation_calculation_method') + self.depreciation_calculation_method = attributes[:'depreciation_calculation_method'] + end + + if attributes.key?(:'depreciable_object_id') + self.depreciable_object_id = attributes[:'depreciable_object_id'] + end + + if attributes.key?(:'depreciable_object_type') + self.depreciable_object_type = attributes[:'depreciable_object_type'] + end + + if attributes.key?(:'book_effective_date_of_change_id') + self.book_effective_date_of_change_id = attributes[:'book_effective_date_of_change_id'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + depreciation_method_validator = EnumAttributeValidator.new('String', ["NoDepreciation", "StraightLine", "DiminishingValue100", "DiminishingValue150", "DiminishingValue200", "FullDepreciation"]) + return false unless depreciation_method_validator.valid?(@depreciation_method) + averaging_method_validator = EnumAttributeValidator.new('String', ["FullMonth", "ActualDays"]) + return false unless averaging_method_validator.valid?(@averaging_method) + depreciation_calculation_method_validator = EnumAttributeValidator.new('String', ["Rate", "Life", "None"]) + return false unless depreciation_calculation_method_validator.valid?(@depreciation_calculation_method) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] depreciation_method Object to be assigned + def depreciation_method=(depreciation_method) + validator = EnumAttributeValidator.new('String', ["NoDepreciation", "StraightLine", "DiminishingValue100", "DiminishingValue150", "DiminishingValue200", "FullDepreciation"]) + unless validator.valid?(depreciation_method) + fail ArgumentError, "invalid value for \"depreciation_method\", must be one of #{validator.allowable_values}." + end + @depreciation_method = depreciation_method + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] averaging_method Object to be assigned + def averaging_method=(averaging_method) + validator = EnumAttributeValidator.new('String', ["FullMonth", "ActualDays"]) + unless validator.valid?(averaging_method) + fail ArgumentError, "invalid value for \"averaging_method\", must be one of #{validator.allowable_values}." + end + @averaging_method = averaging_method + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] depreciation_calculation_method Object to be assigned + def depreciation_calculation_method=(depreciation_calculation_method) + validator = EnumAttributeValidator.new('String', ["Rate", "Life", "None"]) + unless validator.valid?(depreciation_calculation_method) + fail ArgumentError, "invalid value for \"depreciation_calculation_method\", must be one of #{validator.allowable_values}." + end + @depreciation_calculation_method = depreciation_calculation_method + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + depreciation_method == o.depreciation_method && + averaging_method == o.averaging_method && + depreciation_rate == o.depreciation_rate && + effective_life_years == o.effective_life_years && + depreciation_calculation_method == o.depreciation_calculation_method && + depreciable_object_id == o.depreciable_object_id && + depreciable_object_type == o.depreciable_object_type && + book_effective_date_of_change_id == o.book_effective_date_of_change_id + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [depreciation_method, averaging_method, depreciation_rate, effective_life_years, depreciation_calculation_method, depreciable_object_id, depreciable_object_type, book_effective_date_of_change_id].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/error.rb b/lib/xero-ruby/models/assets/error.rb new file mode 100644 index 00000000..64585c69 --- /dev/null +++ b/lib/xero-ruby/models/assets/error.rb @@ -0,0 +1,248 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class Error + # Array of elements of resource validation errors + attr_accessor :resource_validation_errors + + # Array of elements of field validation errors + attr_accessor :field_validation_errors + + # The internal type of error, not accessible externally + attr_accessor :type + + # Title of the error + attr_accessor :title + + # Detail of the error + attr_accessor :detail + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'resource_validation_errors' => :'resourceValidationErrors', + :'field_validation_errors' => :'fieldValidationErrors', + :'type' => :'type', + :'title' => :'title', + :'detail' => :'detail' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'resource_validation_errors' => :'Array', + :'field_validation_errors' => :'Array', + :'type' => :'String', + :'title' => :'String', + :'detail' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Error` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'resource_validation_errors') + if (value = attributes[:'resource_validation_errors']).is_a?(Array) + self.resource_validation_errors = value + end + end + + if attributes.key?(:'field_validation_errors') + if (value = attributes[:'field_validation_errors']).is_a?(Array) + self.field_validation_errors = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + resource_validation_errors == o.resource_validation_errors && + field_validation_errors == o.field_validation_errors && + type == o.type && + title == o.title && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [resource_validation_errors, field_validation_errors, type, title, detail].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/field_validation_errors_element.rb b/lib/xero-ruby/models/assets/field_validation_errors_element.rb new file mode 100644 index 00000000..bb0562ec --- /dev/null +++ b/lib/xero-ruby/models/assets/field_validation_errors_element.rb @@ -0,0 +1,254 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class FieldValidationErrorsElement + # The field name of the erroneous field + attr_accessor :field_name + + # The provided value + attr_accessor :value_provided + + # Explaination of the field validation error + attr_accessor :localised_message + + # Internal type of the field validation error message + attr_accessor :type + + # Title of the field validation error + attr_accessor :title + + # Detail of the field validation error + attr_accessor :detail + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'field_name' => :'fieldName', + :'value_provided' => :'valueProvided', + :'localised_message' => :'localisedMessage', + :'type' => :'type', + :'title' => :'title', + :'detail' => :'detail' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'field_name' => :'String', + :'value_provided' => :'String', + :'localised_message' => :'String', + :'type' => :'String', + :'title' => :'String', + :'detail' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::FieldValidationErrorsElement` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::FieldValidationErrorsElement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'field_name') + self.field_name = attributes[:'field_name'] + end + + if attributes.key?(:'value_provided') + self.value_provided = attributes[:'value_provided'] + end + + if attributes.key?(:'localised_message') + self.localised_message = attributes[:'localised_message'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + field_name == o.field_name && + value_provided == o.value_provided && + localised_message == o.localised_message && + type == o.type && + title == o.title && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [field_name, value_provided, localised_message, type, title, detail].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/pagination.rb b/lib/xero-ruby/models/assets/pagination.rb new file mode 100644 index 00000000..0b1df56c --- /dev/null +++ b/lib/xero-ruby/models/assets/pagination.rb @@ -0,0 +1,230 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class Pagination + attr_accessor :page + + attr_accessor :page_size + + attr_accessor :page_count + + attr_accessor :item_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'page' => :'page', + :'page_size' => :'pageSize', + :'page_count' => :'pageCount', + :'item_count' => :'itemCount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'page' => :'Integer', + :'page_size' => :'Integer', + :'page_count' => :'Integer', + :'item_count' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Pagination` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'page_count') + self.page_count = attributes[:'page_count'] + end + + if attributes.key?(:'item_count') + self.item_count = attributes[:'item_count'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + page_size == o.page_size && + page_count == o.page_count && + item_count == o.item_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [page, page_size, page_count, item_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb new file mode 100644 index 00000000..6acd292f --- /dev/null +++ b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb @@ -0,0 +1,244 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class ResourceValidationErrorsElement + # The field name of the erroneous field + attr_accessor :resource_name + + # Explaination of the resource validation error + attr_accessor :localised_message + + # Internal type of the resource error message + attr_accessor :type + + # Title of the resource validation error + attr_accessor :title + + # Detail of the resource validation error + attr_accessor :detail + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'resource_name' => :'resourceName', + :'localised_message' => :'localisedMessage', + :'type' => :'type', + :'title' => :'title', + :'detail' => :'detail' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'resource_name' => :'String', + :'localised_message' => :'String', + :'type' => :'String', + :'title' => :'String', + :'detail' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::ResourceValidationErrorsElement` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::ResourceValidationErrorsElement`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'resource_name') + self.resource_name = attributes[:'resource_name'] + end + + if attributes.key?(:'localised_message') + self.localised_message = attributes[:'localised_message'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'detail') + self.detail = attributes[:'detail'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + resource_name == o.resource_name && + localised_message == o.localised_message && + type == o.type && + title == o.title && + detail == o.detail + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [resource_name, localised_message, type, title, detail].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/assets/setting.rb b/lib/xero-ruby/models/assets/setting.rb new file mode 100644 index 00000000..52e55ff6 --- /dev/null +++ b/lib/xero-ruby/models/assets/setting.rb @@ -0,0 +1,274 @@ +=begin +#Xero Assets API + +#This is the Xero Assets API + +The version of the OpenAPI document: 2.2.1 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Assets + class Setting + # The prefix used for fixed asset numbers (“FA-” by default) + attr_accessor :asset_number_prefix + + # The next available sequence number + attr_accessor :asset_number_sequence + + # The date depreciation calculations started on registered fixed assets in Xero + attr_accessor :asset_start_date + + # The last depreciation date + attr_accessor :last_depreciation_date + + # Default account that gains are posted to + attr_accessor :default_gain_on_disposal_account_id + + # Default account that losses are posted to + attr_accessor :default_loss_on_disposal_account_id + + # Default account that capital gains are posted to + attr_accessor :default_capital_gain_on_disposal_account_id + + # opt in for tax calculation + attr_accessor :opt_in_for_tax + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'asset_number_prefix' => :'assetNumberPrefix', + :'asset_number_sequence' => :'assetNumberSequence', + :'asset_start_date' => :'assetStartDate', + :'last_depreciation_date' => :'lastDepreciationDate', + :'default_gain_on_disposal_account_id' => :'defaultGainOnDisposalAccountId', + :'default_loss_on_disposal_account_id' => :'defaultLossOnDisposalAccountId', + :'default_capital_gain_on_disposal_account_id' => :'defaultCapitalGainOnDisposalAccountId', + :'opt_in_for_tax' => :'optInForTax' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'asset_number_prefix' => :'String', + :'asset_number_sequence' => :'String', + :'asset_start_date' => :'Date', + :'last_depreciation_date' => :'Date', + :'default_gain_on_disposal_account_id' => :'String', + :'default_loss_on_disposal_account_id' => :'String', + :'default_capital_gain_on_disposal_account_id' => :'String', + :'opt_in_for_tax' => :'Boolean' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Assets::Setting` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Assets::Setting`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'asset_number_prefix') + self.asset_number_prefix = attributes[:'asset_number_prefix'] + end + + if attributes.key?(:'asset_number_sequence') + self.asset_number_sequence = attributes[:'asset_number_sequence'] + end + + if attributes.key?(:'asset_start_date') + self.asset_start_date = attributes[:'asset_start_date'] + end + + if attributes.key?(:'last_depreciation_date') + self.last_depreciation_date = attributes[:'last_depreciation_date'] + end + + if attributes.key?(:'default_gain_on_disposal_account_id') + self.default_gain_on_disposal_account_id = attributes[:'default_gain_on_disposal_account_id'] + end + + if attributes.key?(:'default_loss_on_disposal_account_id') + self.default_loss_on_disposal_account_id = attributes[:'default_loss_on_disposal_account_id'] + end + + if attributes.key?(:'default_capital_gain_on_disposal_account_id') + self.default_capital_gain_on_disposal_account_id = attributes[:'default_capital_gain_on_disposal_account_id'] + end + + if attributes.key?(:'opt_in_for_tax') + self.opt_in_for_tax = attributes[:'opt_in_for_tax'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + asset_number_prefix == o.asset_number_prefix && + asset_number_sequence == o.asset_number_sequence && + asset_start_date == o.asset_start_date && + last_depreciation_date == o.last_depreciation_date && + default_gain_on_disposal_account_id == o.default_gain_on_disposal_account_id && + default_loss_on_disposal_account_id == o.default_loss_on_disposal_account_id && + default_capital_gain_on_disposal_account_id == o.default_capital_gain_on_disposal_account_id && + opt_in_for_tax == o.opt_in_for_tax + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [asset_number_prefix, asset_number_sequence, asset_start_date, last_depreciation_date, default_gain_on_disposal_account_id, default_loss_on_disposal_account_id, default_capital_gain_on_disposal_account_id, opt_in_for_tax].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Assets.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb new file mode 100644 index 00000000..61c1763c --- /dev/null +++ b/lib/xero-ruby/version.rb @@ -0,0 +1,15 @@ +=begin +#Accounting API + +#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +module XeroRuby + VERSION = '0.4.1' +end diff --git a/xero-ruby.gemspec b/xero-ruby.gemspec index f905e45c..42ed4381 100644 --- a/xero-ruby.gemspec +++ b/xero-ruby.gemspec @@ -5,10 +5,10 @@ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) -The version of the OpenAPI document: 2.1.3 +The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end From 3ad0cec157b76f4a47dffd7e8321e1b7a5db2ceb Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 16:22:27 -0600 Subject: [PATCH 10/21] slight restructure, and generating from docker, specs are green --- lib/xero-ruby.rb | 13 ------------- lib/xero-ruby/api/accounting_api.rb | 2 +- lib/xero-ruby/api/asset_api.rb | 2 +- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb index 1d9e557b..c681bfce 100644 --- a/lib/xero-ruby.rb +++ b/lib/xero-ruby.rb @@ -29,18 +29,6 @@ require 'xero-ruby/models/assets/pagination' require 'xero-ruby/models/assets/resource_validation_errors_element' require 'xero-ruby/models/assets/setting' -require 'xero-ruby/models/assets/asset' -require 'xero-ruby/models/assets/asset_status' -require 'xero-ruby/models/assets/asset_status_query_param' -require 'xero-ruby/models/assets/asset_type' -require 'xero-ruby/models/assets/assets' -require 'xero-ruby/models/assets/book_depreciation_detail' -require 'xero-ruby/models/assets/book_depreciation_setting' -require 'xero-ruby/models/assets/error' -require 'xero-ruby/models/assets/field_validation_errors_element' -require 'xero-ruby/models/assets/pagination' -require 'xero-ruby/models/assets/resource_validation_errors_element' -require 'xero-ruby/models/assets/setting' require 'xero-ruby/models/accounting/account' require 'xero-ruby/models/accounting/account_type' require 'xero-ruby/models/accounting/accounts' @@ -158,7 +146,6 @@ # APIs require 'xero-ruby/api/asset_api' -require 'xero-ruby/api/asset_api' require 'xero-ruby/api/accounting_api' module XeroRuby diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 057a9f7e..1f30158b 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -16,7 +16,7 @@ module XeroRuby class AccountingApi attr_accessor :api_client - def initialize(api_client = ApiClient.default) + def initialize(api_client = ApiClient.new) @api_client = api_client end # Allows you to create a new chart of accounts diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index e445fb3b..6150fda7 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -16,7 +16,7 @@ module XeroRuby class AssetApi attr_accessor :api_client - def initialize(api_client = ApiClient.default) + def initialize(api_client = ApiClient.new) @api_client = api_client end # adds a fixed asset From 0c07c156e87740cd7193882b87aa4b209d18a71b Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 17 Jun 2020 17:40:48 -0600 Subject: [PATCH 11/21] adding projects API --- docs/projects/Amount.md | 19 + docs/projects/ChargeType.md | 16 + docs/projects/CurrencyCode.md | 16 + docs/projects/Error.md | 19 + docs/projects/Pagination.md | 23 + docs/projects/Project.md | 59 + docs/projects/ProjectApi.md | 920 +++++++++++++++ docs/projects/ProjectCreateOrUpdate.md | 23 + docs/projects/ProjectPatch.md | 17 + docs/projects/ProjectStatus.md | 16 + docs/projects/ProjectUser.md | 21 + docs/projects/ProjectUsers.md | 19 + docs/projects/Projects.md | 19 + docs/projects/Task.md | 45 + docs/projects/TaskCreateOrUpdate.md | 23 + docs/projects/Tasks.md | 19 + docs/projects/TimeEntries.md | 19 + docs/projects/TimeEntry.md | 33 + docs/projects/TimeEntryCreateOrUpdate.md | 25 + lib/xero-ruby.rb | 19 + lib/xero-ruby/api/project_api.rb | 1035 +++++++++++++++++ lib/xero-ruby/models/projects/amount.rb | 212 ++++ lib/xero-ruby/models/projects/charge_type.rb | 38 + .../models/projects/currency_code.rb | 199 ++++ lib/xero-ruby/models/projects/error.rb | 214 ++++ lib/xero-ruby/models/projects/pagination.rb | 234 ++++ lib/xero-ruby/models/projects/project.rb | 403 +++++++ .../projects/project_create_or_update.rb | 238 ++++ .../models/projects/project_patch.rb | 208 ++++ .../models/projects/project_status.rb | 37 + lib/xero-ruby/models/projects/project_user.rb | 224 ++++ .../models/projects/project_users.rb | 214 ++++ lib/xero-ruby/models/projects/projects.rb | 214 ++++ lib/xero-ruby/models/projects/task.rb | 373 ++++++ .../models/projects/task_create_or_update.rb | 247 ++++ lib/xero-ruby/models/projects/tasks.rb | 214 ++++ lib/xero-ruby/models/projects/time_entries.rb | 214 ++++ lib/xero-ruby/models/projects/time_entry.rb | 318 +++++ .../projects/time_entry_create_or_update.rb | 264 +++++ lib/xero-ruby/version.rb | 2 +- spec/projects/api/project_api_spec.rb | 229 ++++ spec/projects/models/amount_spec.rb | 47 + spec/projects/models/charge_type_spec.rb | 35 + spec/projects/models/currency_code_spec.rb | 35 + spec/projects/models/error_spec.rb | 47 + spec/projects/models/pagination_spec.rb | 59 + .../models/project_create_or_update_spec.rb | 59 + spec/projects/models/project_patch_spec.rb | 41 + spec/projects/models/project_spec.rb | 167 +++ spec/projects/models/project_status_spec.rb | 35 + spec/projects/models/project_user_spec.rb | 53 + spec/projects/models/project_users_spec.rb | 47 + spec/projects/models/projects_spec.rb | 47 + .../models/task_create_or_update_spec.rb | 59 + spec/projects/models/task_spec.rb | 129 ++ spec/projects/models/tasks_spec.rb | 47 + spec/projects/models/time_entries_spec.rb | 47 + .../time_entry_create_or_update_spec.rb | 65 ++ spec/projects/models/time_entry_spec.rb | 93 ++ 59 files changed, 7812 insertions(+), 1 deletion(-) create mode 100644 docs/projects/Amount.md create mode 100644 docs/projects/ChargeType.md create mode 100644 docs/projects/CurrencyCode.md create mode 100644 docs/projects/Error.md create mode 100644 docs/projects/Pagination.md create mode 100644 docs/projects/Project.md create mode 100644 docs/projects/ProjectApi.md create mode 100644 docs/projects/ProjectCreateOrUpdate.md create mode 100644 docs/projects/ProjectPatch.md create mode 100644 docs/projects/ProjectStatus.md create mode 100644 docs/projects/ProjectUser.md create mode 100644 docs/projects/ProjectUsers.md create mode 100644 docs/projects/Projects.md create mode 100644 docs/projects/Task.md create mode 100644 docs/projects/TaskCreateOrUpdate.md create mode 100644 docs/projects/Tasks.md create mode 100644 docs/projects/TimeEntries.md create mode 100644 docs/projects/TimeEntry.md create mode 100644 docs/projects/TimeEntryCreateOrUpdate.md create mode 100644 lib/xero-ruby/api/project_api.rb create mode 100644 lib/xero-ruby/models/projects/amount.rb create mode 100644 lib/xero-ruby/models/projects/charge_type.rb create mode 100644 lib/xero-ruby/models/projects/currency_code.rb create mode 100644 lib/xero-ruby/models/projects/error.rb create mode 100644 lib/xero-ruby/models/projects/pagination.rb create mode 100644 lib/xero-ruby/models/projects/project.rb create mode 100644 lib/xero-ruby/models/projects/project_create_or_update.rb create mode 100644 lib/xero-ruby/models/projects/project_patch.rb create mode 100644 lib/xero-ruby/models/projects/project_status.rb create mode 100644 lib/xero-ruby/models/projects/project_user.rb create mode 100644 lib/xero-ruby/models/projects/project_users.rb create mode 100644 lib/xero-ruby/models/projects/projects.rb create mode 100644 lib/xero-ruby/models/projects/task.rb create mode 100644 lib/xero-ruby/models/projects/task_create_or_update.rb create mode 100644 lib/xero-ruby/models/projects/tasks.rb create mode 100644 lib/xero-ruby/models/projects/time_entries.rb create mode 100644 lib/xero-ruby/models/projects/time_entry.rb create mode 100644 lib/xero-ruby/models/projects/time_entry_create_or_update.rb create mode 100644 spec/projects/api/project_api_spec.rb create mode 100644 spec/projects/models/amount_spec.rb create mode 100644 spec/projects/models/charge_type_spec.rb create mode 100644 spec/projects/models/currency_code_spec.rb create mode 100644 spec/projects/models/error_spec.rb create mode 100644 spec/projects/models/pagination_spec.rb create mode 100644 spec/projects/models/project_create_or_update_spec.rb create mode 100644 spec/projects/models/project_patch_spec.rb create mode 100644 spec/projects/models/project_spec.rb create mode 100644 spec/projects/models/project_status_spec.rb create mode 100644 spec/projects/models/project_user_spec.rb create mode 100644 spec/projects/models/project_users_spec.rb create mode 100644 spec/projects/models/projects_spec.rb create mode 100644 spec/projects/models/task_create_or_update_spec.rb create mode 100644 spec/projects/models/task_spec.rb create mode 100644 spec/projects/models/tasks_spec.rb create mode 100644 spec/projects/models/time_entries_spec.rb create mode 100644 spec/projects/models/time_entry_create_or_update_spec.rb create mode 100644 spec/projects/models/time_entry_spec.rb diff --git a/docs/projects/Amount.md b/docs/projects/Amount.md new file mode 100644 index 00000000..0481aaae --- /dev/null +++ b/docs/projects/Amount.md @@ -0,0 +1,19 @@ +# XeroRuby::Projects::Amount + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**value** | **Float** | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::Amount.new(currency: null, + value: 1.0) +``` + + diff --git a/docs/projects/ChargeType.md b/docs/projects/ChargeType.md new file mode 100644 index 00000000..2ce51f93 --- /dev/null +++ b/docs/projects/ChargeType.md @@ -0,0 +1,16 @@ +# XeroRuby::Projects::ChargeType + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::ChargeType.new() +``` + + diff --git a/docs/projects/CurrencyCode.md b/docs/projects/CurrencyCode.md new file mode 100644 index 00000000..848ac8a0 --- /dev/null +++ b/docs/projects/CurrencyCode.md @@ -0,0 +1,16 @@ +# XeroRuby::Projects::CurrencyCode + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::CurrencyCode.new() +``` + + diff --git a/docs/projects/Error.md b/docs/projects/Error.md new file mode 100644 index 00000000..2cf3f496 --- /dev/null +++ b/docs/projects/Error.md @@ -0,0 +1,19 @@ +# XeroRuby::Projects::Error + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**message** | **String** | Exception message | [optional] +**model_state** | [**Object**](.md) | Array of Elements of validation Errors | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::Error.new(message: null, + model_state: null) +``` + + diff --git a/docs/projects/Pagination.md b/docs/projects/Pagination.md new file mode 100644 index 00000000..c453ef3b --- /dev/null +++ b/docs/projects/Pagination.md @@ -0,0 +1,23 @@ +# XeroRuby::Projects::Pagination + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**page** | **Integer** | Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. | [optional] +**page_size** | **Integer** | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. | [optional] +**page_count** | **Integer** | Number of pages available | [optional] +**item_count** | **Integer** | Number of items returned | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::Pagination.new(page: 1, + page_size: 10, + page_count: 1, + item_count: 2) +``` + + diff --git a/docs/projects/Project.md b/docs/projects/Project.md new file mode 100644 index 00000000..45fedd2e --- /dev/null +++ b/docs/projects/Project.md @@ -0,0 +1,59 @@ +# XeroRuby::Projects::Project + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**project_id** | **String** | Identifier of the project. | [optional] +**contact_id** | **String** | Identifier of the contact this project was created for. | [optional] +**name** | **String** | Name of the project. | +**currency_code** | [**CurrencyCode**](CurrencyCode.md) | | [optional] +**minutes_logged** | **Integer** | A total of minutes logged against all tasks on the Project. | [optional] +**total_task_amount** | [**Amount**](Amount.md) | | [optional] +**total_expense_amount** | [**Amount**](Amount.md) | | [optional] +**estimate_amount** | [**Amount**](Amount.md) | | [optional] +**minutes_to_be_invoiced** | **Integer** | Minutes which have not been invoiced across all chargeable tasks in the project. | [optional] +**task_amount_to_be_invoiced** | [**Amount**](Amount.md) | | [optional] +**task_amount_invoiced** | [**Amount**](Amount.md) | | [optional] +**expense_amount_to_be_invoiced** | [**Amount**](Amount.md) | | [optional] +**expense_amount_invoiced** | [**Amount**](Amount.md) | | [optional] +**project_amount_invoiced** | [**Amount**](Amount.md) | | [optional] +**deposit** | [**Amount**](Amount.md) | | [optional] +**deposit_applied** | [**Amount**](Amount.md) | | [optional] +**credit_note_amount** | [**Amount**](Amount.md) | | [optional] +**deadline_utc** | **DateTime** | Deadline for the project. UTC Date Time in ISO-8601 format. | [optional] +**total_invoiced** | [**Amount**](Amount.md) | | [optional] +**total_to_be_invoiced** | [**Amount**](Amount.md) | | [optional] +**estimate** | [**Amount**](Amount.md) | | [optional] +**status** | [**ProjectStatus**](ProjectStatus.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::Project.new(project_id: 254553fa-2be8-4991-bd5e-70a97ea12ef8, + contact_id: 01234567-89ab-cdef-0123-456789abcdef, + name: New Kitchen, + currency_code: null, + minutes_logged: 0, + total_task_amount: null, + total_expense_amount: null, + estimate_amount: null, + minutes_to_be_invoiced: 0, + task_amount_to_be_invoiced: null, + task_amount_invoiced: null, + expense_amount_to_be_invoiced: null, + expense_amount_invoiced: null, + project_amount_invoiced: null, + deposit: null, + deposit_applied: null, + credit_note_amount: null, + deadline_utc: 2019-12-10T12:59:59Z, + total_invoiced: null, + total_to_be_invoiced: null, + estimate: null, + status: null) +``` + + diff --git a/docs/projects/ProjectApi.md b/docs/projects/ProjectApi.md new file mode 100644 index 00000000..b7aaf760 --- /dev/null +++ b/docs/projects/ProjectApi.md @@ -0,0 +1,920 @@ +# XeroRuby::Projects::ProjectApi + +All URIs are relative to *https://api.xero.com/projects.xro/2.0* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_project**](ProjectApi.md#create_project) | **POST** /projects | create one or more new projects +[**create_time_entry**](ProjectApi.md#create_time_entry) | **POST** /projects/{projectId}/time | Allows you to create a task +[**delete_time_entry**](ProjectApi.md#delete_time_entry) | **DELETE** /projects/{projectId}/time/{timeEntryId} | Allows you to delete a time entry +[**get_project**](ProjectApi.md#get_project) | **GET** /projects/{projectId} | Allows you to retrieve a single project +[**get_project_users**](ProjectApi.md#get_project_users) | **GET** /projectsusers | list all project users +[**get_projects**](ProjectApi.md#get_projects) | **GET** /projects | list all projects +[**get_task**](ProjectApi.md#get_task) | **GET** /projects/{projectId}/tasks/{taskId} | Allows you to retrieve a single project +[**get_tasks**](ProjectApi.md#get_tasks) | **GET** /projects/{projectId}/tasks | Allows you to retrieve a single project +[**get_time_entries**](ProjectApi.md#get_time_entries) | **GET** /projects/{projectId}/time | Allows you to retrieve the time entries associated with a specific project +[**get_time_entry**](ProjectApi.md#get_time_entry) | **GET** /projects/{projectId}/time/{timeEntryId} | Allows you to get a single time entry in a project +[**patch_project**](ProjectApi.md#patch_project) | **PATCH** /projects/{projectId} | creates a project for the specified contact +[**update_project**](ProjectApi.md#update_project) | **PUT** /projects/{projectId} | update a specific project +[**update_time_entry**](ProjectApi.md#update_time_entry) | **PUT** /projects/{projectId}/time/{timeEntryId} | Allows you to update time entry in a project + + + +## create_project + +> Project create_project(xero_tenant_id, project_create_or_update) + +create one or more new projects + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_create_or_update = { "contactId":"00000000-0000-0000-000-000000000000", "name":"New Kitchen", "deadlineUtc":"2019-12-10T12:59:59Z", "estimateAmount":"99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate object + +begin + #create one or more new projects + result = api_instance.create_project(xero_tenant_id, project_create_or_update) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->create_project: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_create_or_update** | [**ProjectCreateOrUpdate**](ProjectCreateOrUpdate.md)| Create a new project with ProjectCreateOrUpdate object | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## create_time_entry + +> TimeEntry create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update) + +Allows you to create a task + +Allows you to create a specific task + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-26T15:00:00Z", "duration":30, "description":"My description" } # TimeEntryCreateOrUpdate | The time entry object you are creating + +begin + #Allows you to create a task + result = api_instance.create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->create_time_entry: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **time_entry_create_or_update** | [**TimeEntryCreateOrUpdate**](TimeEntryCreateOrUpdate.md)| The time entry object you are creating | + +### Return type + +[**TimeEntry**](TimeEntry.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## delete_time_entry + +> delete_time_entry(xero_tenant_id, project_id, time_entry_id) + +Allows you to delete a time entry + +Allows you to delete a specific time entry + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +time_entry_id = 'time_entry_id_example' # String | You can specify an individual task by appending the id to the endpoint + +begin + #Allows you to delete a time entry + api_instance.delete_time_entry(xero_tenant_id, project_id, time_entry_id) +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->delete_time_entry: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **time_entry_id** | [**String**](.md)| You can specify an individual task by appending the id to the endpoint | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + + +## get_project + +> Project get_project(xero_tenant_id, project_id) + +Allows you to retrieve a single project + +Allows you to retrieve a specific project + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint + +begin + #Allows you to retrieve a single project + result = api_instance.get_project(xero_tenant_id, project_id) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->get_project: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + +### Return type + +[**Project**](Project.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_project_users + +> ProjectUsers get_project_users(xero_tenant_id, opts) + +list all project users + +Allows you to retrieve the users on a projects. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + page: 1, # Integer | set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 50 # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. +} + +begin + #list all project users + result = api_instance.get_project_users(xero_tenant_id, opts) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->get_project_users: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **page** | **Integer**| set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. | [optional] [default to 1] + **page_size** | **Integer**| Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. | [optional] [default to 50] + +### Return type + +[**ProjectUsers**](ProjectUsers.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_projects + +> Projects get_projects(xero_tenant_id, opts) + +list all projects + +Allows you to retrieve, create and update projects. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +opts = { + project_ids: ['project_ids_example'], # Array | Search for all projects that match a comma separated list of projectIds + contact_id: 'contact_id_example', # String | Filter for projects for a specific contact + states: 'states_example', # String | Filter for projects in a particular state (INPROGRESS or CLOSED) + page: 1, # Integer | set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 50 # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. +} + +begin + #list all projects + result = api_instance.get_projects(xero_tenant_id, opts) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->get_projects: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_ids** | [**Array<String>**](String.md)| Search for all projects that match a comma separated list of projectIds | [optional] + **contact_id** | [**String**](.md)| Filter for projects for a specific contact | [optional] + **states** | **String**| Filter for projects in a particular state (INPROGRESS or CLOSED) | [optional] + **page** | **Integer**| set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. | [optional] [default to 1] + **page_size** | **Integer**| Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. | [optional] [default to 50] + +### Return type + +[**Projects**](Projects.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_task + +> Task get_task(xero_tenant_id, project_id, task_id) + +Allows you to retrieve a single project + +Allows you to retrieve a specific project + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +task_id = 'task_id_example' # String | You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId} + +begin + #Allows you to retrieve a single project + result = api_instance.get_task(xero_tenant_id, project_id, task_id) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->get_task: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **task_id** | [**String**](.md)| You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId} | + +### Return type + +[**Task**](Task.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_tasks + +> Tasks get_tasks(xero_tenant_id, project_id, opts) + +Allows you to retrieve a single project + +Allows you to retrieve a specific project + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +opts = { + page: 1, # Integer | Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 10, # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + task_ids: 'task_ids_example' # String | taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId} +} + +begin + #Allows you to retrieve a single project + result = api_instance.get_tasks(xero_tenant_id, project_id, opts) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->get_tasks: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **page** | **Integer**| Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. | [optional] + **page_size** | **Integer**| Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. | [optional] + **task_ids** | **String**| taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId} | [optional] + +### Return type + +[**Tasks**](Tasks.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_time_entries + +> TimeEntries get_time_entries(xero_tenant_id, project_id, opts) + +Allows you to retrieve the time entries associated with a specific project + +Allows you to retrieve the time entries associated with a specific project + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | Identifier of the project, that the task (which the time entry is logged against) belongs to. +opts = { + user_id: 'user_id_example', # String | The xero user identifier of the person who logged time. + task_id: 'task_id_example', # String | Identifier of the task that time entry is logged against. + invoice_id: 'invoice_id_example', # String | Finds all time entries for this invoice. + contact_id: 'contact_id_example', # String | Finds all time entries for this contact identifier. + page: 1, # Integer | Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 10, # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + states: ['states_example'], # Array | Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified. + is_chargeable: true, # Boolean | Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. + date_after_utc: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. + date_before_utc: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. +} + +begin + #Allows you to retrieve the time entries associated with a specific project + result = api_instance.get_time_entries(xero_tenant_id, project_id, opts) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->get_time_entries: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| Identifier of the project, that the task (which the time entry is logged against) belongs to. | + **user_id** | [**String**](.md)| The xero user identifier of the person who logged time. | [optional] + **task_id** | [**String**](.md)| Identifier of the task that time entry is logged against. | [optional] + **invoice_id** | [**String**](.md)| Finds all time entries for this invoice. | [optional] + **contact_id** | [**String**](.md)| Finds all time entries for this contact identifier. | [optional] + **page** | **Integer**| Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. | [optional] + **page_size** | **Integer**| Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. | [optional] + **states** | [**Array<String>**](String.md)| Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified. | [optional] + **is_chargeable** | **Boolean**| Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. | [optional] + **date_after_utc** | **DateTime**| ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. | [optional] + **date_before_utc** | **DateTime**| ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. | [optional] + +### Return type + +[**TimeEntries**](TimeEntries.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## get_time_entry + +> TimeEntry get_time_entry(xero_tenant_id, project_id, time_entry_id) + +Allows you to get a single time entry in a project + +Allows you to upget a single time entry in a project + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpoint + +begin + #Allows you to get a single time entry in a project + result = api_instance.get_time_entry(xero_tenant_id, project_id, time_entry_id) + p result +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->get_time_entry: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **time_entry_id** | [**String**](.md)| You can specify an individual time entry by appending the id to the endpoint | + +### Return type + +[**TimeEntry**](TimeEntry.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + + +## patch_project + +> patch_project(xero_tenant_id, project_id, project_patch) + +creates a project for the specified contact + +Allows you to update a specific projects. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +project_patch = { "status": "INPROGRESS" } # ProjectPatch | Update the status of an existing Project + +begin + #creates a project for the specified contact + api_instance.patch_project(xero_tenant_id, project_id, project_patch) +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->patch_project: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **project_patch** | [**ProjectPatch**](ProjectPatch.md)| Update the status of an existing Project | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_project + +> update_project(xero_tenant_id, project_id, project_create_or_update) + +update a specific project + +Allows you to update a specific projects. + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +project_create_or_update = { "name": "New Kitchen", "deadlineUtc": "2017-04-23T18:25:43.511Z", "estimateAmount": 99.99 } # ProjectCreateOrUpdate | Request of type ProjectCreateOrUpdate + +begin + #update a specific project + api_instance.update_project(xero_tenant_id, project_id, project_create_or_update) +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->update_project: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **project_create_or_update** | [**ProjectCreateOrUpdate**](ProjectCreateOrUpdate.md)| Request of type ProjectCreateOrUpdate | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + + +## update_time_entry + +> update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) + +Allows you to update time entry in a project + +Allows you to update time entry in a project + +### Example + +```ruby +# load the gem +require 'xero-ruby' + +creds = { + client_id: ENV['CLIENT_ID'], + client_secret: ENV['CLIENT_SECRET'], + redirect_uri: ENV['REDIRECT_URI'], + scopes: ENV['SCOPES'] +} +xero_client = XeroRuby::ApiClient.new(credentials: creds) + +token_set = fetch_valid_token_set(user) # example + +xero_client.refresh_token_set(token_set) + +# If using the Accounting API +api_instance = xero_client.accounting_api +# Or for methods in the Assets API +api_instance = xero_client.asset_api + +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpoint +time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-27T15:00:00Z", "duration":45, "description":"My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updating + +begin + #Allows you to update time entry in a project + api_instance.update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) +rescue XeroRuby::Projects::ApiError => e + puts "Exception when calling ProjectApi->update_time_entry: #{e}" +end +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xero_tenant_id** | **String**| Xero identifier for Tenant | + **project_id** | [**String**](.md)| You can specify an individual project by appending the projectId to the endpoint | + **time_entry_id** | [**String**](.md)| You can specify an individual time entry by appending the id to the endpoint | + **time_entry_create_or_update** | [**TimeEntryCreateOrUpdate**](TimeEntryCreateOrUpdate.md)| The time entry object you are updating | + +### Return type + +nil (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: Not defined + diff --git a/docs/projects/ProjectCreateOrUpdate.md b/docs/projects/ProjectCreateOrUpdate.md new file mode 100644 index 00000000..ec06bb1d --- /dev/null +++ b/docs/projects/ProjectCreateOrUpdate.md @@ -0,0 +1,23 @@ +# XeroRuby::Projects::ProjectCreateOrUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contact_id** | **String** | Identifier of the contact this project was created for. | [optional] +**name** | **String** | Name of the project. | +**estimate_amount** | **Float** | | [optional] +**deadline_utc** | **DateTime** | Deadline for the project. UTC Date Time in ISO-8601 format. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::ProjectCreateOrUpdate.new(contact_id: 01234567-89ab-cdef-0123-456789abcdef, + name: New Kitchen, + estimate_amount: 1.0, + deadline_utc: 2019-12-10T12:59:59Z) +``` + + diff --git a/docs/projects/ProjectPatch.md b/docs/projects/ProjectPatch.md new file mode 100644 index 00000000..6db40cea --- /dev/null +++ b/docs/projects/ProjectPatch.md @@ -0,0 +1,17 @@ +# XeroRuby::Projects::ProjectPatch + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | [**ProjectStatus**](ProjectStatus.md) | | + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::ProjectPatch.new(status: null) +``` + + diff --git a/docs/projects/ProjectStatus.md b/docs/projects/ProjectStatus.md new file mode 100644 index 00000000..d500f3fa --- /dev/null +++ b/docs/projects/ProjectStatus.md @@ -0,0 +1,16 @@ +# XeroRuby::Projects::ProjectStatus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::ProjectStatus.new() +``` + + diff --git a/docs/projects/ProjectUser.md b/docs/projects/ProjectUser.md new file mode 100644 index 00000000..4b0ba785 --- /dev/null +++ b/docs/projects/ProjectUser.md @@ -0,0 +1,21 @@ +# XeroRuby::Projects::ProjectUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **String** | Identifier of the user of the project. | [optional] +**name** | **String** | Full name of the user. | [optional] +**email** | **String** | Email address of the user. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::ProjectUser.new(user_id: 254553fa-2be8-4991-bd5e-70a97ea12ef8, + name: Sidney Allen, + email: sidneyallen@xero.com) +``` + + diff --git a/docs/projects/ProjectUsers.md b/docs/projects/ProjectUsers.md new file mode 100644 index 00000000..54375d55 --- /dev/null +++ b/docs/projects/ProjectUsers.md @@ -0,0 +1,19 @@ +# XeroRuby::Projects::ProjectUsers + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**items** | [**Array<ProjectUser>**](ProjectUser.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::ProjectUsers.new(pagination: null, + items: null) +``` + + diff --git a/docs/projects/Projects.md b/docs/projects/Projects.md new file mode 100644 index 00000000..2f79362d --- /dev/null +++ b/docs/projects/Projects.md @@ -0,0 +1,19 @@ +# XeroRuby::Projects::Projects + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**items** | [**Array<Project>**](Project.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::Projects.new(pagination: null, + items: null) +``` + + diff --git a/docs/projects/Task.md b/docs/projects/Task.md new file mode 100644 index 00000000..b2bd1770 --- /dev/null +++ b/docs/projects/Task.md @@ -0,0 +1,45 @@ +# XeroRuby::Projects::Task + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**task_id** | **String** | Identifier of the task. | [optional] +**name** | **String** | Name of the task. | [optional] +**rate** | [**Amount**](Amount.md) | | [optional] +**charge_type** | [**ChargeType**](ChargeType.md) | | [optional] +**estimate_minutes** | **Float** | An estimated time to perform the task | [optional] +**project_id** | **String** | Identifier of the project task belongs to. | [optional] +**total_minutes** | **Float** | Total minutes which have been logged against the task. Logged by assigning a time entry to a task | [optional] +**total_amount** | [**Amount**](Amount.md) | | [optional] +**minutes_invoiced** | **Float** | Minutes on this task which have been invoiced. | [optional] +**minutes_to_be_invoiced** | **Float** | Minutes on this task which have not been invoiced. | [optional] +**fixed_minutes** | **Float** | Minutes logged against this task if its charge type is `FIXED`. | [optional] +**non_chargeable_minutes** | **Float** | Minutes logged against this task if its charge type is `NON_CHARGEABLE`. | [optional] +**amount_to_be_invoiced** | [**Amount**](Amount.md) | | [optional] +**amount_invoiced** | [**Amount**](Amount.md) | | [optional] +**status** | **String** | Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::Task.new(task_id: 00000000-0000-0000-0000-000000000000, + name: null, + rate: null, + charge_type: null, + estimate_minutes: null, + project_id: 00000000-0000-0000-0000-000000000000, + total_minutes: null, + total_amount: null, + minutes_invoiced: null, + minutes_to_be_invoiced: null, + fixed_minutes: null, + non_chargeable_minutes: null, + amount_to_be_invoiced: null, + amount_invoiced: null, + status: null) +``` + + diff --git a/docs/projects/TaskCreateOrUpdate.md b/docs/projects/TaskCreateOrUpdate.md new file mode 100644 index 00000000..b84264c7 --- /dev/null +++ b/docs/projects/TaskCreateOrUpdate.md @@ -0,0 +1,23 @@ +# XeroRuby::Projects::TaskCreateOrUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | Name of the task. Max length 100 characters. | +**rate** | [**Amount**](Amount.md) | | +**charge_type** | [**ChargeType**](ChargeType.md) | | +**estimate_minutes** | **Integer** | Estimated time to perform the task. EstimateMinutes has to be greater than 0 if provided. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::TaskCreateOrUpdate.new(name: null, + rate: null, + charge_type: null, + estimate_minutes: null) +``` + + diff --git a/docs/projects/Tasks.md b/docs/projects/Tasks.md new file mode 100644 index 00000000..33c9e54e --- /dev/null +++ b/docs/projects/Tasks.md @@ -0,0 +1,19 @@ +# XeroRuby::Projects::Tasks + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**items** | [**Array<Task>**](Task.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::Tasks.new(pagination: null, + items: null) +``` + + diff --git a/docs/projects/TimeEntries.md b/docs/projects/TimeEntries.md new file mode 100644 index 00000000..76bcedea --- /dev/null +++ b/docs/projects/TimeEntries.md @@ -0,0 +1,19 @@ +# XeroRuby::Projects::TimeEntries + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pagination** | [**Pagination**](Pagination.md) | | [optional] +**items** | [**Array<TimeEntry>**](TimeEntry.md) | | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::TimeEntries.new(pagination: null, + items: null) +``` + + diff --git a/docs/projects/TimeEntry.md b/docs/projects/TimeEntry.md new file mode 100644 index 00000000..6f96838d --- /dev/null +++ b/docs/projects/TimeEntry.md @@ -0,0 +1,33 @@ +# XeroRuby::Projects::TimeEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**time_entry_id** | **String** | Identifier of the time entry. | [optional] +**user_id** | **String** | The xero user identifier of the person who logged time. | [optional] +**project_id** | **String** | Identifier of the project, that the task (which the time entry is logged against) belongs to. | [optional] +**task_id** | **String** | Identifier of the task that time entry is logged against. | [optional] +**date_utc** | **DateTime** | The date time that time entry is logged on. UTC Date Time in ISO-8601 format. | [optional] +**date_entered_utc** | **DateTime** | The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time. | [optional] +**duration** | **Integer** | The duration of logged minutes. | [optional] +**description** | **String** | A description of the time entry. | [optional] +**status** | **String** | Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::TimeEntry.new(time_entry_id: 00000000-0000-0000-0000-000000000000, + user_id: 00000000-0000-0000-0000-000000000000, + project_id: 00000000-0000-0000-0000-000000000000, + task_id: 00000000-0000-0000-0000-000000000000, + date_utc: null, + date_entered_utc: null, + duration: null, + description: null, + status: null) +``` + + diff --git a/docs/projects/TimeEntryCreateOrUpdate.md b/docs/projects/TimeEntryCreateOrUpdate.md new file mode 100644 index 00000000..570829ef --- /dev/null +++ b/docs/projects/TimeEntryCreateOrUpdate.md @@ -0,0 +1,25 @@ +# XeroRuby::Projects::TimeEntryCreateOrUpdate + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **String** | The xero user identifier of the person logging the time. | +**task_id** | **String** | Identifier of the task that time entry is logged against. | +**date_utc** | **DateTime** | Date time entry is logged on. UTC Date Time in ISO-8601 format. | +**duration** | **Integer** | Number of minutes to be logged. Duration is between 1 and 59940 inclusively. | +**description** | **String** | An optional description of the time entry, will be set to null if not provided during update. | [optional] + +## Code Sample + +```ruby +require 'XeroRuby::Projects' + +instance = XeroRuby::Projects::TimeEntryCreateOrUpdate.new(user_id: 00000000-0000-0000-0000-000000000000, + task_id: 00000000-0000-0000-0000-000000000000, + date_utc: null, + duration: null, + description: null) +``` + + diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb index c681bfce..63ae7004 100644 --- a/lib/xero-ruby.rb +++ b/lib/xero-ruby.rb @@ -17,6 +17,24 @@ require 'xero-ruby/configuration' # Models +require 'xero-ruby/models/projects/amount' +require 'xero-ruby/models/projects/charge_type' +require 'xero-ruby/models/projects/currency_code' +require 'xero-ruby/models/projects/error' +require 'xero-ruby/models/projects/pagination' +require 'xero-ruby/models/projects/project' +require 'xero-ruby/models/projects/project_create_or_update' +require 'xero-ruby/models/projects/project_patch' +require 'xero-ruby/models/projects/project_status' +require 'xero-ruby/models/projects/project_user' +require 'xero-ruby/models/projects/project_users' +require 'xero-ruby/models/projects/projects' +require 'xero-ruby/models/projects/task' +require 'xero-ruby/models/projects/task_create_or_update' +require 'xero-ruby/models/projects/tasks' +require 'xero-ruby/models/projects/time_entries' +require 'xero-ruby/models/projects/time_entry' +require 'xero-ruby/models/projects/time_entry_create_or_update' require 'xero-ruby/models/assets/asset' require 'xero-ruby/models/assets/asset_status' require 'xero-ruby/models/assets/asset_status_query_param' @@ -145,6 +163,7 @@ require 'xero-ruby/models/accounting/validation_error' # APIs +require 'xero-ruby/api/project_api' require 'xero-ruby/api/asset_api' require 'xero-ruby/api/accounting_api' diff --git a/lib/xero-ruby/api/project_api.rb b/lib/xero-ruby/api/project_api.rb new file mode 100644 index 00000000..e605812e --- /dev/null +++ b/lib/xero-ruby/api/project_api.rb @@ -0,0 +1,1035 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'cgi' + +module XeroRuby + class ProjectApi + attr_accessor :api_client + + def initialize(api_client = ApiClient.new) + @api_client = api_client + end + # create one or more new projects + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object + # @param [Hash] opts the optional parameters + # @return [Project] + def create_project(xero_tenant_id, project_create_or_update, opts = {}) + data, _status_code, _headers = create_project_with_http_info(xero_tenant_id, project_create_or_update, opts) + data + end + + # create one or more new projects + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object + # @param [Hash] opts the optional parameters + # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers + def create_project_with_http_info(xero_tenant_id, project_create_or_update, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.create_project" + end + # verify the required parameter 'project_create_or_update' is set + if @api_client.config.client_side_validation && project_create_or_update.nil? + fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.create_project" + end + # resource path + local_var_path = '/projects' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update) + + # return_type + return_type = opts[:return_type] || 'Project' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to create a task + # Allows you to create a specific task + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating + # @param [Hash] opts the optional parameters + # @return [TimeEntry] + def create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update, opts = {}) + data, _status_code, _headers = create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts) + data + end + + # Allows you to create a task + # Allows you to create a specific task + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating + # @param [Hash] opts the optional parameters + # @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers + def create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.create_time_entry ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.create_time_entry" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.create_time_entry" + end + # verify the required parameter 'time_entry_create_or_update' is set + if @api_client.config.client_side_validation && time_entry_create_or_update.nil? + fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.create_time_entry" + end + # resource path + local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update) + + # return_type + return_type = opts[:return_type] || 'TimeEntry' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#create_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to delete a time entry + # Allows you to delete a specific time entry + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id [String] You can specify an individual task by appending the id to the endpoint + # @param [Hash] opts the optional parameters + # @return [nil] + def delete_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {}) + delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts) + nil + end + + # Allows you to delete a time entry + # Allows you to delete a specific time entry + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id [String] You can specify an individual task by appending the id to the endpoint + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.delete_time_entry ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.delete_time_entry" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.delete_time_entry" + end + # verify the required parameter 'time_entry_id' is set + if @api_client.config.client_side_validation && time_entry_id.nil? + fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.delete_time_entry" + end + # resource path + local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#delete_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param [Hash] opts the optional parameters + # @return [Project] + def get_project(xero_tenant_id, project_id, opts = {}) + data, _status_code, _headers = get_project_with_http_info(xero_tenant_id, project_id, opts) + data + end + + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param [Hash] opts the optional parameters + # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers + def get_project_with_http_info(xero_tenant_id, project_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_project" + end + # resource path + local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Project' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # list all project users + # Allows you to retrieve the users on a projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. (default to 1) + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. (default to 50) + # @return [ProjectUsers] + def get_project_users(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_project_users_with_http_info(xero_tenant_id, opts) + data + end + + # list all project users + # Allows you to retrieve the users on a projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @return [Array<(ProjectUsers, Integer, Hash)>] ProjectUsers data, response status code and response headers + def get_project_users_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_users ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project_users" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be smaller than or equal to 500.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/projectsusers' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'ProjectUsers' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#get_project_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # list all projects + # Allows you to retrieve, create and update projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Array] :project_ids Search for all projects that match a comma separated list of projectIds + # @option opts [String] :contact_id Filter for projects for a specific contact + # @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED) + # @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. (default to 1) + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. (default to 50) + # @return [Projects] + def get_projects(xero_tenant_id, opts = {}) + data, _status_code, _headers = get_projects_with_http_info(xero_tenant_id, opts) + data + end + + # list all projects + # Allows you to retrieve, create and update projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Array] :project_ids Search for all projects that match a comma separated list of projectIds + # @option opts [String] :contact_id Filter for projects for a specific contact + # @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED) + # @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @return [Array<(Projects, Integer, Hash)>] Projects data, response status code and response headers + def get_projects_with_http_info(xero_tenant_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.get_projects ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_projects" + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be smaller than or equal to 500.' + end + + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be greater than or equal to 1.' + end + + # resource path + local_var_path = '/projects' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'projectIds'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil? + query_params[:'contactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil? + query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Projects' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId} + # @param [Hash] opts the optional parameters + # @return [Task] + def get_task(xero_tenant_id, project_id, task_id, opts = {}) + data, _status_code, _headers = get_task_with_http_info(xero_tenant_id, project_id, task_id, opts) + data + end + + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId} + # @param [Hash] opts the optional parameters + # @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers + def get_task_with_http_info(xero_tenant_id, project_id, task_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.get_task ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_task" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_task" + end + # verify the required parameter 'task_id' is set + if @api_client.config.client_side_validation && task_id.nil? + fail ArgumentError, "Missing the required parameter 'task_id' when calling ProjectApi.get_task" + end + # resource path + local_var_path = '/projects/{projectId}/tasks/{taskId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'taskId' + '}', task_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Task' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#get_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId} + # @return [Tasks] + def get_tasks(xero_tenant_id, project_id, opts = {}) + data, _status_code, _headers = get_tasks_with_http_info(xero_tenant_id, project_id, opts) + data + end + + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId} + # @return [Array<(Tasks, Integer, Hash)>] Tasks data, response status code and response headers + def get_tasks_with_http_info(xero_tenant_id, project_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.get_tasks ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_tasks" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_tasks" + end + # resource path + local_var_path = '/projects/{projectId}/tasks'.sub('{' + 'projectId' + '}', project_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'taskIds'] = opts[:'task_ids'] if !opts[:'task_ids'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'Tasks' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to retrieve the time entries associated with a specific project + # Allows you to retrieve the time entries associated with a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to. + # @param [Hash] opts the optional parameters + # @option opts [String] :user_id The xero user identifier of the person who logged time. + # @option opts [String] :task_id Identifier of the task that time entry is logged against. + # @option opts [String] :invoice_id Finds all time entries for this invoice. + # @option opts [String] :contact_id Finds all time entries for this contact identifier. + # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @option opts [Array] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified. + # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. + # @option opts [DateTime] :date_after_utc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. + # @option opts [DateTime] :date_before_utc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. + # @return [TimeEntries] + def get_time_entries(xero_tenant_id, project_id, opts = {}) + data, _status_code, _headers = get_time_entries_with_http_info(xero_tenant_id, project_id, opts) + data + end + + # Allows you to retrieve the time entries associated with a specific project + # Allows you to retrieve the time entries associated with a specific project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to. + # @param [Hash] opts the optional parameters + # @option opts [String] :user_id The xero user identifier of the person who logged time. + # @option opts [String] :task_id Identifier of the task that time entry is logged against. + # @option opts [String] :invoice_id Finds all time entries for this invoice. + # @option opts [String] :contact_id Finds all time entries for this contact identifier. + # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @option opts [Array] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified. + # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. + # @option opts [DateTime] :date_after_utc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. + # @option opts [DateTime] :date_before_utc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. + # @return [Array<(TimeEntries, Integer, Hash)>] TimeEntries data, response status code and response headers + def get_time_entries_with_http_info(xero_tenant_id, project_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entries ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entries" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entries" + end + # resource path + local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil? + query_params[:'taskId'] = opts[:'task_id'] if !opts[:'task_id'].nil? + query_params[:'invoiceId'] = opts[:'invoice_id'] if !opts[:'invoice_id'].nil? + query_params[:'contactId'] = opts[:'contact_id'] if !opts[:'contact_id'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil? + query_params[:'isChargeable'] = opts[:'is_chargeable'] if !opts[:'is_chargeable'].nil? + query_params[:'dateAfterUtc'] = opts[:'date_after_utc'] if !opts[:'date_after_utc'].nil? + query_params[:'dateBeforeUtc'] = opts[:'date_before_utc'] if !opts[:'date_before_utc'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimeEntries' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#get_time_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to get a single time entry in a project + # Allows you to upget a single time entry in a project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint + # @param [Hash] opts the optional parameters + # @return [TimeEntry] + def get_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {}) + data, _status_code, _headers = get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts) + data + end + + # Allows you to get a single time entry in a project + # Allows you to upget a single time entry in a project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint + # @param [Hash] opts the optional parameters + # @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers + def get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entry ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entry" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entry" + end + # verify the required parameter 'time_entry_id' is set + if @api_client.config.client_side_validation && time_entry_id.nil? + fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.get_time_entry" + end + # resource path + local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] + + # return_type + return_type = opts[:return_type] || 'TimeEntry' + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#get_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # creates a project for the specified contact + # Allows you to update a specific projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param project_patch [ProjectPatch] Update the status of an existing Project + # @param [Hash] opts the optional parameters + # @return [nil] + def patch_project(xero_tenant_id, project_id, project_patch, opts = {}) + patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts) + nil + end + + # creates a project for the specified contact + # Allows you to update a specific projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param project_patch [ProjectPatch] Update the status of an existing Project + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.patch_project ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.patch_project" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.patch_project" + end + # verify the required parameter 'project_patch' is set + if @api_client.config.client_side_validation && project_patch.nil? + fail ArgumentError, "Missing the required parameter 'project_patch' when calling ProjectApi.patch_project" + end + # resource path + local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(project_patch) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#patch_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # update a specific project + # Allows you to update a specific projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate + # @param [Hash] opts the optional parameters + # @return [nil] + def update_project(xero_tenant_id, project_id, project_create_or_update, opts = {}) + update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts) + nil + end + + # update a specific project + # Allows you to update a specific projects. + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.update_project ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_project" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_project" + end + # verify the required parameter 'project_create_or_update' is set + if @api_client.config.client_side_validation && project_create_or_update.nil? + fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.update_project" + end + # resource path + local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Allows you to update time entry in a project + # Allows you to update time entry in a project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint + # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating + # @param [Hash] opts the optional parameters + # @return [nil] + def update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {}) + update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts) + nil + end + + # Allows you to update time entry in a project + # Allows you to update time entry in a project + # @param xero_tenant_id [String] Xero identifier for Tenant + # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint + # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating + # @param [Hash] opts the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {}) + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ProjectApi.update_time_entry ...' + end + # verify the required parameter 'xero_tenant_id' is set + if @api_client.config.client_side_validation && xero_tenant_id.nil? + fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_time_entry" + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_time_entry" + end + # verify the required parameter 'time_entry_id' is set + if @api_client.config.client_side_validation && time_entry_id.nil? + fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.update_time_entry" + end + # verify the required parameter 'time_entry_create_or_update' is set + if @api_client.config.client_side_validation && time_entry_create_or_update.nil? + fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.update_time_entry" + end + # resource path + local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params[:'Xero-Tenant-Id'] = xero_tenant_id + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update) + + # return_type + return_type = opts[:return_type] + + # auth_names + auth_names = opts[:auth_names] || ['OAuth2'] + + new_options = opts.merge( + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type + ) + + data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ProjectApi#update_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/xero-ruby/models/projects/amount.rb b/lib/xero-ruby/models/projects/amount.rb new file mode 100644 index 00000000..ac543579 --- /dev/null +++ b/lib/xero-ruby/models/projects/amount.rb @@ -0,0 +1,212 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class Amount + attr_accessor :currency + + attr_accessor :value + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'currency' => :'currency', + :'value' => :'value' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'currency' => :'CurrencyCode', + :'value' => :'Float' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::Amount` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::Amount`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'currency') + self.currency = attributes[:'currency'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + currency == o.currency && + value == o.value + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [currency, value].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/charge_type.rb b/lib/xero-ruby/models/projects/charge_type.rb new file mode 100644 index 00000000..91d4ada4 --- /dev/null +++ b/lib/xero-ruby/models/projects/charge_type.rb @@ -0,0 +1,38 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class ChargeType + TIME = "TIME".freeze + FIXED = "FIXED".freeze + NON_CHARGEABLE = "NON_CHARGEABLE".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ChargeType.constants.select { |c| ChargeType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ChargeType" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/projects/currency_code.rb b/lib/xero-ruby/models/projects/currency_code.rb new file mode 100644 index 00000000..1b57aa76 --- /dev/null +++ b/lib/xero-ruby/models/projects/currency_code.rb @@ -0,0 +1,199 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class CurrencyCode + AED = "AED".freeze + AFN = "AFN".freeze + ALL = "ALL".freeze + AMD = "AMD".freeze + ANG = "ANG".freeze + AOA = "AOA".freeze + ARS = "ARS".freeze + AUD = "AUD".freeze + AWG = "AWG".freeze + AZN = "AZN".freeze + BAM = "BAM".freeze + BBD = "BBD".freeze + BDT = "BDT".freeze + BGN = "BGN".freeze + BHD = "BHD".freeze + BIF = "BIF".freeze + BMD = "BMD".freeze + BND = "BND".freeze + BOB = "BOB".freeze + BRL = "BRL".freeze + BSD = "BSD".freeze + BTN = "BTN".freeze + BWP = "BWP".freeze + BYN = "BYN".freeze + BZD = "BZD".freeze + CAD = "CAD".freeze + CDF = "CDF".freeze + CHF = "CHF".freeze + CLP = "CLP".freeze + CNY = "CNY".freeze + COP = "COP".freeze + CRC = "CRC".freeze + CUC = "CUC".freeze + CUP = "CUP".freeze + CVE = "CVE".freeze + CZK = "CZK".freeze + DJF = "DJF".freeze + DKK = "DKK".freeze + DOP = "DOP".freeze + DZD = "DZD".freeze + EGP = "EGP".freeze + ERN = "ERN".freeze + ETB = "ETB".freeze + EUR = "EUR".freeze + FJD = "FJD".freeze + FKP = "FKP".freeze + GBP = "GBP".freeze + GEL = "GEL".freeze + GGP = "GGP".freeze + GHS = "GHS".freeze + GIP = "GIP".freeze + GMD = "GMD".freeze + GNF = "GNF".freeze + GTQ = "GTQ".freeze + GYD = "GYD".freeze + HKD = "HKD".freeze + HNL = "HNL".freeze + HRK = "HRK".freeze + HTG = "HTG".freeze + HUF = "HUF".freeze + IDR = "IDR".freeze + ILS = "ILS".freeze + IMP = "IMP".freeze + INR = "INR".freeze + IQD = "IQD".freeze + IRR = "IRR".freeze + ISK = "ISK".freeze + JEP = "JEP".freeze + JMD = "JMD".freeze + JOD = "JOD".freeze + JPY = "JPY".freeze + KES = "KES".freeze + KGS = "KGS".freeze + KHR = "KHR".freeze + KMF = "KMF".freeze + KPW = "KPW".freeze + KRW = "KRW".freeze + KWD = "KWD".freeze + KYD = "KYD".freeze + KZT = "KZT".freeze + LAK = "LAK".freeze + LBP = "LBP".freeze + LKR = "LKR".freeze + LRD = "LRD".freeze + LSL = "LSL".freeze + LYD = "LYD".freeze + MAD = "MAD".freeze + MDL = "MDL".freeze + MGA = "MGA".freeze + MKD = "MKD".freeze + MMK = "MMK".freeze + MNT = "MNT".freeze + MOP = "MOP".freeze + MRU = "MRU".freeze + MUR = "MUR".freeze + MVR = "MVR".freeze + MWK = "MWK".freeze + MXN = "MXN".freeze + MYR = "MYR".freeze + MZN = "MZN".freeze + NAD = "NAD".freeze + NGN = "NGN".freeze + NIO = "NIO".freeze + NOK = "NOK".freeze + NPR = "NPR".freeze + NZD = "NZD".freeze + OMR = "OMR".freeze + PAB = "PAB".freeze + PEN = "PEN".freeze + PGK = "PGK".freeze + PHP = "PHP".freeze + PKR = "PKR".freeze + PLN = "PLN".freeze + PYG = "PYG".freeze + QAR = "QAR".freeze + RON = "RON".freeze + RSD = "RSD".freeze + RUB = "RUB".freeze + RWF = "RWF".freeze + SAR = "SAR".freeze + SBD = "SBD".freeze + SCR = "SCR".freeze + SDG = "SDG".freeze + SEK = "SEK".freeze + SGD = "SGD".freeze + SHP = "SHP".freeze + SLL = "SLL".freeze + SOS = "SOS".freeze + SPL = "SPL".freeze + SRD = "SRD".freeze + STN = "STN".freeze + SVC = "SVC".freeze + SYP = "SYP".freeze + SZL = "SZL".freeze + THB = "THB".freeze + TJS = "TJS".freeze + TMT = "TMT".freeze + TND = "TND".freeze + TOP = "TOP".freeze + TRY = "TRY".freeze + TTD = "TTD".freeze + TVD = "TVD".freeze + TWD = "TWD".freeze + TZS = "TZS".freeze + UAH = "UAH".freeze + UGX = "UGX".freeze + USD = "USD".freeze + UYU = "UYU".freeze + UZS = "UZS".freeze + VEF = "VEF".freeze + VND = "VND".freeze + VUV = "VUV".freeze + WST = "WST".freeze + XAF = "XAF".freeze + XCD = "XCD".freeze + XDR = "XDR".freeze + XOF = "XOF".freeze + XPF = "XPF".freeze + YER = "YER".freeze + ZAR = "ZAR".freeze + ZMW = "ZMW".freeze + ZMK = "ZMK".freeze + ZWD = "ZWD".freeze + EMPTY = "".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = CurrencyCode.constants.select { |c| CurrencyCode::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #CurrencyCode" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/projects/error.rb b/lib/xero-ruby/models/projects/error.rb new file mode 100644 index 00000000..e9a4a7f5 --- /dev/null +++ b/lib/xero-ruby/models/projects/error.rb @@ -0,0 +1,214 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class Error + # Exception message + attr_accessor :message + + # Array of Elements of validation Errors + attr_accessor :model_state + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'message' => :'message', + :'model_state' => :'modelState' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'message' => :'String', + :'model_state' => :'Object' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::Error` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'model_state') + self.model_state = attributes[:'model_state'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + message == o.message && + model_state == o.model_state + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [message, model_state].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/pagination.rb b/lib/xero-ruby/models/projects/pagination.rb new file mode 100644 index 00000000..b769a783 --- /dev/null +++ b/lib/xero-ruby/models/projects/pagination.rb @@ -0,0 +1,234 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class Pagination + # Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + attr_accessor :page + + # Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + attr_accessor :page_size + + # Number of pages available + attr_accessor :page_count + + # Number of items returned + attr_accessor :item_count + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'page' => :'page', + :'page_size' => :'pageSize', + :'page_count' => :'pageCount', + :'item_count' => :'itemCount' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'page' => :'Integer', + :'page_size' => :'Integer', + :'page_count' => :'Integer', + :'item_count' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::Pagination` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::Pagination`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'page') + self.page = attributes[:'page'] + end + + if attributes.key?(:'page_size') + self.page_size = attributes[:'page_size'] + end + + if attributes.key?(:'page_count') + self.page_count = attributes[:'page_count'] + end + + if attributes.key?(:'item_count') + self.item_count = attributes[:'item_count'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + page == o.page && + page_size == o.page_size && + page_count == o.page_count && + item_count == o.item_count + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [page, page_size, page_count, item_count].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/project.rb b/lib/xero-ruby/models/projects/project.rb new file mode 100644 index 00000000..6a3bd067 --- /dev/null +++ b/lib/xero-ruby/models/projects/project.rb @@ -0,0 +1,403 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class Project + # Identifier of the project. + attr_accessor :project_id + + # Identifier of the contact this project was created for. + attr_accessor :contact_id + + # Name of the project. + attr_accessor :name + + attr_accessor :currency_code + + # A total of minutes logged against all tasks on the Project. + attr_accessor :minutes_logged + + attr_accessor :total_task_amount + + attr_accessor :total_expense_amount + + attr_accessor :estimate_amount + + # Minutes which have not been invoiced across all chargeable tasks in the project. + attr_accessor :minutes_to_be_invoiced + + attr_accessor :task_amount_to_be_invoiced + + attr_accessor :task_amount_invoiced + + attr_accessor :expense_amount_to_be_invoiced + + attr_accessor :expense_amount_invoiced + + attr_accessor :project_amount_invoiced + + attr_accessor :deposit + + attr_accessor :deposit_applied + + attr_accessor :credit_note_amount + + # Deadline for the project. UTC Date Time in ISO-8601 format. + attr_accessor :deadline_utc + + attr_accessor :total_invoiced + + attr_accessor :total_to_be_invoiced + + attr_accessor :estimate + + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'project_id' => :'projectId', + :'contact_id' => :'contactId', + :'name' => :'name', + :'currency_code' => :'currencyCode', + :'minutes_logged' => :'minutesLogged', + :'total_task_amount' => :'totalTaskAmount', + :'total_expense_amount' => :'totalExpenseAmount', + :'estimate_amount' => :'estimateAmount', + :'minutes_to_be_invoiced' => :'minutesToBeInvoiced', + :'task_amount_to_be_invoiced' => :'taskAmountToBeInvoiced', + :'task_amount_invoiced' => :'taskAmountInvoiced', + :'expense_amount_to_be_invoiced' => :'expenseAmountToBeInvoiced', + :'expense_amount_invoiced' => :'expenseAmountInvoiced', + :'project_amount_invoiced' => :'projectAmountInvoiced', + :'deposit' => :'deposit', + :'deposit_applied' => :'depositApplied', + :'credit_note_amount' => :'creditNoteAmount', + :'deadline_utc' => :'deadlineUtc', + :'total_invoiced' => :'totalInvoiced', + :'total_to_be_invoiced' => :'totalToBeInvoiced', + :'estimate' => :'estimate', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'project_id' => :'String', + :'contact_id' => :'String', + :'name' => :'String', + :'currency_code' => :'CurrencyCode', + :'minutes_logged' => :'Integer', + :'total_task_amount' => :'Amount', + :'total_expense_amount' => :'Amount', + :'estimate_amount' => :'Amount', + :'minutes_to_be_invoiced' => :'Integer', + :'task_amount_to_be_invoiced' => :'Amount', + :'task_amount_invoiced' => :'Amount', + :'expense_amount_to_be_invoiced' => :'Amount', + :'expense_amount_invoiced' => :'Amount', + :'project_amount_invoiced' => :'Amount', + :'deposit' => :'Amount', + :'deposit_applied' => :'Amount', + :'credit_note_amount' => :'Amount', + :'deadline_utc' => :'DateTime', + :'total_invoiced' => :'Amount', + :'total_to_be_invoiced' => :'Amount', + :'estimate' => :'Amount', + :'status' => :'ProjectStatus' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::Project` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::Project`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + end + + if attributes.key?(:'contact_id') + self.contact_id = attributes[:'contact_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'currency_code') + self.currency_code = attributes[:'currency_code'] + end + + if attributes.key?(:'minutes_logged') + self.minutes_logged = attributes[:'minutes_logged'] + end + + if attributes.key?(:'total_task_amount') + self.total_task_amount = attributes[:'total_task_amount'] + end + + if attributes.key?(:'total_expense_amount') + self.total_expense_amount = attributes[:'total_expense_amount'] + end + + if attributes.key?(:'estimate_amount') + self.estimate_amount = attributes[:'estimate_amount'] + end + + if attributes.key?(:'minutes_to_be_invoiced') + self.minutes_to_be_invoiced = attributes[:'minutes_to_be_invoiced'] + end + + if attributes.key?(:'task_amount_to_be_invoiced') + self.task_amount_to_be_invoiced = attributes[:'task_amount_to_be_invoiced'] + end + + if attributes.key?(:'task_amount_invoiced') + self.task_amount_invoiced = attributes[:'task_amount_invoiced'] + end + + if attributes.key?(:'expense_amount_to_be_invoiced') + self.expense_amount_to_be_invoiced = attributes[:'expense_amount_to_be_invoiced'] + end + + if attributes.key?(:'expense_amount_invoiced') + self.expense_amount_invoiced = attributes[:'expense_amount_invoiced'] + end + + if attributes.key?(:'project_amount_invoiced') + self.project_amount_invoiced = attributes[:'project_amount_invoiced'] + end + + if attributes.key?(:'deposit') + self.deposit = attributes[:'deposit'] + end + + if attributes.key?(:'deposit_applied') + self.deposit_applied = attributes[:'deposit_applied'] + end + + if attributes.key?(:'credit_note_amount') + self.credit_note_amount = attributes[:'credit_note_amount'] + end + + if attributes.key?(:'deadline_utc') + self.deadline_utc = attributes[:'deadline_utc'] + end + + if attributes.key?(:'total_invoiced') + self.total_invoiced = attributes[:'total_invoiced'] + end + + if attributes.key?(:'total_to_be_invoiced') + self.total_to_be_invoiced = attributes[:'total_to_be_invoiced'] + end + + if attributes.key?(:'estimate') + self.estimate = attributes[:'estimate'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + project_id == o.project_id && + contact_id == o.contact_id && + name == o.name && + currency_code == o.currency_code && + minutes_logged == o.minutes_logged && + total_task_amount == o.total_task_amount && + total_expense_amount == o.total_expense_amount && + estimate_amount == o.estimate_amount && + minutes_to_be_invoiced == o.minutes_to_be_invoiced && + task_amount_to_be_invoiced == o.task_amount_to_be_invoiced && + task_amount_invoiced == o.task_amount_invoiced && + expense_amount_to_be_invoiced == o.expense_amount_to_be_invoiced && + expense_amount_invoiced == o.expense_amount_invoiced && + project_amount_invoiced == o.project_amount_invoiced && + deposit == o.deposit && + deposit_applied == o.deposit_applied && + credit_note_amount == o.credit_note_amount && + deadline_utc == o.deadline_utc && + total_invoiced == o.total_invoiced && + total_to_be_invoiced == o.total_to_be_invoiced && + estimate == o.estimate && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [project_id, contact_id, name, currency_code, minutes_logged, total_task_amount, total_expense_amount, estimate_amount, minutes_to_be_invoiced, task_amount_to_be_invoiced, task_amount_invoiced, expense_amount_to_be_invoiced, expense_amount_invoiced, project_amount_invoiced, deposit, deposit_applied, credit_note_amount, deadline_utc, total_invoiced, total_to_be_invoiced, estimate, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/project_create_or_update.rb b/lib/xero-ruby/models/projects/project_create_or_update.rb new file mode 100644 index 00000000..c523ba95 --- /dev/null +++ b/lib/xero-ruby/models/projects/project_create_or_update.rb @@ -0,0 +1,238 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class ProjectCreateOrUpdate + # Identifier of the contact this project was created for. + attr_accessor :contact_id + + # Name of the project. + attr_accessor :name + + attr_accessor :estimate_amount + + # Deadline for the project. UTC Date Time in ISO-8601 format. + attr_accessor :deadline_utc + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'contact_id' => :'contactId', + :'name' => :'name', + :'estimate_amount' => :'estimateAmount', + :'deadline_utc' => :'deadlineUtc' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'contact_id' => :'String', + :'name' => :'String', + :'estimate_amount' => :'Float', + :'deadline_utc' => :'DateTime' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::ProjectCreateOrUpdate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::ProjectCreateOrUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'contact_id') + self.contact_id = attributes[:'contact_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'estimate_amount') + self.estimate_amount = attributes[:'estimate_amount'] + end + + if attributes.key?(:'deadline_utc') + self.deadline_utc = attributes[:'deadline_utc'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + contact_id == o.contact_id && + name == o.name && + estimate_amount == o.estimate_amount && + deadline_utc == o.deadline_utc + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [contact_id, name, estimate_amount, deadline_utc].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/project_patch.rb b/lib/xero-ruby/models/projects/project_patch.rb new file mode 100644 index 00000000..cf82f080 --- /dev/null +++ b/lib/xero-ruby/models/projects/project_patch.rb @@ -0,0 +1,208 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class ProjectPatch + attr_accessor :status + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'status' => :'ProjectStatus' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::ProjectPatch` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::ProjectPatch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @status.nil? + invalid_properties.push('invalid value for "status", status cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @status.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/project_status.rb b/lib/xero-ruby/models/projects/project_status.rb new file mode 100644 index 00000000..7400ae15 --- /dev/null +++ b/lib/xero-ruby/models/projects/project_status.rb @@ -0,0 +1,37 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class ProjectStatus + INPROGRESS = "INPROGRESS".freeze + CLOSED = "CLOSED".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = ProjectStatus.constants.select { |c| ProjectStatus::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #ProjectStatus" if constantValues.empty? + value + end + end +end diff --git a/lib/xero-ruby/models/projects/project_user.rb b/lib/xero-ruby/models/projects/project_user.rb new file mode 100644 index 00000000..1aa16356 --- /dev/null +++ b/lib/xero-ruby/models/projects/project_user.rb @@ -0,0 +1,224 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class ProjectUser + # Identifier of the user of the project. + attr_accessor :user_id + + # Full name of the user. + attr_accessor :name + + # Email address of the user. + attr_accessor :email + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'name' => :'name', + :'email' => :'email' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'name' => :'String', + :'email' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::ProjectUser` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::ProjectUser`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + name == o.name && + email == o.email + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, name, email].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/project_users.rb b/lib/xero-ruby/models/projects/project_users.rb new file mode 100644 index 00000000..63e6409b --- /dev/null +++ b/lib/xero-ruby/models/projects/project_users.rb @@ -0,0 +1,214 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class ProjectUsers + attr_accessor :pagination + + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'items' => :'items' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'items' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::ProjectUsers` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::ProjectUsers`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/projects.rb b/lib/xero-ruby/models/projects/projects.rb new file mode 100644 index 00000000..01c2c2cc --- /dev/null +++ b/lib/xero-ruby/models/projects/projects.rb @@ -0,0 +1,214 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class Projects + attr_accessor :pagination + + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'items' => :'items' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'items' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::Projects` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::Projects`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/task.rb b/lib/xero-ruby/models/projects/task.rb new file mode 100644 index 00000000..01a600fd --- /dev/null +++ b/lib/xero-ruby/models/projects/task.rb @@ -0,0 +1,373 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class Task + # Identifier of the task. + attr_accessor :task_id + + # Name of the task. + attr_accessor :name + + attr_accessor :rate + + attr_accessor :charge_type + + # An estimated time to perform the task + attr_accessor :estimate_minutes + + # Identifier of the project task belongs to. + attr_accessor :project_id + + # Total minutes which have been logged against the task. Logged by assigning a time entry to a task + attr_accessor :total_minutes + + attr_accessor :total_amount + + # Minutes on this task which have been invoiced. + attr_accessor :minutes_invoiced + + # Minutes on this task which have not been invoiced. + attr_accessor :minutes_to_be_invoiced + + # Minutes logged against this task if its charge type is `FIXED`. + attr_accessor :fixed_minutes + + # Minutes logged against this task if its charge type is `NON_CHARGEABLE`. + attr_accessor :non_chargeable_minutes + + attr_accessor :amount_to_be_invoiced + + attr_accessor :amount_invoiced + + # Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. + attr_accessor :status + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'task_id' => :'taskId', + :'name' => :'name', + :'rate' => :'rate', + :'charge_type' => :'chargeType', + :'estimate_minutes' => :'estimateMinutes', + :'project_id' => :'projectId', + :'total_minutes' => :'totalMinutes', + :'total_amount' => :'totalAmount', + :'minutes_invoiced' => :'minutesInvoiced', + :'minutes_to_be_invoiced' => :'minutesToBeInvoiced', + :'fixed_minutes' => :'fixedMinutes', + :'non_chargeable_minutes' => :'nonChargeableMinutes', + :'amount_to_be_invoiced' => :'amountToBeInvoiced', + :'amount_invoiced' => :'amountInvoiced', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'task_id' => :'String', + :'name' => :'String', + :'rate' => :'Amount', + :'charge_type' => :'ChargeType', + :'estimate_minutes' => :'Float', + :'project_id' => :'String', + :'total_minutes' => :'Float', + :'total_amount' => :'Amount', + :'minutes_invoiced' => :'Float', + :'minutes_to_be_invoiced' => :'Float', + :'fixed_minutes' => :'Float', + :'non_chargeable_minutes' => :'Float', + :'amount_to_be_invoiced' => :'Amount', + :'amount_invoiced' => :'Amount', + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::Task` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::Task`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'task_id') + self.task_id = attributes[:'task_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rate') + self.rate = attributes[:'rate'] + end + + if attributes.key?(:'charge_type') + self.charge_type = attributes[:'charge_type'] + end + + if attributes.key?(:'estimate_minutes') + self.estimate_minutes = attributes[:'estimate_minutes'] + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + end + + if attributes.key?(:'total_minutes') + self.total_minutes = attributes[:'total_minutes'] + end + + if attributes.key?(:'total_amount') + self.total_amount = attributes[:'total_amount'] + end + + if attributes.key?(:'minutes_invoiced') + self.minutes_invoiced = attributes[:'minutes_invoiced'] + end + + if attributes.key?(:'minutes_to_be_invoiced') + self.minutes_to_be_invoiced = attributes[:'minutes_to_be_invoiced'] + end + + if attributes.key?(:'fixed_minutes') + self.fixed_minutes = attributes[:'fixed_minutes'] + end + + if attributes.key?(:'non_chargeable_minutes') + self.non_chargeable_minutes = attributes[:'non_chargeable_minutes'] + end + + if attributes.key?(:'amount_to_be_invoiced') + self.amount_to_be_invoiced = attributes[:'amount_to_be_invoiced'] + end + + if attributes.key?(:'amount_invoiced') + self.amount_invoiced = attributes[:'amount_invoiced'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "INVOICED", "LOCKED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "INVOICED", "LOCKED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + task_id == o.task_id && + name == o.name && + rate == o.rate && + charge_type == o.charge_type && + estimate_minutes == o.estimate_minutes && + project_id == o.project_id && + total_minutes == o.total_minutes && + total_amount == o.total_amount && + minutes_invoiced == o.minutes_invoiced && + minutes_to_be_invoiced == o.minutes_to_be_invoiced && + fixed_minutes == o.fixed_minutes && + non_chargeable_minutes == o.non_chargeable_minutes && + amount_to_be_invoiced == o.amount_to_be_invoiced && + amount_invoiced == o.amount_invoiced && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [task_id, name, rate, charge_type, estimate_minutes, project_id, total_minutes, total_amount, minutes_invoiced, minutes_to_be_invoiced, fixed_minutes, non_chargeable_minutes, amount_to_be_invoiced, amount_invoiced, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/task_create_or_update.rb b/lib/xero-ruby/models/projects/task_create_or_update.rb new file mode 100644 index 00000000..45958e2b --- /dev/null +++ b/lib/xero-ruby/models/projects/task_create_or_update.rb @@ -0,0 +1,247 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class TaskCreateOrUpdate + # Name of the task. Max length 100 characters. + attr_accessor :name + + attr_accessor :rate + + attr_accessor :charge_type + + # Estimated time to perform the task. EstimateMinutes has to be greater than 0 if provided. + attr_accessor :estimate_minutes + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'name' => :'name', + :'rate' => :'rate', + :'charge_type' => :'chargeType', + :'estimate_minutes' => :'estimateMinutes' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'name' => :'String', + :'rate' => :'Amount', + :'charge_type' => :'ChargeType', + :'estimate_minutes' => :'Integer' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::TaskCreateOrUpdate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::TaskCreateOrUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rate') + self.rate = attributes[:'rate'] + end + + if attributes.key?(:'charge_type') + self.charge_type = attributes[:'charge_type'] + end + + if attributes.key?(:'estimate_minutes') + self.estimate_minutes = attributes[:'estimate_minutes'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @name.nil? + invalid_properties.push('invalid value for "name", name cannot be nil.') + end + + if @rate.nil? + invalid_properties.push('invalid value for "rate", rate cannot be nil.') + end + + if @charge_type.nil? + invalid_properties.push('invalid value for "charge_type", charge_type cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @name.nil? + return false if @rate.nil? + return false if @charge_type.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + rate == o.rate && + charge_type == o.charge_type && + estimate_minutes == o.estimate_minutes + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [name, rate, charge_type, estimate_minutes].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/tasks.rb b/lib/xero-ruby/models/projects/tasks.rb new file mode 100644 index 00000000..b3935c40 --- /dev/null +++ b/lib/xero-ruby/models/projects/tasks.rb @@ -0,0 +1,214 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class Tasks + attr_accessor :pagination + + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'items' => :'items' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'items' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::Tasks` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::Tasks`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/time_entries.rb b/lib/xero-ruby/models/projects/time_entries.rb new file mode 100644 index 00000000..2767e8e9 --- /dev/null +++ b/lib/xero-ruby/models/projects/time_entries.rb @@ -0,0 +1,214 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class TimeEntries + attr_accessor :pagination + + attr_accessor :items + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'pagination' => :'pagination', + :'items' => :'items' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'pagination' => :'Pagination', + :'items' => :'Array' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::TimeEntries` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::TimeEntries`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'pagination') + self.pagination = attributes[:'pagination'] + end + + if attributes.key?(:'items') + if (value = attributes[:'items']).is_a?(Array) + self.items = value + end + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + pagination == o.pagination && + items == o.items + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [pagination, items].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/time_entry.rb b/lib/xero-ruby/models/projects/time_entry.rb new file mode 100644 index 00000000..2f1bd789 --- /dev/null +++ b/lib/xero-ruby/models/projects/time_entry.rb @@ -0,0 +1,318 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class TimeEntry + # Identifier of the time entry. + attr_accessor :time_entry_id + + # The xero user identifier of the person who logged time. + attr_accessor :user_id + + # Identifier of the project, that the task (which the time entry is logged against) belongs to. + attr_accessor :project_id + + # Identifier of the task that time entry is logged against. + attr_accessor :task_id + + # The date time that time entry is logged on. UTC Date Time in ISO-8601 format. + attr_accessor :date_utc + + # The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time. + attr_accessor :date_entered_utc + + # The duration of logged minutes. + attr_accessor :duration + + # A description of the time entry. + attr_accessor :description + + # Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. + attr_accessor :status + + class EnumAttributeValidator + attr_reader :datatype + attr_reader :allowable_values + + def initialize(datatype, allowable_values) + @allowable_values = allowable_values.map do |value| + case datatype.to_s + when /Integer/i + value.to_i + when /Float/i + value.to_f + else + value + end + end + end + + def valid?(value) + !value || allowable_values.include?(value) + end + end + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'time_entry_id' => :'timeEntryId', + :'user_id' => :'userId', + :'project_id' => :'projectId', + :'task_id' => :'taskId', + :'date_utc' => :'dateUtc', + :'date_entered_utc' => :'dateEnteredUtc', + :'duration' => :'duration', + :'description' => :'description', + :'status' => :'status' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'time_entry_id' => :'String', + :'user_id' => :'String', + :'project_id' => :'String', + :'task_id' => :'String', + :'date_utc' => :'DateTime', + :'date_entered_utc' => :'DateTime', + :'duration' => :'Integer', + :'description' => :'String', + :'status' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::TimeEntry` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::TimeEntry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'time_entry_id') + self.time_entry_id = attributes[:'time_entry_id'] + end + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + end + + if attributes.key?(:'task_id') + self.task_id = attributes[:'task_id'] + end + + if attributes.key?(:'date_utc') + self.date_utc = attributes[:'date_utc'] + end + + if attributes.key?(:'date_entered_utc') + self.date_entered_utc = attributes[:'date_entered_utc'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + status_validator = EnumAttributeValidator.new('String', ["ACTIVE", "LOCKED"]) + return false unless status_validator.valid?(@status) + true + end + + # Custom attribute writer method checking allowed values (enum). + # @param [Object] status Object to be assigned + def status=(status) + validator = EnumAttributeValidator.new('String', ["ACTIVE", "LOCKED"]) + unless validator.valid?(status) + fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}." + end + @status = status + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + time_entry_id == o.time_entry_id && + user_id == o.user_id && + project_id == o.project_id && + task_id == o.task_id && + date_utc == o.date_utc && + date_entered_utc == o.date_entered_utc && + duration == o.duration && + description == o.description && + status == o.status + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [time_entry_id, user_id, project_id, task_id, date_utc, date_entered_utc, duration, description, status].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb new file mode 100644 index 00000000..e903cf9b --- /dev/null +++ b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb @@ -0,0 +1,264 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'time' +require 'date' + +module XeroRuby::Projects + class TimeEntryCreateOrUpdate + # The xero user identifier of the person logging the time. + attr_accessor :user_id + + # Identifier of the task that time entry is logged against. + attr_accessor :task_id + + # Date time entry is logged on. UTC Date Time in ISO-8601 format. + attr_accessor :date_utc + + # Number of minutes to be logged. Duration is between 1 and 59940 inclusively. + attr_accessor :duration + + # An optional description of the time entry, will be set to null if not provided during update. + attr_accessor :description + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'user_id' => :'userId', + :'task_id' => :'taskId', + :'date_utc' => :'dateUtc', + :'duration' => :'duration', + :'description' => :'description' + } + end + + # Attribute type mapping. + def self.openapi_types + { + :'user_id' => :'String', + :'task_id' => :'String', + :'date_utc' => :'DateTime', + :'duration' => :'Integer', + :'description' => :'String' + } + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Projects::TimeEntryCreateOrUpdate` initialize method" + end + + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Projects::TimeEntryCreateOrUpdate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'user_id') + self.user_id = attributes[:'user_id'] + end + + if attributes.key?(:'task_id') + self.task_id = attributes[:'task_id'] + end + + if attributes.key?(:'date_utc') + self.date_utc = attributes[:'date_utc'] + end + + if attributes.key?(:'duration') + self.duration = attributes[:'duration'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @user_id.nil? + invalid_properties.push('invalid value for "user_id", user_id cannot be nil.') + end + + if @task_id.nil? + invalid_properties.push('invalid value for "task_id", task_id cannot be nil.') + end + + if @date_utc.nil? + invalid_properties.push('invalid value for "date_utc", date_utc cannot be nil.') + end + + if @duration.nil? + invalid_properties.push('invalid value for "duration", duration cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @user_id.nil? + return false if @task_id.nil? + return false if @date_utc.nil? + return false if @duration.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user_id == o.user_id && + task_id == o.task_id && + date_utc == o.date_utc && + duration == o.duration && + description == o.description + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [user_id, task_id, date_utc, duration, description].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end # or else data not found in attributes(hash), not an issue as the data can be optional + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :DateTime + DateTime.parse(parse_date(value)) + when :Date + Date.parse(parse_date(value)) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + XeroRuby::Projects.const_get(type).build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + next if value.nil? + hash[param] = _to_hash(value) + end + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + # customized data_parser + def parse_date(datestring) + seconds_since_epoch = datestring.scan(/[0-9]+/)[0].to_i / 1000.0 + return Time.at(seconds_since_epoch).to_s + end + end +end diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb index 61c1763c..2e05fb74 100644 --- a/lib/xero-ruby/version.rb +++ b/lib/xero-ruby/version.rb @@ -11,5 +11,5 @@ =end module XeroRuby - VERSION = '0.4.1' + VERSION = '1.2.0' end diff --git a/spec/projects/api/project_api_spec.rb b/spec/projects/api/project_api_spec.rb new file mode 100644 index 00000000..2d8adab2 --- /dev/null +++ b/spec/projects/api/project_api_spec.rb @@ -0,0 +1,229 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' + +# Unit tests for XeroRuby::ProjectApi +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ProjectApi' do + before do + # run before each test + @api_instance = XeroRuby::ProjectApi.new + end + + after do + # run after each test + end + + describe 'test an instance of ProjectApi' do + it 'should create an instance of ProjectApi' do + expect(@api_instance).to be_instance_of(XeroRuby::ProjectApi) + end + end + + # unit tests for create_project + # create one or more new projects + # @param xero_tenant_id Xero identifier for Tenant + # @param project_create_or_update Create a new project with ProjectCreateOrUpdate object + # @param [Hash] opts the optional parameters + # @return [Project] + describe 'create_project test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for create_time_entry + # Allows you to create a task + # Allows you to create a specific task + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_create_or_update The time entry object you are creating + # @param [Hash] opts the optional parameters + # @return [TimeEntry] + describe 'create_time_entry test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for delete_time_entry + # Allows you to delete a time entry + # Allows you to delete a specific time entry + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id You can specify an individual task by appending the id to the endpoint + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'delete_time_entry test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_project + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param [Hash] opts the optional parameters + # @return [Project] + describe 'get_project test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_project_users + # list all project users + # Allows you to retrieve the users on a projects. + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @return [ProjectUsers] + describe 'get_project_users test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_projects + # list all projects + # Allows you to retrieve, create and update projects. + # @param xero_tenant_id Xero identifier for Tenant + # @param [Hash] opts the optional parameters + # @option opts [Array] :project_ids Search for all projects that match a comma separated list of projectIds + # @option opts [String] :contact_id Filter for projects for a specific contact + # @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED) + # @option opts [Integer] :page set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @return [Projects] + describe 'get_projects test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_task + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param task_id You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId} + # @param [Hash] opts the optional parameters + # @return [Task] + describe 'get_task test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_tasks + # Allows you to retrieve a single project + # Allows you to retrieve a specific project + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param [Hash] opts the optional parameters + # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId} + # @return [Tasks] + describe 'get_tasks test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_time_entries + # Allows you to retrieve the time entries associated with a specific project + # Allows you to retrieve the time entries associated with a specific project + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id Identifier of the project, that the task (which the time entry is logged against) belongs to. + # @param [Hash] opts the optional parameters + # @option opts [String] :user_id The xero user identifier of the person who logged time. + # @option opts [String] :task_id Identifier of the task that time entry is logged against. + # @option opts [String] :invoice_id Finds all time entries for this invoice. + # @option opts [String] :contact_id Finds all time entries for this contact identifier. + # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + # @option opts [Array] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified. + # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. + # @option opts [DateTime] :date_after_utc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. + # @option opts [DateTime] :date_before_utc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. + # @return [TimeEntries] + describe 'get_time_entries test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for get_time_entry + # Allows you to get a single time entry in a project + # Allows you to upget a single time entry in a project + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id You can specify an individual time entry by appending the id to the endpoint + # @param [Hash] opts the optional parameters + # @return [TimeEntry] + describe 'get_time_entry test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for patch_project + # creates a project for the specified contact + # Allows you to update a specific projects. + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param project_patch Update the status of an existing Project + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'patch_project test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_project + # update a specific project + # Allows you to update a specific projects. + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param project_create_or_update Request of type ProjectCreateOrUpdate + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_project test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + # unit tests for update_time_entry + # Allows you to update time entry in a project + # Allows you to update time entry in a project + # @param xero_tenant_id Xero identifier for Tenant + # @param project_id You can specify an individual project by appending the projectId to the endpoint + # @param time_entry_id You can specify an individual time entry by appending the id to the endpoint + # @param time_entry_create_or_update The time entry object you are updating + # @param [Hash] opts the optional parameters + # @return [nil] + describe 'update_time_entry test' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/amount_spec.rb b/spec/projects/models/amount_spec.rb new file mode 100644 index 00000000..6a4d63f9 --- /dev/null +++ b/spec/projects/models/amount_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::Amount +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Amount' do + before do + # run before each test + @instance = XeroRuby::Projects::Amount.new + end + + after do + # run after each test + end + + describe 'test an instance of Amount' do + it 'should create an instance of Amount' do + expect(@instance).to be_instance_of(XeroRuby::Projects::Amount) + end + end + describe 'test attribute "currency"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "value"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/charge_type_spec.rb b/spec/projects/models/charge_type_spec.rb new file mode 100644 index 00000000..1059c941 --- /dev/null +++ b/spec/projects/models/charge_type_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::ChargeType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ChargeType' do + before do + # run before each test + @instance = XeroRuby::Projects::ChargeType.new + end + + after do + # run after each test + end + + describe 'test an instance of ChargeType' do + it 'should create an instance of ChargeType' do + expect(@instance).to be_instance_of(XeroRuby::Projects::ChargeType) + end + end +end diff --git a/spec/projects/models/currency_code_spec.rb b/spec/projects/models/currency_code_spec.rb new file mode 100644 index 00000000..1ab1af0e --- /dev/null +++ b/spec/projects/models/currency_code_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::CurrencyCode +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'CurrencyCode' do + before do + # run before each test + @instance = XeroRuby::Projects::CurrencyCode.new + end + + after do + # run after each test + end + + describe 'test an instance of CurrencyCode' do + it 'should create an instance of CurrencyCode' do + expect(@instance).to be_instance_of(XeroRuby::Projects::CurrencyCode) + end + end +end diff --git a/spec/projects/models/error_spec.rb b/spec/projects/models/error_spec.rb new file mode 100644 index 00000000..63322869 --- /dev/null +++ b/spec/projects/models/error_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::Error +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Error' do + before do + # run before each test + @instance = XeroRuby::Projects::Error.new + end + + after do + # run after each test + end + + describe 'test an instance of Error' do + it 'should create an instance of Error' do + expect(@instance).to be_instance_of(XeroRuby::Projects::Error) + end + end + describe 'test attribute "message"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "model_state"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/pagination_spec.rb b/spec/projects/models/pagination_spec.rb new file mode 100644 index 00000000..57f39e2b --- /dev/null +++ b/spec/projects/models/pagination_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::Pagination +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Pagination' do + before do + # run before each test + @instance = XeroRuby::Projects::Pagination.new + end + + after do + # run after each test + end + + describe 'test an instance of Pagination' do + it 'should create an instance of Pagination' do + expect(@instance).to be_instance_of(XeroRuby::Projects::Pagination) + end + end + describe 'test attribute "page"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page_size"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "page_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "item_count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/project_create_or_update_spec.rb b/spec/projects/models/project_create_or_update_spec.rb new file mode 100644 index 00000000..ed2865e8 --- /dev/null +++ b/spec/projects/models/project_create_or_update_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::ProjectCreateOrUpdate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ProjectCreateOrUpdate' do + before do + # run before each test + @instance = XeroRuby::Projects::ProjectCreateOrUpdate.new + end + + after do + # run after each test + end + + describe 'test an instance of ProjectCreateOrUpdate' do + it 'should create an instance of ProjectCreateOrUpdate' do + expect(@instance).to be_instance_of(XeroRuby::Projects::ProjectCreateOrUpdate) + end + end + describe 'test attribute "contact_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "estimate_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deadline_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/project_patch_spec.rb b/spec/projects/models/project_patch_spec.rb new file mode 100644 index 00000000..b9576491 --- /dev/null +++ b/spec/projects/models/project_patch_spec.rb @@ -0,0 +1,41 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::ProjectPatch +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ProjectPatch' do + before do + # run before each test + @instance = XeroRuby::Projects::ProjectPatch.new + end + + after do + # run after each test + end + + describe 'test an instance of ProjectPatch' do + it 'should create an instance of ProjectPatch' do + expect(@instance).to be_instance_of(XeroRuby::Projects::ProjectPatch) + end + end + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/project_spec.rb b/spec/projects/models/project_spec.rb new file mode 100644 index 00000000..0a3b905b --- /dev/null +++ b/spec/projects/models/project_spec.rb @@ -0,0 +1,167 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::Project +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Project' do + before do + # run before each test + @instance = XeroRuby::Projects::Project.new + end + + after do + # run after each test + end + + describe 'test an instance of Project' do + it 'should create an instance of Project' do + expect(@instance).to be_instance_of(XeroRuby::Projects::Project) + end + end + describe 'test attribute "project_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "contact_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "currency_code"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "minutes_logged"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_task_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_expense_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "estimate_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "minutes_to_be_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "task_amount_to_be_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "task_amount_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_amount_to_be_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "expense_amount_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "project_amount_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deposit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deposit_applied"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "credit_note_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "deadline_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_to_be_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "estimate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/project_status_spec.rb b/spec/projects/models/project_status_spec.rb new file mode 100644 index 00000000..05a5f6a3 --- /dev/null +++ b/spec/projects/models/project_status_spec.rb @@ -0,0 +1,35 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::ProjectStatus +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ProjectStatus' do + before do + # run before each test + @instance = XeroRuby::Projects::ProjectStatus.new + end + + after do + # run after each test + end + + describe 'test an instance of ProjectStatus' do + it 'should create an instance of ProjectStatus' do + expect(@instance).to be_instance_of(XeroRuby::Projects::ProjectStatus) + end + end +end diff --git a/spec/projects/models/project_user_spec.rb b/spec/projects/models/project_user_spec.rb new file mode 100644 index 00000000..2f69c6c7 --- /dev/null +++ b/spec/projects/models/project_user_spec.rb @@ -0,0 +1,53 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::ProjectUser +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ProjectUser' do + before do + # run before each test + @instance = XeroRuby::Projects::ProjectUser.new + end + + after do + # run after each test + end + + describe 'test an instance of ProjectUser' do + it 'should create an instance of ProjectUser' do + expect(@instance).to be_instance_of(XeroRuby::Projects::ProjectUser) + end + end + describe 'test attribute "user_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "email"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/project_users_spec.rb b/spec/projects/models/project_users_spec.rb new file mode 100644 index 00000000..4f6893a6 --- /dev/null +++ b/spec/projects/models/project_users_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::ProjectUsers +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'ProjectUsers' do + before do + # run before each test + @instance = XeroRuby::Projects::ProjectUsers.new + end + + after do + # run after each test + end + + describe 'test an instance of ProjectUsers' do + it 'should create an instance of ProjectUsers' do + expect(@instance).to be_instance_of(XeroRuby::Projects::ProjectUsers) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/projects_spec.rb b/spec/projects/models/projects_spec.rb new file mode 100644 index 00000000..3fc1fda5 --- /dev/null +++ b/spec/projects/models/projects_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::Projects +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Projects' do + before do + # run before each test + @instance = XeroRuby::Projects::Projects.new + end + + after do + # run after each test + end + + describe 'test an instance of Projects' do + it 'should create an instance of Projects' do + expect(@instance).to be_instance_of(XeroRuby::Projects::Projects) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/task_create_or_update_spec.rb b/spec/projects/models/task_create_or_update_spec.rb new file mode 100644 index 00000000..b68c56cc --- /dev/null +++ b/spec/projects/models/task_create_or_update_spec.rb @@ -0,0 +1,59 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::TaskCreateOrUpdate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TaskCreateOrUpdate' do + before do + # run before each test + @instance = XeroRuby::Projects::TaskCreateOrUpdate.new + end + + after do + # run after each test + end + + describe 'test an instance of TaskCreateOrUpdate' do + it 'should create an instance of TaskCreateOrUpdate' do + expect(@instance).to be_instance_of(XeroRuby::Projects::TaskCreateOrUpdate) + end + end + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "charge_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "estimate_minutes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/task_spec.rb b/spec/projects/models/task_spec.rb new file mode 100644 index 00000000..361e9eb5 --- /dev/null +++ b/spec/projects/models/task_spec.rb @@ -0,0 +1,129 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::Task +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Task' do + before do + # run before each test + @instance = XeroRuby::Projects::Task.new + end + + after do + # run after each test + end + + describe 'test an instance of Task' do + it 'should create an instance of Task' do + expect(@instance).to be_instance_of(XeroRuby::Projects::Task) + end + end + describe 'test attribute "task_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "rate"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "charge_type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "estimate_minutes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "project_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_minutes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "total_amount"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "minutes_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "minutes_to_be_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "fixed_minutes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "non_chargeable_minutes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount_to_be_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "amount_invoiced"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["ACTIVE", "INVOICED", "LOCKED"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + +end diff --git a/spec/projects/models/tasks_spec.rb b/spec/projects/models/tasks_spec.rb new file mode 100644 index 00000000..79c1d8d5 --- /dev/null +++ b/spec/projects/models/tasks_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::Tasks +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'Tasks' do + before do + # run before each test + @instance = XeroRuby::Projects::Tasks.new + end + + after do + # run after each test + end + + describe 'test an instance of Tasks' do + it 'should create an instance of Tasks' do + expect(@instance).to be_instance_of(XeroRuby::Projects::Tasks) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/time_entries_spec.rb b/spec/projects/models/time_entries_spec.rb new file mode 100644 index 00000000..76f71b8a --- /dev/null +++ b/spec/projects/models/time_entries_spec.rb @@ -0,0 +1,47 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::TimeEntries +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimeEntries' do + before do + # run before each test + @instance = XeroRuby::Projects::TimeEntries.new + end + + after do + # run after each test + end + + describe 'test an instance of TimeEntries' do + it 'should create an instance of TimeEntries' do + expect(@instance).to be_instance_of(XeroRuby::Projects::TimeEntries) + end + end + describe 'test attribute "pagination"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "items"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/time_entry_create_or_update_spec.rb b/spec/projects/models/time_entry_create_or_update_spec.rb new file mode 100644 index 00000000..9809da3e --- /dev/null +++ b/spec/projects/models/time_entry_create_or_update_spec.rb @@ -0,0 +1,65 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::TimeEntryCreateOrUpdate +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimeEntryCreateOrUpdate' do + before do + # run before each test + @instance = XeroRuby::Projects::TimeEntryCreateOrUpdate.new + end + + after do + # run after each test + end + + describe 'test an instance of TimeEntryCreateOrUpdate' do + it 'should create an instance of TimeEntryCreateOrUpdate' do + expect(@instance).to be_instance_of(XeroRuby::Projects::TimeEntryCreateOrUpdate) + end + end + describe 'test attribute "user_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "task_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/projects/models/time_entry_spec.rb b/spec/projects/models/time_entry_spec.rb new file mode 100644 index 00000000..6176803a --- /dev/null +++ b/spec/projects/models/time_entry_spec.rb @@ -0,0 +1,93 @@ +=begin +#Xero Projects API + +#This is the Xero Projects API + +The version of the OpenAPI document: 2.2.2 +Contact: api@xero.com +Generated by: https://openapi-generator.tech +OpenAPI Generator version: 4.3.1 + +=end + +require 'spec_helper' +require 'json' +require 'date' + +# Unit tests for XeroRuby::Projects::TimeEntry +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe 'TimeEntry' do + before do + # run before each test + @instance = XeroRuby::Projects::TimeEntry.new + end + + after do + # run after each test + end + + describe 'test an instance of TimeEntry' do + it 'should create an instance of TimeEntry' do + expect(@instance).to be_instance_of(XeroRuby::Projects::TimeEntry) + end + end + describe 'test attribute "time_entry_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "user_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "project_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "task_id"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "date_entered_utc"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "duration"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "description"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "status"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + # validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["ACTIVE", "LOCKED"]) + # validator.allowable_values.each do |value| + # expect { @instance.status = value }.not_to raise_error + # end + end + end + +end From c45d850c53b218135fac0a48db79ec86d6f6989b Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 24 Jun 2020 20:54:25 -0600 Subject: [PATCH 12/21] specs, docs, and projects API added --- docs/accounting/AccountingApi.md | 1829 +++++++---------- docs/accounting/BatchPayment.md | 2 +- docs/assets/AssetApi.md | 46 +- docs/projects/ProjectApi.md | 108 +- lib/xero-ruby.rb | 2 +- lib/xero-ruby/api/accounting_api.rb | 21 +- lib/xero-ruby/api/asset_api.rb | 2 +- lib/xero-ruby/api/project_api.rb | 2 +- lib/xero-ruby/api_client.rb | 2 +- lib/xero-ruby/api_error.rb | 2 +- lib/xero-ruby/configuration.rb | 2 +- lib/xero-ruby/models/accounting/account.rb | 74 +- .../models/accounting/account_type.rb | 2 +- lib/xero-ruby/models/accounting/accounts.rb | 5 +- .../models/accounting/accounts_payable.rb | 6 +- .../models/accounting/accounts_receivable.rb | 6 +- lib/xero-ruby/models/accounting/address.rb | 25 +- lib/xero-ruby/models/accounting/allocation.rb | 16 +- .../models/accounting/allocations.rb | 5 +- lib/xero-ruby/models/accounting/attachment.rb | 14 +- .../models/accounting/attachments.rb | 5 +- lib/xero-ruby/models/accounting/balances.rb | 6 +- .../models/accounting/bank_transaction.rb | 53 +- .../models/accounting/bank_transactions.rb | 5 +- .../models/accounting/bank_transfer.rb | 24 +- .../models/accounting/bank_transfers.rb | 5 +- .../models/accounting/batch_payment.rb | 40 +- .../accounting/batch_payment_details.rb | 12 +- .../models/accounting/batch_payments.rb | 5 +- lib/xero-ruby/models/accounting/bill.rb | 5 +- .../models/accounting/branding_theme.rb | 15 +- .../models/accounting/branding_themes.rb | 5 +- .../models/accounting/cis_org_setting.rb | 8 +- .../models/accounting/cis_setting.rb | 6 +- .../models/accounting/cis_settings.rb | 5 +- lib/xero-ruby/models/accounting/contact.rb | 78 +- .../models/accounting/contact_group.rb | 12 +- .../models/accounting/contact_groups.rb | 5 +- .../models/accounting/contact_person.rb | 10 +- lib/xero-ruby/models/accounting/contacts.rb | 5 +- .../models/accounting/country_code.rb | 2 +- .../models/accounting/credit_note.rb | 59 +- .../models/accounting/credit_notes.rb | 5 +- lib/xero-ruby/models/accounting/currencies.rb | 5 +- lib/xero-ruby/models/accounting/currency.rb | 7 +- .../models/accounting/currency_code.rb | 2 +- lib/xero-ruby/models/accounting/element.rb | 12 +- lib/xero-ruby/models/accounting/employee.rb | 19 +- lib/xero-ruby/models/accounting/employees.rb | 5 +- lib/xero-ruby/models/accounting/error.rb | 10 +- .../models/accounting/expense_claim.rb | 29 +- .../models/accounting/expense_claims.rb | 5 +- .../models/accounting/external_link.rb | 12 +- .../models/accounting/history_record.rb | 10 +- .../models/accounting/history_records.rb | 5 +- lib/xero-ruby/models/accounting/invoice.rb | 89 +- .../models/accounting/invoice_reminder.rb | 4 +- .../models/accounting/invoice_reminders.rb | 5 +- lib/xero-ruby/models/accounting/invoices.rb | 5 +- lib/xero-ruby/models/accounting/item.rb | 32 +- lib/xero-ruby/models/accounting/items.rb | 5 +- lib/xero-ruby/models/accounting/journal.rb | 43 +- .../models/accounting/journal_line.rb | 25 +- lib/xero-ruby/models/accounting/journals.rb | 5 +- .../models/accounting/line_amount_types.rb | 2 +- lib/xero-ruby/models/accounting/line_item.rb | 28 +- .../models/accounting/line_item_tracking.rb | 10 +- .../models/accounting/linked_transaction.rb | 32 +- .../models/accounting/linked_transactions.rb | 5 +- .../models/accounting/manual_journal.rb | 34 +- .../models/accounting/manual_journal_line.rb | 16 +- .../models/accounting/manual_journals.rb | 5 +- .../models/accounting/online_invoice.rb | 4 +- .../models/accounting/online_invoices.rb | 5 +- .../models/accounting/organisation.rb | 134 +- .../models/accounting/organisations.rb | 5 +- .../models/accounting/overpayment.rb | 43 +- .../models/accounting/overpayments.rb | 5 +- lib/xero-ruby/models/accounting/payment.rb | 57 +- .../models/accounting/payment_delete.rb | 4 +- .../models/accounting/payment_service.rb | 14 +- .../models/accounting/payment_services.rb | 5 +- .../models/accounting/payment_term.rb | 6 +- .../models/accounting/payment_term_type.rb | 2 +- lib/xero-ruby/models/accounting/payments.rb | 5 +- lib/xero-ruby/models/accounting/phone.rb | 16 +- lib/xero-ruby/models/accounting/prepayment.rb | 44 +- .../models/accounting/prepayments.rb | 5 +- lib/xero-ruby/models/accounting/purchase.rb | 10 +- .../models/accounting/purchase_order.rb | 62 +- .../models/accounting/purchase_orders.rb | 5 +- lib/xero-ruby/models/accounting/quote.rb | 46 +- .../accounting/quote_line_amount_types.rb | 2 +- .../models/accounting/quote_status_codes.rb | 2 +- lib/xero-ruby/models/accounting/quotes.rb | 5 +- lib/xero-ruby/models/accounting/receipt.rb | 39 +- lib/xero-ruby/models/accounting/receipts.rb | 5 +- .../models/accounting/repeating_invoice.rb | 35 +- .../models/accounting/repeating_invoices.rb | 5 +- lib/xero-ruby/models/accounting/report.rb | 16 +- .../models/accounting/report_attribute.rb | 6 +- .../models/accounting/report_cell.rb | 6 +- .../models/accounting/report_fields.rb | 7 +- lib/xero-ruby/models/accounting/report_row.rb | 7 +- .../models/accounting/report_rows.rb | 8 +- .../models/accounting/report_with_row.rb | 18 +- .../models/accounting/report_with_rows.rb | 5 +- lib/xero-ruby/models/accounting/reports.rb | 5 +- .../models/accounting/request_empty.rb | 4 +- lib/xero-ruby/models/accounting/row_type.rb | 2 +- .../accounting/sales_tracking_category.rb | 6 +- lib/xero-ruby/models/accounting/schedule.rb | 24 +- .../models/accounting/tax_component.rb | 10 +- lib/xero-ruby/models/accounting/tax_rate.rb | 104 +- lib/xero-ruby/models/accounting/tax_rates.rb | 5 +- lib/xero-ruby/models/accounting/tax_type.rb | 2 +- .../accounting/ten_nintey_nine_contact.rb | 46 +- lib/xero-ruby/models/accounting/time_zone.rb | 2 +- .../models/accounting/tracking_categories.rb | 5 +- .../models/accounting/tracking_category.rb | 17 +- .../models/accounting/tracking_option.rb | 13 +- .../models/accounting/tracking_options.rb | 5 +- lib/xero-ruby/models/accounting/user.rb | 23 +- lib/xero-ruby/models/accounting/users.rb | 5 +- .../models/accounting/validation_error.rb | 4 +- lib/xero-ruby/models/assets/asset.rb | 29 +- lib/xero-ruby/models/assets/asset_status.rb | 2 +- .../models/assets/asset_status_query_param.rb | 2 +- lib/xero-ruby/models/assets/asset_type.rb | 15 +- lib/xero-ruby/models/assets/assets.rb | 6 +- .../models/assets/book_depreciation_detail.rb | 16 +- .../assets/book_depreciation_setting.rb | 29 +- lib/xero-ruby/models/assets/error.rb | 12 +- .../assets/field_validation_errors_element.rb | 14 +- lib/xero-ruby/models/assets/pagination.rb | 8 +- .../resource_validation_errors_element.rb | 12 +- lib/xero-ruby/models/assets/setting.rb | 18 +- lib/xero-ruby/models/projects/amount.rb | 6 +- lib/xero-ruby/models/projects/charge_type.rb | 2 +- .../models/projects/currency_code.rb | 2 +- lib/xero-ruby/models/projects/error.rb | 6 +- lib/xero-ruby/models/projects/pagination.rb | 10 +- lib/xero-ruby/models/projects/project.rb | 30 +- .../projects/project_create_or_update.rb | 9 +- .../models/projects/project_patch.rb | 5 +- .../models/projects/project_status.rb | 2 +- lib/xero-ruby/models/projects/project_user.rb | 8 +- .../models/projects/project_users.rb | 6 +- lib/xero-ruby/models/projects/projects.rb | 6 +- lib/xero-ruby/models/projects/task.rb | 30 +- .../models/projects/task_create_or_update.rb | 8 +- lib/xero-ruby/models/projects/tasks.rb | 6 +- lib/xero-ruby/models/projects/time_entries.rb | 6 +- lib/xero-ruby/models/projects/time_entry.rb | 22 +- .../projects/time_entry_create_or_update.rb | 12 +- lib/xero-ruby/version.rb | 2 +- xero-ruby.gemspec | 4 +- 157 files changed, 2217 insertions(+), 2065 deletions(-) diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md index e182cad5..03b10705 100644 --- a/docs/accounting/AccountingApi.md +++ b/docs/accounting/AccountingApi.md @@ -150,7 +150,7 @@ Method | HTTP request | Description [**get_purchase_order_history**](AccountingApi.md#get_purchase_order_history) | **GET** /PurchaseOrders/{PurchaseOrderID}/History | Allows you to retrieve history for PurchaseOrder [**get_purchase_orders**](AccountingApi.md#get_purchase_orders) | **GET** /PurchaseOrders | Allows you to retrieve purchase orders [**get_quote**](AccountingApi.md#get_quote) | **GET** /Quotes/{QuoteID} | Allows you to retrieve a specified quote -[**get_quote_as_pdf**](AccountingApi.md#get_quote_as_pdf) | **GET** /Quotes/{QuotesID}/pdf | Allows you to retrieve quotes as PDF files +[**get_quote_as_pdf**](AccountingApi.md#get_quote_as_pdf) | **GET** /Quotes/{QuoteID}/pdf | Allows you to retrieve quotes as PDF files [**get_quote_attachment_by_file_name**](AccountingApi.md#get_quote_attachment_by_file_name) | **GET** /Quotes/{QuoteID}/Attachments/{FileName} | Allows you to retrieve Attachment on Quote by Filename [**get_quote_attachment_by_id**](AccountingApi.md#get_quote_attachment_by_id) | **GET** /Quotes/{QuoteID}/Attachments/{AttachmentID} | Allows you to retrieve specific Attachment on Quote [**get_quote_attachments**](AccountingApi.md#get_quote_attachments) | **GET** /Quotes/{QuoteID}/Attachments | Allows you to retrieve Attachments for Quotes @@ -186,7 +186,7 @@ Method | HTTP request | Description [**get_users**](AccountingApi.md#get_users) | **GET** /Users | Allows you to retrieve users [**update_account**](AccountingApi.md#update_account) | **POST** /Accounts/{AccountID} | Allows you to update a chart of accounts [**update_account_attachment_by_file_name**](AccountingApi.md#update_account_attachment_by_file_name) | **POST** /Accounts/{AccountID}/Attachments/{FileName} | Allows you to update Attachment on Account by Filename -[**update_bank_transaction**](AccountingApi.md#update_bank_transaction) | **POST** /BankTransactions/{BankTransactionID} | Allows you to update a single spend or receive money transaction +[**update_bank_transaction**](AccountingApi.md#update_bank_transaction) | **POST** /BankTransactions/{BankTransactionID} | [**update_bank_transaction_attachment_by_file_name**](AccountingApi.md#update_bank_transaction_attachment_by_file_name) | **POST** /BankTransactions/{BankTransactionID}/Attachments/{FileName} | Allows you to update an Attachment on BankTransaction by Filename [**update_bank_transfer_attachment_by_file_name**](AccountingApi.md#update_bank_transfer_attachment_by_file_name) | **POST** /BankTransfers/{BankTransferID}/Attachments/{FileName} | [**update_contact**](AccountingApi.md#update_contact) | **POST** /Contacts/{ContactID} | @@ -246,16 +246,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account = { code: "123456", name: "Foobar", type: AccountType.EXPENSE, description: "Hello World" } # Account | Account object in body of request - +api_instance = xero_client.asset_apiaccount = { code: "123456", name: "Foobar", type: XeroRuby::Accounting::AccountType::EXPENSE, description: "Hello World" } begin - #Allows you to create a new chart of accounts + # Allows you to create a new chart of accounts result = api_instance.create_account(xero_tenant_id, account) p result rescue XeroRuby::Accounting::ApiError => e @@ -309,7 +305,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -317,10 +313,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create Attachment on Account +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to create Attachment on Account result = api_instance.create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -376,7 +370,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -384,10 +378,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction file_name = 'xero-dev.jpg' # String | The name of the file being attached -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to createa an Attachment on BankTransaction by Filename +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to createa an Attachment on BankTransaction by Filename result = api_instance.create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -443,17 +435,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create history record for a bank transactions +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create history record for a bank transactions result = api_instance.create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -508,20 +498,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apibank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" } ], bank_account: { code: "000" }}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | BankTransactions with an array of BankTransaction objects in body of request opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to create one or more spend or receive money transaction + # Allows you to create one or more spend or receive money transaction result = api_instance.create_bank_transactions(xero_tenant_id, bank_transactions, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -577,16 +565,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfers = { bankTransfers:[ { fromBankAccount: { code:"000", accountID:"00000000-0000-0000-000-000000000000"}, toBankAccount:{ code:"001", accountID:"00000000-0000-0000-000-000000000000"}, amount:"50.00" } ] } # BankTransfers | BankTransfers with array of BankTransfer objects in request body - +api_instance = xero_client.asset_apibank_transfers = { bank_transfers: [{ from_bank_account: { code: "000", account_id: "00000000-0000-0000-000-000000000000" }, to_bank_account: { code: "001", account_id: "00000000-0000-0000-000-000000000000" }, amount: "50.00" }]} begin - #Allows you to create a bank transfers + # Allows you to create a bank transfers result = api_instance.create_bank_transfer(xero_tenant_id, bank_transfers) p result rescue XeroRuby::Accounting::ApiError => e @@ -640,7 +624,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -648,9 +632,7 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -body = 'body_example' # String | Byte array of file in body of request - -begin +body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -706,16 +688,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin result = api_instance.create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -770,19 +750,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apibatch_payments = { batch_payments: [{ account: { account_id: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [{ account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }}]}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -batch_payments = { batchPayments: [ { account: { accountID: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [ { account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoiceID: "00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, type: Invoice.TypeEnum.ACCPAY } } ] } ] } # BatchPayments | BatchPayments with an array of Payments in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Create one or many BatchPayments for invoices + # Create one or many BatchPayments for invoices result = api_instance.create_batch_payment(xero_tenant_id, batch_payments, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -837,17 +814,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for a Batch Payment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create a history record for a Batch Payment result = api_instance.create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -902,17 +877,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme -payment_service = { paymentServiceID:"dede7858-14e3-4a46-bf95-4d4cc491e645", paymentServiceName:"ACME Payments", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Pay Now" } # PaymentService | PaymentService object in body of request - +api_instance = xero_client.asset_apipayment_service = { payment_service_id: "dede7858-14e3-4a46-bf95-4d4cc491e645", payment_service_name: "ACME Payments", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Pay Now" } begin - #Allow for the creation of new custom payment service for specified Branding Theme + # Allow for the creation of new custom payment service for specified Branding Theme result = api_instance.create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) p result rescue XeroRuby::Accounting::ApiError => e @@ -967,7 +937,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -975,9 +945,7 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -body = 'body_example' # String | Byte array of file in body of request - -begin +body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -1033,16 +1001,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_groups = { contactGroups:[ { name:"VIPs" } ] } # ContactGroups | ContactGroups with an array of names in request body - +api_instance = xero_client.asset_apicontact_groups = { contact_groups: [{ name: "VIPs" }]} begin - #Allows you to create a contact group + # Allows you to create a contact group result = api_instance.create_contact_group(xero_tenant_id, contact_groups) p result rescue XeroRuby::Accounting::ApiError => e @@ -1096,17 +1060,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group -contacts = { contacts:[ { contactID:"a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID:"4e1753b9-018a-4775-b6aa-1bc7871cfee3" } ] } # Contacts | Contacts with array of contacts specifiying the ContactID to be added to ContactGroup in body of request - +api_instance = xero_client.asset_apicontacts = { contacts: [{ contactID: "a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID: "4e1753b9-018a-4775-b6aa-1bc7871cfee3" }]} begin - #Allows you to add Contacts to a Contact Group + # Allows you to add Contacts to a Contact Group result = api_instance.create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts) p result rescue XeroRuby::Accounting::ApiError => e @@ -1161,17 +1120,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an Contact +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to retrieve a history records of an Contact result = api_instance.create_contact_history(xero_tenant_id, contact_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -1226,19 +1183,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apicontacts = { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::DAYSAFTERBILLMONTH }}}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | Contacts with an array of Contact objects to create in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create a multiple contacts (bulk) in a Xero organisation + # Allows you to create a multiple contacts (bulk) in a Xero organisation result = api_instance.create_contacts(xero_tenant_id, contacts, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -1293,17 +1247,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -allocations = { allocations:[ { amount:1.0, date:"2019-03-05", invoice:{ invoiceID:"c45720a1-ade3-4a38-a064-d15489be6841", lineItems:[], type: Invoice.TypeEnum.ACCPAY, contact:{} } } ] } # Allocations | Allocations with array of Allocation object in body of request. - +api_instance = xero_client.asset_apiallocations = { allocations: [{ amount: 1.0, date: "2019-03-05", invoice: { invoice_id: "c45720a1-ade3-4a38-a064-d15489be6841", line_items: [], type: XeroRuby::Accounting::Invoice::ACCPAY, contact: {} }}]} begin - #Allows you to create Allocation on CreditNote + # Allows you to create Allocation on CreditNote result = api_instance.create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations) p result rescue XeroRuby::Accounting::ApiError => e @@ -1358,7 +1307,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -1370,9 +1319,8 @@ body = 'body_example' # String | Byte array of file in body of request opts = { include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice } - begin - #Allows you to create Attachments on CreditNote by file name + # Allows you to create Attachments on CreditNote by file name result = api_instance.create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -1429,17 +1377,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an CreditNote +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to retrieve a history records of an CreditNote result = api_instance.create_credit_note_history(xero_tenant_id, credit_note_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -1494,20 +1440,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apicredit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "430fa14a-f945-44d3-9f97-5df5e28441b8" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_notes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"430fa14a-f945-44d3-9f97-5df5e28441b8" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | Credit Notes with array of CreditNote object in body of request opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to create a credit note + # Allows you to create a credit note result = api_instance.create_credit_notes(xero_tenant_id, credit_notes, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -1563,14 +1507,10 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -currency = { code: CurrencyCode.USD, description:"United States Dollar" } # Currency | Currency obejct in the body of request - +api_instance = xero_client.asset_apicurrency = { code: XeroRuby::Accounting::CurrencyCode::USD, description: "United States Dollar" } begin result = api_instance.create_currency(xero_tenant_id, currency) p result @@ -1625,19 +1565,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiemployees = { employees: [{ first_name: "Nick", last_name: "Fury", externalink: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | Employees with array of Employee object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create new employees used in Xero payrun + # Allows you to create new employees used in Xero payrun result = api_instance.create_employees(xero_tenant_id, employees, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -1692,17 +1629,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history records of an ExpenseClaim +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create a history records of an ExpenseClaim result = api_instance.create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -1757,16 +1692,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claims = { expenseClaims:[ { status: ExpenseClaim.StatusEnum.SUBMITTED, user:{ userID:"d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts:[ { receiptID:"dc1c7f6d-0a4c-402f-acac-551d62ce5816", lineItems:[], contact: {}, user: {}, date: "2018-01-01" } ] } ] } # ExpenseClaims | ExpenseClaims with array of ExpenseClaim object in body of request - +api_instance = xero_client.asset_apiexpense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::SUBMITTED, user: { user_id: "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts: [{ receipt_id: "dc1c7f6d-0a4c-402f-acac-551d62ce5816", line_items: [], contact: {}, user: {}, date: "2018-01-01" }]}]} begin - #Allows you to retrieve expense claims + # Allows you to retrieve expense claims result = api_instance.create_expense_claims(xero_tenant_id, expense_claims) p result rescue XeroRuby::Accounting::ApiError => e @@ -1820,7 +1751,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -1832,9 +1763,8 @@ body = 'body_example' # String | Byte array of file in body of request opts = { include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice } - begin - #Allows you to create an Attachment on invoices or purchase bills by it's filename + # Allows you to create an Attachment on invoices or purchase bills by it's filename result = api_instance.create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -1891,17 +1821,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an invoice +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to retrieve a history records of an invoice result = api_instance.create_invoice_history(xero_tenant_id, invoice_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -1956,20 +1884,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiinvoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"000", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.DRAFT } ] } # Invoices | Invoices with an array of invoice objects in body of request opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to create one or more sales invoices or purchase bills + # Allows you to create one or more sales invoices or purchase bills result = api_instance.create_invoices(xero_tenant_id, invoices, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -2025,17 +1951,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for items +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create a history record for items result = api_instance.create_item_history(xero_tenant_id, item_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -2090,20 +2014,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiitems = { items: [{ code: "abcXYZ123", name: "HelloWorld11", description: "Foobar", inventory_asset_account_code: "140", purchase_details: { cogs_account_code: "500" }}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -items = { items:[ { code:"abcXYZ123", name:"HelloWorld11", description:"Foobar", inventoryAssetAccountCode:"140", purchaseDetails: {cOGSAccountCode:"500"} } ] } # Items | Items with an array of Item objects in body of request opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to create one or more items + # Allows you to create one or more items result = api_instance.create_items(xero_tenant_id, items, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -2159,16 +2081,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction = { sourceTransactionID:"00000000-0000-0000-000-000000000000", sourceLineItemID:"00000000-0000-0000-000-000000000000"} # LinkedTransaction | LinkedTransaction object in body of request - +api_instance = xero_client.asset_apilinked_transaction = { source_transaction_id: "00000000-0000-0000-000-000000000000", source_line_item_id: "00000000-0000-0000-000-000000000000" } begin - #Allows you to create linked transactions (billable expenses) + # Allows you to create linked transactions (billable expenses) result = api_instance.create_linked_transaction(xero_tenant_id, linked_transaction) p result rescue XeroRuby::Accounting::ApiError => e @@ -2222,7 +2140,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -2230,10 +2148,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create a specified Attachment on ManualJournal by file name +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to create a specified Attachment on ManualJournal by file name result = api_instance.create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -2289,19 +2205,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apimanual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" }, { line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpson", option: "Bart" }] }]}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | ManualJournals array with ManualJournal object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create one or more manual journals + # Allows you to create one or more manual journals result = api_instance.create_manual_journals(xero_tenant_id, manual_journals, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -2356,20 +2269,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiallocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, amount: 1.0, date: "2019-03-12" }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment -allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, amount:1.0, date:"2019-03-12" } ] } # Allocations | Allocations array with Allocation object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create a single allocation for an overpayment + # Allows you to create a single allocation for an overpayment result = api_instance.create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -2425,17 +2334,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create history records of an Overpayment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create history records of an Overpayment result = api_instance.create_overpayment_history(xero_tenant_id, overpayment_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -2490,16 +2397,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment = { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } # Payment | Request body with a single Payment object - +api_instance = xero_client.asset_apiinvoice = { invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 } begin - #Allows you to create a single payment for invoices or credit notes + # Allows you to create a single payment for invoices or credit notes result = api_instance.create_payment(xero_tenant_id, payment) p result rescue XeroRuby::Accounting::ApiError => e @@ -2553,17 +2456,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for a payment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create a history record for a payment result = api_instance.create_payment_history(xero_tenant_id, payment_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -2618,16 +2519,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_services = { paymentServices:[ { paymentServiceName:"PayUpNow", paymentServiceUrl:"https://www.payupnow.com/", payNowText:"Time To Pay" } ] } # PaymentServices | PaymentServices array with PaymentService object in body of request - +api_instance = xero_client.asset_apipayment_services = { payment_services: [{ payment_service_name: "PayUpNow", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Time To Pay" }]} begin - #Allows you to create payment services + # Allows you to create payment services result = api_instance.create_payment_service(xero_tenant_id, payment_services) p result rescue XeroRuby::Accounting::ApiError => e @@ -2681,19 +2578,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apipayments = { payments: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payments = { payments:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: Invoice.TypeEnum.ACCPAY }, account:{ code:"970" }, date:"2019-03-12", amount:1.0 } ] } # Payments | Payments array with Payment object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create multiple payments for invoices or credit notes + # Allows you to create multiple payments for invoices or credit notes result = api_instance.create_payments(xero_tenant_id, payments, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -2748,20 +2642,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiallocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: null }, amount: 1.0, date: "2019-03-13" }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Prepayment -allocations = { allocations:[ { invoice:{ invoiceID:"00000000-0000-0000-000-000000000000", lineItems:[], contact: {}, type: null }, amount:1.0, date:"2019-03-13" } ] } # Allocations | Allocations with an array of Allocation object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create an Allocation for prepayments + # Allows you to create an Allocation for prepayments result = api_instance.create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -2817,17 +2707,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create a history record for an Prepayment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create a history record for an Prepayment result = api_instance.create_prepayment_history(xero_tenant_id, prepayment_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -2882,17 +2770,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create HistoryRecord for purchase orders +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create HistoryRecord for purchase orders result = api_instance.create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -2947,19 +2833,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apipurchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, account_code: "710" }], date: "2019-03-13" }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_orders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | PurchaseOrders with an array of PurchaseOrder object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create one or more purchase orders + # Allows you to create one or more purchase orders result = api_instance.create_purchase_orders(xero_tenant_id, purchase_orders, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -3014,7 +2897,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -3022,10 +2905,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create Attachment on Quote +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to create Attachment on Quote result = api_instance.create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -3081,17 +2962,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an quote +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to retrieve a history records of an quote result = api_instance.create_quote_history(xero_tenant_id, quote_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -3146,19 +3025,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiquotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date:"2020-02-01" }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | Quotes with an array of Quote object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create one or more quotes + # Allows you to create one or more quotes result = api_instance.create_quotes(xero_tenant_id, quotes, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -3213,19 +3089,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apireceipts = { receipts: [ { contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400", tax_type: XeroRuby::Accounting::TaxType::NONE, line_amount: 40.0 }], user: { user_id: "00000000-0000-0000-000-000000000000" }, line_amount_types: XeroRuby::Accounting::INCLUSIVE, status: XeroRuby::Accounting::Receipt::DRAFT, date: nil }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipts = { receipts:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400", taxType:"NONE", lineAmount:40.0 } ], user:{ userID:"00000000-0000-0000-000-000000000000" }, lineAmountTypes: LineAmountTypes.Inclusive, status: Receipt.StatusEnum.DRAFT , date: null} ] } # Receipts | Receipts with an array of Receipt object in body of request opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to create draft expense claim receipts for any user + # Allows you to create draft expense claim receipts for any user result = api_instance.create_receipt(xero_tenant_id, receipts, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -3280,7 +3153,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -3288,10 +3161,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create Attachment on expense claim receipts by file name +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to create Attachment on expense claim receipts by file name result = api_instance.create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -3347,17 +3218,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to retrieve a history records of an Receipt +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to retrieve a history records of an Receipt result = api_instance.create_receipt_history(xero_tenant_id, receipt_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -3412,7 +3281,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -3420,10 +3289,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to create attachment on repeating invoices by file name +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to create attachment on repeating invoices by file name result = api_instance.create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -3479,17 +3346,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request - -begin - #Allows you to create history for a repeating invoice +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin + # Allows you to create history for a repeating invoice result = api_instance.create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) p result rescue XeroRuby::Accounting::ApiError => e @@ -3544,16 +3409,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tax_rates = { taxRates:[ { name:"CA State Tax", taxComponents:[ { name:"State Tax", rate:2.25 } ] } ] } # TaxRates | TaxRates array with TaxRate object in body of request - +api_instance = xero_client.asset_apitax_rates = { tax_rates: [{ name: "CA State Tax", tax_components: [{ name: "State Tax", rate: 2.25 }]}]} begin - #Allows you to create one or more Tax Rates + # Allows you to create one or more Tax Rates result = api_instance.create_tax_rates(xero_tenant_id, tax_rates) p result rescue XeroRuby::Accounting::ApiError => e @@ -3607,16 +3468,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category = { name:"FooBar" } # TrackingCategory | TrackingCategory object in body of request - -begin - #Allows you to create tracking categories +tracking_category = { name: "FooBar" } # TrackingCategory | TrackingCategory object in body of requestbegin + # Allows you to create tracking categories result = api_instance.create_tracking_category(xero_tenant_id, tracking_category) p result rescue XeroRuby::Accounting::ApiError => e @@ -3670,17 +3529,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_option = { name:"Bar" } # TrackingOption | TrackingOption object in body of request - -begin - #Allows you to create options for a specified tracking category +tracking_option = { name: " Bar" } # TrackingOption | TrackingOption object in body of requestbegin + # Allows you to create options for a specified tracking category result = api_instance.create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option) p result rescue XeroRuby::Accounting::ApiError => e @@ -3735,16 +3592,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object - -begin - #Allows you to delete a chart of accounts +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single objectbegin + # Allows you to delete a chart of accounts result = api_instance.delete_account(xero_tenant_id, account_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -3798,17 +3653,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to delete a specific Contact from a Contact Group +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin + # Allows you to delete a specific Contact from a Contact Group api_instance.delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contact: #{e}" @@ -3862,16 +3715,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group - -begin - #Allows you to delete all Contacts from a Contact Group +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Groupbegin + # Allows you to delete all Contacts from a Contact Group api_instance.delete_contact_group_contacts(xero_tenant_id, contact_group_id) rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contacts: #{e}" @@ -3924,16 +3775,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item - -begin - #Allows you to delete a specified item +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Itembegin + # Allows you to delete a specified item api_instance.delete_item(xero_tenant_id, item_id) rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_item: #{e}" @@ -3986,16 +3835,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction - -begin - #Allows you to delete a specified linked transactions (billable expenses) +linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransactionbegin + # Allows you to delete a specified linked transactions (billable expenses) api_instance.delete_linked_transaction(xero_tenant_id, linked_transaction_id) rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_linked_transaction: #{e}" @@ -4048,17 +3895,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -payment_delete = { status:"DELETED" } # PaymentDelete | - -begin - #Allows you to update a specified payment for invoices and credit notes +payment_delete = { status: "DELETED" } # PaymentDelete | begin + # Allows you to update a specified payment for invoices and credit notes result = api_instance.delete_payment(xero_tenant_id, payment_id, payment_delete) p result rescue XeroRuby::Accounting::ApiError => e @@ -4113,16 +3958,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory - -begin - #Allows you to delete tracking categories +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategorybegin + # Allows you to delete tracking categories result = api_instance.delete_tracking_category(xero_tenant_id, tracking_category_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -4176,17 +4019,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option - -begin - #Allows you to delete a specified option for a specified tracking category +tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Optionbegin + # Allows you to delete a specified option for a specified tracking category result = api_instance.delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -4241,17 +4082,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -request_empty = {} # RequestEmpty | - -begin - #Allows you to email a copy of invoice to related Contact +request_empty = {} # RequestEmpty | begin + # Allows you to email a copy of invoice to related Contact api_instance.email_invoice(xero_tenant_id, invoice_id, request_empty) rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->email_invoice: #{e}" @@ -4305,16 +4144,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object - -begin - #Allows you to retrieve a single chart of accounts +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single objectbegin + # Allows you to retrieve a single chart of accounts result = api_instance.get_account(xero_tenant_id, account_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -4368,7 +4205,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -4376,10 +4213,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object file_name = 'xero-dev.jpg' # String | Name of the attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachment on Account by Filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachment on Account by Filename result = api_instance.get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -4435,7 +4270,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -4443,10 +4278,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specific Attachment on Account +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve specific Attachment on Account result = api_instance.get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -4502,16 +4335,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object - -begin - #Allows you to retrieve Attachments for accounts +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account objectbegin + # Allows you to retrieve Attachments for accounts result = api_instance.get_account_attachments(xero_tenant_id, account_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -4565,7 +4396,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -4573,12 +4404,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Account.StatusEnum.ACTIVE + '\" AND Type==\"' + Account.BankAccountTypeEnum.BANK + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::Account::ACTIVE}", # String | Filter by an any element + order: 'Name ASC' # String | Order by an any element } - begin - #Allows you to retrieve the full chart of accounts + # Allows you to retrieve the full chart of accounts result = api_instance.get_accounts(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -4634,7 +4466,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -4644,9 +4476,8 @@ bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero gene opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve a single spend or receive money transaction + # Allows you to retrieve a single spend or receive money transaction result = api_instance.get_bank_transaction(xero_tenant_id, bank_transaction_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -4701,7 +4532,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -4709,10 +4540,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction file_name = 'xero-dev.jpg' # String | The name of the file being attached -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on BankTransaction by Filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on BankTransaction by Filename result = api_instance.get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -4768,7 +4597,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -4776,10 +4605,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on a specific BankTransaction +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on a specific BankTransaction result = api_instance.get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -4835,16 +4662,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction - -begin - #Allows you to retrieve any attachments to bank transactions +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transactionbegin + # Allows you to retrieve any attachments to bank transactions result = api_instance.get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -4898,7 +4723,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -4906,14 +4731,17 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + BankTransaction.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::BankTransaction::AUTHORISED}", # String | Filter by an any element + order: 'Type ASC', # String | Order by an any element + page: 1, # Integer | Up to 100 bank transactions will be returned in a single API call with line items details + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve any spend or receive money transactions + # Allows you to retrieve any spend or receive money transactions result = api_instance.get_bank_transactions(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -4971,16 +4799,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction - -begin - #Allows you to retrieve history from a bank transactions +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transactionbegin + # Allows you to retrieve history from a bank transactions result = api_instance.get_bank_transactions_history(xero_tenant_id, bank_transaction_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5034,16 +4860,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer - -begin - #Allows you to retrieve any bank transfers +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin + # Allows you to retrieve any bank transfers result = api_instance.get_bank_transfer(xero_tenant_id, bank_transfer_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5097,7 +4921,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -5105,10 +4929,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on BankTransfer by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on BankTransfer by file name result = api_instance.get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -5164,7 +4986,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -5172,10 +4994,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an Attachment to a bank transfer -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on BankTransfer +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on BankTransfer result = api_instance.get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -5231,16 +5051,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer - -begin - #Allows you to retrieve Attachments from bank transfers +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin + # Allows you to retrieve Attachments from bank transfers result = api_instance.get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5294,16 +5112,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer - -begin - #Allows you to retrieve history from a bank transfers +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin + # Allows you to retrieve history from a bank transfers result = api_instance.get_bank_transfer_history(xero_tenant_id, bank_transfer_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5357,7 +5173,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -5365,12 +5181,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + BankTransfer.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + + where: 'HasAttachments==true', # String | Filter by an any element + order: 'Amount ASC' # String | Order by an any element } - begin - #Allows you to retrieve all bank transfers + # Allows you to retrieve all bank transfers result = api_instance.get_bank_transfers(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -5426,16 +5243,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment - -begin - #Allows you to retrieve history from a Batch Payment +batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPaymentbegin + # Allows you to retrieve history from a Batch Payment result = api_instance.get_batch_payment_history(xero_tenant_id, batch_payment_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5489,7 +5304,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -5497,12 +5312,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + BatchPayment.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::BatchPayment::AUTHORISED}", # String | Filter by an any element + order: 'Date ASC' # String | Order by an any element } - begin - #Retrieve either one or many BatchPayments for invoices + # Retrieve either one or many BatchPayments for invoices result = api_instance.get_batch_payments(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -5558,16 +5374,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme - -begin - #Allows you to retrieve a specific BrandingThemes +branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Themebegin + # Allows you to retrieve a specific BrandingThemes result = api_instance.get_branding_theme(xero_tenant_id, branding_theme_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5621,16 +5435,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme - -begin - #Allows you to retrieve the Payment services for a Branding Theme +branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Themebegin + # Allows you to retrieve the Payment services for a Branding Theme result = api_instance.get_branding_theme_payment_services(xero_tenant_id, branding_theme_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5684,15 +5496,13 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve all the BrandingThemes +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin + # Allows you to retrieve all the BrandingThemes result = api_instance.get_branding_themes(xero_tenant_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5745,16 +5555,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve a single contacts in a Xero organisation +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin + # Allows you to retrieve a single contacts in a Xero organisation result = api_instance.get_contact(xero_tenant_id, contact_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -5808,7 +5616,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -5816,10 +5624,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on Contacts by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on Contacts by file name result = api_instance.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -5875,7 +5681,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -5883,10 +5689,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on Contacts +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on Contacts result = api_instance.get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -5942,16 +5746,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve, add and update contacts in a Xero organisation +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin + # Allows you to retrieve, add and update contacts in a Xero organisation result = api_instance.get_contact_attachments(xero_tenant_id, contact_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6005,16 +5807,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_number = 'SB2' # String | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). - -begin - #Allows you to retrieve a single contact by Contact Number in a Xero organisation +contact_number = 'SB2' # String | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).begin + # Allows you to retrieve a single contact by Contact Number in a Xero organisation result = api_instance.get_contact_by_contact_number(xero_tenant_id, contact_number) p result rescue XeroRuby::Accounting::ApiError => e @@ -6068,16 +5868,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve CISSettings for a contact in a Xero organisation +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin + # Allows you to retrieve CISSettings for a contact in a Xero organisation result = api_instance.get_contact_cis_settings(xero_tenant_id, contact_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6131,16 +5929,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group - -begin - #Allows you to retrieve a unique Contact Group by ID +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Groupbegin + # Allows you to retrieve a unique Contact Group by ID result = api_instance.get_contact_group(xero_tenant_id, contact_group_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6194,19 +5990,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { - where: 'Status==\"' + ContactGroup.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + where: "Status==#{XeroRuby::Accounting::ContactGroup::ACTIVE}", # String | Filter by an any element + order: 'Name ASC' # String | Order by an any element } - begin - #Allows you to retrieve the ContactID and Name of all the contacts in a contact group + # Allows you to retrieve the ContactID and Name of all the contacts in a contact group result = api_instance.get_contact_groups(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -6261,16 +6057,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact - -begin - #Allows you to retrieve a history records of an Contact +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin + # Allows you to retrieve a history records of an Contact result = api_instance.get_contact_history(xero_tenant_id, contact_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6324,7 +6118,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -6332,15 +6126,19 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Contact.ContactStatusEnum.ACTIVE + '\"', # String | Filter by an any element + + where: "ContactStatus==#{XeroRuby::Accounting::Contact::ACTIVE}", # String | Filter by an any element + order: 'Name ASC', # String | Order by an any element + i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma separated list of ContactIDs. Allows you to retrieve a specific set of contacts in a single call. + page: 1, # Integer | e.g. page=1 - Up to 100 contacts will be returned in a single API call. + include_archived: true # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response } - begin - #Allows you to retrieve all contacts in a Xero organisation + # Allows you to retrieve all contacts in a Xero organisation result = api_instance.get_contacts(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -6399,7 +6197,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -6409,9 +6207,8 @@ credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identif opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve a specific credit note + # Allows you to retrieve a specific credit note result = api_instance.get_credit_note(xero_tenant_id, credit_note_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -6466,16 +6263,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note - -begin - #Allows you to retrieve Credit Note as PDF files +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin + # Allows you to retrieve Credit Note as PDF files result = api_instance.get_credit_note_as_pdf(xero_tenant_id, credit_note_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6529,7 +6324,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -6537,10 +6332,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on CreditNote by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on CreditNote by file name result = api_instance.get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -6596,7 +6389,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -6604,10 +6397,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on CreditNote +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on CreditNote result = api_instance.get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -6663,16 +6454,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note - -begin - #Allows you to retrieve Attachments for credit notes +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin + # Allows you to retrieve Attachments for credit notes result = api_instance.get_credit_note_attachments(xero_tenant_id, credit_note_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6726,16 +6515,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note - -begin - #Allows you to retrieve a history records of an CreditNote +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin + # Allows you to retrieve a history records of an CreditNote result = api_instance.get_credit_note_history(xero_tenant_id, credit_note_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6789,7 +6576,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -6797,14 +6584,17 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + CreditNote.StatusEnum.DRAFT + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::CreditNote::DRAFT}", # String | Filter by an any element + order: 'CreditNoteNumber ASC', # String | Order by an any element + page: 1, # Integer | e.g. page=1 – Up to 100 credit notes will be returned in a single API call with line items shown for each credit note + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve any credit notes + # Allows you to retrieve any credit notes result = api_instance.get_credit_notes(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -6862,19 +6652,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { - where: 'Status==\"' + Currency.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + where: "Status==#{XeroRuby::Accounting::Currency::ACTIVE}", # String | Filter by an any element + order: 'Code ASC' # String | Order by an any element } - begin - #Allows you to retrieve currencies for your organisation + # Allows you to retrieve currencies for your organisation result = api_instance.get_currencies(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -6929,16 +6719,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -employee_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Employee - -begin - #Allows you to retrieve a specific employee used in Xero payrun +employee_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Employeebegin + # Allows you to retrieve a specific employee used in Xero payrun result = api_instance.get_employee(xero_tenant_id, employee_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -6992,7 +6780,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7000,12 +6788,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Employee.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::Employee::ACTIVE}", # String | Filter by an any element + order: 'ASC' # String | Order by an any element } - begin - #Allows you to retrieve employees used in Xero payrun + # Allows you to retrieve employees used in Xero payrun result = api_instance.get_employees(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -7061,16 +6850,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim - -begin - #Allows you to retrieve a specified expense claim +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaimbegin + # Allows you to retrieve a specified expense claim result = api_instance.get_expense_claim(xero_tenant_id, expense_claim_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -7124,16 +6911,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim - -begin - #Allows you to retrieve a history records of an ExpenseClaim +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaimbegin + # Allows you to retrieve a history records of an ExpenseClaim result = api_instance.get_expense_claim_history(xero_tenant_id, expense_claim_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -7187,7 +6972,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7195,12 +6980,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + ExpenseClaim.StatusEnum.SUBMITTED + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::ExpenseClaim::SUBMITTED}", # String | Filter by an any element + order: 'Status ASC' # String | Order by an any element } - begin - #Allows you to retrieve expense claims + # Allows you to retrieve expense claims result = api_instance.get_expense_claims(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -7256,7 +7042,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7266,9 +7052,8 @@ invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve a specified sales invoice or purchase bill + # Allows you to retrieve a specified sales invoice or purchase bill result = api_instance.get_invoice(xero_tenant_id, invoice_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -7323,16 +7108,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve invoices or purchase bills as PDF files +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin + # Allows you to retrieve invoices or purchase bills as PDF files result = api_instance.get_invoice_as_pdf(xero_tenant_id, invoice_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -7386,7 +7169,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7394,10 +7177,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice file_name = 'xero-dev.jpg' # String | Name of the file you are attaching -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachment on invoices or purchase bills by it's filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachment on invoices or purchase bills by it's filename result = api_instance.get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -7453,7 +7234,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7461,10 +7242,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID result = api_instance.get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -7520,16 +7299,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve Attachments on invoices or purchase bills +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin + # Allows you to retrieve Attachments on invoices or purchase bills result = api_instance.get_invoice_attachments(xero_tenant_id, invoice_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -7583,16 +7360,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve a history records of an invoice +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin + # Allows you to retrieve a history records of an invoice result = api_instance.get_invoice_history(xero_tenant_id, invoice_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -7646,15 +7421,13 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve invoice reminder settings +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin + # Allows you to retrieve invoice reminder settings result = api_instance.get_invoice_reminders(xero_tenant_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -7707,7 +7480,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7715,20 +7488,29 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Invoice.StatusEnum.DRAFT + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::Invoice::DRAFT}", # String | Filter by an any element + order: 'InvoiceNumber ASC', # String | Order by an any element + i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma-separated list of InvoicesIDs. + invoice_numbers: ['null'], # Array | Filter by a comma-separated list of InvoiceNumbers. + contact_i_ds: ['00000000-0000-0000-000-000000000000,00000000-0000-0000-000-000000000000'], # Array | Filter by a comma-separated list of ContactIDs. + statuses: ['null'], # Array | Filter by a comma-separated list Statuses. For faster response times we recommend using these explicit parameters instead of passing OR conditions into the Where filter. + page: 1, # Integer | e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice + include_archived: true, # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response + created_by_my_app: false, # Boolean | When set to true you'll only retrieve Invoices created by your app + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve any sales invoices or purchase bills + # Allows you to retrieve any sales invoices or purchase bills result = api_instance.get_invoices(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -7792,7 +7574,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7802,9 +7584,8 @@ item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve a specified item + # Allows you to retrieve a specified item result = api_instance.get_item(xero_tenant_id, item_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -7859,16 +7640,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item - -begin - #Allows you to retrieve history for items +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Itembegin + # Allows you to retrieve history for items result = api_instance.get_item_history(xero_tenant_id, item_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -7922,7 +7701,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -7930,13 +7709,15 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'IsSold==true', # String | Filter by an any element + order: 'Code ASC', # String | Order by an any element + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve any items + # Allows you to retrieve any items result = api_instance.get_items(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -7993,16 +7774,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Journal - -begin - #Allows you to retrieve a specified journals. +journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Journalbegin + # Allows you to retrieve a specified journals. result = api_instance.get_journal(xero_tenant_id, journal_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8056,7 +7835,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -8064,12 +7843,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + offset: 10, # Integer | Offset by a specified journal number. e.g. journals with a JournalNumber greater than the offset will be returned + payments_only: true # Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. } - begin - #Allows you to retrieve any journals. + # Allows you to retrieve any journals. result = api_instance.get_journals(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -8125,16 +7905,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction - -begin - #Allows you to retrieve a specified linked transactions (billable expenses) +linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransactionbegin + # Allows you to retrieve a specified linked transactions (billable expenses) result = api_instance.get_linked_transaction(xero_tenant_id, linked_transaction_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8188,7 +7966,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -8196,15 +7974,19 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { page: 1, # Integer | Up to 100 linked transactions will be returned in a single API call. Use the page parameter to specify the page to be returned e.g. page=1. + linked_transaction_id: '00000000-0000-0000-000-000000000000', # String | The Xero identifier for an Linked Transaction + source_transaction_id: '00000000-0000-0000-000-000000000000', # String | Filter by the SourceTransactionID. Get the linked transactions created from a particular ACCPAY invoice + contact_id: '00000000-0000-0000-000-000000000000', # String | Filter by the ContactID. Get all the linked transactions that have been assigned to a particular customer. + status: 'APPROVED', # String | Filter by the combination of ContactID and Status. Get the linked transactions associaed to a customer and with a status + target_transaction_id: '00000000-0000-0000-000-000000000000' # String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice } - begin - #Retrieve linked transactions (billable expenses) + # Retrieve linked transactions (billable expenses) result = api_instance.get_linked_transactions(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -8263,16 +8045,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal - -begin - #Allows you to retrieve a specified manual journals +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournalbegin + # Allows you to retrieve a specified manual journals result = api_instance.get_manual_journal(xero_tenant_id, manual_journal_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8326,7 +8106,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -8334,10 +8114,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specified Attachment on ManualJournal by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve specified Attachment on ManualJournal by file name result = api_instance.get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -8393,7 +8171,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -8401,10 +8179,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specified Attachment on ManualJournals +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve specified Attachment on ManualJournals result = api_instance.get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -8460,16 +8236,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal - -begin - #Allows you to retrieve Attachment for manual journals +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournalbegin + # Allows you to retrieve Attachment for manual journals result = api_instance.get_manual_journal_attachments(xero_tenant_id, manual_journal_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8523,7 +8297,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -8531,13 +8305,15 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + ManualJournal.StatusEnum.DRAFT + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::ManualJournal::DRAFT}", # String | Filter by an any element + order: 'Date ASC', # String | Order by an any element + page: 1 # Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment } - begin - #Allows you to retrieve any manual journals + # Allows you to retrieve any manual journals result = api_instance.get_manual_journals(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -8594,16 +8370,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice - -begin - #Allows you to retrieve a URL to an online invoice +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin + # Allows you to retrieve a URL to an online invoice result = api_instance.get_online_invoice(xero_tenant_id, invoice_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8657,16 +8431,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -organisation_id = '00000000-0000-0000-000-000000000000' # String | The unique Xero identifier for an organisation - -begin - #Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. +organisation_id = '00000000-0000-0000-000-000000000000' # String | The unique Xero identifier for an organisationbegin + # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. result = api_instance.get_organisation_cis_settings(xero_tenant_id, organisation_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8720,15 +8492,13 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve Organisation details +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin + # Allows you to retrieve Organisation details result = api_instance.get_organisations(xero_tenant_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8781,16 +8551,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment - -begin - #Allows you to retrieve a specified overpayments +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpaymentbegin + # Allows you to retrieve a specified overpayments result = api_instance.get_overpayment(xero_tenant_id, overpayment_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8844,16 +8612,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment - -begin - #Allows you to retrieve a history records of an Overpayment +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpaymentbegin + # Allows you to retrieve a history records of an Overpayment result = api_instance.get_overpayment_history(xero_tenant_id, overpayment_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -8907,7 +8673,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -8915,14 +8681,17 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Overpayment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::Overpayment::AUTHORISED}", # String | Filter by an any element + order: 'RemainingCredit ASC', # String | Order by an any element + page: 1, # Integer | e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve overpayments + # Allows you to retrieve overpayments result = api_instance.get_overpayments(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -8980,16 +8749,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment - -begin - #Allows you to retrieve a specified payment for invoices and credit notes +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Paymentbegin + # Allows you to retrieve a specified payment for invoices and credit notes result = api_instance.get_payment(xero_tenant_id, payment_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9043,16 +8810,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment - -begin - #Allows you to retrieve history records of a payment +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Paymentbegin + # Allows you to retrieve history records of a payment result = api_instance.get_payment_history(xero_tenant_id, payment_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9106,15 +8871,13 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve payment services +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin + # Allows you to retrieve payment services result = api_instance.get_payment_services(xero_tenant_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9167,7 +8930,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -9175,13 +8938,15 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Payment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::Payment::AUTHORISED}", # String | Filter by an any element + order: 'Amount ASC', # String | Order by an any element + page: 1 # Integer | Up to 100 payments will be returned in a single API call } - begin - #Allows you to retrieve payments for invoices and credit notes + # Allows you to retrieve payments for invoices and credit notes result = api_instance.get_payments(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -9238,16 +9003,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment - -begin - #Allows you to retrieve a specified prepayments +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePaymentbegin + # Allows you to retrieve a specified prepayments result = api_instance.get_prepayment(xero_tenant_id, prepayment_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9301,16 +9064,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment - -begin - #Allows you to retrieve a history records of an Prepayment +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePaymentbegin + # Allows you to retrieve a history records of an Prepayment result = api_instance.get_prepayment_history(xero_tenant_id, prepayment_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9364,7 +9125,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -9372,14 +9133,17 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Prepayment.StatusEnum.AUTHORISED + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::Prepayment::AUTHORISED}", # String | Filter by an any element + order: 'Reference ASC', # String | Order by an any element + page: 1, # Integer | e.g. page=1 – Up to 100 prepayments will be returned in a single API call with line items shown for each overpayment + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve prepayments + # Allows you to retrieve prepayments result = api_instance.get_prepayments(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -9437,16 +9201,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder - -begin - #Allows you to retrieve a specified purchase orders +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrderbegin + # Allows you to retrieve a specified purchase orders result = api_instance.get_purchase_order(xero_tenant_id, purchase_order_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9500,16 +9262,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Order - -begin - #Allows you to retrieve purchase orders as PDF files +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Orderbegin + # Allows you to retrieve purchase orders as PDF files result = api_instance.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9563,16 +9323,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_number = 'PO1234' # String | Unique identifier for a PurchaseOrder - -begin - #Allows you to retrieve a specified purchase orders +purchase_order_number = 'PO1234' # String | Unique identifier for a PurchaseOrderbegin + # Allows you to retrieve a specified purchase orders result = api_instance.get_purchase_order_by_number(xero_tenant_id, purchase_order_number) p result rescue XeroRuby::Accounting::ApiError => e @@ -9626,16 +9384,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder - -begin - #Allows you to retrieve history for PurchaseOrder +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrderbegin + # Allows you to retrieve history for PurchaseOrder result = api_instance.get_purchase_order_history(xero_tenant_id, purchase_order_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9689,7 +9445,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -9697,15 +9453,19 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + status: 'SUBMITTED', # String | Filter by purchase order status + date_from: '2019-12-01', # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + date_to: '2019-12-31', # String | Filter by purchase order date (e.g. GET https://.../PurchaseOrders?DateFrom=2015-12-01&DateTo=2015-12-31 + order: 'PurchaseOrderNumber ASC', # String | Order by an any element + page: 1 # Integer | To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. } - begin - #Allows you to retrieve purchase orders + # Allows you to retrieve purchase orders result = api_instance.get_purchase_orders(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -9764,16 +9524,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote - -begin - #Allows you to retrieve a specified quote +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin + # Allows you to retrieve a specified quote result = api_instance.get_quote(xero_tenant_id, quote_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9827,16 +9585,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote - -begin - #Allows you to retrieve quotes as PDF files +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin + # Allows you to retrieve quotes as PDF files result = api_instance.get_quote_as_pdf(xero_tenant_id, quote_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -9890,7 +9646,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -9898,10 +9654,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object file_name = 'xero-dev.jpg' # String | Name of the attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachment on Quote by Filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachment on Quote by Filename result = api_instance.get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -9957,7 +9711,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -9965,10 +9719,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specific Attachment on Quote +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve specific Attachment on Quote result = api_instance.get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -10024,16 +9776,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object - -begin - #Allows you to retrieve Attachments for Quotes +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote objectbegin + # Allows you to retrieve Attachments for Quotes result = api_instance.get_quote_attachments(xero_tenant_id, quote_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -10087,16 +9837,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote - -begin - #Allows you to retrieve a history records of an quote +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin + # Allows you to retrieve a history records of an quote result = api_instance.get_quote_history(xero_tenant_id, quote_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -10150,7 +9898,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -10158,18 +9906,25 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + date_from: Date.parse('2013-10-20'), # Date | Filter for quotes after a particular date + date_to: Date.parse('2013-10-20'), # Date | Filter for quotes before a particular date + expiry_date_from: Date.parse('2013-10-20'), # Date | Filter for quotes expiring after a particular date + expiry_date_to: Date.parse('2013-10-20'), # Date | Filter for quotes before a particular date + contact_id: '00000000-0000-0000-000-000000000000', # String | Filter for quotes belonging to a particular contact + status: 'status_example', # String | Filter for quotes of a particular Status + page: 1, # Integer | e.g. page=1 – Up to 100 Quotes will be returned in a single API call with line items shown for each quote + order: 'ASC' # String | Order by an any element } - begin - #Allows you to retrieve any sales quotes + # Allows you to retrieve any sales quotes result = api_instance.get_quotes(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -10231,7 +9986,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -10241,9 +9996,8 @@ receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve a specified draft expense claim receipts + # Allows you to retrieve a specified draft expense claim receipts result = api_instance.get_receipt(xero_tenant_id, receipt_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -10298,7 +10052,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -10306,10 +10060,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on expense claim receipts by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on expense claim receipts by file name result = api_instance.get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -10365,7 +10117,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -10373,10 +10125,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve Attachments on expense claim receipts by ID +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve Attachments on expense claim receipts by ID result = api_instance.get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -10432,16 +10182,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt - -begin - #Allows you to retrieve Attachments for expense claim receipts +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receiptbegin + # Allows you to retrieve Attachments for expense claim receipts result = api_instance.get_receipt_attachments(xero_tenant_id, receipt_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -10495,16 +10243,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt - -begin - #Allows you to retrieve a history records of an Receipt +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receiptbegin + # Allows you to retrieve a history records of an Receipt result = api_instance.get_receipt_history(xero_tenant_id, receipt_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -10558,7 +10304,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -10566,13 +10312,15 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned - where: 'Status==\"' + Receipt.StatusEnum.DRAFT + '\"', # String | Filter by an any element + + where: "Status==#{XeroRuby::Accounting::Receipt::DRAFT}", # String | Filter by an any element + order: 'ReceiptNumber ASC', # String | Order by an any element + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve draft expense claim receipts for any user + # Allows you to retrieve draft expense claim receipts for any user result = api_instance.get_receipts(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -10629,16 +10377,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice - -begin - #Allows you to retrieve a specified repeating invoice +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin + # Allows you to retrieve a specified repeating invoice result = api_instance.get_repeating_invoice(xero_tenant_id, repeating_invoice_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -10692,7 +10438,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -10700,10 +10446,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve specified attachment on repeating invoices by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve specified attachment on repeating invoices by file name result = api_instance.get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -10759,7 +10503,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -10767,10 +10511,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf - -begin - #Allows you to retrieve a specified Attachments on repeating invoices +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin + # Allows you to retrieve a specified Attachments on repeating invoices result = api_instance.get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type) p result rescue XeroRuby::Accounting::ApiError => e @@ -10826,16 +10568,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice - -begin - #Allows you to retrieve Attachments on repeating invoice +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin + # Allows you to retrieve Attachments on repeating invoice result = api_instance.get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -10889,16 +10629,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice - -begin - #Allows you to retrieve history for a repeating invoice +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin + # Allows you to retrieve history for a repeating invoice result = api_instance.get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -10952,19 +10690,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { - where: 'Status==\"' + RepeatingInvoice.StatusEnum.DRAFT + '\"', # String | Filter by an any element + where: "Status==#{XeroRuby::Accounting::RepeatingInvoice::DRAFT}", # String | Filter by an any element + order: 'Total ASC' # String | Order by an any element } - begin - #Allows you to retrieve any repeating invoices + # Allows you to retrieve any repeating invoices result = api_instance.get_repeating_invoices(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11019,7 +10757,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11028,12 +10766,13 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact opts = { date: Date.parse('2013-10-20'), # Date | The date of the Aged Payables By Contact report + from_date: Date.parse('2013-10-20'), # Date | The from date of the Aged Payables By Contact report + to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Payables By Contact report } - begin - #Allows you to retrieve report for AgedPayablesByContact + # Allows you to retrieve report for AgedPayablesByContact result = api_instance.get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11090,7 +10829,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11099,12 +10838,13 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact opts = { date: Date.parse('2013-10-20'), # Date | The date of the Aged Receivables By Contact report + from_date: Date.parse('2013-10-20'), # Date | The from date of the Aged Receivables By Contact report + to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Receivables By Contact report } - begin - #Allows you to retrieve report for AgedReceivablesByContact + # Allows you to retrieve report for AgedReceivablesByContact result = api_instance.get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11161,16 +10901,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -report_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Report - -begin - #Allows you to retrieve report for BAS only valid for AU orgs +report_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Reportbegin + # Allows you to retrieve report for BAS only valid for AU orgs result = api_instance.get_report_ba_sor_gst(xero_tenant_id, report_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -11224,15 +10962,13 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant - -begin - #Allows you to retrieve report for BAS only valid for AU orgs +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin + # Allows you to retrieve report for BAS only valid for AU orgs result = api_instance.get_report_ba_sor_gst_list(xero_tenant_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -11285,7 +11021,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11293,16 +11029,21 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { date: '2019-11-01', # String | The date of the Balance Sheet report + periods: 3, # Integer | The number of periods for the Balance Sheet report + timeframe: 'MONTH', # String | The period size to compare to (MONTH, QUARTER, YEAR) + tracking_option_id1: '00000000-0000-0000-000-000000000000', # String | The tracking option 1 for the Balance Sheet report + tracking_option_id2: '00000000-0000-0000-000-000000000000', # String | The tracking option 2 for the Balance Sheet report + standard_layout: true, # Boolean | The standard layout boolean for the Balance Sheet report + payments_only: false # Boolean | return a cash basis for the Balance Sheet report } - begin - #Allows you to retrieve report for BalanceSheet + # Allows you to retrieve report for BalanceSheet result = api_instance.get_report_balance_sheet(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11362,7 +11103,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11370,11 +11111,11 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { from_date: Date.parse('2019-11-01'), # Date | The from date for the Bank Summary report e.g. 2018-03-31 + to_date: Date.parse('2019-11-30') # Date | The to date for the Bank Summary report e.g. 2018-03-31 } - begin - #Allows you to retrieve report for BankSummary + # Allows you to retrieve report for BankSummary result = api_instance.get_report_bank_summary(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11429,7 +11170,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11437,12 +11178,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { date: Date.parse('2019-03-31'), # Date | The date for the Bank Summary report e.g. 2018-03-31 + period: 2, # Integer | The number of periods to compare (integer between 1 and 12) + timeframe: 3 # Integer | The period size to compare to (1=month, 3=quarter, 12=year) } - begin - #Allows you to retrieve report for Budget Summary + # Allows you to retrieve report for Budget Summary result = api_instance.get_report_budget_summary(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11498,7 +11240,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11507,9 +11249,8 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { date: Date.parse('2019-03-31') # Date | The date for the Bank Summary report e.g. 2018-03-31 } - begin - #Allows you to retrieve report for ExecutiveSummary + # Allows you to retrieve report for ExecutiveSummary result = api_instance.get_report_executive_summary(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11563,7 +11304,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11571,19 +11312,27 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { from_date: Date.parse('2019-03-01'), # Date | The from date for the ProfitAndLoss report e.g. 2018-03-31 + to_date: Date.parse('2019-03-31'), # Date | The to date for the ProfitAndLoss report e.g. 2018-03-31 + periods: 3, # Integer | The number of periods to compare (integer between 1 and 12) + timeframe: 'MONTH', # String | The period size to compare to (MONTH, QUARTER, YEAR) + tracking_category_id: '00000000-0000-0000-000-000000000000', # String | The trackingCategory 1 for the ProfitAndLoss report + tracking_category_id2: '00000000-0000-0000-000-000000000000', # String | The trackingCategory 2 for the ProfitAndLoss report + tracking_option_id: '00000000-0000-0000-000-000000000000', # String | The tracking option 1 for the ProfitAndLoss report + tracking_option_id2: '00000000-0000-0000-000-000000000000', # String | The tracking option 2 for the ProfitAndLoss report + standard_layout: true, # Boolean | Return the standard layout for the ProfitAndLoss report + payments_only: false # Boolean | Return cash only basis for the ProfitAndLoss report } - begin - #Allows you to retrieve report for ProfitAndLoss + # Allows you to retrieve report for ProfitAndLoss result = api_instance.get_report_profit_and_loss(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11646,7 +11395,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11655,9 +11404,8 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { report_year: '2019' # String | The year of the 1099 report } - begin - #Allows you to retrieve report for TenNinetyNine + # Allows you to retrieve report for TenNinetyNine result = api_instance.get_report_ten_ninety_nine(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11711,7 +11459,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -11719,11 +11467,11 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { date: Date.parse('2019-10-31'), # Date | The date for the Trial Balance report e.g. 2018-03-31 + payments_only: true # Boolean | Return cash only basis for the Trial Balance report } - begin - #Allows you to retrieve report for TrialBalance + # Allows you to retrieve report for TrialBalance result = api_instance.get_report_trial_balance(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11778,20 +11526,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { - where: 'Status==\"' + TaxRate.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + where: "Status==#{XeroRuby::Accounting::TaxRate::ACTIVE}", # String | Filter by an any element + order: 'Name ASC', # String | Order by an any element + tax_type: 'INPUT' # String | Filter by tax type } - begin - #Allows you to retrieve Tax Rates + # Allows you to retrieve Tax Rates result = api_instance.get_tax_rates(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11847,20 +11596,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { - where: 'Status==\"' + TrackingCategory.StatusEnum.ACTIVE + '\"', # String | Filter by an any element + where: "Status==#{XeroRuby::Accounting::TrackingCategory::ACTIVE}", # String | Filter by an any element + order: 'Name ASC', # String | Order by an any element + include_archived: true # Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response } - begin - #Allows you to retrieve tracking categories and options + # Allows you to retrieve tracking categories and options result = api_instance.get_tracking_categories(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -11916,16 +11666,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory - -begin - #Allows you to retrieve tracking categories and options for specified category +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategorybegin + # Allows you to retrieve tracking categories and options for specified category result = api_instance.get_tracking_category(xero_tenant_id, tracking_category_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -11979,16 +11727,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -user_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a User - -begin - #Allows you to retrieve a specified user +user_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Userbegin + # Allows you to retrieve a specified user result = api_instance.get_user(xero_tenant_id, user_id) p result rescue XeroRuby::Accounting::ApiError => e @@ -12042,7 +11788,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12050,12 +11796,13 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { if_modified_since: DateTime.parse('2020-02-06T12:17:43.202-08:00'), # DateTime | Only records created or modified since this timestamp will be returned + where: 'IsSubscriber==true', # String | Filter by an any element + order: 'LastName ASC' # String | Order by an any element } - begin - #Allows you to retrieve users + # Allows you to retrieve users result = api_instance.get_users(xero_tenant_id, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -12111,17 +11858,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object -accounts = { accounts:[ { code:"123456", name:"BarFoo", accountID:"00000000-0000-0000-000-000000000000", type:AccountType.EXPENSE, description:"GoodBye World", taxType:"INPUT" } ] } # Accounts | Request of type Accounts array with one Account - -begin - #Allows you to update a chart of accounts +accounts = { accounts: [{ code: "123456", name: "BarFoo", accountID: "00000000-0000-0000-000-000000000000", type: AccountType.EXPENSE, description: "GoodBye World", taxType: TaxType.INPUT }]} # Accounts | Request of type Accounts array with one Accountbegin + # Allows you to update a chart of accounts result = api_instance.update_account(xero_tenant_id, account_id, accounts) p result rescue XeroRuby::Accounting::ApiError => e @@ -12176,7 +11921,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12184,10 +11929,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on Account by Filename +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update Attachment on Account by Filename result = api_instance.update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -12221,9 +11964,9 @@ Name | Type | Description | Notes ## update_bank_transaction -> BankTransactions update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts) +> BankTransactions update_bank_transaction(xero_tenant_id, bank_transactions) + -Allows you to update a single spend or receive money transaction ### Example @@ -12243,21 +11986,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, date:"2019-02-25", reference:"You just updated", status:BankTransaction.StatusEnum.AUTHORISED, bankTransactionID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {}, bankAccount: {accountID: "00000000-0000-0000-000-000000000000"} } ] } # BankTransactions | -opts = { - unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts -} - +api_instance = xero_client.asset_api{ bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, date: "2019-02-25", reference: "You just updated", status: XeroRuby::Accounting::BankTransaction::AUTHORISED, bank_transaction_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, bank_account: { account_id: "00000000-0000-0000-000-000000000000" }}]} summary: Allows you to update a single spend or receive money transaction parameters: - required: true in: path name: BankTransactionID description: Xero generated unique identifier for a bank transaction example: "00000000-0000-0000-000-000000000000" schema: type: string format: uuid - $ref: begin - #Allows you to update a single spend or receive money transaction - result = api_instance.update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts) + result = api_instance.update_bank_transaction(xero_tenant_id, bank_transactions) p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_bank_transaction: #{e}" @@ -12270,9 +12004,7 @@ end Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **xero_tenant_id** | **String**| Xero identifier for Tenant | - **bank_transaction_id** | [**String**](.md)| Xero generated unique identifier for a bank transaction | **bank_transactions** | [**BankTransactions**](BankTransactions.md)| | - **unitdp** | **Integer**| e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts | [optional] ### Return type @@ -12312,7 +12044,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12320,10 +12052,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction file_name = 'xero-dev.jpg' # String | The name of the file being attached -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update an Attachment on BankTransaction by Filename +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update an Attachment on BankTransaction by Filename result = api_instance.update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -12379,7 +12109,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12387,9 +12117,7 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -body = 'body_example' # String | Byte array of file in body of request - -begin +body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -12445,15 +12173,10 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -contacts = { contacts:[ { contactID:"00000000-0000-0000-000-000000000000", name:"Thanos" } ] } # Contacts | an array of Contacts containing single Contact object with properties to update - +api_instance = xero_client.asset_apicontacts = { contacts: [{ contact_id: "00000000-0000-0000-000-000000000000", name: "Thanos" }]} begin result = api_instance.update_contact(xero_tenant_id, contact_id, contacts) p result @@ -12509,7 +12232,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12517,9 +12240,7 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -body = 'body_example' # String | Byte array of file in body of request - -begin +body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -12575,17 +12296,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group -contact_groups = { contactGroups:[ { name:"Vendor" } ] } # ContactGroups | an array of Contact groups with Name of specific group to update - +api_instance = xero_client.asset_apicontact_groups = { contact_groups: [{ name: "Vendor" }]} begin - #Allows you to update a Contact Group + # Allows you to update a Contact Group result = api_instance.update_contact_group(xero_tenant_id, contact_group_id, contact_groups) p result rescue XeroRuby::Accounting::ApiError => e @@ -12640,20 +12356,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apicredit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", status: XeroRuby::Accounting::CreditNote::AUTHORISED, reference: "Mind stone", line_items: [{ description: "Infinity Stones", quantity: 1.0, unit_amount: 100.0, account_code: "400" } ]}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -credit_notes = { creditNotes:[ { type:CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", status: CreditNote.StatusEnum.AUTHORISED, reference: "Mind stone", lineItems:[ { description:"Infinity Stones", quantity:1.0, unitAmount:100.0, accountCode:"400" } ] } ] } # CreditNotes | an array of Credit Notes containing credit note details to update opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to update a specific credit note + # Allows you to update a specific credit note result = api_instance.update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -12709,7 +12421,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12717,10 +12429,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachments on CreditNote by file name +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update Attachments on CreditNote by file name result = api_instance.update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -12776,17 +12486,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim -expense_claims = { expenseClaims:[ { status:ExpenseClaim.StatusEnum.AUTHORISED, user:{ userID:"00000000-0000-0000-000-000000000000" }, receipts:[ { receiptID:"00000000-0000-0000-000-000000000000", lineItems: [], contact: {}, date:"2020-01-01", user:{} } ] } ] } # ExpenseClaims | - +api_instance = xero_client.asset_apiexpense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::AUTHORISED, user: { user_id: "00000000-0000-0000-000-000000000000" }, receipts: [{ receipt_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, date:"2020-01-01", user: {} }]}]} begin - #Allows you to update specified expense claims + # Allows you to update specified expense claims result = api_instance.update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims) p result rescue XeroRuby::Accounting::ApiError => e @@ -12841,20 +12546,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiinvoices = { invoices: [{ reference: "I am Iron Man", invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -invoices = { invoices:[ { reference:"I am Iron Man", invoiceID:"00000000-0000-0000-000-000000000000", lineItems: [],contact: {},type: Invoice.TypeEnum.ACCPAY } ] } # Invoices | opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to update a specified sales invoices or purchase bills + # Allows you to update a specified sales invoices or purchase bills result = api_instance.update_invoice(xero_tenant_id, invoice_id, invoices, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -12910,7 +12611,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12918,10 +12619,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice file_name = 'xero-dev.jpg' # String | Name of the file you are attaching -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on invoices or purchase bills by it's filename +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update Attachment on invoices or purchase bills by it's filename result = api_instance.update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -12977,7 +12676,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -12988,9 +12687,8 @@ items = { items:[ { code:"abc123", description:"Hello Xero" } ] } # Items | opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to update a specified item + # Allows you to update a specified item result = api_instance.update_item(xero_tenant_id, item_id, items, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13046,17 +12744,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction -linked_transactions = { linkedTransactions:[ {sourceLineItemID:"00000000-0000-0000-000-000000000000", contactID:"00000000-0000-0000-000-000000000000" } ] } # LinkedTransactions | - +api_instance = xero_client.asset_apilinked_transactions = { linked_transactions: [{ source_line_item_id: "00000000-0000-0000-000-000000000000", contact_id: "00000000-0000-0000-000-000000000000" }]} begin - #Allows you to update a specified linked transactions (billable expenses) + # Allows you to update a specified linked transactions (billable expenses) result = api_instance.update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions) p result rescue XeroRuby::Accounting::ApiError => e @@ -13111,17 +12804,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal -manual_journals = { manualJournals:[ { narration:"Hello Xero", manualJournalID:"00000000-0000-0000-000-000000000000",journalLines:[] } ] } # ManualJournals | - +api_instance = xero_client.asset_apimanual_journals = { manual_journals: [{ narration: "Hello Xero", manual_journal_id: "00000000-0000-0000-000-000000000000", journal_ines: [] }]} begin - #Allows you to update a specified manual journal + # Allows you to update a specified manual journal result = api_instance.update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals) p result rescue XeroRuby::Accounting::ApiError => e @@ -13176,7 +12864,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -13184,10 +12872,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update a specified Attachment on ManualJournal by file name +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update a specified Attachment on ManualJournal by file name result = api_instance.update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -13243,20 +12929,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apibank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" }], bank_account: { code: "000" }}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transactions = { bankTransactions:[ { type: BankTransaction.TypeEnum.SPEND, contact: { contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity: 1.0, unitAmount:20.0, accountCode:"000" } ], bankAccount:{ code:"000" } } ] } # BankTransactions | opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to update or create one or more spend or receive money transaction + # Allows you to update or create one or more spend or receive money transaction result = api_instance.update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13312,19 +12996,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_api{ contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTHDAYSAFTERBILLMONTH }}}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contacts = {contacts: [{ name:"Bruce Banner", emailAddress:"hulk@avengers.com", phones:[ { phoneType: Phone.PhoneTypeEnum.MOBILE, phoneNumber:"555-1212", phoneAreaCode:"415" } ], paymentTerms:{ bills:{ day:15, type: PaymentTermType.OFCURRENTMONTH }, sales:{ day:10, type: PaymentTermType.DAYSAFTERBILLMONTH } } } ] } # Contacts | opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to update OR create one or more contacts in a Xero organisation + # Allows you to update OR create one or more contacts in a Xero organisation result = api_instance.update_or_create_contacts(xero_tenant_id, contacts, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13379,20 +13060,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apicredit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_notes = { creditNotes:[ { type: CreditNote.TypeEnum.ACCPAYCREDIT, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, date:"2019-01-05", lineItems:[ { description:"Foobar", quantity:2.0, unitAmount:20.0, accountCode:"400" } ] } ] } # CreditNotes | an array of Credit Notes with a single CreditNote object. opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to update OR create one or more credit notes + # Allows you to update OR create one or more credit notes result = api_instance.update_or_create_credit_notes(xero_tenant_id, credit_notes, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13448,19 +13127,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiemployees = { employees: [{ first_name: "Nick", last_name: "Fury", external_link: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -employees = { employees:[ { firstName:"Nick", lastName:"Fury", externalLink:{ url:"http://twitter.com/#!/search/Nick+Fury" } } ] } # Employees | Employees with array of Employee object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create a single new employees used in Xero payrun + # Allows you to create a single new employees used in Xero payrun result = api_instance.update_or_create_employees(xero_tenant_id, employees, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13515,20 +13191,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiinvoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoices = { invoices:[ { type: Invoice.TypeEnum.ACCREC, contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Acme Tires", quantity:2.0, unitAmount:20.0, accountCode:"200", taxType:"NONE", lineAmount:40.0 } ], date:"2019-03-11", dueDate:"2018-12-10", reference:"Website Design", status: Invoice.StatusEnum.AUTHORISED } ] } # Invoices | opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to update OR create one or more sales invoices or purchase bills + # Allows you to update OR create one or more sales invoices or purchase bills result = api_instance.update_or_create_invoices(xero_tenant_id, invoices, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13584,20 +13258,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiitems = { items: [{ code: "abcXYZ", name: "HelloWorld", description: "Foobar" }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -items = { items:[ { code:"abcXYZ", name:"HelloWorld", description:"Foobar" } ] } # Items | opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors + unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to update or create one or more items + # Allows you to update or create one or more items result = api_instance.update_or_create_items(xero_tenant_id, items, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13653,19 +13325,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apimanual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" },{ line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpsons", option: "Bart" }]}] }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journals = { manualJournals:[ { narration:"Foo bar", journalLines:[ { lineAmount:100.0, accountCode:"400", description:"Hello there" }, { lineAmount:-100.0, accountCode:"400", description:"Goodbye", tracking:[ { name:"Simpsons", option:"Bart" } ] } ], date:"2019-03-14" } ] } # ManualJournals | ManualJournals array with ManualJournal object in body of request opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to create a single manual journal + # Allows you to create a single manual journal result = api_instance.update_or_create_manual_journals(xero_tenant_id, manual_journals, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13720,19 +13389,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apipurchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "710" }], date: "2019-03-13" }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_orders = { purchaseOrders:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"710" } ], date:"2019-03-13" } ] } # PurchaseOrders | opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to update or create one or more purchase orders + # Allows you to update or create one or more purchase orders result = api_instance.update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13787,19 +13453,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apiquotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date: "2020-02-01" }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quotes = { quotes:[ { contact:{ contactID:"00000000-0000-0000-000-000000000000" }, lineItems:[ { description:"Foobar", quantity:1.0, unitAmount:20.0, accountCode:"12775" } ], date:"2020-02-01" } ] } # Quotes | opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } - begin - #Allows you to update OR create one or more quotes + # Allows you to update OR create one or more quotes result = api_instance.update_or_create_quotes(xero_tenant_id, quotes, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -13854,17 +13517,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder -purchase_orders = { purchaseOrders:[ { attentionTo:"Peter Parker",lineItems: [],contact: {} } ] } # PurchaseOrders | - +api_instance = xero_client.asset_apipurchase_orders = { purchase_orders: [ { attention_to: "Peter Parker", line_items: [], contact: {} }]} begin - #Allows you to update a specified purchase order + # Allows you to update a specified purchase order result = api_instance.update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders) p result rescue XeroRuby::Accounting::ApiError => e @@ -13919,17 +13577,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote -quotes = {quotes:[{reference:"I am an update",contact:{contactID:"00000000-0000-0000-000-000000000000"},date:"2020-02-01"}]} # Quotes | - +api_instance = xero_client.asset_apiquotes = { quotes: [{ reference: "I am an update", contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2020-02-01" }]} begin - #Allows you to update a specified quote + # Allows you to update a specified quote result = api_instance.update_quote(xero_tenant_id, quote_id, quotes) p result rescue XeroRuby::Accounting::ApiError => e @@ -13984,7 +13637,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -13992,10 +13645,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on Quote by Filename +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update Attachment on Quote by Filename result = api_instance.update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -14051,20 +13702,16 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api +api_instance = xero_client.asset_apireceipts = { receipts: [{ user: { user_id: "00000000-0000-0000-000-000000000000" }, reference: "Foobar", date: "2020-01-01", contact: {}, line_items: [] }]} -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -receipts = { receipts:[ { user:{ userID:"00000000-0000-0000-000-000000000000" }, reference:"Foobar", date: "2020-01-01",contact: {},lineItems: []} ] } # Receipts | opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } - begin - #Allows you to retrieve a specified draft expense claim receipts + # Allows you to retrieve a specified draft expense claim receipts result = api_instance.update_receipt(xero_tenant_id, receipt_id, receipts, opts) p result rescue XeroRuby::Accounting::ApiError => e @@ -14120,7 +13767,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -14128,10 +13775,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update Attachment on expense claim receipts by file name +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update Attachment on expense claim receipts by file name result = api_instance.update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -14187,7 +13832,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -14195,10 +13840,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -body = 'body_example' # String | Byte array of file in body of request - -begin - #Allows you to update specified attachment on repeating invoices by file name +body = 'body_example' # String | Byte array of file in body of requestbegin + # Allows you to update specified attachment on repeating invoices by file name result = api_instance.update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) p result rescue XeroRuby::Accounting::ApiError => e @@ -14254,16 +13897,12 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API -api_instance = xero_client.asset_api - -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tax_rates = { taxRates:[ { name:"State Tax NY", taxComponents:[ { name:"State Tax", rate:2.25 } ], status:"DELETED", reportTaxType:"INPUT" } ] } # TaxRates | - +api_instance = xero_client.asset_apitax_rates = { tax_rates: [{ name: "State Tax NY", tax_components: [{ name: "State Tax", rate: 2.25 }], status: XeroRuby::Accounting::TaxRate::Deleted, report_tax_type: XeroRuby::Accounting::TaxRate::INPUT }]} begin - #Allows you to update Tax Rates + # Allows you to update Tax Rates result = api_instance.update_tax_rate(xero_tenant_id, tax_rates) p result rescue XeroRuby::Accounting::ApiError => e @@ -14317,17 +13956,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_category = { name:"Avengers" } # TrackingCategory | - -begin - #Allows you to update tracking categories +tracking_category = { name: "Avengers" } # TrackingCategory | begin + # Allows you to update tracking categories result = api_instance.update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) p result rescue XeroRuby::Accounting::ApiError => e @@ -14382,7 +14019,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -14390,10 +14027,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option -tracking_option = { name:"Vision" } # TrackingOption | - -begin - #Allows you to update options for a specified tracking category +tracking_option = { name: "Vision" } # TrackingOption | begin + # Allows you to update options for a specified tracking category result = api_instance.update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option) p result rescue XeroRuby::Accounting::ApiError => e diff --git a/docs/accounting/BatchPayment.md b/docs/accounting/BatchPayment.md index b36c2711..992f92a5 100644 --- a/docs/accounting/BatchPayment.md +++ b/docs/accounting/BatchPayment.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **date_string** | **String** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] **date** | **Date** | Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 | [optional] **amount** | **Float** | The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 | [optional] -**payments** | [**Array<Payment>**](Payment.md) | | [optional] +**payments** | [**Array<Payment>**](Payment.md) | An array of payments | [optional] **type** | **String** | PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) | [optional] **status** | **String** | AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. | [optional] **total_amount** | **String** | The total of the payments that make up the batch (read-only) | [optional] diff --git a/docs/assets/AssetApi.md b/docs/assets/AssetApi.md index a8a9f721..2e6fa8dc 100644 --- a/docs/assets/AssetApi.md +++ b/docs/assets/AssetApi.md @@ -39,16 +39,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -asset = { "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01", "purchasePrice":100.0, "disposalPrice":23.23, "assetStatus":"Draft", "bookDepreciationSetting":{ "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.5, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "currentCapitalGain":5.32, "currentGainLoss":3.88, "depreciationStartDate":"2020-01-02", "costLimit":100.0, "currentAccumDepreciationAmount":2.25 }, "AccountingBookValue":99.5 } # Asset | Fixed asset you are creating - -begin - #adds a fixed asset +asset = { "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01", "purchasePrice":100.0, "disposalPrice":23.23, "assetStatus":"Draft", "bookDepreciationSetting":{ "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.5, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "currentCapitalGain":5.32, "currentGainLoss":3.88, "depreciationStartDate":"2020-01-02", "costLimit":100.0, "currentAccumDepreciationAmount":2.25 }, "AccountingBookValue":99.5 } # Asset | Fixed asset you are creatingbegin + # adds a fixed asset result = api_instance.create_asset(xero_tenant_id, asset) p result rescue XeroRuby::Assets::ApiError => e @@ -104,7 +102,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -113,9 +111,8 @@ xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant opts = { asset_type: { "assetTypeName":"Machinery11004", "fixedAssetAccountId":"3d8d063a-c148-4bb8-8b3c-a5e2ad3b1e82", "depreciationExpenseAccountId":"d1602f69-f900-4616-8d34-90af393fa368", "accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8", "bookDepreciationSetting":{ "depreciationMethod":"DiminishingValue100", "averagingMethod":"ActualDays", "depreciationRate":0.05, "depreciationCalculationMethod":"None" } } # AssetType | Asset type to add } - begin - #adds a fixed asset type + # adds a fixed asset type result = api_instance.create_asset_type(xero_tenant_id, opts) p result rescue XeroRuby::Assets::ApiError => e @@ -171,16 +168,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -id = '4f7bcdcb-5ec1-4258-9558-19f662fccdfe' # String | fixed asset id for single object - -begin - #retrieves fixed asset by id +id = '4f7bcdcb-5ec1-4258-9558-19f662fccdfe' # String | fixed asset id for single objectbegin + # retrieves fixed asset by id result = api_instance.get_asset_by_id(xero_tenant_id, id) p result rescue XeroRuby::Assets::ApiError => e @@ -236,15 +231,13 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant - -begin - #searches fixed asset settings +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenantbegin + # searches fixed asset settings result = api_instance.get_asset_settings(xero_tenant_id) p result rescue XeroRuby::Assets::ApiError => e @@ -299,15 +292,13 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant - -begin - #searches fixed asset types +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenantbegin + # searches fixed asset types result = api_instance.get_asset_types(xero_tenant_id) p result rescue XeroRuby::Assets::ApiError => e @@ -362,7 +353,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -371,14 +362,17 @@ xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant status = XeroRuby::Assets::AssetStatusQueryParam.new # AssetStatusQueryParam | Required when retrieving a collection of assets. See Asset Status Codes opts = { page: 1, # Integer | Results are paged. This specifies which page of the results to return. The default page is 1. + page_size: 5, # Integer | The number of records returned per page. By default the number of records returned is 10. + order_by: 'AssetName', # String | Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice. + sort_direction: 'ASC', # String | ASC or DESC + filter_by: 'Draft' # String | A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. } - begin - #searches fixed asset + # searches fixed asset result = api_instance.get_assets(xero_tenant_id, status, opts) p result rescue XeroRuby::Assets::ApiError => e diff --git a/docs/projects/ProjectApi.md b/docs/projects/ProjectApi.md index b7aaf760..26b63514 100644 --- a/docs/projects/ProjectApi.md +++ b/docs/projects/ProjectApi.md @@ -44,16 +44,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -project_create_or_update = { "contactId":"00000000-0000-0000-000-000000000000", "name":"New Kitchen", "deadlineUtc":"2019-12-10T12:59:59Z", "estimateAmount":"99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate object - -begin - #create one or more new projects +project_create_or_update = { "contactId":"00000000-0000-0000-000-000000000000", "name":"New Kitchen", "deadlineUtc":"2019-12-10T12:59:59Z", "estimateAmount":"99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate objectbegin + # create one or more new projects result = api_instance.create_project(xero_tenant_id, project_create_or_update) p result rescue XeroRuby::Projects::ApiError => e @@ -109,17 +107,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-26T15:00:00Z", "duration":30, "description":"My description" } # TimeEntryCreateOrUpdate | The time entry object you are creating - -begin - #Allows you to create a task +time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-26T15:00:00Z", "duration":30, "description":"My description" } # TimeEntryCreateOrUpdate | The time entry object you are creatingbegin + # Allows you to create a task result = api_instance.create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update) p result rescue XeroRuby::Projects::ApiError => e @@ -176,17 +172,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -time_entry_id = 'time_entry_id_example' # String | You can specify an individual task by appending the id to the endpoint - -begin - #Allows you to delete a time entry +time_entry_id = 'time_entry_id_example' # String | You can specify an individual task by appending the id to the endpointbegin + # Allows you to delete a time entry api_instance.delete_time_entry(xero_tenant_id, project_id, time_entry_id) rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->delete_time_entry: #{e}" @@ -242,16 +236,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint - -begin - #Allows you to retrieve a single project +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpointbegin + # Allows you to retrieve a single project result = api_instance.get_project(xero_tenant_id, project_id) p result rescue XeroRuby::Projects::ApiError => e @@ -307,7 +299,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -315,11 +307,11 @@ api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant opts = { page: 1, # Integer | set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 50 # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. } - begin - #list all project users + # list all project users result = api_instance.get_project_users(xero_tenant_id, opts) p result rescue XeroRuby::Projects::ApiError => e @@ -376,7 +368,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -384,14 +376,17 @@ api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant opts = { project_ids: ['project_ids_example'], # Array | Search for all projects that match a comma separated list of projectIds + contact_id: 'contact_id_example', # String | Filter for projects for a specific contact + states: 'states_example', # String | Filter for projects in a particular state (INPROGRESS or CLOSED) + page: 1, # Integer | set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 50 # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. } - begin - #list all projects + # list all projects result = api_instance.get_projects(xero_tenant_id, opts) p result rescue XeroRuby::Projects::ApiError => e @@ -451,17 +446,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -task_id = 'task_id_example' # String | You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId} - -begin - #Allows you to retrieve a single project +task_id = 'task_id_example' # String | You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}begin + # Allows you to retrieve a single project result = api_instance.get_task(xero_tenant_id, project_id, task_id) p result rescue XeroRuby::Projects::ApiError => e @@ -518,7 +511,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -527,12 +520,13 @@ xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint opts = { page: 1, # Integer | Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 10, # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + task_ids: 'task_ids_example' # String | taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId} } - begin - #Allows you to retrieve a single project + # Allows you to retrieve a single project result = api_instance.get_tasks(xero_tenant_id, project_id, opts) p result rescue XeroRuby::Projects::ApiError => e @@ -591,7 +585,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -600,19 +594,27 @@ xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | Identifier of the project, that the task (which the time entry is logged against) belongs to. opts = { user_id: 'user_id_example', # String | The xero user identifier of the person who logged time. + task_id: 'task_id_example', # String | Identifier of the task that time entry is logged against. + invoice_id: 'invoice_id_example', # String | Finds all time entries for this invoice. + contact_id: 'contact_id_example', # String | Finds all time entries for this contact identifier. + page: 1, # Integer | Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. + page_size: 10, # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. + states: ['states_example'], # Array | Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified. + is_chargeable: true, # Boolean | Finds all time entries which relate to tasks with the charge type `TIME` or `FIXED`. + date_after_utc: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | ISO 8601 UTC date. Finds all time entries on or after this date filtered on the `dateUtc` field. + date_before_utc: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. } - begin - #Allows you to retrieve the time entries associated with a specific project + # Allows you to retrieve the time entries associated with a specific project result = api_instance.get_time_entries(xero_tenant_id, project_id, opts) p result rescue XeroRuby::Projects::ApiError => e @@ -678,17 +680,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpoint - -begin - #Allows you to get a single time entry in a project +time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpointbegin + # Allows you to get a single time entry in a project result = api_instance.get_time_entry(xero_tenant_id, project_id, time_entry_id) p result rescue XeroRuby::Projects::ApiError => e @@ -745,17 +745,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -project_patch = { "status": "INPROGRESS" } # ProjectPatch | Update the status of an existing Project - -begin - #creates a project for the specified contact +project_patch = { "status": "INPROGRESS" } # ProjectPatch | Update the status of an existing Projectbegin + # creates a project for the specified contact api_instance.patch_project(xero_tenant_id, project_id, project_patch) rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->patch_project: #{e}" @@ -811,17 +809,15 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -project_create_or_update = { "name": "New Kitchen", "deadlineUtc": "2017-04-23T18:25:43.511Z", "estimateAmount": 99.99 } # ProjectCreateOrUpdate | Request of type ProjectCreateOrUpdate - -begin - #update a specific project +project_create_or_update = { "name": "New Kitchen", "deadlineUtc": "2017-04-23T18:25:43.511Z", "estimateAmount": 99.99 } # ProjectCreateOrUpdate | Request of type ProjectCreateOrUpdatebegin + # update a specific project api_instance.update_project(xero_tenant_id, project_id, project_create_or_update) rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_project: #{e}" @@ -877,7 +873,7 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# If using the Accounting API +# doc assumes you are api_instance = xero_client.accounting_api # Or for methods in the Assets API api_instance = xero_client.asset_api @@ -885,10 +881,8 @@ api_instance = xero_client.asset_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpoint -time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-27T15:00:00Z", "duration":45, "description":"My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updating - -begin - #Allows you to update time entry in a project +time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-27T15:00:00Z", "duration":45, "description":"My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updatingbegin + # Allows you to update time entry in a project api_instance.update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_time_entry: #{e}" diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb index 63ae7004..c9b7b9a9 100644 --- a/lib/xero-ruby.rb +++ b/lib/xero-ruby.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 1f30158b..11c319a4 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -13149,26 +13149,20 @@ def update_account_attachment_by_file_name_with_http_info(xero_tenant_id, accoun return data, status_code, headers end - # Allows you to update a single spend or receive money transaction # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction # @param bank_transactions [BankTransactions] # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [BankTransactions] - def update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {}) - data, _status_code, _headers = update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts) + def update_bank_transaction(xero_tenant_id, bank_transactions, opts = {}) + data, _status_code, _headers = update_bank_transaction_with_http_info(xero_tenant_id, bank_transactions, opts) data end - # Allows you to update a single spend or receive money transaction # @param xero_tenant_id [String] Xero identifier for Tenant - # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction # @param bank_transactions [BankTransactions] # @param [Hash] opts the optional parameters - # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers - def update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {}) + def update_bank_transaction_with_http_info(xero_tenant_id, bank_transactions, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction ...' end @@ -13176,20 +13170,15 @@ def update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, if @api_client.config.client_side_validation && xero_tenant_id.nil? fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transaction" end - # verify the required parameter 'bank_transaction_id' is set - if @api_client.config.client_side_validation && bank_transaction_id.nil? - fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction" - end # verify the required parameter 'bank_transactions' is set if @api_client.config.client_side_validation && bank_transactions.nil? fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_bank_transaction" end # resource path - local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s) + local_var_path = '/BankTransactions/{BankTransactionID}' # query parameters query_params = opts[:query_params] || {} - query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index 6150fda7..f3bb6d62 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/project_api.rb b/lib/xero-ruby/api/project_api.rb index e605812e..722800f3 100644 --- a/lib/xero-ruby/api/project_api.rb +++ b/lib/xero-ruby/api/project_api.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index c580498f..b893f719 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/api_error.rb b/lib/xero-ruby/api_error.rb index fe6065f6..73308970 100644 --- a/lib/xero-ruby/api_error.rb +++ b/lib/xero-ruby/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/configuration.rb b/lib/xero-ruby/configuration.rb index 53ff7624..853b5c44 100644 --- a/lib/xero-ruby/configuration.rb +++ b/lib/xero-ruby/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index 7fc99fc3..edef80bf 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,62 +17,98 @@ module XeroRuby::Accounting class Account # Customer defined alpha numeric account code e.g 200 or SALES (max length = 10) attr_accessor :code - + # Name of account (max length = 150) attr_accessor :name - + # The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 attr_accessor :account_id + attr_accessor :type - + # For bank accounts only (Account Type BANK) attr_accessor :bank_account_number - + # Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes attr_accessor :status - + ACTIVE = "ACTIVE".freeze + ARCHIVED = "ARCHIVED".freeze + DELETED = "DELETED".freeze + # Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000) attr_accessor :description - + # For bank accounts only. See Bank Account types attr_accessor :bank_account_type + BANK = "BANK".freeze + CREDITCARD = "CREDITCARD".freeze + PAYPAL = "PAYPAL".freeze + NONE = "NONE".freeze + EMPTY = "".freeze + attr_accessor :currency_code - + # The tax type from TaxRates attr_accessor :tax_type - + # Boolean – describes whether account can have payments applied to it attr_accessor :enable_payments_to_account - + # Boolean – describes whether account code is available for use with expense claims attr_accessor :show_in_expense_claims - + # See Account Class Types attr_accessor :_class - + ASSET = "ASSET".freeze + EQUITY = "EQUITY".freeze + EXPENSE = "EXPENSE".freeze + LIABILITY = "LIABILITY".freeze + REVENUE = "REVENUE".freeze + # If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null. attr_accessor :system_account - + DEBTORS = "DEBTORS".freeze + CREDITORS = "CREDITORS".freeze + BANKCURRENCYGAIN = "BANKCURRENCYGAIN".freeze + GST = "GST".freeze + GSTONIMPORTS = "GSTONIMPORTS".freeze + HISTORICAL = "HISTORICAL".freeze + REALISEDCURRENCYGAIN = "REALISEDCURRENCYGAIN".freeze + RETAINEDEARNINGS = "RETAINEDEARNINGS".freeze + ROUNDING = "ROUNDING".freeze + TRACKINGTRANSFERS = "TRACKINGTRANSFERS".freeze + UNPAIDEXPCLM = "UNPAIDEXPCLM".freeze + UNREALISEDCURRENCYGAIN = "UNREALISEDCURRENCYGAIN".freeze + WAGEPAYABLES = "WAGEPAYABLES".freeze + CISASSETS = "CISASSETS".freeze + CISASSET = "CISASSET".freeze + CISLABOUR = "CISLABOUR".freeze + CISLABOUREXPENSE = "CISLABOUREXPENSE".freeze + CISLABOURINCOME = "CISLABOURINCOME".freeze + CISLIABILITY = "CISLIABILITY".freeze + CISMATERIALS = "CISMATERIALS".freeze + EMPTY = "".freeze + # Shown if set attr_accessor :reporting_code - + # Shown if set attr_accessor :reporting_code_name - + # boolean to indicate if an account has an attachment (read only) attr_accessor :has_attachments - + # Last modified date UTC format attr_accessor :updated_date_utc - + # Boolean – describes whether the account is shown in the watchlist widget on the dashboard attr_accessor :add_to_watchlist - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/account_type.rb b/lib/xero-ruby/models/accounting/account_type.rb index 60406e95..c1aaf627 100644 --- a/lib/xero-ruby/models/accounting/account_type.rb +++ b/lib/xero-ruby/models/accounting/account_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/accounts.rb b/lib/xero-ruby/models/accounting/accounts.rb index 7248b510..4005ff7b 100644 --- a/lib/xero-ruby/models/accounting/accounts.rb +++ b/lib/xero-ruby/models/accounting/accounts.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Accounts - attr_accessor :accounts + attr_accessor :accounts + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/accounts_payable.rb b/lib/xero-ruby/models/accounting/accounts_payable.rb index aed25592..072e3010 100644 --- a/lib/xero-ruby/models/accounting/accounts_payable.rb +++ b/lib/xero-ruby/models/accounting/accounts_payable.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,10 +15,12 @@ module XeroRuby::Accounting class AccountsPayable + attr_accessor :outstanding + attr_accessor :overdue - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/accounts_receivable.rb b/lib/xero-ruby/models/accounting/accounts_receivable.rb index aa4a1b6a..59002564 100644 --- a/lib/xero-ruby/models/accounting/accounts_receivable.rb +++ b/lib/xero-ruby/models/accounting/accounts_receivable.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,10 +15,12 @@ module XeroRuby::Accounting class AccountsReceivable + attr_accessor :outstanding + attr_accessor :overdue - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/address.rb b/lib/xero-ruby/models/accounting/address.rb index 84a34f4c..3dd63423 100644 --- a/lib/xero-ruby/models/accounting/address.rb +++ b/lib/xero-ruby/models/accounting/address.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,34 +17,37 @@ module XeroRuby::Accounting class Address # define the type of address attr_accessor :address_type - + POBOX = "POBOX".freeze + STREET = "STREET".freeze + DELIVERY = "DELIVERY".freeze + # max length = 500 attr_accessor :address_line1 - + # max length = 500 attr_accessor :address_line2 - + # max length = 500 attr_accessor :address_line3 - + # max length = 500 attr_accessor :address_line4 - + # max length = 255 attr_accessor :city - + # max length = 255 attr_accessor :region - + # max length = 50 attr_accessor :postal_code - + # max length = 50, [A-Z], [a-z] only attr_accessor :country - + # max length = 255 attr_accessor :attention_to - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/allocation.rb b/lib/xero-ruby/models/accounting/allocation.rb index 2f97d886..d7a3e431 100644 --- a/lib/xero-ruby/models/accounting/allocation.rb +++ b/lib/xero-ruby/models/accounting/allocation.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,26 +15,30 @@ module XeroRuby::Accounting class Allocation + attr_accessor :invoice + attr_accessor :overpayment + attr_accessor :prepayment + attr_accessor :credit_note - + # the amount being applied to the invoice attr_accessor :amount - + # the date the allocation is applied YYYY-MM-DD. attr_accessor :date - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/allocations.rb b/lib/xero-ruby/models/accounting/allocations.rb index f870c643..e03e9903 100644 --- a/lib/xero-ruby/models/accounting/allocations.rb +++ b/lib/xero-ruby/models/accounting/allocations.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Allocations - attr_accessor :allocations + attr_accessor :allocations + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/attachment.rb b/lib/xero-ruby/models/accounting/attachment.rb index 07360e4c..40743527 100644 --- a/lib/xero-ruby/models/accounting/attachment.rb +++ b/lib/xero-ruby/models/accounting/attachment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,22 +17,22 @@ module XeroRuby::Accounting class Attachment # Unique ID for the file attr_accessor :attachment_id - + # Name of the file attr_accessor :file_name - + # URL to the file on xero.com attr_accessor :url - + # Type of file attr_accessor :mime_type - + # Length of the file content attr_accessor :content_length - + # Include the file with the online invoice attr_accessor :include_online - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/attachments.rb b/lib/xero-ruby/models/accounting/attachments.rb index 60863e63..4f282930 100644 --- a/lib/xero-ruby/models/accounting/attachments.rb +++ b/lib/xero-ruby/models/accounting/attachments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Attachments - attr_accessor :attachments + attr_accessor :attachments + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/balances.rb b/lib/xero-ruby/models/accounting/balances.rb index bed0c395..0cce283c 100644 --- a/lib/xero-ruby/models/accounting/balances.rb +++ b/lib/xero-ruby/models/accounting/balances.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -16,10 +16,12 @@ module XeroRuby::Accounting # The raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only) class Balances + attr_accessor :accounts_receivable + attr_accessor :accounts_payable - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/bank_transaction.rb b/lib/xero-ruby/models/accounting/bank_transaction.rb index 2cde0c77..1e553053 100644 --- a/lib/xero-ruby/models/accounting/bank_transaction.rb +++ b/lib/xero-ruby/models/accounting/bank_transaction.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,66 +17,81 @@ module XeroRuby::Accounting class BankTransaction # See Bank Transaction Types attr_accessor :type + RECEIVE = "RECEIVE".freeze + RECEIVE_OVERPAYMENT = "RECEIVE-OVERPAYMENT".freeze + RECEIVE_PREPAYMENT = "RECEIVE-PREPAYMENT".freeze + SPEND = "SPEND".freeze + SPEND_OVERPAYMENT = "SPEND-OVERPAYMENT".freeze + SPEND_PREPAYMENT = "SPEND-PREPAYMENT".freeze + RECEIVE_TRANSFER = "RECEIVE-TRANSFER".freeze + SPEND_TRANSFER = "SPEND-TRANSFER".freeze + attr_accessor :contact - + # See LineItems attr_accessor :line_items + attr_accessor :bank_account - + # Boolean to show if transaction is reconciled attr_accessor :is_reconciled - + # Date of transaction – YYYY-MM-DD attr_accessor :date - + # Reference for the transaction. Only supported for SPEND and RECEIVE transactions. attr_accessor :reference + attr_accessor :currency_code - + # Exchange rate to base currency when money is spent or received. e.g.0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments. attr_accessor :currency_rate - + # URL link to a source document – shown as “Go to App Name” attr_accessor :url - + # See Bank Transaction Status Codes attr_accessor :status + AUTHORISED = "AUTHORISED".freeze + DELETED = "DELETED".freeze + VOIDED = "VOIDED".freeze + attr_accessor :line_amount_types - + # Total of bank transaction excluding taxes attr_accessor :sub_total - + # Total tax on bank transaction attr_accessor :total_tax - + # Total of bank transaction tax inclusive attr_accessor :total - + # Xero generated unique identifier for bank transaction attr_accessor :bank_transaction_id - + # Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT attr_accessor :prepayment_id - + # Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT attr_accessor :overpayment_id - + # Last modified date UTC format attr_accessor :updated_date_utc - + # Boolean to indicate if a bank transaction has an attachment attr_accessor :has_attachments - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/bank_transactions.rb b/lib/xero-ruby/models/accounting/bank_transactions.rb index 073083a2..c39f8449 100644 --- a/lib/xero-ruby/models/accounting/bank_transactions.rb +++ b/lib/xero-ruby/models/accounting/bank_transactions.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class BankTransactions - attr_accessor :bank_transactions + attr_accessor :bank_transactions + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/bank_transfer.rb b/lib/xero-ruby/models/accounting/bank_transfer.rb index 64d9c17c..956f8f17 100644 --- a/lib/xero-ruby/models/accounting/bank_transfer.rb +++ b/lib/xero-ruby/models/accounting/bank_transfer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,37 +15,39 @@ module XeroRuby::Accounting class BankTransfer + attr_accessor :from_bank_account + attr_accessor :to_bank_account - + # amount of the transaction attr_accessor :amount - + # The date of the Transfer YYYY-MM-DD attr_accessor :date - + # The identifier of the Bank Transfer attr_accessor :bank_transfer_id - + # The currency rate attr_accessor :currency_rate - + # The Bank Transaction ID for the source account attr_accessor :from_bank_transaction_id - + # The Bank Transaction ID for the destination account attr_accessor :to_bank_transaction_id - + # Boolean to indicate if a Bank Transfer has an attachment attr_accessor :has_attachments - + # UTC timestamp of creation date of bank transfer attr_accessor :created_date_utc - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/bank_transfers.rb b/lib/xero-ruby/models/accounting/bank_transfers.rb index dbdf9785..a601e298 100644 --- a/lib/xero-ruby/models/accounting/bank_transfers.rb +++ b/lib/xero-ruby/models/accounting/bank_transfers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class BankTransfers - attr_accessor :bank_transfers + attr_accessor :bank_transfers + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/batch_payment.rb b/lib/xero-ruby/models/accounting/batch_payment.rb index 9e7da43d..e560caf9 100644 --- a/lib/xero-ruby/models/accounting/batch_payment.rb +++ b/lib/xero-ruby/models/accounting/batch_payment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,52 +15,58 @@ module XeroRuby::Accounting class BatchPayment - attr_accessor :account + attr_accessor :account + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. attr_accessor :reference - + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. attr_accessor :particulars - + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. attr_accessor :code - + # (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 attr_accessor :details - + # (UK Only) Only shows on the statement line in Xero. Max length =18 attr_accessor :narrative - + # The Xero generated unique identifier for the bank transaction (read-only) attr_accessor :batch_payment_id - + # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 attr_accessor :date_string - + # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 attr_accessor :date - + # The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 attr_accessor :amount - + + # An array of payments attr_accessor :payments - + # PAYBATCH for bill payments or RECBATCH for sales invoice payments (read-only) attr_accessor :type - + PAYBATCH = "PAYBATCH".freeze + RECBATCH = "RECBATCH".freeze + # AUTHORISED or DELETED (read-only). New batch payments will have a status of AUTHORISED. It is not possible to delete batch payments via the API. attr_accessor :status - + AUTHORISED = "AUTHORISED".freeze + DELETED = "DELETED".freeze + # The total of the payments that make up the batch (read-only) attr_accessor :total_amount - + # UTC timestamp of last update to the payment attr_accessor :updated_date_utc - + # Booelan that tells you if the batch payment has been reconciled (read-only) attr_accessor :is_reconciled - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/batch_payment_details.rb b/lib/xero-ruby/models/accounting/batch_payment_details.rb index 2cf2fdb2..b4101272 100644 --- a/lib/xero-ruby/models/accounting/batch_payment_details.rb +++ b/lib/xero-ruby/models/accounting/batch_payment_details.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -18,19 +18,19 @@ module XeroRuby::Accounting class BatchPaymentDetails # Bank account number for use with Batch Payments attr_accessor :bank_account_number - + # Name of bank for use with Batch Payments attr_accessor :bank_account_name - + # (Non-NZ Only) These details are sent to the org’s bank as a reference for the batch payment transaction. They will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement imported into Xero. Maximum field length = 18 attr_accessor :details - + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. attr_accessor :code - + # (NZ Only) Optional references for the batch payment transaction. It will also show with the batch payment transaction in the bank reconciliation Find & Match screen. Depending on your individual bank, the detail may also show on the bank statement you import into Xero. attr_accessor :reference - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/batch_payments.rb b/lib/xero-ruby/models/accounting/batch_payments.rb index 79fd4d21..081468cb 100644 --- a/lib/xero-ruby/models/accounting/batch_payments.rb +++ b/lib/xero-ruby/models/accounting/batch_payments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class BatchPayments - attr_accessor :batch_payments + attr_accessor :batch_payments + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/bill.rb b/lib/xero-ruby/models/accounting/bill.rb index 6d5e1f66..17ff440f 100644 --- a/lib/xero-ruby/models/accounting/bill.rb +++ b/lib/xero-ruby/models/accounting/bill.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,9 +17,10 @@ module XeroRuby::Accounting class Bill # Day of Month (0-31) attr_accessor :day + attr_accessor :type - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/branding_theme.rb b/lib/xero-ruby/models/accounting/branding_theme.rb index c0073094..18a4bfdb 100644 --- a/lib/xero-ruby/models/accounting/branding_theme.rb +++ b/lib/xero-ruby/models/accounting/branding_theme.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,22 +17,23 @@ module XeroRuby::Accounting class BrandingTheme # Xero identifier attr_accessor :branding_theme_id - + # Name of branding theme attr_accessor :name - + # The location of the image file used as the logo on this branding theme attr_accessor :logo_url - + # Always INVOICE attr_accessor :type - + INVOICE = "INVOICE".freeze + # Integer – ranked order of branding theme. The default branding theme has a value of 0 attr_accessor :sort_order - + # UTC timestamp of creation date of branding theme attr_accessor :created_date_utc - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/branding_themes.rb b/lib/xero-ruby/models/accounting/branding_themes.rb index c9b03f77..55189993 100644 --- a/lib/xero-ruby/models/accounting/branding_themes.rb +++ b/lib/xero-ruby/models/accounting/branding_themes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class BrandingThemes - attr_accessor :branding_themes + attr_accessor :branding_themes + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/cis_org_setting.rb b/lib/xero-ruby/models/accounting/cis_org_setting.rb index d4978856..f3888efe 100644 --- a/lib/xero-ruby/models/accounting/cis_org_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_org_setting.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,13 +17,13 @@ module XeroRuby::Accounting class CISOrgSetting # true or false - Boolean that describes if the organisation is a CIS Contractor attr_accessor :cis_contractor_enabled - + # true or false - Boolean that describes if the organisation is a CIS SubContractor attr_accessor :cis_sub_contractor_enabled - + # CIS Deduction rate for the organisation attr_accessor :rate - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/cis_setting.rb b/lib/xero-ruby/models/accounting/cis_setting.rb index 6e77e8a0..86f11c68 100644 --- a/lib/xero-ruby/models/accounting/cis_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_setting.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,10 +17,10 @@ module XeroRuby::Accounting class CISSetting # Boolean that describes if the contact is a CIS Subcontractor attr_accessor :cis_enabled - + # CIS Deduction rate for the contact if he is a subcontractor. If the contact is not CISEnabled, then the rate is not returned attr_accessor :rate - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/cis_settings.rb b/lib/xero-ruby/models/accounting/cis_settings.rb index c39c1197..79bef977 100644 --- a/lib/xero-ruby/models/accounting/cis_settings.rb +++ b/lib/xero-ruby/models/accounting/cis_settings.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class CISSettings - attr_accessor :cis_settings + attr_accessor :cis_settings + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/contact.rb b/lib/xero-ruby/models/accounting/contact.rb index 57f70f78..e76fd726 100644 --- a/lib/xero-ruby/models/accounting/contact.rb +++ b/lib/xero-ruby/models/accounting/contact.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,116 +17,124 @@ module XeroRuby::Accounting class Contact # Xero identifier attr_accessor :contact_id - + # This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero. attr_accessor :contact_number - + # A user defined account number. This can be updated via the API and the Xero UI (max length = 50) attr_accessor :account_number - + # Current status of a contact – see contact status types attr_accessor :contact_status - + ACTIVE = "ACTIVE".freeze + ARCHIVED = "ARCHIVED".freeze + GDPRREQUEST = "GDPRREQUEST".freeze + # Full name of contact/organisation (max length = 255) attr_accessor :name - + # First name of contact person (max length = 255) attr_accessor :first_name - + # Last name of contact person (max length = 255) attr_accessor :last_name - + # Email address of contact person (umlauts not supported) (max length = 255) attr_accessor :email_address - + # Skype user name of contact attr_accessor :skype_user_name - + # See contact persons attr_accessor :contact_persons - + # Bank account number of contact attr_accessor :bank_account_details - + # Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50) attr_accessor :tax_number - + # The tax type from TaxRates attr_accessor :accounts_receivable_tax_type - + # The tax type from TaxRates attr_accessor :accounts_payable_tax_type - + # Store certain address types for a contact – see address types attr_accessor :addresses - + # Store certain phone types for a contact – see phone types attr_accessor :phones - + # true or false – Boolean that describes if a contact that has any AP invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable invoice is generated against this contact. attr_accessor :is_supplier - + # true or false – Boolean that describes if a contact has any AR invoices entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable invoice is generated against this contact. attr_accessor :is_customer + attr_accessor :default_currency - + # Store XeroNetworkKey for contacts. attr_accessor :xero_network_key - + # The default sales account code for contacts attr_accessor :sales_default_account_code - + # The default purchases account code for contacts attr_accessor :purchases_default_account_code - + # The default sales tracking categories for contacts attr_accessor :sales_tracking_categories - + # The default purchases tracking categories for contacts attr_accessor :purchases_tracking_categories - + # The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories attr_accessor :tracking_category_name - + # The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories attr_accessor :tracking_category_option + attr_accessor :payment_terms - + # UTC timestamp of last update to contact attr_accessor :updated_date_utc - + # Displays which contact groups a contact is included in attr_accessor :contact_groups - + # Website address for contact (read only) attr_accessor :website + attr_accessor :branding_theme + attr_accessor :batch_payments - + # The default discount rate for the contact (read only) attr_accessor :discount + attr_accessor :balances - + # Displays array of attachments from the API attr_accessor :attachments - + # A boolean to indicate if a contact has an attachment attr_accessor :has_attachments - + # Displays validation errors returned from the API attr_accessor :validation_errors - + # A boolean to indicate if a contact has an validation errors attr_accessor :has_validation_errors - + # Status of object attr_accessor :status_attribute_string - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/contact_group.rb b/lib/xero-ruby/models/accounting/contact_group.rb index 386bd65c..6fef44ce 100644 --- a/lib/xero-ruby/models/accounting/contact_group.rb +++ b/lib/xero-ruby/models/accounting/contact_group.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,18 @@ module XeroRuby::Accounting class ContactGroup # The Name of the contact group. Required when creating a new contact group attr_accessor :name - + # The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs. attr_accessor :status - + ACTIVE = "ACTIVE".freeze + DELETED = "DELETED".freeze + # The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9 attr_accessor :contact_group_id - + # The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL. attr_accessor :contacts - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/contact_groups.rb b/lib/xero-ruby/models/accounting/contact_groups.rb index 289ff347..e43303fa 100644 --- a/lib/xero-ruby/models/accounting/contact_groups.rb +++ b/lib/xero-ruby/models/accounting/contact_groups.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class ContactGroups - attr_accessor :contact_groups + attr_accessor :contact_groups + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/contact_person.rb b/lib/xero-ruby/models/accounting/contact_person.rb index 3d30621e..6deb3f68 100644 --- a/lib/xero-ruby/models/accounting/contact_person.rb +++ b/lib/xero-ruby/models/accounting/contact_person.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,16 @@ module XeroRuby::Accounting class ContactPerson # First name of person attr_accessor :first_name - + # Last name of person attr_accessor :last_name - + # Email address of person attr_accessor :email_address - + # boolean to indicate whether contact should be included on emails with invoices etc. attr_accessor :include_in_emails - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/contacts.rb b/lib/xero-ruby/models/accounting/contacts.rb index 71990109..9a87b2ef 100644 --- a/lib/xero-ruby/models/accounting/contacts.rb +++ b/lib/xero-ruby/models/accounting/contacts.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Contacts - attr_accessor :contacts + attr_accessor :contacts + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/country_code.rb b/lib/xero-ruby/models/accounting/country_code.rb index 4a6f5c1d..ac9a71d2 100644 --- a/lib/xero-ruby/models/accounting/country_code.rb +++ b/lib/xero-ruby/models/accounting/country_code.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/credit_note.rb b/lib/xero-ruby/models/accounting/credit_note.rb index d3723760..af858af5 100644 --- a/lib/xero-ruby/models/accounting/credit_note.rb +++ b/lib/xero-ruby/models/accounting/credit_note.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,79 +17,90 @@ module XeroRuby::Accounting class CreditNote # See Credit Note Types attr_accessor :type + ACCPAYCREDIT = "ACCPAYCREDIT".freeze + ACCRECCREDIT = "ACCRECCREDIT".freeze + attr_accessor :contact - + # The date the credit note is issued YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation attr_accessor :date - + # See Credit Note Status Codes attr_accessor :status + DRAFT = "DRAFT".freeze + SUBMITTED = "SUBMITTED".freeze + DELETED = "DELETED".freeze + AUTHORISED = "AUTHORISED".freeze + PAID = "PAID".freeze + VOIDED = "VOIDED".freeze + attr_accessor :line_amount_types - + # See Invoice Line Items attr_accessor :line_items - + # The subtotal of the credit note excluding taxes attr_accessor :sub_total - + # The total tax on the credit note attr_accessor :total_tax - + # The total of the Credit Note(subtotal + total tax) attr_accessor :total - + # UTC timestamp of last update to the credit note attr_accessor :updated_date_utc + attr_accessor :currency_code - + # Date when credit note was fully paid(UTC format) attr_accessor :fully_paid_on_date - + # Xero generated unique identifier attr_accessor :credit_note_id - + # ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings) attr_accessor :credit_note_number - + # ACCRECCREDIT only – additional reference number attr_accessor :reference - + # boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only) attr_accessor :sent_to_contact - + # The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used attr_accessor :currency_rate - + # The remaining credit balance on the Credit Note attr_accessor :remaining_credit - + # See Allocations attr_accessor :allocations - + # The amount of applied to an invoice attr_accessor :applied_amount - + # See Payments attr_accessor :payments - + # See BrandingThemes attr_accessor :branding_theme_id - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # boolean to indicate if a credit note has an attachment attr_accessor :has_attachments - + # A boolean to indicate if a credit note has an validation errors attr_accessor :has_errors - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/credit_notes.rb b/lib/xero-ruby/models/accounting/credit_notes.rb index bbbefb3c..0d6d3cbe 100644 --- a/lib/xero-ruby/models/accounting/credit_notes.rb +++ b/lib/xero-ruby/models/accounting/credit_notes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class CreditNotes - attr_accessor :credit_notes + attr_accessor :credit_notes + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/currencies.rb b/lib/xero-ruby/models/accounting/currencies.rb index c3dc69fd..27ee14ab 100644 --- a/lib/xero-ruby/models/accounting/currencies.rb +++ b/lib/xero-ruby/models/accounting/currencies.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Currencies - attr_accessor :currencies + attr_accessor :currencies + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/currency.rb b/lib/xero-ruby/models/accounting/currency.rb index 92436f02..3329e2a9 100644 --- a/lib/xero-ruby/models/accounting/currency.rb +++ b/lib/xero-ruby/models/accounting/currency.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,11 +15,12 @@ module XeroRuby::Accounting class Currency - attr_accessor :code + attr_accessor :code + # Name of Currency attr_accessor :description - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/currency_code.rb b/lib/xero-ruby/models/accounting/currency_code.rb index c4cdc829..f01c11a8 100644 --- a/lib/xero-ruby/models/accounting/currency_code.rb +++ b/lib/xero-ruby/models/accounting/currency_code.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/element.rb b/lib/xero-ruby/models/accounting/element.rb index 924fdb6e..c00ac014 100644 --- a/lib/xero-ruby/models/accounting/element.rb +++ b/lib/xero-ruby/models/accounting/element.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,22 +17,28 @@ module XeroRuby::Accounting class Element # Array of Validation Error message attr_accessor :validation_errors - + # Unique ID for batch payment object with validation error attr_accessor :batch_payment_id + attr_accessor :bank_transaction_id + attr_accessor :credit_note_id + attr_accessor :contact_id + attr_accessor :invoice_id + attr_accessor :item_id + attr_accessor :purchase_order_id - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/employee.rb b/lib/xero-ruby/models/accounting/employee.rb index e79c9620..d9b44bba 100644 --- a/lib/xero-ruby/models/accounting/employee.rb +++ b/lib/xero-ruby/models/accounting/employee.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,26 +17,31 @@ module XeroRuby::Accounting class Employee # The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 attr_accessor :employee_id - + # Current status of an employee – see contact status types attr_accessor :status - + ACTIVE = "ACTIVE".freeze + ARCHIVED = "ARCHIVED".freeze + GDPRREQUEST = "GDPRREQUEST".freeze + # First name of an employee (max length = 255) attr_accessor :first_name - + # Last name of an employee (max length = 255) attr_accessor :last_name + attr_accessor :external_link + attr_accessor :updated_date_utc - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/employees.rb b/lib/xero-ruby/models/accounting/employees.rb index 5d21865e..70a74c34 100644 --- a/lib/xero-ruby/models/accounting/employees.rb +++ b/lib/xero-ruby/models/accounting/employees.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Employees - attr_accessor :employees + attr_accessor :employees + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/error.rb b/lib/xero-ruby/models/accounting/error.rb index 5e25fb8f..f0a0cf93 100644 --- a/lib/xero-ruby/models/accounting/error.rb +++ b/lib/xero-ruby/models/accounting/error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,16 @@ module XeroRuby::Accounting class Error # Exception number attr_accessor :error_number - + # Exception type attr_accessor :type - + # Exception message attr_accessor :message - + # Array of Elements of validation Errors attr_accessor :elements - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/expense_claim.rb b/lib/xero-ruby/models/accounting/expense_claim.rb index b7089e4d..4b1d3dbc 100644 --- a/lib/xero-ruby/models/accounting/expense_claim.rb +++ b/lib/xero-ruby/models/accounting/expense_claim.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,38 +17,45 @@ module XeroRuby::Accounting class ExpenseClaim # Xero generated unique identifier for an expense claim attr_accessor :expense_claim_id - + # Current status of an expense claim – see status types attr_accessor :status - + SUBMITTED = "SUBMITTED".freeze + AUTHORISED = "AUTHORISED".freeze + PAID = "PAID".freeze + VOIDED = "VOIDED".freeze + DELETED = "DELETED".freeze + # See Payments attr_accessor :payments + attr_accessor :user + attr_accessor :receipts - + # Last modified date UTC format attr_accessor :updated_date_utc - + # The total of an expense claim being paid attr_accessor :total - + # The amount due to be paid for an expense claim attr_accessor :amount_due - + # The amount still to pay for an expense claim attr_accessor :amount_paid - + # The date when the expense claim is due to be paid YYYY-MM-DD attr_accessor :payment_due_date - + # The date the expense claim will be reported in Xero YYYY-MM-DD attr_accessor :reporting_date - + # The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9 attr_accessor :receipt_id - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/expense_claims.rb b/lib/xero-ruby/models/accounting/expense_claims.rb index 9f310844..530402a8 100644 --- a/lib/xero-ruby/models/accounting/expense_claims.rb +++ b/lib/xero-ruby/models/accounting/expense_claims.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class ExpenseClaims - attr_accessor :expense_claims + attr_accessor :expense_claims + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/external_link.rb b/lib/xero-ruby/models/accounting/external_link.rb index eee67f1a..14116283 100644 --- a/lib/xero-ruby/models/accounting/external_link.rb +++ b/lib/xero-ruby/models/accounting/external_link.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,12 +17,18 @@ module XeroRuby::Accounting class ExternalLink # See External link types attr_accessor :link_type - + FACEBOOK = "Facebook".freeze + GOOGLE_PLUS = "GooglePlus".freeze + LINKED_IN = "LinkedIn".freeze + TWITTER = "Twitter".freeze + WEBSITE = "Website".freeze + # URL for service e.g. http://twitter.com/xeroapi attr_accessor :url + attr_accessor :description - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/history_record.rb b/lib/xero-ruby/models/accounting/history_record.rb index 6cb6ad84..a0a0f277 100644 --- a/lib/xero-ruby/models/accounting/history_record.rb +++ b/lib/xero-ruby/models/accounting/history_record.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,16 @@ module XeroRuby::Accounting class HistoryRecord # details attr_accessor :details - + # Name of branding theme attr_accessor :changes - + # has a value of 0 attr_accessor :user - + # UTC timestamp of creation date of branding theme attr_accessor :date_utc - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/history_records.rb b/lib/xero-ruby/models/accounting/history_records.rb index ea0f4a69..55d77ca3 100644 --- a/lib/xero-ruby/models/accounting/history_records.rb +++ b/lib/xero-ruby/models/accounting/history_records.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class HistoryRecords - attr_accessor :history_records + attr_accessor :history_records + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/invoice.rb b/lib/xero-ruby/models/accounting/invoice.rb index 678271dd..15f8aa97 100644 --- a/lib/xero-ruby/models/accounting/invoice.rb +++ b/lib/xero-ruby/models/accounting/invoice.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,115 +17,132 @@ module XeroRuby::Accounting class Invoice # See Invoice Types attr_accessor :type + ACCPAY = "ACCPAY".freeze + ACCPAYCREDIT = "ACCPAYCREDIT".freeze + APOVERPAYMENT = "APOVERPAYMENT".freeze + APPREPAYMENT = "APPREPAYMENT".freeze + ACCREC = "ACCREC".freeze + ACCRECCREDIT = "ACCRECCREDIT".freeze + AROVERPAYMENT = "AROVERPAYMENT".freeze + ARPREPAYMENT = "ARPREPAYMENT".freeze + attr_accessor :contact - + # See LineItems attr_accessor :line_items - + # Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation attr_accessor :date - + # Date invoice is due – YYYY-MM-DD attr_accessor :due_date + attr_accessor :line_amount_types - + # ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255) attr_accessor :invoice_number - + # ACCREC only – additional reference number (max length = 255) attr_accessor :reference - + # See BrandingThemes attr_accessor :branding_theme_id - + # URL link to a source document – shown as “Go to [appName]” in the Xero app attr_accessor :url + attr_accessor :currency_code - + # The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6]) attr_accessor :currency_rate - + # See Invoice Status Codes attr_accessor :status - + DRAFT = "DRAFT".freeze + SUBMITTED = "SUBMITTED".freeze + DELETED = "DELETED".freeze + AUTHORISED = "AUTHORISED".freeze + PAID = "PAID".freeze + VOIDED = "VOIDED".freeze + # Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved attr_accessor :sent_to_contact - + # Shown on sales invoices (Accounts Receivable) when this has been set attr_accessor :expected_payment_date - + # Shown on bills (Accounts Payable) when this has been set attr_accessor :planned_payment_date - + # CIS deduction for UK contractors attr_accessor :cis_deduction - + # Total of invoice excluding taxes attr_accessor :sub_total - + # Total tax on invoice attr_accessor :total_tax - + # Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts attr_accessor :total - + # Total of discounts applied on the invoice line items attr_accessor :total_discount - + # Xero generated unique identifier for invoice attr_accessor :invoice_id - + # boolean to indicate if an invoice has an attachment attr_accessor :has_attachments - + # boolean to indicate if an invoice has a discount attr_accessor :is_discounted - + # See Payments attr_accessor :payments - + # See Prepayments attr_accessor :prepayments - + # See Overpayments attr_accessor :overpayments - + # Amount remaining to be paid on invoice attr_accessor :amount_due - + # Sum of payments received for invoice attr_accessor :amount_paid - + # The date the invoice was fully paid. Only returned on fully paid invoices attr_accessor :fully_paid_on_date - + # Sum of all credit notes, over-payments and pre-payments applied to invoice attr_accessor :amount_credited - + # Last modified date UTC format attr_accessor :updated_date_utc - + # Details of credit notes that have been applied to an invoice attr_accessor :credit_notes - + # Displays array of attachments from the API attr_accessor :attachments - + # A boolean to indicate if a invoice has an validation errors attr_accessor :has_errors - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Displays array of warning messages from the API attr_accessor :warnings - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/invoice_reminder.rb b/lib/xero-ruby/models/accounting/invoice_reminder.rb index 7a452281..902f8714 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminder.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminder.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,7 +17,7 @@ module XeroRuby::Accounting class InvoiceReminder # setting for on or off attr_accessor :enabled - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/invoice_reminders.rb b/lib/xero-ruby/models/accounting/invoice_reminders.rb index 8143ad1f..f3c3f4bb 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminders.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminders.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class InvoiceReminders - attr_accessor :invoice_reminders + attr_accessor :invoice_reminders + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/invoices.rb b/lib/xero-ruby/models/accounting/invoices.rb index b7cdf9a6..3609dcbd 100644 --- a/lib/xero-ruby/models/accounting/invoices.rb +++ b/lib/xero-ruby/models/accounting/invoices.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Invoices - attr_accessor :invoices + attr_accessor :invoices + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/item.rb b/lib/xero-ruby/models/accounting/item.rb index 6374e1f6..512b4e5b 100644 --- a/lib/xero-ruby/models/accounting/item.rb +++ b/lib/xero-ruby/models/accounting/item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,50 +17,52 @@ module XeroRuby::Accounting class Item # User defined item code (max length = 30) attr_accessor :code - + # The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item attr_accessor :inventory_asset_account_code - + # The name of the item (max length = 50) attr_accessor :name - + # Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. attr_accessor :is_sold - + # Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. attr_accessor :is_purchased - + # The sales description of the item (max length = 4000) attr_accessor :description - + # The purchase description of the item (max length = 4000) attr_accessor :purchase_description + attr_accessor :purchase_details + attr_accessor :sales_details - + # True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. attr_accessor :is_tracked_as_inventory - + # The value of the item on hand. Calculated using average cost accounting. attr_accessor :total_cost_pool - + # The quantity of the item on hand attr_accessor :quantity_on_hand - + # Last modified date in UTC format attr_accessor :updated_date_utc - + # The Xero identifier for an Item attr_accessor :item_id - + # Status of object attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/items.rb b/lib/xero-ruby/models/accounting/items.rb index a5e6ce9a..a04ab19c 100644 --- a/lib/xero-ruby/models/accounting/items.rb +++ b/lib/xero-ruby/models/accounting/items.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Items - attr_accessor :items + attr_accessor :items + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/journal.rb b/lib/xero-ruby/models/accounting/journal.rb index 13962deb..247d824e 100644 --- a/lib/xero-ruby/models/accounting/journal.rb +++ b/lib/xero-ruby/models/accounting/journal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,28 +17,53 @@ module XeroRuby::Accounting class Journal # Xero identifier attr_accessor :journal_id - + # Date the journal was posted attr_accessor :journal_date - + # Xero generated journal number attr_accessor :journal_number - + # Created date UTC format attr_accessor :created_date_utc - + # reference field for additional indetifying information attr_accessor :reference - + # The identifier for the source transaction (e.g. InvoiceID) attr_accessor :source_id - + # The journal source type. The type of transaction that created the journal attr_accessor :source_type - + ACCREC = "ACCREC".freeze + ACCPAY = "ACCPAY".freeze + ACCRECCREDIT = "ACCRECCREDIT".freeze + ACCPAYCREDIT = "ACCPAYCREDIT".freeze + ACCRECPAYMENT = "ACCRECPAYMENT".freeze + ACCPAYPAYMENT = "ACCPAYPAYMENT".freeze + ARCREDITPAYMENT = "ARCREDITPAYMENT".freeze + APCREDITPAYMENT = "APCREDITPAYMENT".freeze + CASHREC = "CASHREC".freeze + CASHPAID = "CASHPAID".freeze + TRANSFER = "TRANSFER".freeze + ARPREPAYMENT = "ARPREPAYMENT".freeze + APPREPAYMENT = "APPREPAYMENT".freeze + AROVERPAYMENT = "AROVERPAYMENT".freeze + APOVERPAYMENT = "APOVERPAYMENT".freeze + EXPCLAIM = "EXPCLAIM".freeze + EXPPAYMENT = "EXPPAYMENT".freeze + MANJOURNAL = "MANJOURNAL".freeze + PAYSLIP = "PAYSLIP".freeze + WAGEPAYABLE = "WAGEPAYABLE".freeze + INTEGRATEDPAYROLLPE = "INTEGRATEDPAYROLLPE".freeze + INTEGRATEDPAYROLLPT = "INTEGRATEDPAYROLLPT".freeze + EXTERNALSPENDMONEY = "EXTERNALSPENDMONEY".freeze + INTEGRATEDPAYROLLPTPAYMENT = "INTEGRATEDPAYROLLPTPAYMENT".freeze + INTEGRATEDPAYROLLCN = "INTEGRATEDPAYROLLCN".freeze + # See JournalLines attr_accessor :journal_lines - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/journal_line.rb b/lib/xero-ruby/models/accounting/journal_line.rb index 7e593eb4..c319770b 100644 --- a/lib/xero-ruby/models/accounting/journal_line.rb +++ b/lib/xero-ruby/models/accounting/journal_line.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,39 +17,40 @@ module XeroRuby::Accounting class JournalLine # Xero identifier for Journal attr_accessor :journal_line_id - + # See Accounts attr_accessor :account_id - + # See Accounts attr_accessor :account_code + attr_accessor :account_type - + # See AccountCodes attr_accessor :account_name - + # The description from the source transaction line item. Only returned if populated. attr_accessor :description - + # Net amount of journal line. This will be a positive value for a debit and negative for a credit attr_accessor :net_amount - + # Gross amount of journal line (NetAmount + TaxAmount). attr_accessor :gross_amount - + # Total tax on a journal line attr_accessor :tax_amount - + # The tax type from TaxRates attr_accessor :tax_type - + # see TaxRates attr_accessor :tax_name - + # Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements. attr_accessor :tracking_categories - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/journals.rb b/lib/xero-ruby/models/accounting/journals.rb index 985c24a7..f3e7341a 100644 --- a/lib/xero-ruby/models/accounting/journals.rb +++ b/lib/xero-ruby/models/accounting/journals.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Journals - attr_accessor :journals + attr_accessor :journals + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/line_amount_types.rb b/lib/xero-ruby/models/accounting/line_amount_types.rb index 84264448..6da52859 100644 --- a/lib/xero-ruby/models/accounting/line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/line_amount_types.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/line_item.rb b/lib/xero-ruby/models/accounting/line_item.rb index 92ef489d..67afa953 100644 --- a/lib/xero-ruby/models/accounting/line_item.rb +++ b/lib/xero-ruby/models/accounting/line_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,43 +17,43 @@ module XeroRuby::Accounting class LineItem # LineItem unique ID attr_accessor :line_item_id - + # Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a element that contains at least 1 character attr_accessor :description - + # LineItem Quantity attr_accessor :quantity - + # LineItem Unit Amount attr_accessor :unit_amount - + # See Items attr_accessor :item_code - + # See Accounts attr_accessor :account_code - + # The tax type from TaxRates attr_accessor :tax_type - + # The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated is not correct. attr_accessor :tax_amount - + # If you wish to omit either of the or you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100) attr_accessor :line_amount - + # Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 elements. attr_accessor :tracking - + # Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts attr_accessor :discount_rate - + # Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts. attr_accessor :discount_amount - + # The Xero identifier for a Repeating Invoice attr_accessor :repeating_invoice_id - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/line_item_tracking.rb b/lib/xero-ruby/models/accounting/line_item_tracking.rb index e865ec9c..1ad0fa66 100644 --- a/lib/xero-ruby/models/accounting/line_item_tracking.rb +++ b/lib/xero-ruby/models/accounting/line_item_tracking.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,16 @@ module XeroRuby::Accounting class LineItemTracking # The Xero identifier for a tracking category attr_accessor :tracking_category_id - + # The Xero identifier for a tracking category option attr_accessor :tracking_option_id - + # The name of the tracking category attr_accessor :name - + # See Tracking Options attr_accessor :option - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/linked_transaction.rb b/lib/xero-ruby/models/accounting/linked_transaction.rb index 649de7c1..2ff311b4 100644 --- a/lib/xero-ruby/models/accounting/linked_transaction.rb +++ b/lib/xero-ruby/models/accounting/linked_transaction.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,37 +17,45 @@ module XeroRuby::Accounting class LinkedTransaction # Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice attr_accessor :source_transaction_id - + # The line item identifier from the source transaction. attr_accessor :source_line_item_id - + # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. attr_accessor :contact_id - + # Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice attr_accessor :target_transaction_id - + # The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID. attr_accessor :target_line_item_id - + # The Xero identifier for an Linked Transaction e.g./LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9 attr_accessor :linked_transaction_id - + # Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED. attr_accessor :status - + APPROVED = "APPROVED".freeze + DRAFT = "DRAFT".freeze + ONDRAFT = "ONDRAFT".freeze + BILLED = "BILLED".freeze + VOIDED = "VOIDED".freeze + # This will always be BILLABLEEXPENSE. More types may be added in future. attr_accessor :type - + BILLABLEEXPENSE = "BILLABLEEXPENSE".freeze + # The last modified date in UTC format attr_accessor :updated_date_utc - + # The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction. attr_accessor :source_transaction_type_code - + ACCPAY = "ACCPAY".freeze + SPEND = "SPEND".freeze + # Displays array of validation error messages from the API attr_accessor :validation_errors - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/linked_transactions.rb b/lib/xero-ruby/models/accounting/linked_transactions.rb index 86c6e701..54ed18c9 100644 --- a/lib/xero-ruby/models/accounting/linked_transactions.rb +++ b/lib/xero-ruby/models/accounting/linked_transactions.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class LinkedTransactions - attr_accessor :linked_transactions + attr_accessor :linked_transactions + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/manual_journal.rb b/lib/xero-ruby/models/accounting/manual_journal.rb index 0be61478..ce710873 100644 --- a/lib/xero-ruby/models/accounting/manual_journal.rb +++ b/lib/xero-ruby/models/accounting/manual_journal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,45 +17,51 @@ module XeroRuby::Accounting class ManualJournal # Description of journal being posted attr_accessor :narration - + # See JournalLines attr_accessor :journal_lines - + # Date journal was posted – YYYY-MM-DD attr_accessor :date + attr_accessor :line_amount_types - + # See Manual Journal Status Codes attr_accessor :status - + DRAFT = "DRAFT".freeze + POSTED = "POSTED".freeze + DELETED = "DELETED".freeze + VOIDED = "VOIDED".freeze + ARCHIVED = "ARCHIVED".freeze + # Url link to a source document – shown as “Go to [appName]” in the Xero app attr_accessor :url - + # Boolean – default is true if not specified attr_accessor :show_on_cash_basis_reports - + # Boolean to indicate if a manual journal has an attachment attr_accessor :has_attachments - + # Last modified date UTC format attr_accessor :updated_date_utc - + # The Xero identifier for a Manual Journal attr_accessor :manual_journal_id - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of warning messages from the API attr_accessor :warnings - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Displays array of attachments from the API attr_accessor :attachments - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/manual_journal_line.rb b/lib/xero-ruby/models/accounting/manual_journal_line.rb index cc790c63..0637594f 100644 --- a/lib/xero-ruby/models/accounting/manual_journal_line.rb +++ b/lib/xero-ruby/models/accounting/manual_journal_line.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,25 +17,25 @@ module XeroRuby::Accounting class ManualJournalLine # total for line. Debits are positive, credits are negative value attr_accessor :line_amount - + # See Accounts attr_accessor :account_code - + # Description for journal line attr_accessor :description - + # The tax type from TaxRates attr_accessor :tax_type - + # Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 elements. attr_accessor :tracking - + # The calculated tax amount based on the TaxType and LineAmount attr_accessor :tax_amount - + # is the line blank attr_accessor :is_blank - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/manual_journals.rb b/lib/xero-ruby/models/accounting/manual_journals.rb index 522708aa..abec9055 100644 --- a/lib/xero-ruby/models/accounting/manual_journals.rb +++ b/lib/xero-ruby/models/accounting/manual_journals.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class ManualJournals - attr_accessor :manual_journals + attr_accessor :manual_journals + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/online_invoice.rb b/lib/xero-ruby/models/accounting/online_invoice.rb index 9e4aeba7..99263cc6 100644 --- a/lib/xero-ruby/models/accounting/online_invoice.rb +++ b/lib/xero-ruby/models/accounting/online_invoice.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,7 +17,7 @@ module XeroRuby::Accounting class OnlineInvoice # the URL to an online invoice attr_accessor :online_invoice_url - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/online_invoices.rb b/lib/xero-ruby/models/accounting/online_invoices.rb index e1835fd4..8f25aa3e 100644 --- a/lib/xero-ruby/models/accounting/online_invoices.rb +++ b/lib/xero-ruby/models/accounting/online_invoices.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class OnlineInvoices - attr_accessor :online_invoices + attr_accessor :online_invoices + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index 72d39c67..1d227679 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,99 +17,173 @@ module XeroRuby::Accounting class Organisation # Unique Xero identifier attr_accessor :organisation_id - + # Display a unique key used for Xero-to-Xero transactions attr_accessor :api_key - + # Display name of organisation shown in Xero attr_accessor :name - + # Organisation name shown on Reports attr_accessor :legal_name - + # Boolean to describe if organisation is registered with a local tax authority i.e. true, false attr_accessor :pays_tax - + # See Version Types attr_accessor :version - + AU = "AU".freeze + NZ = "NZ".freeze + GLOBAL = "GLOBAL".freeze + UK = "UK".freeze + US = "US".freeze + AUONRAMP = "AUONRAMP".freeze + NZONRAMP = "NZONRAMP".freeze + GLOBALONRAMP = "GLOBALONRAMP".freeze + UKONRAMP = "UKONRAMP".freeze + USONRAMP = "USONRAMP".freeze + # Organisation Type attr_accessor :organisation_type + ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze + COMPANY = "COMPANY".freeze + CHARITY = "CHARITY".freeze + CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze + LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze + NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze + PARTNERSHIP = "PARTNERSHIP".freeze + S_CORPORATION = "S_CORPORATION".freeze + SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze + SOLE_TRADER = "SOLE_TRADER".freeze + SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze + TRUST = "TRUST".freeze + attr_accessor :base_currency + attr_accessor :country_code - + # Boolean to describe if organisation is a demo company. attr_accessor :is_demo_company - + # Will be set to ACTIVE if you can connect to organisation via the Xero API attr_accessor :organisation_status - + # Shows for New Zealand, Australian and UK organisations attr_accessor :registration_number - + # Shown if set. US Only. attr_accessor :employer_identification_number - + # Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global). attr_accessor :tax_number - + # Calendar day e.g. 0-31 attr_accessor :financial_year_end_day - + # Calendar Month e.g. 1-12 attr_accessor :financial_year_end_month - + # The accounting basis used for tax returns. See Sales Tax Basis attr_accessor :sales_tax_basis - + PAYMENTS = "PAYMENTS".freeze + INVOICE = "INVOICE".freeze + NONE = "NONE".freeze + CASH = "CASH".freeze + ACCRUAL = "ACCRUAL".freeze + FLATRATECASH = "FLATRATECASH".freeze + FLATRATEACCRUAL = "FLATRATEACCRUAL".freeze + ACCRUALS = "ACCRUALS".freeze + # The frequency with which tax returns are processed. See Sales Tax Period attr_accessor :sales_tax_period - + MONTHLY = "MONTHLY".freeze + QUARTERLY1 = "QUARTERLY1".freeze + QUARTERLY2 = "QUARTERLY2".freeze + QUARTERLY3 = "QUARTERLY3".freeze + ANNUALLY = "ANNUALLY".freeze + ONEMONTHS = "ONEMONTHS".freeze + TWOMONTHS = "TWOMONTHS".freeze + SIXMONTHS = "SIXMONTHS".freeze + N1_MONTHLY = "1MONTHLY".freeze + N2_MONTHLY = "2MONTHLY".freeze + N3_MONTHLY = "3MONTHLY".freeze + N6_MONTHLY = "6MONTHLY".freeze + QUARTERLY = "QUARTERLY".freeze + YEARLY = "YEARLY".freeze + NONE = "NONE".freeze + # The default for LineAmountTypes on sales transactions attr_accessor :default_sales_tax - + # The default for LineAmountTypes on purchase transactions attr_accessor :default_purchases_tax - + # Shown if set. See lock dates attr_accessor :period_lock_date - + # Shown if set. See lock dates attr_accessor :end_of_year_lock_date - + # Timestamp when the organisation was created in Xero attr_accessor :created_date_utc + attr_accessor :timezone - + # Organisation Type attr_accessor :organisation_entity_type - + ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze + COMPANY = "COMPANY".freeze + CHARITY = "CHARITY".freeze + CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze + LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze + NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze + PARTNERSHIP = "PARTNERSHIP".freeze + S_CORPORATION = "S_CORPORATION".freeze + SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze + SOLE_TRADER = "SOLE_TRADER".freeze + SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze + TRUST = "TRUST".freeze + # A unique identifier for the organisation. Potential uses. attr_accessor :short_code - + # Organisation Classes describe which plan the Xero organisation is on (e.g. DEMO, TRIAL, PREMIUM) attr_accessor :_class - + DEMO = "DEMO".freeze + TRIAL = "TRIAL".freeze + STARTER = "STARTER".freeze + STANDARD = "STANDARD".freeze + PREMIUM = "PREMIUM".freeze + PREMIUM_20 = "PREMIUM_20".freeze + PREMIUM_50 = "PREMIUM_50".freeze + PREMIUM_100 = "PREMIUM_100".freeze + LEDGER = "LEDGER".freeze + GST_CASHBOOK = "GST_CASHBOOK".freeze + NON_GST_CASHBOOK = "NON_GST_CASHBOOK".freeze + # BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing) attr_accessor :edition - + BUSINESS = "BUSINESS".freeze + PARTNER = "PARTNER".freeze + # Description of business type as defined in Organisation settings attr_accessor :line_of_business - + # Address details for organisation – see Addresses attr_accessor :addresses - + # Phones details for organisation – see Phones attr_accessor :phones - + # Organisation profile links for popular services such as Facebook,Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings is updated in Xero. See ExternalLinks below attr_accessor :external_links + attr_accessor :payment_terms - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/organisations.rb b/lib/xero-ruby/models/accounting/organisations.rb index 97e2fa0f..cb449f66 100644 --- a/lib/xero-ruby/models/accounting/organisations.rb +++ b/lib/xero-ruby/models/accounting/organisations.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Organisations - attr_accessor :organisations + attr_accessor :organisations + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/overpayment.rb b/lib/xero-ruby/models/accounting/overpayment.rb index a796bba2..167069d8 100644 --- a/lib/xero-ruby/models/accounting/overpayment.rb +++ b/lib/xero-ruby/models/accounting/overpayment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,58 +17,67 @@ module XeroRuby::Accounting class Overpayment # See Overpayment Types attr_accessor :type + RECEIVE_OVERPAYMENT = "RECEIVE-OVERPAYMENT".freeze + SPEND_OVERPAYMENT = "SPEND-OVERPAYMENT".freeze + AROVERPAYMENT = "AROVERPAYMENT".freeze + attr_accessor :contact - + # The date the overpayment is created YYYY-MM-DD attr_accessor :date - + # See Overpayment Status Codes attr_accessor :status + AUTHORISED = "AUTHORISED".freeze + PAID = "PAID".freeze + VOIDED = "VOIDED".freeze + attr_accessor :line_amount_types - + # See Overpayment Line Items attr_accessor :line_items - + # The subtotal of the overpayment excluding taxes attr_accessor :sub_total - + # The total tax on the overpayment attr_accessor :total_tax - + # The total of the overpayment (subtotal + total tax) attr_accessor :total - + # UTC timestamp of last update to the overpayment attr_accessor :updated_date_utc + attr_accessor :currency_code - + # Xero generated unique identifier attr_accessor :overpayment_id - + # The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used attr_accessor :currency_rate - + # The remaining credit balance on the overpayment attr_accessor :remaining_credit - + # See Allocations attr_accessor :allocations - + # The amount of applied to an invoice attr_accessor :applied_amount - + # See Payments attr_accessor :payments - + # boolean to indicate if a overpayment has an attachment attr_accessor :has_attachments - + # See Attachments attr_accessor :attachments - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/overpayments.rb b/lib/xero-ruby/models/accounting/overpayments.rb index b7fa83a6..cc4c0a1f 100644 --- a/lib/xero-ruby/models/accounting/overpayments.rb +++ b/lib/xero-ruby/models/accounting/overpayments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Overpayments - attr_accessor :overpayments + attr_accessor :overpayments + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/payment.rb b/lib/xero-ruby/models/accounting/payment.rb index bcba190e..6eee2a6e 100644 --- a/lib/xero-ruby/models/accounting/payment.rb +++ b/lib/xero-ruby/models/accounting/payment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,73 +15,88 @@ module XeroRuby::Accounting class Payment + attr_accessor :invoice + attr_accessor :credit_note + attr_accessor :prepayment + attr_accessor :overpayment - + # Number of invoice or credit note you are applying payment to e.g.INV-4003 attr_accessor :invoice_number - + # Number of invoice or credit note you are applying payment to e.g. INV-4003 attr_accessor :credit_note_number + attr_accessor :account - + # Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value) attr_accessor :code - + # Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06 attr_accessor :date - + # Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500 attr_accessor :currency_rate - + # The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00 attr_accessor :amount - + # An optional description for the payment e.g. Direct Debit attr_accessor :reference - + # An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET attr_accessor :is_reconciled - + # The status of the payment. attr_accessor :status - + AUTHORISED = "AUTHORISED".freeze + DELETED = "DELETED".freeze + # See Payment Types. attr_accessor :payment_type - + ACCRECPAYMENT = "ACCRECPAYMENT".freeze + ACCPAYPAYMENT = "ACCPAYPAYMENT".freeze + ARCREDITPAYMENT = "ARCREDITPAYMENT".freeze + APCREDITPAYMENT = "APCREDITPAYMENT".freeze + AROVERPAYMENTPAYMENT = "AROVERPAYMENTPAYMENT".freeze + ARPREPAYMENTPAYMENT = "ARPREPAYMENTPAYMENT".freeze + APPREPAYMENTPAYMENT = "APPREPAYMENTPAYMENT".freeze + APOVERPAYMENTPAYMENT = "APOVERPAYMENTPAYMENT".freeze + # UTC timestamp of last update to the payment attr_accessor :updated_date_utc - + # The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 attr_accessor :payment_id - + # The suppliers bank account number the payment is being made to attr_accessor :bank_account_number - + # The suppliers bank account number the payment is being made to attr_accessor :particulars - + # The information to appear on the supplier's bank account attr_accessor :details - + # A boolean to indicate if a contact has an validation errors attr_accessor :has_account - + # A boolean to indicate if a contact has an validation errors attr_accessor :has_validation_errors - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/payment_delete.rb b/lib/xero-ruby/models/accounting/payment_delete.rb index 5b6fab3b..047fc0b3 100644 --- a/lib/xero-ruby/models/accounting/payment_delete.rb +++ b/lib/xero-ruby/models/accounting/payment_delete.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,7 +17,7 @@ module XeroRuby::Accounting class PaymentDelete # The status of the payment. attr_accessor :status - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/payment_service.rb b/lib/xero-ruby/models/accounting/payment_service.rb index ea8fa2d8..8718b9bd 100644 --- a/lib/xero-ruby/models/accounting/payment_service.rb +++ b/lib/xero-ruby/models/accounting/payment_service.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,22 +17,22 @@ module XeroRuby::Accounting class PaymentService # Xero identifier attr_accessor :payment_service_id - + # Name of payment service attr_accessor :payment_service_name - + # The custom payment URL attr_accessor :payment_service_url - + # The text displayed on the Pay Now button in Xero Online Invoicing. If this is not set it will default to Pay by credit card attr_accessor :pay_now_text - + # This will always be CUSTOM for payment services created via the API. attr_accessor :payment_service_type - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/payment_services.rb b/lib/xero-ruby/models/accounting/payment_services.rb index 7c6153f3..426d38d0 100644 --- a/lib/xero-ruby/models/accounting/payment_services.rb +++ b/lib/xero-ruby/models/accounting/payment_services.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class PaymentServices - attr_accessor :payment_services + attr_accessor :payment_services + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/payment_term.rb b/lib/xero-ruby/models/accounting/payment_term.rb index ec71976e..8844a406 100644 --- a/lib/xero-ruby/models/accounting/payment_term.rb +++ b/lib/xero-ruby/models/accounting/payment_term.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,10 +15,12 @@ module XeroRuby::Accounting class PaymentTerm + attr_accessor :bills + attr_accessor :sales - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/payment_term_type.rb b/lib/xero-ruby/models/accounting/payment_term_type.rb index 9ce43bda..8c380e92 100644 --- a/lib/xero-ruby/models/accounting/payment_term_type.rb +++ b/lib/xero-ruby/models/accounting/payment_term_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/payments.rb b/lib/xero-ruby/models/accounting/payments.rb index 540723f3..6ace8cd9 100644 --- a/lib/xero-ruby/models/accounting/payments.rb +++ b/lib/xero-ruby/models/accounting/payments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Payments - attr_accessor :payments + attr_accessor :payments + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/phone.rb b/lib/xero-ruby/models/accounting/phone.rb index 18fd6552..5d68b7e3 100644 --- a/lib/xero-ruby/models/accounting/phone.rb +++ b/lib/xero-ruby/models/accounting/phone.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,17 +15,23 @@ module XeroRuby::Accounting class Phone - attr_accessor :phone_type + attr_accessor :phone_type + DEFAULT = "DEFAULT".freeze + DDI = "DDI".freeze + MOBILE = "MOBILE".freeze + FAX = "FAX".freeze + OFFICE = "OFFICE".freeze + # max length = 50 attr_accessor :phone_number - + # max length = 10 attr_accessor :phone_area_code - + # max length = 20 attr_accessor :phone_country_code - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/prepayment.rb b/lib/xero-ruby/models/accounting/prepayment.rb index d89ebf5c..fa801f3d 100644 --- a/lib/xero-ruby/models/accounting/prepayment.rb +++ b/lib/xero-ruby/models/accounting/prepayment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,58 +17,68 @@ module XeroRuby::Accounting class Prepayment # See Prepayment Types attr_accessor :type + RECEIVE_PREPAYMENT = "RECEIVE-PREPAYMENT".freeze + SPEND_PREPAYMENT = "SPEND-PREPAYMENT".freeze + ARPREPAYMENT = "ARPREPAYMENT".freeze + APPREPAYMENT = "APPREPAYMENT".freeze + attr_accessor :contact - + # The date the prepayment is created YYYY-MM-DD attr_accessor :date - + # See Prepayment Status Codes attr_accessor :status + AUTHORISED = "AUTHORISED".freeze + PAID = "PAID".freeze + VOIDED = "VOIDED".freeze + attr_accessor :line_amount_types - + # See Prepayment Line Items attr_accessor :line_items - + # The subtotal of the prepayment excluding taxes attr_accessor :sub_total - + # The total tax on the prepayment attr_accessor :total_tax - + # The total of the prepayment(subtotal + total tax) attr_accessor :total - + # Returns Invoice number field. Reference field isn't available. attr_accessor :reference - + # UTC timestamp of last update to the prepayment attr_accessor :updated_date_utc + attr_accessor :currency_code - + # Xero generated unique identifier attr_accessor :prepayment_id - + # The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used attr_accessor :currency_rate - + # The remaining credit balance on the prepayment attr_accessor :remaining_credit - + # See Allocations attr_accessor :allocations - + # The amount of applied to an invoice attr_accessor :applied_amount - + # boolean to indicate if a prepayment has an attachment attr_accessor :has_attachments - + # See Attachments attr_accessor :attachments - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/prepayments.rb b/lib/xero-ruby/models/accounting/prepayments.rb index 35afec98..8d77dc16 100644 --- a/lib/xero-ruby/models/accounting/prepayments.rb +++ b/lib/xero-ruby/models/accounting/prepayments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Prepayments - attr_accessor :prepayments + attr_accessor :prepayments + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/purchase.rb b/lib/xero-ruby/models/accounting/purchase.rb index 7bde8095..8ad03fb6 100644 --- a/lib/xero-ruby/models/accounting/purchase.rb +++ b/lib/xero-ruby/models/accounting/purchase.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,16 @@ module XeroRuby::Accounting class Purchase # Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. attr_accessor :unit_price - + # Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items attr_accessor :account_code - + # Cost of goods sold account. Only applicable to the purchase details of tracked items. attr_accessor :cogs_account_code - + # The tax type from TaxRates attr_accessor :tax_type - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/purchase_order.rb b/lib/xero-ruby/models/accounting/purchase_order.rb index 6a919d7b..3a35b1fd 100644 --- a/lib/xero-ruby/models/accounting/purchase_order.rb +++ b/lib/xero-ruby/models/accounting/purchase_order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,87 +15,95 @@ module XeroRuby::Accounting class PurchaseOrder - attr_accessor :contact + attr_accessor :contact + # See LineItems attr_accessor :line_items - + # Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation attr_accessor :date - + # Date the goods are to be delivered – YYYY-MM-DD attr_accessor :delivery_date + attr_accessor :line_amount_types - + # Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings) attr_accessor :purchase_order_number - + # Additional reference number attr_accessor :reference - + # See BrandingThemes attr_accessor :branding_theme_id + attr_accessor :currency_code - + # See Purchase Order Status Codes attr_accessor :status - + DRAFT = "DRAFT".freeze + SUBMITTED = "SUBMITTED".freeze + AUTHORISED = "AUTHORISED".freeze + BILLED = "BILLED".freeze + DELETED = "DELETED".freeze + # Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed attr_accessor :sent_to_contact - + # The address the goods are to be delivered to attr_accessor :delivery_address - + # The person that the delivery is going to attr_accessor :attention_to - + # The phone number for the person accepting the delivery attr_accessor :telephone - + # A free text feild for instructions (500 characters max) attr_accessor :delivery_instructions - + # The date the goods are expected to arrive. attr_accessor :expected_arrival_date - + # Xero generated unique identifier for purchase order attr_accessor :purchase_order_id - + # The currency rate for a multicurrency purchase order. If no rate is specified, the XE.com day rate is used. attr_accessor :currency_rate - + # Total of purchase order excluding taxes attr_accessor :sub_total - + # Total tax on purchase order attr_accessor :total_tax - + # Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax) attr_accessor :total - + # Total of discounts applied on the purchase order line items attr_accessor :total_discount - + # boolean to indicate if a purchase order has an attachment attr_accessor :has_attachments - + # Last modified date UTC format attr_accessor :updated_date_utc - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Displays array of warning messages from the API attr_accessor :warnings - + # Displays array of attachments from the API attr_accessor :attachments - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/purchase_orders.rb b/lib/xero-ruby/models/accounting/purchase_orders.rb index 9d74acc0..fd40cea4 100644 --- a/lib/xero-ruby/models/accounting/purchase_orders.rb +++ b/lib/xero-ruby/models/accounting/purchase_orders.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class PurchaseOrders - attr_accessor :purchase_orders + attr_accessor :purchase_orders + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/quote.rb b/lib/xero-ruby/models/accounting/quote.rb index a8f1b94c..112a50fd 100644 --- a/lib/xero-ruby/models/accounting/quote.rb +++ b/lib/xero-ruby/models/accounting/quote.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,72 +17,76 @@ module XeroRuby::Accounting class Quote # QuoteID GUID is automatically generated and is returned after create or GET. attr_accessor :quote_id - + # Unique alpha numeric code identifying a quote (Max Length = 255) attr_accessor :quote_number - + # Additional reference number attr_accessor :reference - + # Terms of the quote attr_accessor :terms + attr_accessor :contact - + # See LineItems attr_accessor :line_items - + # Date quote was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation attr_accessor :date - + # Date the quote was issued (YYYY-MM-DD) attr_accessor :date_string - + # Date the quote expires – YYYY-MM-DD. attr_accessor :expiry_date - + # Date the quote expires – YYYY-MM-DD. attr_accessor :expiry_date_string + attr_accessor :status + attr_accessor :currency_code - + # The currency rate for a multicurrency quote attr_accessor :currency_rate - + # Total of quote excluding taxes. attr_accessor :sub_total - + # Total tax on quote attr_accessor :total_tax - + # Total of Quote tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts attr_accessor :total - + # Total of discounts applied on the quote line items attr_accessor :total_discount - + # Title text for the quote attr_accessor :title - + # Summary text for the quote attr_accessor :summary - + # See BrandingThemes attr_accessor :branding_theme_id - + # Last modified date UTC format attr_accessor :updated_date_utc + attr_accessor :line_amount_types - + # A string to indicate if a invoice status attr_accessor :status_attribute_string - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb index 19a37818..bdede777 100644 --- a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/quote_status_codes.rb b/lib/xero-ruby/models/accounting/quote_status_codes.rb index 40801dd7..7325a28a 100644 --- a/lib/xero-ruby/models/accounting/quote_status_codes.rb +++ b/lib/xero-ruby/models/accounting/quote_status_codes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/quotes.rb b/lib/xero-ruby/models/accounting/quotes.rb index 70a56a46..7db0d6ae 100644 --- a/lib/xero-ruby/models/accounting/quotes.rb +++ b/lib/xero-ruby/models/accounting/quotes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Quotes - attr_accessor :quotes + attr_accessor :quotes + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/receipt.rb b/lib/xero-ruby/models/accounting/receipt.rb index 3761297f..487de6e9 100644 --- a/lib/xero-ruby/models/accounting/receipt.rb +++ b/lib/xero-ruby/models/accounting/receipt.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,54 +17,63 @@ module XeroRuby::Accounting class Receipt # Date of receipt – YYYY-MM-DD attr_accessor :date + attr_accessor :contact + attr_accessor :line_items + attr_accessor :user - + # Additional reference number attr_accessor :reference + attr_accessor :line_amount_types - + # Total of receipt excluding taxes attr_accessor :sub_total - + # Total tax on receipt attr_accessor :total_tax - + # Total of receipt tax inclusive (i.e. SubTotal + TotalTax) attr_accessor :total - + # Xero generated unique identifier for receipt attr_accessor :receipt_id - + # Current status of receipt – see status types attr_accessor :status - + DRAFT = "DRAFT".freeze + SUBMITTED = "SUBMITTED".freeze + AUTHORISED = "AUTHORISED".freeze + DECLINED = "DECLINED".freeze + VOIDED = "VOIDED".freeze + # Xero generated sequence number for receipt in current claim for a given user attr_accessor :receipt_number - + # Last modified date UTC format attr_accessor :updated_date_utc - + # boolean to indicate if a receipt has an attachment attr_accessor :has_attachments - + # URL link to a source document – shown as “Go to [appName]” in the Xero app attr_accessor :url - + # Displays array of validation error messages from the API attr_accessor :validation_errors - + # Displays array of warning messages from the API attr_accessor :warnings - + # Displays array of attachments from the API attr_accessor :attachments - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/receipts.rb b/lib/xero-ruby/models/accounting/receipts.rb index d7801db7..a69e3dec 100644 --- a/lib/xero-ruby/models/accounting/receipts.rb +++ b/lib/xero-ruby/models/accounting/receipts.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Receipts - attr_accessor :receipts + attr_accessor :receipts + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/repeating_invoice.rb b/lib/xero-ruby/models/accounting/repeating_invoice.rb index ad1f32f3..0f8c5feb 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoice.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoice.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,48 +17,57 @@ module XeroRuby::Accounting class RepeatingInvoice # See Invoice Types attr_accessor :type + ACCPAY = "ACCPAY".freeze + ACCREC = "ACCREC".freeze + attr_accessor :contact + attr_accessor :schedule - + # See LineItems attr_accessor :line_items + attr_accessor :line_amount_types - + # ACCREC only – additional reference number attr_accessor :reference - + # See BrandingThemes attr_accessor :branding_theme_id + attr_accessor :currency_code - + # One of the following - DRAFT or AUTHORISED – See Invoice Status Codes attr_accessor :status - + DRAFT = "DRAFT".freeze + AUTHORISED = "AUTHORISED".freeze + DELETED = "DELETED".freeze + # Total of invoice excluding taxes attr_accessor :sub_total - + # Total tax on invoice attr_accessor :total_tax - + # Total of Invoice tax inclusive (i.e. SubTotal + TotalTax) attr_accessor :total - + # Xero generated unique identifier for repeating invoice template attr_accessor :repeating_invoice_id - + # Xero generated unique identifier for repeating invoice template attr_accessor :id - + # boolean to indicate if an invoice has an attachment attr_accessor :has_attachments - + # Displays array of attachments from the API attr_accessor :attachments - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/repeating_invoices.rb b/lib/xero-ruby/models/accounting/repeating_invoices.rb index 16e12d86..6bb7e2f4 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoices.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoices.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class RepeatingInvoices - attr_accessor :repeating_invoices + attr_accessor :repeating_invoices + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/report.rb b/lib/xero-ruby/models/accounting/report.rb index 196567fd..fbd6c87d 100644 --- a/lib/xero-ruby/models/accounting/report.rb +++ b/lib/xero-ruby/models/accounting/report.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,24 +17,26 @@ module XeroRuby::Accounting class Report # See Prepayment Types attr_accessor :report_id - + # See Prepayment Types attr_accessor :report_name - + # See Prepayment Types attr_accessor :report_type - + AGED_PAYABLES_BY_CONTACT = "AgedPayablesByContact".freeze + # See Prepayment Types attr_accessor :report_title - + # Date of report attr_accessor :report_date - + # Updated Date attr_accessor :updated_date_utc + attr_accessor :contacts - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/report_attribute.rb b/lib/xero-ruby/models/accounting/report_attribute.rb index a9baa80e..ccb4a4e1 100644 --- a/lib/xero-ruby/models/accounting/report_attribute.rb +++ b/lib/xero-ruby/models/accounting/report_attribute.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,10 +15,12 @@ module XeroRuby::Accounting class ReportAttribute + attr_accessor :id + attr_accessor :value - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/report_cell.rb b/lib/xero-ruby/models/accounting/report_cell.rb index 7b4ea394..4ebc5c42 100644 --- a/lib/xero-ruby/models/accounting/report_cell.rb +++ b/lib/xero-ruby/models/accounting/report_cell.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,10 +15,12 @@ module XeroRuby::Accounting class ReportCell + attr_accessor :value + attr_accessor :attributes - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/report_fields.rb b/lib/xero-ruby/models/accounting/report_fields.rb index e2d9b315..c2ee5a93 100644 --- a/lib/xero-ruby/models/accounting/report_fields.rb +++ b/lib/xero-ruby/models/accounting/report_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,12 +15,15 @@ module XeroRuby::Accounting class ReportFields + attr_accessor :field_id + attr_accessor :description + attr_accessor :value - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/report_row.rb b/lib/xero-ruby/models/accounting/report_row.rb index d7dfef58..42edc0b6 100644 --- a/lib/xero-ruby/models/accounting/report_row.rb +++ b/lib/xero-ruby/models/accounting/report_row.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,12 +15,15 @@ module XeroRuby::Accounting class ReportRow + attr_accessor :row_type + attr_accessor :title + attr_accessor :cells - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/report_rows.rb b/lib/xero-ruby/models/accounting/report_rows.rb index 99a4cd4a..3733085d 100644 --- a/lib/xero-ruby/models/accounting/report_rows.rb +++ b/lib/xero-ruby/models/accounting/report_rows.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,14 +15,18 @@ module XeroRuby::Accounting class ReportRows + attr_accessor :row_type + attr_accessor :title + attr_accessor :cells + attr_accessor :rows - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/report_with_row.rb b/lib/xero-ruby/models/accounting/report_with_row.rb index 6dfab044..909ab775 100644 --- a/lib/xero-ruby/models/accounting/report_with_row.rb +++ b/lib/xero-ruby/models/accounting/report_with_row.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,29 +17,31 @@ module XeroRuby::Accounting class ReportWithRow # Report id attr_accessor :report_id - + # Name of the report attr_accessor :report_name - + # Title of the report attr_accessor :report_title - + # The type of report (BalanceSheet,ProfitLoss, etc) attr_accessor :report_type - + # Report titles array (3 to 4 strings with the report name, orgnisation name and time frame of report) attr_accessor :report_titles - + # Date of report attr_accessor :report_date + attr_accessor :rows - + # Updated Date attr_accessor :updated_date_utc + attr_accessor :fields - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/report_with_rows.rb b/lib/xero-ruby/models/accounting/report_with_rows.rb index c34ba685..f7fcee2d 100644 --- a/lib/xero-ruby/models/accounting/report_with_rows.rb +++ b/lib/xero-ruby/models/accounting/report_with_rows.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class ReportWithRows - attr_accessor :reports + attr_accessor :reports + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/reports.rb b/lib/xero-ruby/models/accounting/reports.rb index 7a573aea..a94cc0a4 100644 --- a/lib/xero-ruby/models/accounting/reports.rb +++ b/lib/xero-ruby/models/accounting/reports.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Reports - attr_accessor :reports + attr_accessor :reports + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/request_empty.rb b/lib/xero-ruby/models/accounting/request_empty.rb index 0139762b..dec3ab31 100644 --- a/lib/xero-ruby/models/accounting/request_empty.rb +++ b/lib/xero-ruby/models/accounting/request_empty.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,7 +17,7 @@ module XeroRuby::Accounting class RequestEmpty # Need at least one field to create an empty JSON payload attr_accessor :status - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/row_type.rb b/lib/xero-ruby/models/accounting/row_type.rb index 87c0a6fa..57e577af 100644 --- a/lib/xero-ruby/models/accounting/row_type.rb +++ b/lib/xero-ruby/models/accounting/row_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/sales_tracking_category.rb b/lib/xero-ruby/models/accounting/sales_tracking_category.rb index 177fd8df..60c5501d 100644 --- a/lib/xero-ruby/models/accounting/sales_tracking_category.rb +++ b/lib/xero-ruby/models/accounting/sales_tracking_category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,10 +17,10 @@ module XeroRuby::Accounting class SalesTrackingCategory # The default sales tracking category name for contacts attr_accessor :tracking_category_name - + # The default purchase tracking category name for contacts attr_accessor :tracking_option_name - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/schedule.rb b/lib/xero-ruby/models/accounting/schedule.rb index 5fe4b23c..ffc6a510 100644 --- a/lib/xero-ruby/models/accounting/schedule.rb +++ b/lib/xero-ruby/models/accounting/schedule.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,25 +17,33 @@ module XeroRuby::Accounting class Schedule # Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months) attr_accessor :period - + # One of the following - WEEKLY or MONTHLY attr_accessor :unit - + WEEKLY = "WEEKLY".freeze + MONTHLY = "MONTHLY".freeze + # Integer used with due date type e.g 20 (of following month), 31 (of current month) attr_accessor :due_date - + # the payment terms attr_accessor :due_date_type - + DAYSAFTERBILLDATE = "DAYSAFTERBILLDATE".freeze + DAYSAFTERBILLMONTH = "DAYSAFTERBILLMONTH".freeze + DAYSAFTERINVOICEDATE = "DAYSAFTERINVOICEDATE".freeze + DAYSAFTERINVOICEMONTH = "DAYSAFTERINVOICEMONTH".freeze + OFCURRENTMONTH = "OFCURRENTMONTH".freeze + OFFOLLOWINGMONTH = "OFFOLLOWINGMONTH".freeze + # Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited) attr_accessor :start_date - + # The calendar date of the next invoice in the schedule to be generated attr_accessor :next_scheduled_date - + # Invoice end date – only returned if the template has an end date set attr_accessor :end_date - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/tax_component.rb b/lib/xero-ruby/models/accounting/tax_component.rb index 9d8f8e60..56656558 100644 --- a/lib/xero-ruby/models/accounting/tax_component.rb +++ b/lib/xero-ruby/models/accounting/tax_component.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,16 @@ module XeroRuby::Accounting class TaxComponent # Name of Tax Component attr_accessor :name - + # Tax Rate (up to 4dp) attr_accessor :rate - + # Boolean to describe if Tax rate is compounded. attr_accessor :is_compound - + # Boolean to describe if tax rate is non-recoverable. Non-recoverable rates are only applicable to Canadian organisations attr_accessor :is_non_recoverable - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/tax_rate.rb b/lib/xero-ruby/models/accounting/tax_rate.rb index eb1e5e5b..1a648a71 100644 --- a/lib/xero-ruby/models/accounting/tax_rate.rb +++ b/lib/xero-ruby/models/accounting/tax_rate.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,40 +17,118 @@ module XeroRuby::Accounting class TaxRate # Name of tax rate attr_accessor :name - + # The tax type attr_accessor :tax_type - + # See TaxComponents attr_accessor :tax_components - + # See Status Codes attr_accessor :status - + ACTIVE = "ACTIVE".freeze + DELETED = "DELETED".freeze + ARCHIVED = "ARCHIVED".freeze + PENDING = "PENDING".freeze + # See ReportTaxTypes attr_accessor :report_tax_type - + AVALARA = "AVALARA".freeze + BASEXCLUDED = "BASEXCLUDED".freeze + CAPITALSALESOUTPUT = "CAPITALSALESOUTPUT".freeze + CAPITALEXPENSESINPUT = "CAPITALEXPENSESINPUT".freeze + ECOUTPUT = "ECOUTPUT".freeze + ECOUTPUTSERVICES = "ECOUTPUTSERVICES".freeze + ECINPUT = "ECINPUT".freeze + ECACQUISITIONS = "ECACQUISITIONS".freeze + EXEMPTEXPENSES = "EXEMPTEXPENSES".freeze + EXEMPTINPUT = "EXEMPTINPUT".freeze + EXEMPTOUTPUT = "EXEMPTOUTPUT".freeze + GSTONIMPORTS = "GSTONIMPORTS".freeze + INPUT = "INPUT".freeze + INPUTTAXED = "INPUTTAXED".freeze + MOSSSALES = "MOSSSALES".freeze + NONE = "NONE".freeze + NONEOUTPUT = "NONEOUTPUT".freeze + OUTPUT = "OUTPUT".freeze + PURCHASESINPUT = "PURCHASESINPUT".freeze + SALESOUTPUT = "SALESOUTPUT".freeze + EXEMPTCAPITAL = "EXEMPTCAPITAL".freeze + EXEMPTEXPORT = "EXEMPTEXPORT".freeze + CAPITALEXINPUT = "CAPITALEXINPUT".freeze + GSTONCAPIMPORTS = "GSTONCAPIMPORTS".freeze + GSTONCAPITALIMPORTS = "GSTONCAPITALIMPORTS".freeze + REVERSECHARGES = "REVERSECHARGES".freeze + PAYMENTS = "PAYMENTS".freeze + INVOICE = "INVOICE".freeze + CASH = "CASH".freeze + ACCRUAL = "ACCRUAL".freeze + FLATRATECASH = "FLATRATECASH".freeze + FLATRATEACCRUAL = "FLATRATEACCRUAL".freeze + ACCRUALS = "ACCRUALS".freeze + TXCA = "TXCA".freeze + SRCAS = "SRCAS".freeze + DSOUTPUT = "DSOUTPUT".freeze + BLINPUT2 = "BLINPUT2".freeze + EPINPUT = "EPINPUT".freeze + IMINPUT2 = "IMINPUT2".freeze + MEINPUT = "MEINPUT".freeze + IGDSINPUT2 = "IGDSINPUT2".freeze + ESN33_OUTPUT = "ESN33OUTPUT".freeze + OPINPUT = "OPINPUT".freeze + OSOUTPUT = "OSOUTPUT".freeze + TXN33_INPUT = "TXN33INPUT".freeze + TXESSINPUT = "TXESSINPUT".freeze + TXREINPUT = "TXREINPUT".freeze + TXPETINPUT = "TXPETINPUT".freeze + NRINPUT = "NRINPUT".freeze + ES33_OUTPUT = "ES33OUTPUT".freeze + ZERORATEDINPUT = "ZERORATEDINPUT".freeze + ZERORATEDOUTPUT = "ZERORATEDOUTPUT".freeze + DRCHARGESUPPLY = "DRCHARGESUPPLY".freeze + DRCHARGE = "DRCHARGE".freeze + CAPINPUT = "CAPINPUT".freeze + CAPIMPORTS = "CAPIMPORTS".freeze + IMINPUT = "IMINPUT".freeze + INPUT2 = "INPUT2".freeze + CIUINPUT = "CIUINPUT".freeze + SRINPUT = "SRINPUT".freeze + OUTPUT2 = "OUTPUT2".freeze + SROUTPUT = "SROUTPUT".freeze + CAPOUTPUT = "CAPOUTPUT".freeze + SROUTPUT2 = "SROUTPUT2".freeze + CIUOUTPUT = "CIUOUTPUT".freeze + ZROUTPUT = "ZROUTPUT".freeze + ZREXPORT = "ZREXPORT".freeze + ACC28_PLUS = "ACC28PLUS".freeze + ACCUPTO28 = "ACCUPTO28".freeze + OTHEROUTPUT = "OTHEROUTPUT".freeze + SHOUTPUT = "SHOUTPUT".freeze + ZRINPUT = "ZRINPUT".freeze + BADDEBT = "BADDEBT".freeze + OTHERINPUT = "OTHERINPUT".freeze + # Boolean to describe if tax rate can be used for asset accounts i.e. true,false attr_accessor :can_apply_to_assets - + # Boolean to describe if tax rate can be used for equity accounts i.e true,false attr_accessor :can_apply_to_equity - + # Boolean to describe if tax rate can be used for expense accounts i.e. true,false attr_accessor :can_apply_to_expenses - + # Boolean to describe if tax rate can be used for liability accounts i.e. true,false attr_accessor :can_apply_to_liabilities - + # Boolean to describe if tax rate can be used for revenue accounts i.e. true,false attr_accessor :can_apply_to_revenue - + # Tax Rate (decimal to 4dp) e.g 12.5000 attr_accessor :display_tax_rate - + # Effective Tax Rate (decimal to 4dp) e.g 12.5000 attr_accessor :effective_rate - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/tax_rates.rb b/lib/xero-ruby/models/accounting/tax_rates.rb index 7a55b9e7..94694bf3 100644 --- a/lib/xero-ruby/models/accounting/tax_rates.rb +++ b/lib/xero-ruby/models/accounting/tax_rates.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class TaxRates - attr_accessor :tax_rates + attr_accessor :tax_rates + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/tax_type.rb b/lib/xero-ruby/models/accounting/tax_type.rb index 673c0af3..7440809d 100644 --- a/lib/xero-ruby/models/accounting/tax_type.rb +++ b/lib/xero-ruby/models/accounting/tax_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb b/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb index d2e4d6a8..e8d08b41 100644 --- a/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb +++ b/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,70 +17,70 @@ module XeroRuby::Accounting class TenNinteyNineContact # Box 1 on 1099 Form attr_accessor :box1 - + # Box 2 on 1099 Form attr_accessor :box2 - + # Box 3 on 1099 Form attr_accessor :box3 - + # Box 4 on 1099 Form attr_accessor :box4 - + # Box 5 on 1099 Form attr_accessor :box5 - + # Box 6 on 1099 Form attr_accessor :box6 - + # Box 7 on 1099 Form attr_accessor :box7 - + # Box 8 on 1099 Form attr_accessor :box8 - + # Box 9 on 1099 Form attr_accessor :box9 - + # Box 10 on 1099 Form attr_accessor :box10 - + # Box 11 on 1099 Form attr_accessor :box11 - + # Box 13 on 1099 Form attr_accessor :box13 - + # Box 14 on 1099 Form attr_accessor :box14 - + # Contact name on 1099 Form attr_accessor :name - + # Contact Fed Tax ID type attr_accessor :federal_tax_id_type - + # Contact city on 1099 Form attr_accessor :city - + # Contact zip on 1099 Form attr_accessor :zip - + # Contact State on 1099 Form attr_accessor :state - + # Contact email on 1099 Form attr_accessor :email - + # Contact address on 1099 Form attr_accessor :street_address - + # Contact tax id on 1099 Form attr_accessor :tax_id - + # Contact contact id attr_accessor :contact_id - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/time_zone.rb b/lib/xero-ruby/models/accounting/time_zone.rb index 19a4f9fb..87d4c270 100644 --- a/lib/xero-ruby/models/accounting/time_zone.rb +++ b/lib/xero-ruby/models/accounting/time_zone.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/lib/xero-ruby/models/accounting/tracking_categories.rb b/lib/xero-ruby/models/accounting/tracking_categories.rb index 3e494d29..d1e70fce 100644 --- a/lib/xero-ruby/models/accounting/tracking_categories.rb +++ b/lib/xero-ruby/models/accounting/tracking_categories.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class TrackingCategories - attr_accessor :tracking_categories + attr_accessor :tracking_categories + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/tracking_category.rb b/lib/xero-ruby/models/accounting/tracking_category.rb index 4a588f72..e2207946 100644 --- a/lib/xero-ruby/models/accounting/tracking_category.rb +++ b/lib/xero-ruby/models/accounting/tracking_category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,22 +17,25 @@ module XeroRuby::Accounting class TrackingCategory # The Xero identifier for a tracking category e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 attr_accessor :tracking_category_id - + # The Xero identifier for a tracking option e.g. dc54c220-0140-495a-b925-3246adc0075f attr_accessor :tracking_option_id - + # The name of the tracking category e.g. Department, Region (max length = 100) attr_accessor :name - + # The option name of the tracking option e.g. East, West (max length = 100) attr_accessor :option - + # The status of a tracking category attr_accessor :status - + ACTIVE = "ACTIVE".freeze + ARCHIVED = "ARCHIVED".freeze + DELETED = "DELETED".freeze + # See Tracking Options attr_accessor :options - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/tracking_option.rb b/lib/xero-ruby/models/accounting/tracking_option.rb index c3e746ad..c84e3827 100644 --- a/lib/xero-ruby/models/accounting/tracking_option.rb +++ b/lib/xero-ruby/models/accounting/tracking_option.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,16 +17,19 @@ module XeroRuby::Accounting class TrackingOption # The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a attr_accessor :tracking_option_id - + # The name of the tracking option e.g. Marketing, East (max length = 50) attr_accessor :name - + # The status of a tracking option attr_accessor :status - + ACTIVE = "ACTIVE".freeze + ARCHIVED = "ARCHIVED".freeze + DELETED = "DELETED".freeze + # Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9 attr_accessor :tracking_category_id - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/tracking_options.rb b/lib/xero-ruby/models/accounting/tracking_options.rb index 8e7e0283..c54ea2b9 100644 --- a/lib/xero-ruby/models/accounting/tracking_options.rb +++ b/lib/xero-ruby/models/accounting/tracking_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class TrackingOptions - attr_accessor :options + attr_accessor :options + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/user.rb b/lib/xero-ruby/models/accounting/user.rb index 0518516c..c9acbf20 100644 --- a/lib/xero-ruby/models/accounting/user.rb +++ b/lib/xero-ruby/models/accounting/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,25 +17,32 @@ module XeroRuby::Accounting class User # Xero identifier attr_accessor :user_id - + # Email address of user attr_accessor :email_address - + # First name of user attr_accessor :first_name - + # Last name of user attr_accessor :last_name - + # Timestamp of last change to user attr_accessor :updated_date_utc - + # Boolean to indicate if user is the subscriber attr_accessor :is_subscriber - + # User role that defines permissions in Xero and via API (READONLY, INVOICEONLY, STANDARD, FINANCIALADVISER, etc) attr_accessor :organisation_role - + READONLY = "READONLY".freeze + INVOICEONLY = "INVOICEONLY".freeze + STANDARD = "STANDARD".freeze + FINANCIALADVISER = "FINANCIALADVISER".freeze + MANAGEDCLIENT = "MANAGEDCLIENT".freeze + CASHBOOKCLIENT = "CASHBOOKCLIENT".freeze + UNKNOWN = "UNKNOWN".freeze + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/accounting/users.rb b/lib/xero-ruby/models/accounting/users.rb index 30096699..23c27840 100644 --- a/lib/xero-ruby/models/accounting/users.rb +++ b/lib/xero-ruby/models/accounting/users.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -15,8 +15,9 @@ module XeroRuby::Accounting class Users - attr_accessor :users + attr_accessor :users + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/accounting/validation_error.rb b/lib/xero-ruby/models/accounting/validation_error.rb index cba323e3..51b6e2a7 100644 --- a/lib/xero-ruby/models/accounting/validation_error.rb +++ b/lib/xero-ruby/models/accounting/validation_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -17,7 +17,7 @@ module XeroRuby::Accounting class ValidationError # Validation error message attr_accessor :message - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/asset.rb b/lib/xero-ruby/models/assets/asset.rb index df93bbed..73a0a095 100644 --- a/lib/xero-ruby/models/assets/asset.rb +++ b/lib/xero-ruby/models/assets/asset.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,46 +17,49 @@ module XeroRuby::Assets class Asset # The Xero-generated Id for the asset attr_accessor :asset_id - + # The name of the asset attr_accessor :asset_name - + # The Xero-generated Id for the asset type attr_accessor :asset_type_id - + # Must be unique. attr_accessor :asset_number - + # The date the asset was purchased YYYY-MM-DD attr_accessor :purchase_date - + # The purchase price of the asset attr_accessor :purchase_price - + # The price the asset was disposed at attr_accessor :disposal_price + attr_accessor :asset_status - + # The date the asset’s warranty expires (if needed) YYYY-MM-DD attr_accessor :warranty_expiry_date - + # The asset's serial number attr_accessor :serial_number + attr_accessor :book_depreciation_setting + attr_accessor :book_depreciation_detail - + # Boolean to indicate whether depreciation can be rolled back for this asset individually. This is true if it doesn't have 'legacy' journal entries and if there is no lock period that would prevent this asset from rolling back. attr_accessor :can_rollback - + # The accounting value of the asset attr_accessor :accounting_book_value - + # Boolean to indicate whether delete is enabled attr_accessor :is_delete_enabled_for_date - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/asset_status.rb b/lib/xero-ruby/models/assets/asset_status.rb index 705a2624..1cd81b77 100644 --- a/lib/xero-ruby/models/assets/asset_status.rb +++ b/lib/xero-ruby/models/assets/asset_status.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_status_query_param.rb b/lib/xero-ruby/models/assets/asset_status_query_param.rb index 307dcd14..0c072cf7 100644 --- a/lib/xero-ruby/models/assets/asset_status_query_param.rb +++ b/lib/xero-ruby/models/assets/asset_status_query_param.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_type.rb b/lib/xero-ruby/models/assets/asset_type.rb index de589eb5..b223c8c0 100644 --- a/lib/xero-ruby/models/assets/asset_type.rb +++ b/lib/xero-ruby/models/assets/asset_type.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,24 +17,25 @@ module XeroRuby::Assets class AssetType # Xero generated unique identifier for asset types attr_accessor :asset_type_id - + # The name of the asset type attr_accessor :asset_type_name - + # The asset account for fixed assets of this type attr_accessor :fixed_asset_account_id - + # The expense account for the depreciation of fixed assets of this type attr_accessor :depreciation_expense_account_id - + # The account for accumulated depreciation of fixed assets of this type attr_accessor :accumulated_depreciation_account_id + attr_accessor :book_depreciation_setting - + # All asset types that have accumulated depreciation for any assets that use them are deemed ‘locked’ and cannot be removed. attr_accessor :locks - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/assets.rb b/lib/xero-ruby/models/assets/assets.rb index 6b57495a..597fa203 100644 --- a/lib/xero-ruby/models/assets/assets.rb +++ b/lib/xero-ruby/models/assets/assets.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,10 +15,12 @@ module XeroRuby::Assets class Assets + attr_accessor :pagination + attr_accessor :items - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/book_depreciation_detail.rb b/lib/xero-ruby/models/assets/book_depreciation_detail.rb index 264177f5..c8d98032 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_detail.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_detail.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,25 +17,25 @@ module XeroRuby::Assets class BookDepreciationDetail # When an asset is disposed, this will be the sell price minus the purchase price if a profit was made. attr_accessor :current_capital_gain - + # When an asset is disposed, this will be the lowest one of sell price or purchase price, minus the current book value. attr_accessor :current_gain_loss - + # YYYY-MM-DD attr_accessor :depreciation_start_date - + # The value of the asset you want to depreciate, if this is less than the cost of the asset. attr_accessor :cost_limit - + # The value of the asset remaining when you've fully depreciated it. attr_accessor :residual_value - + # All depreciation prior to the current financial year. attr_accessor :prior_accum_depreciation_amount - + # All depreciation occurring in the current financial year. attr_accessor :current_accum_depreciation_amount - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/book_depreciation_setting.rb b/lib/xero-ruby/models/assets/book_depreciation_setting.rb index 5e2e1473..0e24dd7c 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_setting.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,28 +17,39 @@ module XeroRuby::Assets class BookDepreciationSetting # The method of depreciation applied to this asset. See Depreciation Methods attr_accessor :depreciation_method - + NO_DEPRECIATION = "NoDepreciation".freeze + STRAIGHT_LINE = "StraightLine".freeze + DIMINISHING_VALUE100 = "DiminishingValue100".freeze + DIMINISHING_VALUE150 = "DiminishingValue150".freeze + DIMINISHING_VALUE200 = "DiminishingValue200".freeze + FULL_DEPRECIATION = "FullDepreciation".freeze + # The method of averaging applied to this asset. See Averaging Methods attr_accessor :averaging_method - + FULL_MONTH = "FullMonth".freeze + ACTUAL_DAYS = "ActualDays".freeze + # The rate of depreciation (e.g. 0.05) attr_accessor :depreciation_rate - + # Effective life of the asset in years (e.g. 5) attr_accessor :effective_life_years - + # See Depreciation Calculation Methods attr_accessor :depreciation_calculation_method - + RATE = "Rate".freeze + LIFE = "Life".freeze + NONE = "None".freeze + # Unique Xero identifier for the depreciable object attr_accessor :depreciable_object_id - + # The type of asset object attr_accessor :depreciable_object_type - + # Unique Xero identifier for the effective date change attr_accessor :book_effective_date_of_change_id - + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/assets/error.rb b/lib/xero-ruby/models/assets/error.rb index 64585c69..3de6ac19 100644 --- a/lib/xero-ruby/models/assets/error.rb +++ b/lib/xero-ruby/models/assets/error.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,19 +17,19 @@ module XeroRuby::Assets class Error # Array of elements of resource validation errors attr_accessor :resource_validation_errors - + # Array of elements of field validation errors attr_accessor :field_validation_errors - + # The internal type of error, not accessible externally attr_accessor :type - + # Title of the error attr_accessor :title - + # Detail of the error attr_accessor :detail - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/field_validation_errors_element.rb b/lib/xero-ruby/models/assets/field_validation_errors_element.rb index bb0562ec..7efd8ec3 100644 --- a/lib/xero-ruby/models/assets/field_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/field_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,22 +17,22 @@ module XeroRuby::Assets class FieldValidationErrorsElement # The field name of the erroneous field attr_accessor :field_name - + # The provided value attr_accessor :value_provided - + # Explaination of the field validation error attr_accessor :localised_message - + # Internal type of the field validation error message attr_accessor :type - + # Title of the field validation error attr_accessor :title - + # Detail of the field validation error attr_accessor :detail - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/pagination.rb b/lib/xero-ruby/models/assets/pagination.rb index 0b1df56c..c97f957d 100644 --- a/lib/xero-ruby/models/assets/pagination.rb +++ b/lib/xero-ruby/models/assets/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,14 +15,18 @@ module XeroRuby::Assets class Pagination + attr_accessor :page + attr_accessor :page_size + attr_accessor :page_count + attr_accessor :item_count - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb index 6acd292f..1e86623f 100644 --- a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,19 +17,19 @@ module XeroRuby::Assets class ResourceValidationErrorsElement # The field name of the erroneous field attr_accessor :resource_name - + # Explaination of the resource validation error attr_accessor :localised_message - + # Internal type of the resource error message attr_accessor :type - + # Title of the resource validation error attr_accessor :title - + # Detail of the resource validation error attr_accessor :detail - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/assets/setting.rb b/lib/xero-ruby/models/assets/setting.rb index 52e55ff6..4bf87982 100644 --- a/lib/xero-ruby/models/assets/setting.rb +++ b/lib/xero-ruby/models/assets/setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.1 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,28 +17,28 @@ module XeroRuby::Assets class Setting # The prefix used for fixed asset numbers (“FA-” by default) attr_accessor :asset_number_prefix - + # The next available sequence number attr_accessor :asset_number_sequence - + # The date depreciation calculations started on registered fixed assets in Xero attr_accessor :asset_start_date - + # The last depreciation date attr_accessor :last_depreciation_date - + # Default account that gains are posted to attr_accessor :default_gain_on_disposal_account_id - + # Default account that losses are posted to attr_accessor :default_loss_on_disposal_account_id - + # Default account that capital gains are posted to attr_accessor :default_capital_gain_on_disposal_account_id - + # opt in for tax calculation attr_accessor :opt_in_for_tax - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/amount.rb b/lib/xero-ruby/models/projects/amount.rb index ac543579..65d65821 100644 --- a/lib/xero-ruby/models/projects/amount.rb +++ b/lib/xero-ruby/models/projects/amount.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,10 +15,12 @@ module XeroRuby::Projects class Amount + attr_accessor :currency + attr_accessor :value - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/charge_type.rb b/lib/xero-ruby/models/projects/charge_type.rb index 91d4ada4..d8dfdc73 100644 --- a/lib/xero-ruby/models/projects/charge_type.rb +++ b/lib/xero-ruby/models/projects/charge_type.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/currency_code.rb b/lib/xero-ruby/models/projects/currency_code.rb index 1b57aa76..0abc666c 100644 --- a/lib/xero-ruby/models/projects/currency_code.rb +++ b/lib/xero-ruby/models/projects/currency_code.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/error.rb b/lib/xero-ruby/models/projects/error.rb index e9a4a7f5..c76cdf79 100644 --- a/lib/xero-ruby/models/projects/error.rb +++ b/lib/xero-ruby/models/projects/error.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,10 +17,10 @@ module XeroRuby::Projects class Error # Exception message attr_accessor :message - + # Array of Elements of validation Errors attr_accessor :model_state - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/pagination.rb b/lib/xero-ruby/models/projects/pagination.rb index b769a783..5fd5bb43 100644 --- a/lib/xero-ruby/models/projects/pagination.rb +++ b/lib/xero-ruby/models/projects/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,16 +17,16 @@ module XeroRuby::Projects class Pagination # Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0. attr_accessor :page - + # Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. attr_accessor :page_size - + # Number of pages available attr_accessor :page_count - + # Number of items returned attr_accessor :item_count - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/project.rb b/lib/xero-ruby/models/projects/project.rb index 6a3bd067..85eb0703 100644 --- a/lib/xero-ruby/models/projects/project.rb +++ b/lib/xero-ruby/models/projects/project.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,54 +17,70 @@ module XeroRuby::Projects class Project # Identifier of the project. attr_accessor :project_id - + # Identifier of the contact this project was created for. attr_accessor :contact_id - + # Name of the project. attr_accessor :name + attr_accessor :currency_code - + # A total of minutes logged against all tasks on the Project. attr_accessor :minutes_logged + attr_accessor :total_task_amount + attr_accessor :total_expense_amount + attr_accessor :estimate_amount - + # Minutes which have not been invoiced across all chargeable tasks in the project. attr_accessor :minutes_to_be_invoiced + attr_accessor :task_amount_to_be_invoiced + attr_accessor :task_amount_invoiced + attr_accessor :expense_amount_to_be_invoiced + attr_accessor :expense_amount_invoiced + attr_accessor :project_amount_invoiced + attr_accessor :deposit + attr_accessor :deposit_applied + attr_accessor :credit_note_amount - + # Deadline for the project. UTC Date Time in ISO-8601 format. attr_accessor :deadline_utc + attr_accessor :total_invoiced + attr_accessor :total_to_be_invoiced + attr_accessor :estimate + attr_accessor :status - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/project_create_or_update.rb b/lib/xero-ruby/models/projects/project_create_or_update.rb index c523ba95..7681732b 100644 --- a/lib/xero-ruby/models/projects/project_create_or_update.rb +++ b/lib/xero-ruby/models/projects/project_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,15 +17,16 @@ module XeroRuby::Projects class ProjectCreateOrUpdate # Identifier of the contact this project was created for. attr_accessor :contact_id - + # Name of the project. attr_accessor :name + attr_accessor :estimate_amount - + # Deadline for the project. UTC Date Time in ISO-8601 format. attr_accessor :deadline_utc - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/project_patch.rb b/lib/xero-ruby/models/projects/project_patch.rb index cf82f080..c7e54be8 100644 --- a/lib/xero-ruby/models/projects/project_patch.rb +++ b/lib/xero-ruby/models/projects/project_patch.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,8 +15,9 @@ module XeroRuby::Projects class ProjectPatch - attr_accessor :status + attr_accessor :status + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/project_status.rb b/lib/xero-ruby/models/projects/project_status.rb index 7400ae15..01fcffac 100644 --- a/lib/xero-ruby/models/projects/project_status.rb +++ b/lib/xero-ruby/models/projects/project_status.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_user.rb b/lib/xero-ruby/models/projects/project_user.rb index 1aa16356..a752a373 100644 --- a/lib/xero-ruby/models/projects/project_user.rb +++ b/lib/xero-ruby/models/projects/project_user.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,13 +17,13 @@ module XeroRuby::Projects class ProjectUser # Identifier of the user of the project. attr_accessor :user_id - + # Full name of the user. attr_accessor :name - + # Email address of the user. attr_accessor :email - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/project_users.rb b/lib/xero-ruby/models/projects/project_users.rb index 63e6409b..de9817b5 100644 --- a/lib/xero-ruby/models/projects/project_users.rb +++ b/lib/xero-ruby/models/projects/project_users.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,10 +15,12 @@ module XeroRuby::Projects class ProjectUsers + attr_accessor :pagination + attr_accessor :items - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/projects.rb b/lib/xero-ruby/models/projects/projects.rb index 01c2c2cc..71b1f657 100644 --- a/lib/xero-ruby/models/projects/projects.rb +++ b/lib/xero-ruby/models/projects/projects.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,10 +15,12 @@ module XeroRuby::Projects class Projects + attr_accessor :pagination + attr_accessor :items - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/task.rb b/lib/xero-ruby/models/projects/task.rb index 01a600fd..97d41acf 100644 --- a/lib/xero-ruby/models/projects/task.rb +++ b/lib/xero-ruby/models/projects/task.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,44 +17,52 @@ module XeroRuby::Projects class Task # Identifier of the task. attr_accessor :task_id - + # Name of the task. attr_accessor :name + attr_accessor :rate + attr_accessor :charge_type - + # An estimated time to perform the task attr_accessor :estimate_minutes - + # Identifier of the project task belongs to. attr_accessor :project_id - + # Total minutes which have been logged against the task. Logged by assigning a time entry to a task attr_accessor :total_minutes + attr_accessor :total_amount - + # Minutes on this task which have been invoiced. attr_accessor :minutes_invoiced - + # Minutes on this task which have not been invoiced. attr_accessor :minutes_to_be_invoiced - + # Minutes logged against this task if its charge type is `FIXED`. attr_accessor :fixed_minutes - + # Minutes logged against this task if its charge type is `NON_CHARGEABLE`. attr_accessor :non_chargeable_minutes + attr_accessor :amount_to_be_invoiced + attr_accessor :amount_invoiced - + # Status of the task. When a task of ChargeType is `FIXED` and the rate amount is invoiced the status will be set to `INVOICED` and can't be modified. A task with ChargeType of `TIME` or `NON_CHARGEABLE` cannot have a status of `INVOICED`. A `LOCKED` state indicates that the task is currently changing state (for example being invoiced) and can't be modified. attr_accessor :status - + ACTIVE = "ACTIVE".freeze + INVOICED = "INVOICED".freeze + LOCKED = "LOCKED".freeze + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/projects/task_create_or_update.rb b/lib/xero-ruby/models/projects/task_create_or_update.rb index 45958e2b..a4d1bdb4 100644 --- a/lib/xero-ruby/models/projects/task_create_or_update.rb +++ b/lib/xero-ruby/models/projects/task_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,14 +17,16 @@ module XeroRuby::Projects class TaskCreateOrUpdate # Name of the task. Max length 100 characters. attr_accessor :name + attr_accessor :rate + attr_accessor :charge_type - + # Estimated time to perform the task. EstimateMinutes has to be greater than 0 if provided. attr_accessor :estimate_minutes - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/tasks.rb b/lib/xero-ruby/models/projects/tasks.rb index b3935c40..21db457a 100644 --- a/lib/xero-ruby/models/projects/tasks.rb +++ b/lib/xero-ruby/models/projects/tasks.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,10 +15,12 @@ module XeroRuby::Projects class Tasks + attr_accessor :pagination + attr_accessor :items - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/time_entries.rb b/lib/xero-ruby/models/projects/time_entries.rb index 2767e8e9..faabdbd5 100644 --- a/lib/xero-ruby/models/projects/time_entries.rb +++ b/lib/xero-ruby/models/projects/time_entries.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -15,10 +15,12 @@ module XeroRuby::Projects class TimeEntries + attr_accessor :pagination + attr_accessor :items - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/models/projects/time_entry.rb b/lib/xero-ruby/models/projects/time_entry.rb index 2f1bd789..d3ee2a2a 100644 --- a/lib/xero-ruby/models/projects/time_entry.rb +++ b/lib/xero-ruby/models/projects/time_entry.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,31 +17,33 @@ module XeroRuby::Projects class TimeEntry # Identifier of the time entry. attr_accessor :time_entry_id - + # The xero user identifier of the person who logged time. attr_accessor :user_id - + # Identifier of the project, that the task (which the time entry is logged against) belongs to. attr_accessor :project_id - + # Identifier of the task that time entry is logged against. attr_accessor :task_id - + # The date time that time entry is logged on. UTC Date Time in ISO-8601 format. attr_accessor :date_utc - + # The date time that time entry is created. UTC Date Time in ISO-8601 format. By default it is set to server time. attr_accessor :date_entered_utc - + # The duration of logged minutes. attr_accessor :duration - + # A description of the time entry. attr_accessor :description - + # Status of the time entry. By default a time entry is created with status of `ACTIVE`. A `LOCKED` state indicates that the time entry is currently changing state (for example being invoiced). Updates are not allowed when in this state. It will have a status of INVOICED once it is invoiced. attr_accessor :status - + ACTIVE = "ACTIVE".freeze + LOCKED = "LOCKED".freeze + class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values diff --git a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb index e903cf9b..996f75fd 100644 --- a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +++ b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.2 +The version of the OpenAPI document: 2.2.4 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -17,19 +17,19 @@ module XeroRuby::Projects class TimeEntryCreateOrUpdate # The xero user identifier of the person logging the time. attr_accessor :user_id - + # Identifier of the task that time entry is logged against. attr_accessor :task_id - + # Date time entry is logged on. UTC Date Time in ISO-8601 format. attr_accessor :date_utc - + # Number of minutes to be logged. Duration is between 1 and 59940 inclusively. attr_accessor :duration - + # An optional description of the time entry, will be set to null if not provided during update. attr_accessor :description - + # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb index 2e05fb74..26c6e59c 100644 --- a/lib/xero-ruby/version.rb +++ b/lib/xero-ruby/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end diff --git a/xero-ruby.gemspec b/xero-ruby.gemspec index 42ed4381..84c2c41a 100644 --- a/xero-ruby.gemspec +++ b/xero-ruby.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.1 +OpenAPI Generator version: 4.3.0 =end @@ -27,7 +27,7 @@ Gem::Specification.new do |s| s.license = "Unlicense" s.required_ruby_version = ">= 1.9" - s.add_runtime_dependency 'faraday', '~> 0.14', '>= 0.14.0' + s.add_runtime_dependency 'faraday', '~> 1.0.1', '>= 1.0.1' s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' From f32739d09a59b4e89c7f7fb50f5c5a55e7d6f0f0 Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 24 Jun 2020 21:04:14 -0600 Subject: [PATCH 13/21] remove enums from organisationentitytype to avoid duplicate enums, need to check with team before merge --- .../models/accounting/organisation.rb | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index 1d227679..caaf0d16 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -134,18 +134,6 @@ class Organisation # Organisation Type attr_accessor :organisation_entity_type - ACCOUNTING_PRACTICE = "ACCOUNTING_PRACTICE".freeze - COMPANY = "COMPANY".freeze - CHARITY = "CHARITY".freeze - CLUB_OR_SOCIETY = "CLUB_OR_SOCIETY".freeze - LOOK_THROUGH_COMPANY = "LOOK_THROUGH_COMPANY".freeze - NOT_FOR_PROFIT = "NOT_FOR_PROFIT".freeze - PARTNERSHIP = "PARTNERSHIP".freeze - S_CORPORATION = "S_CORPORATION".freeze - SELF_MANAGED_SUPERANNUATION_FUND = "SELF_MANAGED_SUPERANNUATION_FUND".freeze - SOLE_TRADER = "SOLE_TRADER".freeze - SUPERANNUATION_FUND = "SUPERANNUATION_FUND".freeze - TRUST = "TRUST".freeze # A unique identifier for the organisation. Potential uses. attr_accessor :short_code @@ -456,8 +444,6 @@ def valid? return false unless sales_tax_basis_validator.valid?(@sales_tax_basis) sales_tax_period_validator = EnumAttributeValidator.new('String', ["MONTHLY", "QUARTERLY1", "QUARTERLY2", "QUARTERLY3", "ANNUALLY", "ONEMONTHS", "TWOMONTHS", "SIXMONTHS", "1MONTHLY", "2MONTHLY", "3MONTHLY", "6MONTHLY", "QUARTERLY", "YEARLY", "NONE"]) return false unless sales_tax_period_validator.valid?(@sales_tax_period) - organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) - return false unless organisation_entity_type_validator.valid?(@organisation_entity_type) _class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK"]) return false unless _class_validator.valid?(@_class) edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"]) @@ -505,16 +491,6 @@ def sales_tax_period=(sales_tax_period) @sales_tax_period = sales_tax_period end - # Custom attribute writer method checking allowed values (enum). - # @param [Object] organisation_entity_type Object to be assigned - def organisation_entity_type=(organisation_entity_type) - validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"]) - unless validator.valid?(organisation_entity_type) - fail ArgumentError, "invalid value for \"organisation_entity_type\", must be one of #{validator.allowable_values}." - end - @organisation_entity_type = organisation_entity_type - end - # Custom attribute writer method checking allowed values (enum). # @param [Object] _class Object to be assigned def _class=(_class) From dfbdc1fb100da91a0bfd6520b684b7aa1891864f Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 24 Jun 2020 21:20:03 -0600 Subject: [PATCH 14/21] run via docker with 4.3.1 --- lib/xero-ruby.rb | 2 +- lib/xero-ruby/api/accounting_api.rb | 2 +- lib/xero-ruby/api_client.rb | 2 +- lib/xero-ruby/api_error.rb | 2 +- lib/xero-ruby/configuration.rb | 2 +- lib/xero-ruby/models/accounting/account.rb | 2 +- lib/xero-ruby/models/accounting/account_type.rb | 2 +- lib/xero-ruby/models/accounting/accounts.rb | 2 +- lib/xero-ruby/models/accounting/accounts_payable.rb | 2 +- lib/xero-ruby/models/accounting/accounts_receivable.rb | 2 +- lib/xero-ruby/models/accounting/address.rb | 2 +- lib/xero-ruby/models/accounting/allocation.rb | 2 +- lib/xero-ruby/models/accounting/allocations.rb | 2 +- lib/xero-ruby/models/accounting/attachment.rb | 2 +- lib/xero-ruby/models/accounting/attachments.rb | 2 +- lib/xero-ruby/models/accounting/balances.rb | 2 +- lib/xero-ruby/models/accounting/bank_transaction.rb | 2 +- lib/xero-ruby/models/accounting/bank_transactions.rb | 2 +- lib/xero-ruby/models/accounting/bank_transfer.rb | 2 +- lib/xero-ruby/models/accounting/bank_transfers.rb | 2 +- lib/xero-ruby/models/accounting/batch_payment.rb | 2 +- lib/xero-ruby/models/accounting/batch_payment_details.rb | 2 +- lib/xero-ruby/models/accounting/batch_payments.rb | 2 +- lib/xero-ruby/models/accounting/bill.rb | 2 +- lib/xero-ruby/models/accounting/branding_theme.rb | 2 +- lib/xero-ruby/models/accounting/branding_themes.rb | 2 +- lib/xero-ruby/models/accounting/cis_org_setting.rb | 2 +- lib/xero-ruby/models/accounting/cis_setting.rb | 2 +- lib/xero-ruby/models/accounting/cis_settings.rb | 2 +- lib/xero-ruby/models/accounting/contact.rb | 2 +- lib/xero-ruby/models/accounting/contact_group.rb | 2 +- lib/xero-ruby/models/accounting/contact_groups.rb | 2 +- lib/xero-ruby/models/accounting/contact_person.rb | 2 +- lib/xero-ruby/models/accounting/contacts.rb | 2 +- lib/xero-ruby/models/accounting/country_code.rb | 2 +- lib/xero-ruby/models/accounting/credit_note.rb | 2 +- lib/xero-ruby/models/accounting/credit_notes.rb | 2 +- lib/xero-ruby/models/accounting/currencies.rb | 2 +- lib/xero-ruby/models/accounting/currency.rb | 2 +- lib/xero-ruby/models/accounting/currency_code.rb | 2 +- lib/xero-ruby/models/accounting/element.rb | 2 +- lib/xero-ruby/models/accounting/employee.rb | 2 +- lib/xero-ruby/models/accounting/employees.rb | 2 +- lib/xero-ruby/models/accounting/error.rb | 2 +- lib/xero-ruby/models/accounting/expense_claim.rb | 2 +- lib/xero-ruby/models/accounting/expense_claims.rb | 2 +- lib/xero-ruby/models/accounting/external_link.rb | 2 +- lib/xero-ruby/models/accounting/history_record.rb | 2 +- lib/xero-ruby/models/accounting/history_records.rb | 2 +- lib/xero-ruby/models/accounting/invoice.rb | 2 +- lib/xero-ruby/models/accounting/invoice_reminder.rb | 2 +- lib/xero-ruby/models/accounting/invoice_reminders.rb | 2 +- lib/xero-ruby/models/accounting/invoices.rb | 2 +- lib/xero-ruby/models/accounting/item.rb | 2 +- lib/xero-ruby/models/accounting/items.rb | 2 +- lib/xero-ruby/models/accounting/journal.rb | 2 +- lib/xero-ruby/models/accounting/journal_line.rb | 2 +- lib/xero-ruby/models/accounting/journals.rb | 2 +- lib/xero-ruby/models/accounting/line_amount_types.rb | 2 +- lib/xero-ruby/models/accounting/line_item.rb | 2 +- lib/xero-ruby/models/accounting/line_item_tracking.rb | 2 +- lib/xero-ruby/models/accounting/linked_transaction.rb | 2 +- lib/xero-ruby/models/accounting/linked_transactions.rb | 2 +- lib/xero-ruby/models/accounting/manual_journal.rb | 2 +- lib/xero-ruby/models/accounting/manual_journal_line.rb | 2 +- lib/xero-ruby/models/accounting/manual_journals.rb | 2 +- lib/xero-ruby/models/accounting/online_invoice.rb | 2 +- lib/xero-ruby/models/accounting/online_invoices.rb | 2 +- lib/xero-ruby/models/accounting/organisation.rb | 2 +- lib/xero-ruby/models/accounting/organisations.rb | 2 +- lib/xero-ruby/models/accounting/overpayment.rb | 2 +- lib/xero-ruby/models/accounting/overpayments.rb | 2 +- lib/xero-ruby/models/accounting/payment.rb | 2 +- lib/xero-ruby/models/accounting/payment_delete.rb | 2 +- lib/xero-ruby/models/accounting/payment_service.rb | 2 +- lib/xero-ruby/models/accounting/payment_services.rb | 2 +- lib/xero-ruby/models/accounting/payment_term.rb | 2 +- lib/xero-ruby/models/accounting/payment_term_type.rb | 2 +- lib/xero-ruby/models/accounting/payments.rb | 2 +- lib/xero-ruby/models/accounting/phone.rb | 2 +- lib/xero-ruby/models/accounting/prepayment.rb | 2 +- lib/xero-ruby/models/accounting/prepayments.rb | 2 +- lib/xero-ruby/models/accounting/purchase.rb | 2 +- lib/xero-ruby/models/accounting/purchase_order.rb | 2 +- lib/xero-ruby/models/accounting/purchase_orders.rb | 2 +- lib/xero-ruby/models/accounting/quote.rb | 2 +- lib/xero-ruby/models/accounting/quote_line_amount_types.rb | 2 +- lib/xero-ruby/models/accounting/quote_status_codes.rb | 2 +- lib/xero-ruby/models/accounting/quotes.rb | 2 +- lib/xero-ruby/models/accounting/receipt.rb | 2 +- lib/xero-ruby/models/accounting/receipts.rb | 2 +- lib/xero-ruby/models/accounting/repeating_invoice.rb | 2 +- lib/xero-ruby/models/accounting/repeating_invoices.rb | 2 +- lib/xero-ruby/models/accounting/report.rb | 2 +- lib/xero-ruby/models/accounting/report_attribute.rb | 2 +- lib/xero-ruby/models/accounting/report_cell.rb | 2 +- lib/xero-ruby/models/accounting/report_fields.rb | 2 +- lib/xero-ruby/models/accounting/report_row.rb | 2 +- lib/xero-ruby/models/accounting/report_rows.rb | 2 +- lib/xero-ruby/models/accounting/report_with_row.rb | 2 +- lib/xero-ruby/models/accounting/report_with_rows.rb | 2 +- lib/xero-ruby/models/accounting/reports.rb | 2 +- lib/xero-ruby/models/accounting/request_empty.rb | 2 +- lib/xero-ruby/models/accounting/row_type.rb | 2 +- lib/xero-ruby/models/accounting/sales_tracking_category.rb | 2 +- lib/xero-ruby/models/accounting/schedule.rb | 2 +- lib/xero-ruby/models/accounting/tax_component.rb | 2 +- lib/xero-ruby/models/accounting/tax_rate.rb | 2 +- lib/xero-ruby/models/accounting/tax_rates.rb | 2 +- lib/xero-ruby/models/accounting/tax_type.rb | 2 +- lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb | 2 +- lib/xero-ruby/models/accounting/time_zone.rb | 2 +- lib/xero-ruby/models/accounting/tracking_categories.rb | 2 +- lib/xero-ruby/models/accounting/tracking_category.rb | 2 +- lib/xero-ruby/models/accounting/tracking_option.rb | 2 +- lib/xero-ruby/models/accounting/tracking_options.rb | 2 +- lib/xero-ruby/models/accounting/user.rb | 2 +- lib/xero-ruby/models/accounting/users.rb | 2 +- lib/xero-ruby/models/accounting/validation_error.rb | 2 +- lib/xero-ruby/version.rb | 2 +- xero-ruby.gemspec | 2 +- 121 files changed, 121 insertions(+), 121 deletions(-) diff --git a/lib/xero-ruby.rb b/lib/xero-ruby.rb index c9b7b9a9..63ae7004 100644 --- a/lib/xero-ruby.rb +++ b/lib/xero-ruby.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/api/accounting_api.rb b/lib/xero-ruby/api/accounting_api.rb index 11c319a4..87fb0345 100644 --- a/lib/xero-ruby/api/accounting_api.rb +++ b/lib/xero-ruby/api/accounting_api.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index b893f719..c580498f 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/api_error.rb b/lib/xero-ruby/api_error.rb index 73308970..fe6065f6 100644 --- a/lib/xero-ruby/api_error.rb +++ b/lib/xero-ruby/api_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/configuration.rb b/lib/xero-ruby/configuration.rb index 853b5c44..53ff7624 100644 --- a/lib/xero-ruby/configuration.rb +++ b/lib/xero-ruby/configuration.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index edef80bf..5cf6b997 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/account_type.rb b/lib/xero-ruby/models/accounting/account_type.rb index c1aaf627..60406e95 100644 --- a/lib/xero-ruby/models/accounting/account_type.rb +++ b/lib/xero-ruby/models/accounting/account_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/accounts.rb b/lib/xero-ruby/models/accounting/accounts.rb index 4005ff7b..5cbb0178 100644 --- a/lib/xero-ruby/models/accounting/accounts.rb +++ b/lib/xero-ruby/models/accounting/accounts.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/accounts_payable.rb b/lib/xero-ruby/models/accounting/accounts_payable.rb index 072e3010..ed7e50fe 100644 --- a/lib/xero-ruby/models/accounting/accounts_payable.rb +++ b/lib/xero-ruby/models/accounting/accounts_payable.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/accounts_receivable.rb b/lib/xero-ruby/models/accounting/accounts_receivable.rb index 59002564..38154450 100644 --- a/lib/xero-ruby/models/accounting/accounts_receivable.rb +++ b/lib/xero-ruby/models/accounting/accounts_receivable.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/address.rb b/lib/xero-ruby/models/accounting/address.rb index 3dd63423..454909cf 100644 --- a/lib/xero-ruby/models/accounting/address.rb +++ b/lib/xero-ruby/models/accounting/address.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/allocation.rb b/lib/xero-ruby/models/accounting/allocation.rb index d7a3e431..15f0e267 100644 --- a/lib/xero-ruby/models/accounting/allocation.rb +++ b/lib/xero-ruby/models/accounting/allocation.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/allocations.rb b/lib/xero-ruby/models/accounting/allocations.rb index e03e9903..5577a115 100644 --- a/lib/xero-ruby/models/accounting/allocations.rb +++ b/lib/xero-ruby/models/accounting/allocations.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/attachment.rb b/lib/xero-ruby/models/accounting/attachment.rb index 40743527..0b93cc91 100644 --- a/lib/xero-ruby/models/accounting/attachment.rb +++ b/lib/xero-ruby/models/accounting/attachment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/attachments.rb b/lib/xero-ruby/models/accounting/attachments.rb index 4f282930..32cd006d 100644 --- a/lib/xero-ruby/models/accounting/attachments.rb +++ b/lib/xero-ruby/models/accounting/attachments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/balances.rb b/lib/xero-ruby/models/accounting/balances.rb index 0cce283c..d47c8fbc 100644 --- a/lib/xero-ruby/models/accounting/balances.rb +++ b/lib/xero-ruby/models/accounting/balances.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/bank_transaction.rb b/lib/xero-ruby/models/accounting/bank_transaction.rb index 1e553053..1de4b956 100644 --- a/lib/xero-ruby/models/accounting/bank_transaction.rb +++ b/lib/xero-ruby/models/accounting/bank_transaction.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/bank_transactions.rb b/lib/xero-ruby/models/accounting/bank_transactions.rb index c39f8449..41c83a5b 100644 --- a/lib/xero-ruby/models/accounting/bank_transactions.rb +++ b/lib/xero-ruby/models/accounting/bank_transactions.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/bank_transfer.rb b/lib/xero-ruby/models/accounting/bank_transfer.rb index 956f8f17..1f083f0c 100644 --- a/lib/xero-ruby/models/accounting/bank_transfer.rb +++ b/lib/xero-ruby/models/accounting/bank_transfer.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/bank_transfers.rb b/lib/xero-ruby/models/accounting/bank_transfers.rb index a601e298..05359282 100644 --- a/lib/xero-ruby/models/accounting/bank_transfers.rb +++ b/lib/xero-ruby/models/accounting/bank_transfers.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/batch_payment.rb b/lib/xero-ruby/models/accounting/batch_payment.rb index e560caf9..0bf6d124 100644 --- a/lib/xero-ruby/models/accounting/batch_payment.rb +++ b/lib/xero-ruby/models/accounting/batch_payment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/batch_payment_details.rb b/lib/xero-ruby/models/accounting/batch_payment_details.rb index b4101272..0339dfac 100644 --- a/lib/xero-ruby/models/accounting/batch_payment_details.rb +++ b/lib/xero-ruby/models/accounting/batch_payment_details.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/batch_payments.rb b/lib/xero-ruby/models/accounting/batch_payments.rb index 081468cb..610d83b6 100644 --- a/lib/xero-ruby/models/accounting/batch_payments.rb +++ b/lib/xero-ruby/models/accounting/batch_payments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/bill.rb b/lib/xero-ruby/models/accounting/bill.rb index 17ff440f..bdc8c5bd 100644 --- a/lib/xero-ruby/models/accounting/bill.rb +++ b/lib/xero-ruby/models/accounting/bill.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/branding_theme.rb b/lib/xero-ruby/models/accounting/branding_theme.rb index 18a4bfdb..4ebea1a2 100644 --- a/lib/xero-ruby/models/accounting/branding_theme.rb +++ b/lib/xero-ruby/models/accounting/branding_theme.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/branding_themes.rb b/lib/xero-ruby/models/accounting/branding_themes.rb index 55189993..8467a498 100644 --- a/lib/xero-ruby/models/accounting/branding_themes.rb +++ b/lib/xero-ruby/models/accounting/branding_themes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/cis_org_setting.rb b/lib/xero-ruby/models/accounting/cis_org_setting.rb index f3888efe..f25e15c9 100644 --- a/lib/xero-ruby/models/accounting/cis_org_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_org_setting.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/cis_setting.rb b/lib/xero-ruby/models/accounting/cis_setting.rb index 86f11c68..82ec3de5 100644 --- a/lib/xero-ruby/models/accounting/cis_setting.rb +++ b/lib/xero-ruby/models/accounting/cis_setting.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/cis_settings.rb b/lib/xero-ruby/models/accounting/cis_settings.rb index 79bef977..3e72a953 100644 --- a/lib/xero-ruby/models/accounting/cis_settings.rb +++ b/lib/xero-ruby/models/accounting/cis_settings.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/contact.rb b/lib/xero-ruby/models/accounting/contact.rb index e76fd726..2e45ad88 100644 --- a/lib/xero-ruby/models/accounting/contact.rb +++ b/lib/xero-ruby/models/accounting/contact.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/contact_group.rb b/lib/xero-ruby/models/accounting/contact_group.rb index 6fef44ce..8aa789f8 100644 --- a/lib/xero-ruby/models/accounting/contact_group.rb +++ b/lib/xero-ruby/models/accounting/contact_group.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/contact_groups.rb b/lib/xero-ruby/models/accounting/contact_groups.rb index e43303fa..dbec474c 100644 --- a/lib/xero-ruby/models/accounting/contact_groups.rb +++ b/lib/xero-ruby/models/accounting/contact_groups.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/contact_person.rb b/lib/xero-ruby/models/accounting/contact_person.rb index 6deb3f68..5e45588f 100644 --- a/lib/xero-ruby/models/accounting/contact_person.rb +++ b/lib/xero-ruby/models/accounting/contact_person.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/contacts.rb b/lib/xero-ruby/models/accounting/contacts.rb index 9a87b2ef..a2d1cf9f 100644 --- a/lib/xero-ruby/models/accounting/contacts.rb +++ b/lib/xero-ruby/models/accounting/contacts.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/country_code.rb b/lib/xero-ruby/models/accounting/country_code.rb index ac9a71d2..4a6f5c1d 100644 --- a/lib/xero-ruby/models/accounting/country_code.rb +++ b/lib/xero-ruby/models/accounting/country_code.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/credit_note.rb b/lib/xero-ruby/models/accounting/credit_note.rb index af858af5..29c095e5 100644 --- a/lib/xero-ruby/models/accounting/credit_note.rb +++ b/lib/xero-ruby/models/accounting/credit_note.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/credit_notes.rb b/lib/xero-ruby/models/accounting/credit_notes.rb index 0d6d3cbe..d008b453 100644 --- a/lib/xero-ruby/models/accounting/credit_notes.rb +++ b/lib/xero-ruby/models/accounting/credit_notes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/currencies.rb b/lib/xero-ruby/models/accounting/currencies.rb index 27ee14ab..462dc561 100644 --- a/lib/xero-ruby/models/accounting/currencies.rb +++ b/lib/xero-ruby/models/accounting/currencies.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/currency.rb b/lib/xero-ruby/models/accounting/currency.rb index 3329e2a9..78c527b0 100644 --- a/lib/xero-ruby/models/accounting/currency.rb +++ b/lib/xero-ruby/models/accounting/currency.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/currency_code.rb b/lib/xero-ruby/models/accounting/currency_code.rb index f01c11a8..c4cdc829 100644 --- a/lib/xero-ruby/models/accounting/currency_code.rb +++ b/lib/xero-ruby/models/accounting/currency_code.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/element.rb b/lib/xero-ruby/models/accounting/element.rb index c00ac014..2a02acd2 100644 --- a/lib/xero-ruby/models/accounting/element.rb +++ b/lib/xero-ruby/models/accounting/element.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/employee.rb b/lib/xero-ruby/models/accounting/employee.rb index d9b44bba..6b2cb8dc 100644 --- a/lib/xero-ruby/models/accounting/employee.rb +++ b/lib/xero-ruby/models/accounting/employee.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/employees.rb b/lib/xero-ruby/models/accounting/employees.rb index 70a74c34..06b470c3 100644 --- a/lib/xero-ruby/models/accounting/employees.rb +++ b/lib/xero-ruby/models/accounting/employees.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/error.rb b/lib/xero-ruby/models/accounting/error.rb index f0a0cf93..525eab2c 100644 --- a/lib/xero-ruby/models/accounting/error.rb +++ b/lib/xero-ruby/models/accounting/error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/expense_claim.rb b/lib/xero-ruby/models/accounting/expense_claim.rb index 4b1d3dbc..5a7eaa4d 100644 --- a/lib/xero-ruby/models/accounting/expense_claim.rb +++ b/lib/xero-ruby/models/accounting/expense_claim.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/expense_claims.rb b/lib/xero-ruby/models/accounting/expense_claims.rb index 530402a8..89264df7 100644 --- a/lib/xero-ruby/models/accounting/expense_claims.rb +++ b/lib/xero-ruby/models/accounting/expense_claims.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/external_link.rb b/lib/xero-ruby/models/accounting/external_link.rb index 14116283..857ed74a 100644 --- a/lib/xero-ruby/models/accounting/external_link.rb +++ b/lib/xero-ruby/models/accounting/external_link.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/history_record.rb b/lib/xero-ruby/models/accounting/history_record.rb index a0a0f277..4f915231 100644 --- a/lib/xero-ruby/models/accounting/history_record.rb +++ b/lib/xero-ruby/models/accounting/history_record.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/history_records.rb b/lib/xero-ruby/models/accounting/history_records.rb index 55d77ca3..35cd55d5 100644 --- a/lib/xero-ruby/models/accounting/history_records.rb +++ b/lib/xero-ruby/models/accounting/history_records.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/invoice.rb b/lib/xero-ruby/models/accounting/invoice.rb index 15f8aa97..41df5871 100644 --- a/lib/xero-ruby/models/accounting/invoice.rb +++ b/lib/xero-ruby/models/accounting/invoice.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/invoice_reminder.rb b/lib/xero-ruby/models/accounting/invoice_reminder.rb index 902f8714..2711881a 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminder.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminder.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/invoice_reminders.rb b/lib/xero-ruby/models/accounting/invoice_reminders.rb index f3c3f4bb..f1a0bd3c 100644 --- a/lib/xero-ruby/models/accounting/invoice_reminders.rb +++ b/lib/xero-ruby/models/accounting/invoice_reminders.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/invoices.rb b/lib/xero-ruby/models/accounting/invoices.rb index 3609dcbd..84c567f9 100644 --- a/lib/xero-ruby/models/accounting/invoices.rb +++ b/lib/xero-ruby/models/accounting/invoices.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/item.rb b/lib/xero-ruby/models/accounting/item.rb index 512b4e5b..910daa57 100644 --- a/lib/xero-ruby/models/accounting/item.rb +++ b/lib/xero-ruby/models/accounting/item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/items.rb b/lib/xero-ruby/models/accounting/items.rb index a04ab19c..44dfc8e8 100644 --- a/lib/xero-ruby/models/accounting/items.rb +++ b/lib/xero-ruby/models/accounting/items.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/journal.rb b/lib/xero-ruby/models/accounting/journal.rb index 247d824e..3a5f334a 100644 --- a/lib/xero-ruby/models/accounting/journal.rb +++ b/lib/xero-ruby/models/accounting/journal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/journal_line.rb b/lib/xero-ruby/models/accounting/journal_line.rb index c319770b..32c0de82 100644 --- a/lib/xero-ruby/models/accounting/journal_line.rb +++ b/lib/xero-ruby/models/accounting/journal_line.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/journals.rb b/lib/xero-ruby/models/accounting/journals.rb index f3e7341a..ff7dbd5c 100644 --- a/lib/xero-ruby/models/accounting/journals.rb +++ b/lib/xero-ruby/models/accounting/journals.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/line_amount_types.rb b/lib/xero-ruby/models/accounting/line_amount_types.rb index 6da52859..84264448 100644 --- a/lib/xero-ruby/models/accounting/line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/line_amount_types.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/line_item.rb b/lib/xero-ruby/models/accounting/line_item.rb index 67afa953..94061c16 100644 --- a/lib/xero-ruby/models/accounting/line_item.rb +++ b/lib/xero-ruby/models/accounting/line_item.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/line_item_tracking.rb b/lib/xero-ruby/models/accounting/line_item_tracking.rb index 1ad0fa66..f00a77f9 100644 --- a/lib/xero-ruby/models/accounting/line_item_tracking.rb +++ b/lib/xero-ruby/models/accounting/line_item_tracking.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/linked_transaction.rb b/lib/xero-ruby/models/accounting/linked_transaction.rb index 2ff311b4..26475d28 100644 --- a/lib/xero-ruby/models/accounting/linked_transaction.rb +++ b/lib/xero-ruby/models/accounting/linked_transaction.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/linked_transactions.rb b/lib/xero-ruby/models/accounting/linked_transactions.rb index 54ed18c9..ca527e97 100644 --- a/lib/xero-ruby/models/accounting/linked_transactions.rb +++ b/lib/xero-ruby/models/accounting/linked_transactions.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/manual_journal.rb b/lib/xero-ruby/models/accounting/manual_journal.rb index ce710873..dd920550 100644 --- a/lib/xero-ruby/models/accounting/manual_journal.rb +++ b/lib/xero-ruby/models/accounting/manual_journal.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/manual_journal_line.rb b/lib/xero-ruby/models/accounting/manual_journal_line.rb index 0637594f..e55c4aed 100644 --- a/lib/xero-ruby/models/accounting/manual_journal_line.rb +++ b/lib/xero-ruby/models/accounting/manual_journal_line.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/manual_journals.rb b/lib/xero-ruby/models/accounting/manual_journals.rb index abec9055..0f2a35bd 100644 --- a/lib/xero-ruby/models/accounting/manual_journals.rb +++ b/lib/xero-ruby/models/accounting/manual_journals.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/online_invoice.rb b/lib/xero-ruby/models/accounting/online_invoice.rb index 99263cc6..51b6e448 100644 --- a/lib/xero-ruby/models/accounting/online_invoice.rb +++ b/lib/xero-ruby/models/accounting/online_invoice.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/online_invoices.rb b/lib/xero-ruby/models/accounting/online_invoices.rb index 8f25aa3e..8d1294db 100644 --- a/lib/xero-ruby/models/accounting/online_invoices.rb +++ b/lib/xero-ruby/models/accounting/online_invoices.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index caaf0d16..29e842e6 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/organisations.rb b/lib/xero-ruby/models/accounting/organisations.rb index cb449f66..d1b035ee 100644 --- a/lib/xero-ruby/models/accounting/organisations.rb +++ b/lib/xero-ruby/models/accounting/organisations.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/overpayment.rb b/lib/xero-ruby/models/accounting/overpayment.rb index 167069d8..b95fa81d 100644 --- a/lib/xero-ruby/models/accounting/overpayment.rb +++ b/lib/xero-ruby/models/accounting/overpayment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/overpayments.rb b/lib/xero-ruby/models/accounting/overpayments.rb index cc4c0a1f..4b357b87 100644 --- a/lib/xero-ruby/models/accounting/overpayments.rb +++ b/lib/xero-ruby/models/accounting/overpayments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/payment.rb b/lib/xero-ruby/models/accounting/payment.rb index 6eee2a6e..325dff32 100644 --- a/lib/xero-ruby/models/accounting/payment.rb +++ b/lib/xero-ruby/models/accounting/payment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/payment_delete.rb b/lib/xero-ruby/models/accounting/payment_delete.rb index 047fc0b3..5e875d0d 100644 --- a/lib/xero-ruby/models/accounting/payment_delete.rb +++ b/lib/xero-ruby/models/accounting/payment_delete.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/payment_service.rb b/lib/xero-ruby/models/accounting/payment_service.rb index 8718b9bd..bebc308f 100644 --- a/lib/xero-ruby/models/accounting/payment_service.rb +++ b/lib/xero-ruby/models/accounting/payment_service.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/payment_services.rb b/lib/xero-ruby/models/accounting/payment_services.rb index 426d38d0..cce3ea38 100644 --- a/lib/xero-ruby/models/accounting/payment_services.rb +++ b/lib/xero-ruby/models/accounting/payment_services.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/payment_term.rb b/lib/xero-ruby/models/accounting/payment_term.rb index 8844a406..c94d008a 100644 --- a/lib/xero-ruby/models/accounting/payment_term.rb +++ b/lib/xero-ruby/models/accounting/payment_term.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/payment_term_type.rb b/lib/xero-ruby/models/accounting/payment_term_type.rb index 8c380e92..9ce43bda 100644 --- a/lib/xero-ruby/models/accounting/payment_term_type.rb +++ b/lib/xero-ruby/models/accounting/payment_term_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/payments.rb b/lib/xero-ruby/models/accounting/payments.rb index 6ace8cd9..2d01d622 100644 --- a/lib/xero-ruby/models/accounting/payments.rb +++ b/lib/xero-ruby/models/accounting/payments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/phone.rb b/lib/xero-ruby/models/accounting/phone.rb index 5d68b7e3..b956390f 100644 --- a/lib/xero-ruby/models/accounting/phone.rb +++ b/lib/xero-ruby/models/accounting/phone.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/prepayment.rb b/lib/xero-ruby/models/accounting/prepayment.rb index fa801f3d..27f1bb6d 100644 --- a/lib/xero-ruby/models/accounting/prepayment.rb +++ b/lib/xero-ruby/models/accounting/prepayment.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/prepayments.rb b/lib/xero-ruby/models/accounting/prepayments.rb index 8d77dc16..d57cf1ac 100644 --- a/lib/xero-ruby/models/accounting/prepayments.rb +++ b/lib/xero-ruby/models/accounting/prepayments.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/purchase.rb b/lib/xero-ruby/models/accounting/purchase.rb index 8ad03fb6..c4e51a72 100644 --- a/lib/xero-ruby/models/accounting/purchase.rb +++ b/lib/xero-ruby/models/accounting/purchase.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/purchase_order.rb b/lib/xero-ruby/models/accounting/purchase_order.rb index 3a35b1fd..34a28b42 100644 --- a/lib/xero-ruby/models/accounting/purchase_order.rb +++ b/lib/xero-ruby/models/accounting/purchase_order.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/purchase_orders.rb b/lib/xero-ruby/models/accounting/purchase_orders.rb index fd40cea4..35d42682 100644 --- a/lib/xero-ruby/models/accounting/purchase_orders.rb +++ b/lib/xero-ruby/models/accounting/purchase_orders.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/quote.rb b/lib/xero-ruby/models/accounting/quote.rb index 112a50fd..c40d723d 100644 --- a/lib/xero-ruby/models/accounting/quote.rb +++ b/lib/xero-ruby/models/accounting/quote.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb index bdede777..19a37818 100644 --- a/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +++ b/lib/xero-ruby/models/accounting/quote_line_amount_types.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/quote_status_codes.rb b/lib/xero-ruby/models/accounting/quote_status_codes.rb index 7325a28a..40801dd7 100644 --- a/lib/xero-ruby/models/accounting/quote_status_codes.rb +++ b/lib/xero-ruby/models/accounting/quote_status_codes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/quotes.rb b/lib/xero-ruby/models/accounting/quotes.rb index 7db0d6ae..bc238513 100644 --- a/lib/xero-ruby/models/accounting/quotes.rb +++ b/lib/xero-ruby/models/accounting/quotes.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/receipt.rb b/lib/xero-ruby/models/accounting/receipt.rb index 487de6e9..cb666403 100644 --- a/lib/xero-ruby/models/accounting/receipt.rb +++ b/lib/xero-ruby/models/accounting/receipt.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/receipts.rb b/lib/xero-ruby/models/accounting/receipts.rb index a69e3dec..d4c6c0b8 100644 --- a/lib/xero-ruby/models/accounting/receipts.rb +++ b/lib/xero-ruby/models/accounting/receipts.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/repeating_invoice.rb b/lib/xero-ruby/models/accounting/repeating_invoice.rb index 0f8c5feb..9f4570f3 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoice.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoice.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/repeating_invoices.rb b/lib/xero-ruby/models/accounting/repeating_invoices.rb index 6bb7e2f4..ff4cea38 100644 --- a/lib/xero-ruby/models/accounting/repeating_invoices.rb +++ b/lib/xero-ruby/models/accounting/repeating_invoices.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report.rb b/lib/xero-ruby/models/accounting/report.rb index fbd6c87d..d6543f71 100644 --- a/lib/xero-ruby/models/accounting/report.rb +++ b/lib/xero-ruby/models/accounting/report.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report_attribute.rb b/lib/xero-ruby/models/accounting/report_attribute.rb index ccb4a4e1..b0207da5 100644 --- a/lib/xero-ruby/models/accounting/report_attribute.rb +++ b/lib/xero-ruby/models/accounting/report_attribute.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report_cell.rb b/lib/xero-ruby/models/accounting/report_cell.rb index 4ebc5c42..3f375373 100644 --- a/lib/xero-ruby/models/accounting/report_cell.rb +++ b/lib/xero-ruby/models/accounting/report_cell.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report_fields.rb b/lib/xero-ruby/models/accounting/report_fields.rb index c2ee5a93..58f1820d 100644 --- a/lib/xero-ruby/models/accounting/report_fields.rb +++ b/lib/xero-ruby/models/accounting/report_fields.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report_row.rb b/lib/xero-ruby/models/accounting/report_row.rb index 42edc0b6..b5f36e1e 100644 --- a/lib/xero-ruby/models/accounting/report_row.rb +++ b/lib/xero-ruby/models/accounting/report_row.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report_rows.rb b/lib/xero-ruby/models/accounting/report_rows.rb index 3733085d..bef9b6a5 100644 --- a/lib/xero-ruby/models/accounting/report_rows.rb +++ b/lib/xero-ruby/models/accounting/report_rows.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report_with_row.rb b/lib/xero-ruby/models/accounting/report_with_row.rb index 909ab775..8f87fff4 100644 --- a/lib/xero-ruby/models/accounting/report_with_row.rb +++ b/lib/xero-ruby/models/accounting/report_with_row.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/report_with_rows.rb b/lib/xero-ruby/models/accounting/report_with_rows.rb index f7fcee2d..1af468a7 100644 --- a/lib/xero-ruby/models/accounting/report_with_rows.rb +++ b/lib/xero-ruby/models/accounting/report_with_rows.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/reports.rb b/lib/xero-ruby/models/accounting/reports.rb index a94cc0a4..257589fd 100644 --- a/lib/xero-ruby/models/accounting/reports.rb +++ b/lib/xero-ruby/models/accounting/reports.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/request_empty.rb b/lib/xero-ruby/models/accounting/request_empty.rb index dec3ab31..37a24a35 100644 --- a/lib/xero-ruby/models/accounting/request_empty.rb +++ b/lib/xero-ruby/models/accounting/request_empty.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/row_type.rb b/lib/xero-ruby/models/accounting/row_type.rb index 57e577af..87c0a6fa 100644 --- a/lib/xero-ruby/models/accounting/row_type.rb +++ b/lib/xero-ruby/models/accounting/row_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/sales_tracking_category.rb b/lib/xero-ruby/models/accounting/sales_tracking_category.rb index 60c5501d..f77bf87a 100644 --- a/lib/xero-ruby/models/accounting/sales_tracking_category.rb +++ b/lib/xero-ruby/models/accounting/sales_tracking_category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/schedule.rb b/lib/xero-ruby/models/accounting/schedule.rb index ffc6a510..939782ae 100644 --- a/lib/xero-ruby/models/accounting/schedule.rb +++ b/lib/xero-ruby/models/accounting/schedule.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tax_component.rb b/lib/xero-ruby/models/accounting/tax_component.rb index 56656558..9b0bc267 100644 --- a/lib/xero-ruby/models/accounting/tax_component.rb +++ b/lib/xero-ruby/models/accounting/tax_component.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tax_rate.rb b/lib/xero-ruby/models/accounting/tax_rate.rb index 1a648a71..e2c6ee2b 100644 --- a/lib/xero-ruby/models/accounting/tax_rate.rb +++ b/lib/xero-ruby/models/accounting/tax_rate.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tax_rates.rb b/lib/xero-ruby/models/accounting/tax_rates.rb index 94694bf3..c367fef2 100644 --- a/lib/xero-ruby/models/accounting/tax_rates.rb +++ b/lib/xero-ruby/models/accounting/tax_rates.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tax_type.rb b/lib/xero-ruby/models/accounting/tax_type.rb index 7440809d..673c0af3 100644 --- a/lib/xero-ruby/models/accounting/tax_type.rb +++ b/lib/xero-ruby/models/accounting/tax_type.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb b/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb index e8d08b41..f4ff26b8 100644 --- a/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb +++ b/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/time_zone.rb b/lib/xero-ruby/models/accounting/time_zone.rb index 87d4c270..19a4f9fb 100644 --- a/lib/xero-ruby/models/accounting/time_zone.rb +++ b/lib/xero-ruby/models/accounting/time_zone.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tracking_categories.rb b/lib/xero-ruby/models/accounting/tracking_categories.rb index d1e70fce..df3ef618 100644 --- a/lib/xero-ruby/models/accounting/tracking_categories.rb +++ b/lib/xero-ruby/models/accounting/tracking_categories.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tracking_category.rb b/lib/xero-ruby/models/accounting/tracking_category.rb index e2207946..bec6d92b 100644 --- a/lib/xero-ruby/models/accounting/tracking_category.rb +++ b/lib/xero-ruby/models/accounting/tracking_category.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tracking_option.rb b/lib/xero-ruby/models/accounting/tracking_option.rb index c84e3827..3ecbbf67 100644 --- a/lib/xero-ruby/models/accounting/tracking_option.rb +++ b/lib/xero-ruby/models/accounting/tracking_option.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/tracking_options.rb b/lib/xero-ruby/models/accounting/tracking_options.rb index c54ea2b9..d06e5a9a 100644 --- a/lib/xero-ruby/models/accounting/tracking_options.rb +++ b/lib/xero-ruby/models/accounting/tracking_options.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/user.rb b/lib/xero-ruby/models/accounting/user.rb index c9acbf20..cadc0708 100644 --- a/lib/xero-ruby/models/accounting/user.rb +++ b/lib/xero-ruby/models/accounting/user.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/users.rb b/lib/xero-ruby/models/accounting/users.rb index 23c27840..8b160305 100644 --- a/lib/xero-ruby/models/accounting/users.rb +++ b/lib/xero-ruby/models/accounting/users.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/models/accounting/validation_error.rb b/lib/xero-ruby/models/accounting/validation_error.rb index 51b6e2a7..60987aee 100644 --- a/lib/xero-ruby/models/accounting/validation_error.rb +++ b/lib/xero-ruby/models/accounting/validation_error.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/lib/xero-ruby/version.rb b/lib/xero-ruby/version.rb index 26c6e59c..2e05fb74 100644 --- a/lib/xero-ruby/version.rb +++ b/lib/xero-ruby/version.rb @@ -6,7 +6,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end diff --git a/xero-ruby.gemspec b/xero-ruby.gemspec index 84c2c41a..7b74677b 100644 --- a/xero-ruby.gemspec +++ b/xero-ruby.gemspec @@ -8,7 +8,7 @@ The version of the OpenAPI document: 2.2.2 Contact: api@xero.com Generated by: https://openapi-generator.tech -OpenAPI Generator version: 4.3.0 +OpenAPI Generator version: 4.3.1 =end From 7e59dae50ffba6a0afd49cc96a75b1dd5ed3727c Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 24 Jun 2020 21:45:05 -0600 Subject: [PATCH 15/21] most specs assetions were not auto generated from openapi-spec generation. lots of good framerwork to layer in coverage over time. & removed 2 duplicate enums I need to fix from the spec later --- lib/xero-ruby/models/accounting/account.rb | 2 +- lib/xero-ruby/models/accounting/organisation.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index 5cf6b997..41398229 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -89,7 +89,7 @@ class Account CISLABOURINCOME = "CISLABOURINCOME".freeze CISLIABILITY = "CISLIABILITY".freeze CISMATERIALS = "CISMATERIALS".freeze - EMPTY = "".freeze + # EMPTY = "".freeze -> duplicate generation #TODO # Shown if set attr_accessor :reporting_code diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index 29e842e6..ebe35464 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -112,7 +112,7 @@ class Organisation N6_MONTHLY = "6MONTHLY".freeze QUARTERLY = "QUARTERLY".freeze YEARLY = "YEARLY".freeze - NONE = "NONE".freeze + # NONE = "NONE".freeze -> duplicate generation #TODO # The default for LineAmountTypes on sales transactions attr_accessor :default_sales_tax From 4cbd5c8e7d59d21fca3a4e9d322b406297a89d34 Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 24 Jun 2020 22:02:53 -0600 Subject: [PATCH 16/21] new line to return and docs --- docs/accounting/AccountingApi.md | 5 +++++ docs/projects/ProjectApi.md | 4 ++++ lib/xero-ruby/models/accounting/account.rb | 2 +- lib/xero-ruby/models/accounting/organisation.rb | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md index 03b10705..ecaee4b9 100644 --- a/docs/accounting/AccountingApi.md +++ b/docs/accounting/AccountingApi.md @@ -3663,6 +3663,7 @@ contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique ident contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin # Allows you to delete a specific Contact from a Contact Group api_instance.delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contact: #{e}" end @@ -3724,6 +3725,7 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Groupbegin # Allows you to delete all Contacts from a Contact Group api_instance.delete_contact_group_contacts(xero_tenant_id, contact_group_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contacts: #{e}" end @@ -3784,6 +3786,7 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Itembegin # Allows you to delete a specified item api_instance.delete_item(xero_tenant_id, item_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_item: #{e}" end @@ -3844,6 +3847,7 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransactionbegin # Allows you to delete a specified linked transactions (billable expenses) api_instance.delete_linked_transaction(xero_tenant_id, linked_transaction_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_linked_transaction: #{e}" end @@ -4092,6 +4096,7 @@ invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier request_empty = {} # RequestEmpty | begin # Allows you to email a copy of invoice to related Contact api_instance.email_invoice(xero_tenant_id, invoice_id, request_empty) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->email_invoice: #{e}" end diff --git a/docs/projects/ProjectApi.md b/docs/projects/ProjectApi.md index 26b63514..1f848443 100644 --- a/docs/projects/ProjectApi.md +++ b/docs/projects/ProjectApi.md @@ -182,6 +182,7 @@ project_id = 'project_id_example' # String | You can specify an individual proje time_entry_id = 'time_entry_id_example' # String | You can specify an individual task by appending the id to the endpointbegin # Allows you to delete a time entry api_instance.delete_time_entry(xero_tenant_id, project_id, time_entry_id) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->delete_time_entry: #{e}" end @@ -755,6 +756,7 @@ project_id = 'project_id_example' # String | You can specify an individual proje project_patch = { "status": "INPROGRESS" } # ProjectPatch | Update the status of an existing Projectbegin # creates a project for the specified contact api_instance.patch_project(xero_tenant_id, project_id, project_patch) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->patch_project: #{e}" end @@ -819,6 +821,7 @@ project_id = 'project_id_example' # String | You can specify an individual proje project_create_or_update = { "name": "New Kitchen", "deadlineUtc": "2017-04-23T18:25:43.511Z", "estimateAmount": 99.99 } # ProjectCreateOrUpdate | Request of type ProjectCreateOrUpdatebegin # update a specific project api_instance.update_project(xero_tenant_id, project_id, project_create_or_update) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_project: #{e}" end @@ -884,6 +887,7 @@ time_entry_id = 'time_entry_id_example' # String | You can specify an individual time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-27T15:00:00Z", "duration":45, "description":"My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updatingbegin # Allows you to update time entry in a project api_instance.update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_time_entry: #{e}" end diff --git a/lib/xero-ruby/models/accounting/account.rb b/lib/xero-ruby/models/accounting/account.rb index 41398229..5cf6b997 100644 --- a/lib/xero-ruby/models/accounting/account.rb +++ b/lib/xero-ruby/models/accounting/account.rb @@ -89,7 +89,7 @@ class Account CISLABOURINCOME = "CISLABOURINCOME".freeze CISLIABILITY = "CISLIABILITY".freeze CISMATERIALS = "CISMATERIALS".freeze - # EMPTY = "".freeze -> duplicate generation #TODO + EMPTY = "".freeze # Shown if set attr_accessor :reporting_code diff --git a/lib/xero-ruby/models/accounting/organisation.rb b/lib/xero-ruby/models/accounting/organisation.rb index ebe35464..29e842e6 100644 --- a/lib/xero-ruby/models/accounting/organisation.rb +++ b/lib/xero-ruby/models/accounting/organisation.rb @@ -112,7 +112,7 @@ class Organisation N6_MONTHLY = "6MONTHLY".freeze QUARTERLY = "QUARTERLY".freeze YEARLY = "YEARLY".freeze - # NONE = "NONE".freeze -> duplicate generation #TODO + NONE = "NONE".freeze # The default for LineAmountTypes on sales transactions attr_accessor :default_sales_tax From 5915a900187b08d186deb67c1d2590a9a9a29e9b Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 24 Jun 2020 22:18:22 -0600 Subject: [PATCH 17/21] fix docs --- docs/accounting/AccountingApi.md | 2029 +++++++++++++++++++++++------- docs/assets/AssetApi.md | 54 +- docs/projects/ProjectApi.md | 117 +- 3 files changed, 1685 insertions(+), 515 deletions(-) diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md index ecaee4b9..e6ab26ab 100644 --- a/docs/accounting/AccountingApi.md +++ b/docs/accounting/AccountingApi.md @@ -246,13 +246,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiaccount = { code: "123456", name: "Foobar", type: XeroRuby::Accounting::AccountType::EXPENSE, description: "Hello World" } +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +account = { code: "123456", name: "Foobar", type: XeroRuby::Accounting::AccountType::EXPENSE, description: "Hello World" } begin # Allows you to create a new chart of accounts result = api_instance.create_account(xero_tenant_id, account) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_account: #{e}" @@ -305,10 +310,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object @@ -316,6 +325,7 @@ file_name = 'xero-dev.jpg' # String | Name of the attachment body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to create Attachment on Account result = api_instance.create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_account_attachment_by_file_name: #{e}" @@ -370,10 +380,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction @@ -381,6 +395,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to createa an Attachment on BankTransaction by Filename result = api_instance.create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transaction_attachment_by_file_name: #{e}" @@ -435,16 +450,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create history record for a bank transactions result = api_instance.create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transaction_history_record: #{e}" @@ -498,10 +518,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apibank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" } ], bank_account: { code: "000" }}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +bank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" } ], bank_account: { code: "000" }}]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -511,6 +535,7 @@ opts = { begin # Allows you to create one or more spend or receive money transaction result = api_instance.create_bank_transactions(xero_tenant_id, bank_transactions, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transactions: #{e}" @@ -565,13 +590,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apibank_transfers = { bank_transfers: [{ from_bank_account: { code: "000", account_id: "00000000-0000-0000-000-000000000000" }, to_bank_account: { code: "001", account_id: "00000000-0000-0000-000-000000000000" }, amount: "50.00" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +bank_transfers = { bank_transfers: [{ from_bank_account: { code: "000", account_id: "00000000-0000-0000-000-000000000000" }, to_bank_account: { code: "001", account_id: "00000000-0000-0000-000-000000000000" }, amount: "50.00" }]} begin # Allows you to create a bank transfers result = api_instance.create_bank_transfer(xero_tenant_id, bank_transfers) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transfer: #{e}" @@ -624,16 +654,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transfer_attachment_by_file_name: #{e}" @@ -688,15 +723,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin result = api_instance.create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transfer_history_record: #{e}" @@ -750,10 +790,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apibatch_payments = { batch_payments: [{ account: { account_id: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [{ account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }}]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +batch_payments = { batch_payments: [{ account: { account_id: "00000000-0000-0000-000-000000000000" }, reference: "ref", date: "2018-08-01", payments: [{ account: { code: "001" }, date: "2019-12-31", amount: 500, invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }}]}]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -761,6 +805,7 @@ opts = { begin # Create one or many BatchPayments for invoices result = api_instance.create_batch_payment(xero_tenant_id, batch_payments, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_batch_payment: #{e}" @@ -814,16 +859,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create a history record for a Batch Payment result = api_instance.create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_batch_payment_history_record: #{e}" @@ -877,13 +927,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apipayment_service = { payment_service_id: "dede7858-14e3-4a46-bf95-4d4cc491e645", payment_service_name: "ACME Payments", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Pay Now" } +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +payment_service = { payment_service_id: "dede7858-14e3-4a46-bf95-4d4cc491e645", payment_service_name: "ACME Payments", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Pay Now" } begin # Allow for the creation of new custom payment service for specified Branding Theme result = api_instance.create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_branding_theme_payment_services: #{e}" @@ -937,16 +992,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_attachment_by_file_name: #{e}" @@ -1001,13 +1061,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicontact_groups = { contact_groups: [{ name: "VIPs" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +contact_groups = { contact_groups: [{ name: "VIPs" }]} begin # Allows you to create a contact group result = api_instance.create_contact_group(xero_tenant_id, contact_groups) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_group: #{e}" @@ -1060,13 +1125,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicontacts = { contacts: [{ contactID: "a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID: "4e1753b9-018a-4775-b6aa-1bc7871cfee3" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +contacts = { contacts: [{ contactID: "a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID: "4e1753b9-018a-4775-b6aa-1bc7871cfee3" }]} begin # Allows you to add Contacts to a Contact Group result = api_instance.create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_group_contacts: #{e}" @@ -1120,16 +1190,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to retrieve a history records of an Contact result = api_instance.create_contact_history(xero_tenant_id, contact_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_history: #{e}" @@ -1183,10 +1258,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicontacts = { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::DAYSAFTERBILLMONTH }}}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +contacts = { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::DAYSAFTERBILLMONTH }}}]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -1194,6 +1273,7 @@ opts = { begin # Allows you to create a multiple contacts (bulk) in a Xero organisation result = api_instance.create_contacts(xero_tenant_id, contacts, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contacts: #{e}" @@ -1247,13 +1327,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiallocations = { allocations: [{ amount: 1.0, date: "2019-03-05", invoice: { invoice_id: "c45720a1-ade3-4a38-a064-d15489be6841", line_items: [], type: XeroRuby::Accounting::Invoice::ACCPAY, contact: {} }}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +allocations = { allocations: [{ amount: 1.0, date: "2019-03-05", invoice: { invoice_id: "c45720a1-ade3-4a38-a064-d15489be6841", line_items: [], type: XeroRuby::Accounting::Invoice::ACCPAY, contact: {} }}]} begin # Allows you to create Allocation on CreditNote result = api_instance.create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_note_allocation: #{e}" @@ -1307,10 +1392,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note @@ -1322,6 +1411,7 @@ opts = { begin # Allows you to create Attachments on CreditNote by file name result = api_instance.create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_note_attachment_by_file_name: #{e}" @@ -1377,16 +1467,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to retrieve a history records of an CreditNote result = api_instance.create_credit_note_history(xero_tenant_id, credit_note_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_note_history: #{e}" @@ -1440,10 +1535,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicredit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "430fa14a-f945-44d3-9f97-5df5e28441b8" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "430fa14a-f945-44d3-9f97-5df5e28441b8" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -1453,6 +1552,7 @@ opts = { begin # Allows you to create a credit note result = api_instance.create_credit_notes(xero_tenant_id, credit_notes, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_notes: #{e}" @@ -1507,12 +1607,17 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicurrency = { code: XeroRuby::Accounting::CurrencyCode::USD, description: "United States Dollar" } +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +currency = { code: XeroRuby::Accounting::CurrencyCode::USD, description: "United States Dollar" } begin result = api_instance.create_currency(xero_tenant_id, currency) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_currency: #{e}" @@ -1565,10 +1670,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiemployees = { employees: [{ first_name: "Nick", last_name: "Fury", externalink: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +employees = { employees: [{ first_name: "Nick", last_name: "Fury", externalink: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -1576,6 +1685,7 @@ opts = { begin # Allows you to create new employees used in Xero payrun result = api_instance.create_employees(xero_tenant_id, employees, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_employees: #{e}" @@ -1629,16 +1739,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create a history records of an ExpenseClaim result = api_instance.create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_expense_claim_history: #{e}" @@ -1692,13 +1807,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiexpense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::SUBMITTED, user: { user_id: "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts: [{ receipt_id: "dc1c7f6d-0a4c-402f-acac-551d62ce5816", line_items: [], contact: {}, user: {}, date: "2018-01-01" }]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::SUBMITTED, user: { user_id: "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts: [{ receipt_id: "dc1c7f6d-0a4c-402f-acac-551d62ce5816", line_items: [], contact: {}, user: {}, date: "2018-01-01" }]}]} begin # Allows you to retrieve expense claims result = api_instance.create_expense_claims(xero_tenant_id, expense_claims) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_expense_claims: #{e}" @@ -1751,10 +1871,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice @@ -1766,6 +1890,7 @@ opts = { begin # Allows you to create an Attachment on invoices or purchase bills by it's filename result = api_instance.create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_invoice_attachment_by_file_name: #{e}" @@ -1821,16 +1946,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to retrieve a history records of an invoice result = api_instance.create_invoice_history(xero_tenant_id, invoice_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_invoice_history: #{e}" @@ -1884,10 +2014,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiinvoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -1897,6 +2031,7 @@ opts = { begin # Allows you to create one or more sales invoices or purchase bills result = api_instance.create_invoices(xero_tenant_id, invoices, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_invoices: #{e}" @@ -1951,16 +2086,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create a history record for items result = api_instance.create_item_history(xero_tenant_id, item_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_item_history: #{e}" @@ -2014,10 +2154,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiitems = { items: [{ code: "abcXYZ123", name: "HelloWorld11", description: "Foobar", inventory_asset_account_code: "140", purchase_details: { cogs_account_code: "500" }}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +items = { items: [{ code: "abcXYZ123", name: "HelloWorld11", description: "Foobar", inventory_asset_account_code: "140", purchase_details: { cogs_account_code: "500" }}]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -2027,6 +2171,7 @@ opts = { begin # Allows you to create one or more items result = api_instance.create_items(xero_tenant_id, items, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_items: #{e}" @@ -2081,13 +2226,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apilinked_transaction = { source_transaction_id: "00000000-0000-0000-000-000000000000", source_line_item_id: "00000000-0000-0000-000-000000000000" } +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +linked_transaction = { source_transaction_id: "00000000-0000-0000-000-000000000000", source_line_item_id: "00000000-0000-0000-000-000000000000" } begin # Allows you to create linked transactions (billable expenses) result = api_instance.create_linked_transaction(xero_tenant_id, linked_transaction) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_linked_transaction: #{e}" @@ -2140,10 +2290,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal @@ -2151,6 +2305,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to a M body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to create a specified Attachment on ManualJournal by file name result = api_instance.create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_manual_journal_attachment_by_file_name: #{e}" @@ -2205,10 +2360,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apimanual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" }, { line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpson", option: "Bart" }] }]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" }, { line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpson", option: "Bart" }] }]}]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -2216,6 +2375,7 @@ opts = { begin # Allows you to create one or more manual journals result = api_instance.create_manual_journals(xero_tenant_id, manual_journals, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_manual_journals: #{e}" @@ -2269,10 +2429,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiallocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, amount: 1.0, date: "2019-03-12" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, amount: 1.0, date: "2019-03-12" }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -2280,6 +2444,7 @@ opts = { begin # Allows you to create a single allocation for an overpayment result = api_instance.create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_overpayment_allocations: #{e}" @@ -2334,16 +2499,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create history records of an Overpayment result = api_instance.create_overpayment_history(xero_tenant_id, overpayment_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_overpayment_history: #{e}" @@ -2397,13 +2567,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiinvoice = { invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 } +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +invoice = { invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 } begin # Allows you to create a single payment for invoices or credit notes result = api_instance.create_payment(xero_tenant_id, payment) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payment: #{e}" @@ -2456,16 +2631,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create a history record for a payment result = api_instance.create_payment_history(xero_tenant_id, payment_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payment_history: #{e}" @@ -2519,13 +2699,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apipayment_services = { payment_services: [{ payment_service_name: "PayUpNow", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Time To Pay" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +payment_services = { payment_services: [{ payment_service_name: "PayUpNow", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Time To Pay" }]} begin # Allows you to create payment services result = api_instance.create_payment_service(xero_tenant_id, payment_services) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payment_service: #{e}" @@ -2578,10 +2763,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apipayments = { payments: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +payments = { payments: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -2589,6 +2778,7 @@ opts = { begin # Allows you to create multiple payments for invoices or credit notes result = api_instance.create_payments(xero_tenant_id, payments, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payments: #{e}" @@ -2642,10 +2832,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiallocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: null }, amount: 1.0, date: "2019-03-13" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: null }, amount: 1.0, date: "2019-03-13" }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -2653,6 +2847,7 @@ opts = { begin # Allows you to create an Allocation for prepayments result = api_instance.create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_prepayment_allocations: #{e}" @@ -2707,16 +2902,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create a history record for an Prepayment result = api_instance.create_prepayment_history(xero_tenant_id, prepayment_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_prepayment_history: #{e}" @@ -2770,16 +2970,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create HistoryRecord for purchase orders result = api_instance.create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_purchase_order_history: #{e}" @@ -2833,10 +3038,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apipurchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, account_code: "710" }], date: "2019-03-13" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, account_code: "710" }], date: "2019-03-13" }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -2844,6 +3053,7 @@ opts = { begin # Allows you to create one or more purchase orders result = api_instance.create_purchase_orders(xero_tenant_id, purchase_orders, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_purchase_orders: #{e}" @@ -2897,10 +3107,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object @@ -2908,6 +3122,7 @@ file_name = 'xero-dev.jpg' # String | Name of the attachment body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to create Attachment on Quote result = api_instance.create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_quote_attachment_by_file_name: #{e}" @@ -2962,16 +3177,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to retrieve a history records of an quote result = api_instance.create_quote_history(xero_tenant_id, quote_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_quote_history: #{e}" @@ -3025,10 +3245,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiquotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date:"2020-02-01" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date:"2020-02-01" }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -3036,6 +3260,7 @@ opts = { begin # Allows you to create one or more quotes result = api_instance.create_quotes(xero_tenant_id, quotes, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_quotes: #{e}" @@ -3089,10 +3314,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apireceipts = { receipts: [ { contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400", tax_type: XeroRuby::Accounting::TaxType::NONE, line_amount: 40.0 }], user: { user_id: "00000000-0000-0000-000-000000000000" }, line_amount_types: XeroRuby::Accounting::INCLUSIVE, status: XeroRuby::Accounting::Receipt::DRAFT, date: nil }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +receipts = { receipts: [ { contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400", tax_type: XeroRuby::Accounting::TaxType::NONE, line_amount: 40.0 }], user: { user_id: "00000000-0000-0000-000-000000000000" }, line_amount_types: XeroRuby::Accounting::INCLUSIVE, status: XeroRuby::Accounting::Receipt::DRAFT, date: nil }]} opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts @@ -3100,6 +3329,7 @@ opts = { begin # Allows you to create draft expense claim receipts for any user result = api_instance.create_receipt(xero_tenant_id, receipts, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_receipt: #{e}" @@ -3153,10 +3383,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt @@ -3164,6 +3398,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to the body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to create Attachment on expense claim receipts by file name result = api_instance.create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_receipt_attachment_by_file_name: #{e}" @@ -3218,16 +3453,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to retrieve a history records of an Receipt result = api_instance.create_receipt_history(xero_tenant_id, receipt_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_receipt_history: #{e}" @@ -3281,10 +3521,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice @@ -3292,6 +3536,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to a R body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to create attachment on repeating invoices by file name result = api_instance.create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_repeating_invoice_attachment_by_file_name: #{e}" @@ -3346,16 +3591,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin # Allows you to create history for a repeating invoice result = api_instance.create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_repeating_invoice_history: #{e}" @@ -3409,13 +3659,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apitax_rates = { tax_rates: [{ name: "CA State Tax", tax_components: [{ name: "State Tax", rate: 2.25 }]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +tax_rates = { tax_rates: [{ name: "CA State Tax", tax_components: [{ name: "State Tax", rate: 2.25 }]}]} begin # Allows you to create one or more Tax Rates result = api_instance.create_tax_rates(xero_tenant_id, tax_rates) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_tax_rates: #{e}" @@ -3468,15 +3723,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category = { name: "FooBar" } # TrackingCategory | TrackingCategory object in body of requestbegin # Allows you to create tracking categories result = api_instance.create_tracking_category(xero_tenant_id, tracking_category) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_tracking_category: #{e}" @@ -3529,16 +3789,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory tracking_option = { name: " Bar" } # TrackingOption | TrackingOption object in body of requestbegin # Allows you to create options for a specified tracking category result = api_instance.create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_tracking_options: #{e}" @@ -3592,15 +3857,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single objectbegin # Allows you to delete a chart of accounts result = api_instance.delete_account(xero_tenant_id, account_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_account: #{e}" @@ -3653,10 +3923,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group @@ -3664,6 +3938,7 @@ contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier # Allows you to delete a specific Contact from a Contact Group api_instance.delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contact: #{e}" end @@ -3716,16 +3991,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Groupbegin # Allows you to delete all Contacts from a Contact Group api_instance.delete_contact_group_contacts(xero_tenant_id, contact_group_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contacts: #{e}" end @@ -3777,16 +4057,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Itembegin # Allows you to delete a specified item api_instance.delete_item(xero_tenant_id, item_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_item: #{e}" end @@ -3838,16 +4123,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransactionbegin # Allows you to delete a specified linked transactions (billable expenses) api_instance.delete_linked_transaction(xero_tenant_id, linked_transaction_id) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_linked_transaction: #{e}" end @@ -3899,16 +4189,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment payment_delete = { status: "DELETED" } # PaymentDelete | begin # Allows you to update a specified payment for invoices and credit notes result = api_instance.delete_payment(xero_tenant_id, payment_id, payment_delete) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_payment: #{e}" @@ -3962,15 +4257,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategorybegin # Allows you to delete tracking categories result = api_instance.delete_tracking_category(xero_tenant_id, tracking_category_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_tracking_category: #{e}" @@ -4023,16 +4323,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Optionbegin # Allows you to delete a specified option for a specified tracking category result = api_instance.delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_tracking_options: #{e}" @@ -4086,10 +4391,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice @@ -4097,6 +4406,7 @@ request_empty = {} # RequestEmpty | begin # Allows you to email a copy of invoice to related Contact api_instance.email_invoice(xero_tenant_id, invoice_id, request_empty) + rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->email_invoice: #{e}" end @@ -4149,15 +4459,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single objectbegin # Allows you to retrieve a single chart of accounts result = api_instance.get_account(xero_tenant_id, account_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account: #{e}" @@ -4210,10 +4525,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object @@ -4221,6 +4540,7 @@ file_name = 'xero-dev.jpg' # String | Name of the attachment content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachment on Account by Filename result = api_instance.get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account_attachment_by_file_name: #{e}" @@ -4275,10 +4595,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object @@ -4286,6 +4610,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve specific Attachment on Account result = api_instance.get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account_attachment_by_id: #{e}" @@ -4340,15 +4665,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account objectbegin # Allows you to retrieve Attachments for accounts result = api_instance.get_account_attachments(xero_tenant_id, account_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account_attachments: #{e}" @@ -4401,10 +4731,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -4417,6 +4751,7 @@ opts = { begin # Allows you to retrieve the full chart of accounts result = api_instance.get_accounts(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_accounts: #{e}" @@ -4471,10 +4806,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction @@ -4484,6 +4823,7 @@ opts = { begin # Allows you to retrieve a single spend or receive money transaction result = api_instance.get_bank_transaction(xero_tenant_id, bank_transaction_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction: #{e}" @@ -4537,10 +4877,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction @@ -4548,6 +4892,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on BankTransaction by Filename result = api_instance.get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_file_name: #{e}" @@ -4602,10 +4947,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction @@ -4613,6 +4962,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on a specific BankTransaction result = api_instance.get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_id: #{e}" @@ -4667,15 +5017,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transactionbegin # Allows you to retrieve any attachments to bank transactions result = api_instance.get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction_attachments: #{e}" @@ -4728,10 +5083,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -4748,6 +5107,7 @@ opts = { begin # Allows you to retrieve any spend or receive money transactions result = api_instance.get_bank_transactions(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transactions: #{e}" @@ -4804,15 +5164,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transactionbegin # Allows you to retrieve history from a bank transactions result = api_instance.get_bank_transactions_history(xero_tenant_id, bank_transaction_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transactions_history: #{e}" @@ -4865,15 +5230,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin # Allows you to retrieve any bank transfers result = api_instance.get_bank_transfer(xero_tenant_id, bank_transfer_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer: #{e}" @@ -4926,10 +5296,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer @@ -4937,6 +5311,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to a B content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on BankTransfer by file name result = api_instance.get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_file_name: #{e}" @@ -4991,10 +5366,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer @@ -5002,6 +5381,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on BankTransfer result = api_instance.get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_id: #{e}" @@ -5056,15 +5436,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin # Allows you to retrieve Attachments from bank transfers result = api_instance.get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_attachments: #{e}" @@ -5117,15 +5502,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin # Allows you to retrieve history from a bank transfers result = api_instance.get_bank_transfer_history(xero_tenant_id, bank_transfer_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_history: #{e}" @@ -5178,10 +5568,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -5194,6 +5588,7 @@ opts = { begin # Allows you to retrieve all bank transfers result = api_instance.get_bank_transfers(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfers: #{e}" @@ -5248,15 +5643,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPaymentbegin # Allows you to retrieve history from a Batch Payment result = api_instance.get_batch_payment_history(xero_tenant_id, batch_payment_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_batch_payment_history: #{e}" @@ -5309,10 +5709,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -5325,6 +5729,7 @@ opts = { begin # Retrieve either one or many BatchPayments for invoices result = api_instance.get_batch_payments(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_batch_payments: #{e}" @@ -5379,15 +5784,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Themebegin # Allows you to retrieve a specific BrandingThemes result = api_instance.get_branding_theme(xero_tenant_id, branding_theme_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_branding_theme: #{e}" @@ -5440,15 +5850,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Themebegin # Allows you to retrieve the Payment services for a Branding Theme result = api_instance.get_branding_theme_payment_services(xero_tenant_id, branding_theme_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_branding_theme_payment_services: #{e}" @@ -5501,14 +5916,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin # Allows you to retrieve all the BrandingThemes result = api_instance.get_branding_themes(xero_tenant_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_branding_themes: #{e}" @@ -5560,15 +5980,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin # Allows you to retrieve a single contacts in a Xero organisation result = api_instance.get_contact(xero_tenant_id, contact_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact: #{e}" @@ -5621,10 +6046,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact @@ -5632,6 +6061,7 @@ file_name = 'xero-dev.jpg' # String | Name for the file you are attaching content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on Contacts by file name result = api_instance.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_attachment_by_file_name: #{e}" @@ -5686,10 +6116,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact @@ -5697,6 +6131,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on Contacts result = api_instance.get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_attachment_by_id: #{e}" @@ -5751,15 +6186,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin # Allows you to retrieve, add and update contacts in a Xero organisation result = api_instance.get_contact_attachments(xero_tenant_id, contact_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_attachments: #{e}" @@ -5812,15 +6252,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_number = 'SB2' # String | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).begin # Allows you to retrieve a single contact by Contact Number in a Xero organisation result = api_instance.get_contact_by_contact_number(xero_tenant_id, contact_number) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_by_contact_number: #{e}" @@ -5873,15 +6318,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin # Allows you to retrieve CISSettings for a contact in a Xero organisation result = api_instance.get_contact_cis_settings(xero_tenant_id, contact_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_cis_settings: #{e}" @@ -5934,15 +6384,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Groupbegin # Allows you to retrieve a unique Contact Group by ID result = api_instance.get_contact_group(xero_tenant_id, contact_group_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_group: #{e}" @@ -5995,10 +6450,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -6009,6 +6468,7 @@ opts = { begin # Allows you to retrieve the ContactID and Name of all the contacts in a contact group result = api_instance.get_contact_groups(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_groups: #{e}" @@ -6062,15 +6522,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin # Allows you to retrieve a history records of an Contact result = api_instance.get_contact_history(xero_tenant_id, contact_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_history: #{e}" @@ -6123,10 +6588,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -6145,6 +6614,7 @@ opts = { begin # Allows you to retrieve all contacts in a Xero organisation result = api_instance.get_contacts(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contacts: #{e}" @@ -6202,10 +6672,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note @@ -6215,6 +6689,7 @@ opts = { begin # Allows you to retrieve a specific credit note result = api_instance.get_credit_note(xero_tenant_id, credit_note_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note: #{e}" @@ -6268,15 +6743,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin # Allows you to retrieve Credit Note as PDF files result = api_instance.get_credit_note_as_pdf(xero_tenant_id, credit_note_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_as_pdf: #{e}" @@ -6329,10 +6809,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note @@ -6340,6 +6824,7 @@ file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Cred content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on CreditNote by file name result = api_instance.get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_attachment_by_file_name: #{e}" @@ -6394,10 +6879,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note @@ -6405,6 +6894,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on CreditNote result = api_instance.get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_attachment_by_id: #{e}" @@ -6459,15 +6949,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin # Allows you to retrieve Attachments for credit notes result = api_instance.get_credit_note_attachments(xero_tenant_id, credit_note_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_attachments: #{e}" @@ -6520,15 +7015,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin # Allows you to retrieve a history records of an CreditNote result = api_instance.get_credit_note_history(xero_tenant_id, credit_note_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_history: #{e}" @@ -6581,10 +7081,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -6601,6 +7105,7 @@ opts = { begin # Allows you to retrieve any credit notes result = api_instance.get_credit_notes(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_notes: #{e}" @@ -6657,10 +7162,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -6671,6 +7180,7 @@ opts = { begin # Allows you to retrieve currencies for your organisation result = api_instance.get_currencies(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_currencies: #{e}" @@ -6724,15 +7234,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant employee_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Employeebegin # Allows you to retrieve a specific employee used in Xero payrun result = api_instance.get_employee(xero_tenant_id, employee_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_employee: #{e}" @@ -6785,10 +7300,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -6801,6 +7320,7 @@ opts = { begin # Allows you to retrieve employees used in Xero payrun result = api_instance.get_employees(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_employees: #{e}" @@ -6855,15 +7375,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaimbegin # Allows you to retrieve a specified expense claim result = api_instance.get_expense_claim(xero_tenant_id, expense_claim_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_expense_claim: #{e}" @@ -6916,15 +7441,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaimbegin # Allows you to retrieve a history records of an ExpenseClaim result = api_instance.get_expense_claim_history(xero_tenant_id, expense_claim_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_expense_claim_history: #{e}" @@ -6977,10 +7507,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -6993,6 +7527,7 @@ opts = { begin # Allows you to retrieve expense claims result = api_instance.get_expense_claims(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_expense_claims: #{e}" @@ -7047,10 +7582,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice @@ -7060,6 +7599,7 @@ opts = { begin # Allows you to retrieve a specified sales invoice or purchase bill result = api_instance.get_invoice(xero_tenant_id, invoice_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice: #{e}" @@ -7113,15 +7653,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin # Allows you to retrieve invoices or purchase bills as PDF files result = api_instance.get_invoice_as_pdf(xero_tenant_id, invoice_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_as_pdf: #{e}" @@ -7174,10 +7719,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice @@ -7185,6 +7734,7 @@ file_name = 'xero-dev.jpg' # String | Name of the file you are attaching content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachment on invoices or purchase bills by it's filename result = api_instance.get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_attachment_by_file_name: #{e}" @@ -7239,10 +7789,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice @@ -7250,6 +7804,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID result = api_instance.get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_attachment_by_id: #{e}" @@ -7304,15 +7859,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin # Allows you to retrieve Attachments on invoices or purchase bills result = api_instance.get_invoice_attachments(xero_tenant_id, invoice_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_attachments: #{e}" @@ -7365,15 +7925,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin # Allows you to retrieve a history records of an invoice result = api_instance.get_invoice_history(xero_tenant_id, invoice_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_history: #{e}" @@ -7426,14 +7991,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin # Allows you to retrieve invoice reminder settings result = api_instance.get_invoice_reminders(xero_tenant_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_reminders: #{e}" @@ -7485,10 +8055,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -7517,6 +8091,7 @@ opts = { begin # Allows you to retrieve any sales invoices or purchase bills result = api_instance.get_invoices(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoices: #{e}" @@ -7579,10 +8154,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item @@ -7592,6 +8171,7 @@ opts = { begin # Allows you to retrieve a specified item result = api_instance.get_item(xero_tenant_id, item_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_item: #{e}" @@ -7645,15 +8225,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Itembegin # Allows you to retrieve history for items result = api_instance.get_item_history(xero_tenant_id, item_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_item_history: #{e}" @@ -7706,10 +8291,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -7724,6 +8313,7 @@ opts = { begin # Allows you to retrieve any items result = api_instance.get_items(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_items: #{e}" @@ -7779,15 +8369,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Journalbegin # Allows you to retrieve a specified journals. result = api_instance.get_journal(xero_tenant_id, journal_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_journal: #{e}" @@ -7840,10 +8435,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -7856,6 +8455,7 @@ opts = { begin # Allows you to retrieve any journals. result = api_instance.get_journals(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_journals: #{e}" @@ -7910,15 +8510,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransactionbegin # Allows you to retrieve a specified linked transactions (billable expenses) result = api_instance.get_linked_transaction(xero_tenant_id, linked_transaction_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_linked_transaction: #{e}" @@ -7971,10 +8576,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -7993,6 +8602,7 @@ opts = { begin # Retrieve linked transactions (billable expenses) result = api_instance.get_linked_transactions(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_linked_transactions: #{e}" @@ -8050,15 +8660,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournalbegin # Allows you to retrieve a specified manual journals result = api_instance.get_manual_journal(xero_tenant_id, manual_journal_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal: #{e}" @@ -8111,10 +8726,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal @@ -8122,6 +8741,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to a M content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve specified Attachment on ManualJournal by file name result = api_instance.get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_file_name: #{e}" @@ -8176,10 +8796,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal @@ -8187,6 +8811,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve specified Attachment on ManualJournals result = api_instance.get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_id: #{e}" @@ -8241,15 +8866,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournalbegin # Allows you to retrieve Attachment for manual journals result = api_instance.get_manual_journal_attachments(xero_tenant_id, manual_journal_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal_attachments: #{e}" @@ -8302,10 +8932,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -8320,6 +8954,7 @@ opts = { begin # Allows you to retrieve any manual journals result = api_instance.get_manual_journals(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journals: #{e}" @@ -8375,15 +9010,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin # Allows you to retrieve a URL to an online invoice result = api_instance.get_online_invoice(xero_tenant_id, invoice_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_online_invoice: #{e}" @@ -8436,15 +9076,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant organisation_id = '00000000-0000-0000-000-000000000000' # String | The unique Xero identifier for an organisationbegin # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. result = api_instance.get_organisation_cis_settings(xero_tenant_id, organisation_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_organisation_cis_settings: #{e}" @@ -8497,14 +9142,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin # Allows you to retrieve Organisation details result = api_instance.get_organisations(xero_tenant_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_organisations: #{e}" @@ -8556,15 +9206,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpaymentbegin # Allows you to retrieve a specified overpayments result = api_instance.get_overpayment(xero_tenant_id, overpayment_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_overpayment: #{e}" @@ -8617,15 +9272,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpaymentbegin # Allows you to retrieve a history records of an Overpayment result = api_instance.get_overpayment_history(xero_tenant_id, overpayment_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_overpayment_history: #{e}" @@ -8678,10 +9338,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -8698,6 +9362,7 @@ opts = { begin # Allows you to retrieve overpayments result = api_instance.get_overpayments(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_overpayments: #{e}" @@ -8754,15 +9419,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Paymentbegin # Allows you to retrieve a specified payment for invoices and credit notes result = api_instance.get_payment(xero_tenant_id, payment_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payment: #{e}" @@ -8815,15 +9485,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Paymentbegin # Allows you to retrieve history records of a payment result = api_instance.get_payment_history(xero_tenant_id, payment_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payment_history: #{e}" @@ -8876,14 +9551,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin # Allows you to retrieve payment services result = api_instance.get_payment_services(xero_tenant_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payment_services: #{e}" @@ -8935,10 +9615,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -8953,6 +9637,7 @@ opts = { begin # Allows you to retrieve payments for invoices and credit notes result = api_instance.get_payments(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payments: #{e}" @@ -9008,15 +9693,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePaymentbegin # Allows you to retrieve a specified prepayments result = api_instance.get_prepayment(xero_tenant_id, prepayment_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_prepayment: #{e}" @@ -9069,15 +9759,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePaymentbegin # Allows you to retrieve a history records of an Prepayment result = api_instance.get_prepayment_history(xero_tenant_id, prepayment_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_prepayment_history: #{e}" @@ -9130,10 +9825,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -9150,6 +9849,7 @@ opts = { begin # Allows you to retrieve prepayments result = api_instance.get_prepayments(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_prepayments: #{e}" @@ -9206,15 +9906,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrderbegin # Allows you to retrieve a specified purchase orders result = api_instance.get_purchase_order(xero_tenant_id, purchase_order_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order: #{e}" @@ -9267,15 +9972,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Orderbegin # Allows you to retrieve purchase orders as PDF files result = api_instance.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order_as_pdf: #{e}" @@ -9328,15 +10038,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_number = 'PO1234' # String | Unique identifier for a PurchaseOrderbegin # Allows you to retrieve a specified purchase orders result = api_instance.get_purchase_order_by_number(xero_tenant_id, purchase_order_number) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order_by_number: #{e}" @@ -9389,15 +10104,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrderbegin # Allows you to retrieve history for PurchaseOrder result = api_instance.get_purchase_order_history(xero_tenant_id, purchase_order_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order_history: #{e}" @@ -9450,10 +10170,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -9472,6 +10196,7 @@ opts = { begin # Allows you to retrieve purchase orders result = api_instance.get_purchase_orders(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_orders: #{e}" @@ -9529,15 +10254,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin # Allows you to retrieve a specified quote result = api_instance.get_quote(xero_tenant_id, quote_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote: #{e}" @@ -9590,15 +10320,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin # Allows you to retrieve quotes as PDF files result = api_instance.get_quote_as_pdf(xero_tenant_id, quote_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_as_pdf: #{e}" @@ -9651,10 +10386,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object @@ -9662,6 +10401,7 @@ file_name = 'xero-dev.jpg' # String | Name of the attachment content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachment on Quote by Filename result = api_instance.get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_attachment_by_file_name: #{e}" @@ -9716,10 +10456,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object @@ -9727,6 +10471,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve specific Attachment on Quote result = api_instance.get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_attachment_by_id: #{e}" @@ -9781,15 +10526,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote objectbegin # Allows you to retrieve Attachments for Quotes result = api_instance.get_quote_attachments(xero_tenant_id, quote_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_attachments: #{e}" @@ -9842,15 +10592,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin # Allows you to retrieve a history records of an quote result = api_instance.get_quote_history(xero_tenant_id, quote_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_history: #{e}" @@ -9903,10 +10658,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -9931,6 +10690,7 @@ opts = { begin # Allows you to retrieve any sales quotes result = api_instance.get_quotes(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quotes: #{e}" @@ -9991,10 +10751,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt @@ -10004,6 +10768,7 @@ opts = { begin # Allows you to retrieve a specified draft expense claim receipts result = api_instance.get_receipt(xero_tenant_id, receipt_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt: #{e}" @@ -10057,10 +10822,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt @@ -10068,6 +10837,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to the content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on expense claim receipts by file name result = api_instance.get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_attachment_by_file_name: #{e}" @@ -10122,10 +10892,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt @@ -10133,6 +10907,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve Attachments on expense claim receipts by ID result = api_instance.get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_attachment_by_id: #{e}" @@ -10187,15 +10962,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receiptbegin # Allows you to retrieve Attachments for expense claim receipts result = api_instance.get_receipt_attachments(xero_tenant_id, receipt_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_attachments: #{e}" @@ -10248,15 +11028,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receiptbegin # Allows you to retrieve a history records of an Receipt result = api_instance.get_receipt_history(xero_tenant_id, receipt_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_history: #{e}" @@ -10309,10 +11094,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -10327,6 +11116,7 @@ opts = { begin # Allows you to retrieve draft expense claim receipts for any user result = api_instance.get_receipts(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipts: #{e}" @@ -10382,15 +11172,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin # Allows you to retrieve a specified repeating invoice result = api_instance.get_repeating_invoice(xero_tenant_id, repeating_invoice_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice: #{e}" @@ -10443,10 +11238,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice @@ -10454,6 +11253,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to a R content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve specified attachment on repeating invoices by file name result = api_instance.get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_file_name: #{e}" @@ -10508,10 +11308,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice @@ -10519,6 +11323,7 @@ attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifi content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin # Allows you to retrieve a specified Attachments on repeating invoices result = api_instance.get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_id: #{e}" @@ -10573,15 +11378,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin # Allows you to retrieve Attachments on repeating invoice result = api_instance.get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_attachments: #{e}" @@ -10634,15 +11444,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin # Allows you to retrieve history for a repeating invoice result = api_instance.get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_history: #{e}" @@ -10695,10 +11510,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -10709,6 +11528,7 @@ opts = { begin # Allows you to retrieve any repeating invoices result = api_instance.get_repeating_invoices(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoices: #{e}" @@ -10762,10 +11582,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact @@ -10779,6 +11603,7 @@ opts = { begin # Allows you to retrieve report for AgedPayablesByContact result = api_instance.get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_aged_payables_by_contact: #{e}" @@ -10834,10 +11659,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact @@ -10851,6 +11680,7 @@ opts = { begin # Allows you to retrieve report for AgedReceivablesByContact result = api_instance.get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_aged_receivables_by_contact: #{e}" @@ -10906,15 +11736,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant report_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Reportbegin # Allows you to retrieve report for BAS only valid for AU orgs result = api_instance.get_report_ba_sor_gst(xero_tenant_id, report_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_ba_sor_gst: #{e}" @@ -10967,14 +11802,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin # Allows you to retrieve report for BAS only valid for AU orgs result = api_instance.get_report_ba_sor_gst_list(xero_tenant_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_ba_sor_gst_list: #{e}" @@ -11026,10 +11866,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11050,6 +11894,7 @@ opts = { begin # Allows you to retrieve report for BalanceSheet result = api_instance.get_report_balance_sheet(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_balance_sheet: #{e}" @@ -11108,10 +11953,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11122,6 +11971,7 @@ opts = { begin # Allows you to retrieve report for BankSummary result = api_instance.get_report_bank_summary(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_bank_summary: #{e}" @@ -11175,10 +12025,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11191,6 +12045,7 @@ opts = { begin # Allows you to retrieve report for Budget Summary result = api_instance.get_report_budget_summary(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_budget_summary: #{e}" @@ -11245,10 +12100,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11257,6 +12116,7 @@ opts = { begin # Allows you to retrieve report for ExecutiveSummary result = api_instance.get_report_executive_summary(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_executive_summary: #{e}" @@ -11309,10 +12169,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11339,6 +12203,7 @@ opts = { begin # Allows you to retrieve report for ProfitAndLoss result = api_instance.get_report_profit_and_loss(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_profit_and_loss: #{e}" @@ -11400,10 +12265,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11412,6 +12281,7 @@ opts = { begin # Allows you to retrieve report for TenNinetyNine result = api_instance.get_report_ten_ninety_nine(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_ten_ninety_nine: #{e}" @@ -11464,10 +12334,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11478,6 +12352,7 @@ opts = { begin # Allows you to retrieve report for TrialBalance result = api_instance.get_report_trial_balance(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_trial_balance: #{e}" @@ -11531,10 +12406,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11547,6 +12426,7 @@ opts = { begin # Allows you to retrieve Tax Rates result = api_instance.get_tax_rates(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_tax_rates: #{e}" @@ -11601,10 +12481,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11617,6 +12501,7 @@ opts = { begin # Allows you to retrieve tracking categories and options result = api_instance.get_tracking_categories(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_tracking_categories: #{e}" @@ -11671,15 +12556,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategorybegin # Allows you to retrieve tracking categories and options for specified category result = api_instance.get_tracking_category(xero_tenant_id, tracking_category_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_tracking_category: #{e}" @@ -11732,15 +12622,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant user_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Userbegin # Allows you to retrieve a specified user result = api_instance.get_user(xero_tenant_id, user_id) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_user: #{e}" @@ -11793,10 +12688,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { @@ -11809,6 +12708,7 @@ opts = { begin # Allows you to retrieve users result = api_instance.get_users(xero_tenant_id, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_users: #{e}" @@ -11863,16 +12763,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object accounts = { accounts: [{ code: "123456", name: "BarFoo", accountID: "00000000-0000-0000-000-000000000000", type: AccountType.EXPENSE, description: "GoodBye World", taxType: TaxType.INPUT }]} # Accounts | Request of type Accounts array with one Accountbegin # Allows you to update a chart of accounts result = api_instance.update_account(xero_tenant_id, account_id, accounts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_account: #{e}" @@ -11926,10 +12831,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object @@ -11937,6 +12846,7 @@ file_name = 'xero-dev.jpg' # String | Name of the attachment body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update Attachment on Account by Filename result = api_instance.update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_account_attachment_by_file_name: #{e}" @@ -11991,12 +12901,17 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api{ bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, date: "2019-02-25", reference: "You just updated", status: XeroRuby::Accounting::BankTransaction::AUTHORISED, bank_transaction_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, bank_account: { account_id: "00000000-0000-0000-000-000000000000" }}]} summary: Allows you to update a single spend or receive money transaction parameters: - required: true in: path name: BankTransactionID description: Xero generated unique identifier for a bank transaction example: "00000000-0000-0000-000-000000000000" schema: type: string format: uuid - $ref: +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +{ bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, date: "2019-02-25", reference: "You just updated", status: XeroRuby::Accounting::BankTransaction::AUTHORISED, bank_transaction_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, bank_account: { account_id: "00000000-0000-0000-000-000000000000" }}]} summary: Allows you to update a single spend or receive money transaction parameters: - required: true in: path name: BankTransactionID description: Xero generated unique identifier for a bank transaction example: "00000000-0000-0000-000-000000000000" schema: type: string format: uuid - $ref: begin result = api_instance.update_bank_transaction(xero_tenant_id, bank_transactions) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_bank_transaction: #{e}" @@ -12049,10 +12964,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction @@ -12060,6 +12979,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update an Attachment on BankTransaction by Filename result = api_instance.update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_bank_transaction_attachment_by_file_name: #{e}" @@ -12114,16 +13034,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_bank_transfer_attachment_by_file_name: #{e}" @@ -12178,12 +13103,17 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicontacts = { contacts: [{ contact_id: "00000000-0000-0000-000-000000000000", name: "Thanos" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +contacts = { contacts: [{ contact_id: "00000000-0000-0000-000-000000000000", name: "Thanos" }]} begin result = api_instance.update_contact(xero_tenant_id, contact_id, contacts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_contact: #{e}" @@ -12237,16 +13167,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching body = 'body_example' # String | Byte array of file in body of requestbegin result = api_instance.update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_contact_attachment_by_file_name: #{e}" @@ -12301,13 +13236,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicontact_groups = { contact_groups: [{ name: "Vendor" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +contact_groups = { contact_groups: [{ name: "Vendor" }]} begin # Allows you to update a Contact Group result = api_instance.update_contact_group(xero_tenant_id, contact_group_id, contact_groups) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_contact_group: #{e}" @@ -12361,10 +13301,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicredit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", status: XeroRuby::Accounting::CreditNote::AUTHORISED, reference: "Mind stone", line_items: [{ description: "Infinity Stones", quantity: 1.0, unit_amount: 100.0, account_code: "400" } ]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", status: XeroRuby::Accounting::CreditNote::AUTHORISED, reference: "Mind stone", line_items: [{ description: "Infinity Stones", quantity: 1.0, unit_amount: 100.0, account_code: "400" } ]}]} opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts @@ -12372,6 +13316,7 @@ opts = { begin # Allows you to update a specific credit note result = api_instance.update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_credit_note: #{e}" @@ -12426,10 +13371,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note @@ -12437,6 +13386,7 @@ file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Cred body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update Attachments on CreditNote by file name result = api_instance.update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_credit_note_attachment_by_file_name: #{e}" @@ -12491,13 +13441,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiexpense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::AUTHORISED, user: { user_id: "00000000-0000-0000-000-000000000000" }, receipts: [{ receipt_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, date:"2020-01-01", user: {} }]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::AUTHORISED, user: { user_id: "00000000-0000-0000-000-000000000000" }, receipts: [{ receipt_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, date:"2020-01-01", user: {} }]}]} begin # Allows you to update specified expense claims result = api_instance.update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_expense_claim: #{e}" @@ -12551,10 +13506,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiinvoices = { invoices: [{ reference: "I am Iron Man", invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +invoices = { invoices: [{ reference: "I am Iron Man", invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }]} opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts @@ -12562,6 +13521,7 @@ opts = { begin # Allows you to update a specified sales invoices or purchase bills result = api_instance.update_invoice(xero_tenant_id, invoice_id, invoices, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_invoice: #{e}" @@ -12616,10 +13576,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice @@ -12627,6 +13591,7 @@ file_name = 'xero-dev.jpg' # String | Name of the file you are attaching body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update Attachment on invoices or purchase bills by it's filename result = api_instance.update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_invoice_attachment_by_file_name: #{e}" @@ -12681,10 +13646,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item @@ -12695,6 +13664,7 @@ opts = { begin # Allows you to update a specified item result = api_instance.update_item(xero_tenant_id, item_id, items, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_item: #{e}" @@ -12749,13 +13719,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apilinked_transactions = { linked_transactions: [{ source_line_item_id: "00000000-0000-0000-000-000000000000", contact_id: "00000000-0000-0000-000-000000000000" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +linked_transactions = { linked_transactions: [{ source_line_item_id: "00000000-0000-0000-000-000000000000", contact_id: "00000000-0000-0000-000-000000000000" }]} begin # Allows you to update a specified linked transactions (billable expenses) result = api_instance.update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_linked_transaction: #{e}" @@ -12809,13 +13784,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apimanual_journals = { manual_journals: [{ narration: "Hello Xero", manual_journal_id: "00000000-0000-0000-000-000000000000", journal_ines: [] }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +manual_journals = { manual_journals: [{ narration: "Hello Xero", manual_journal_id: "00000000-0000-0000-000-000000000000", journal_ines: [] }]} begin # Allows you to update a specified manual journal result = api_instance.update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_manual_journal: #{e}" @@ -12869,10 +13849,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal @@ -12880,6 +13864,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to a M body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update a specified Attachment on ManualJournal by file name result = api_instance.update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_manual_journal_attachment_by_file_name: #{e}" @@ -12934,10 +13919,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apibank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" }], bank_account: { code: "000" }}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +bank_transactions = { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "000" }], bank_account: { code: "000" }}]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -12947,6 +13936,7 @@ opts = { begin # Allows you to update or create one or more spend or receive money transaction result = api_instance.update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_bank_transactions: #{e}" @@ -13001,10 +13991,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_api{ contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTHDAYSAFTERBILLMONTH }}}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +{ contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.com", phones: [{ phone_type: XeroRuby::Accounting::Phone::MOBILE, phone_number: "555-1212", phone_area_code: "415" }], payment_terms: { bills: { day: 15, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTH }, sales: { day: 10, type: XeroRuby::Accounting::PaymentTermType::OFCURRENTMONTHDAYSAFTERBILLMONTH }}}]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13012,6 +14006,7 @@ opts = { begin # Allows you to update OR create one or more contacts in a Xero organisation result = api_instance.update_or_create_contacts(xero_tenant_id, contacts, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_contacts: #{e}" @@ -13065,10 +14060,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apicredit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAYCREDIT, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2019-01-05", line_items: [{ description: "Foobar", quantity: 2.0, unit_amount: 20.0, account_code: "400" }]}]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13078,6 +14077,7 @@ opts = { begin # Allows you to update OR create one or more credit notes result = api_instance.update_or_create_credit_notes(xero_tenant_id, credit_notes, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_credit_notes: #{e}" @@ -13132,10 +14132,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiemployees = { employees: [{ first_name: "Nick", last_name: "Fury", external_link: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +employees = { employees: [{ first_name: "Nick", last_name: "Fury", external_link: { url: "http://twitter.com/#!/search/Nick+Fury" }}]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13143,6 +14147,7 @@ opts = { begin # Allows you to create a single new employees used in Xero payrun result = api_instance.update_or_create_employees(xero_tenant_id, employees, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_employees: #{e}" @@ -13196,10 +14201,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiinvoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +invoices = { invoices: [{ type: XeroRuby::Accounting::Invoice::ACCREC, contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Acme Tires", quantity: 2.0, unit_amount: 20.0, account_code: "000", tax_type: TaxType.NONE, line_amount: 40.0 }], date: "2019-03-11", due_date: "2018-12-10", reference: "Website Design", status: XeroRuby::Accounting::Invoice::DRAFT }]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13209,6 +14218,7 @@ opts = { begin # Allows you to update OR create one or more sales invoices or purchase bills result = api_instance.update_or_create_invoices(xero_tenant_id, invoices, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_invoices: #{e}" @@ -13263,10 +14273,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiitems = { items: [{ code: "abcXYZ", name: "HelloWorld", description: "Foobar" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +items = { items: [{ code: "abcXYZ", name: "HelloWorld", description: "Foobar" }]} opts = { summarize_errors: false, # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13276,6 +14290,7 @@ opts = { begin # Allows you to update or create one or more items result = api_instance.update_or_create_items(xero_tenant_id, items, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_items: #{e}" @@ -13330,10 +14345,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apimanual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" },{ line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpsons", option: "Bart" }]}] }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14", journal_lines: [{ line_amount: 100.0, account_code: "400", description: "Hello there" },{ line_amount: -100.0, account_code: "400", description: "Goodbye", tracking: [{ name: "Simpsons", option: "Bart" }]}] }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13341,6 +14360,7 @@ opts = { begin # Allows you to create a single manual journal result = api_instance.update_or_create_manual_journals(xero_tenant_id, manual_journals, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_manual_journals: #{e}" @@ -13394,10 +14414,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apipurchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "710" }], date: "2019-03-13" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unitAmount: 20.0, accountCode: "710" }], date: "2019-03-13" }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13405,6 +14429,7 @@ opts = { begin # Allows you to update or create one or more purchase orders result = api_instance.update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_purchase_orders: #{e}" @@ -13458,10 +14483,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiquotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date: "2020-02-01" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-000000000000" }, line_items: [{ description: "Foobar", quantity: 1.0, unit_amount: 20.0, account_code: "12775" }], date: "2020-02-01" }]} opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors @@ -13469,6 +14498,7 @@ opts = { begin # Allows you to update OR create one or more quotes result = api_instance.update_or_create_quotes(xero_tenant_id, quotes, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_quotes: #{e}" @@ -13522,13 +14552,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apipurchase_orders = { purchase_orders: [ { attention_to: "Peter Parker", line_items: [], contact: {} }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +purchase_orders = { purchase_orders: [ { attention_to: "Peter Parker", line_items: [], contact: {} }]} begin # Allows you to update a specified purchase order result = api_instance.update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_purchase_order: #{e}" @@ -13582,13 +14617,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apiquotes = { quotes: [{ reference: "I am an update", contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2020-02-01" }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +quotes = { quotes: [{ reference: "I am an update", contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2020-02-01" }]} begin # Allows you to update a specified quote result = api_instance.update_quote(xero_tenant_id, quote_id, quotes) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_quote: #{e}" @@ -13642,10 +14682,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object @@ -13653,6 +14697,7 @@ file_name = 'xero-dev.jpg' # String | Name of the attachment body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update Attachment on Quote by Filename result = api_instance.update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_quote_attachment_by_file_name: #{e}" @@ -13707,10 +14752,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apireceipts = { receipts: [{ user: { user_id: "00000000-0000-0000-000-000000000000" }, reference: "Foobar", date: "2020-01-01", contact: {}, line_items: [] }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +receipts = { receipts: [{ user: { user_id: "00000000-0000-0000-000-000000000000" }, reference: "Foobar", date: "2020-01-01", contact: {}, line_items: [] }]} opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts @@ -13718,6 +14767,7 @@ opts = { begin # Allows you to retrieve a specified draft expense claim receipts result = api_instance.update_receipt(xero_tenant_id, receipt_id, receipts, opts) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_receipt: #{e}" @@ -13772,10 +14822,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt @@ -13783,6 +14837,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to the body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update Attachment on expense claim receipts by file name result = api_instance.update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_receipt_attachment_by_file_name: #{e}" @@ -13837,10 +14892,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice @@ -13848,6 +14907,7 @@ file_name = 'xero-dev.jpg' # String | The name of the file being attached to a R body = 'body_example' # String | Byte array of file in body of requestbegin # Allows you to update specified attachment on repeating invoices by file name result = api_instance.update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_repeating_invoice_attachment_by_file_name: #{e}" @@ -13902,13 +14962,18 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API -api_instance = xero_client.asset_apitax_rates = { tax_rates: [{ name: "State Tax NY", tax_components: [{ name: "State Tax", rate: 2.25 }], status: XeroRuby::Accounting::TaxRate::Deleted, report_tax_type: XeroRuby::Accounting::TaxRate::INPUT }]} +# :assets_api +api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api +tax_rates = { tax_rates: [{ name: "State Tax NY", tax_components: [{ name: "State Tax", rate: 2.25 }], status: XeroRuby::Accounting::TaxRate::Deleted, report_tax_type: XeroRuby::Accounting::TaxRate::INPUT }]} begin # Allows you to update Tax Rates result = api_instance.update_tax_rate(xero_tenant_id, tax_rates) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_tax_rate: #{e}" @@ -13961,16 +15026,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory tracking_category = { name: "Avengers" } # TrackingCategory | begin # Allows you to update tracking categories result = api_instance.update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_tracking_category: #{e}" @@ -14024,10 +15094,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory @@ -14035,6 +15109,7 @@ tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique ide tracking_option = { name: "Vision" } # TrackingOption | begin # Allows you to update options for a specified tracking category result = api_instance.update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option) + p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_tracking_options: #{e}" diff --git a/docs/assets/AssetApi.md b/docs/assets/AssetApi.md index 2e6fa8dc..d1a15a3e 100644 --- a/docs/assets/AssetApi.md +++ b/docs/assets/AssetApi.md @@ -39,15 +39,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant asset = { "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01", "purchasePrice":100.0, "disposalPrice":23.23, "assetStatus":"Draft", "bookDepreciationSetting":{ "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.5, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "currentCapitalGain":5.32, "currentGainLoss":3.88, "depreciationStartDate":"2020-01-02", "costLimit":100.0, "currentAccumDepreciationAmount":2.25 }, "AccountingBookValue":99.5 } # Asset | Fixed asset you are creatingbegin # adds a fixed asset result = api_instance.create_asset(xero_tenant_id, asset) + p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->create_asset: #{e}" @@ -102,10 +107,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant opts = { @@ -114,6 +123,7 @@ opts = { begin # adds a fixed asset type result = api_instance.create_asset_type(xero_tenant_id, opts) + p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->create_asset_type: #{e}" @@ -168,15 +178,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant id = '4f7bcdcb-5ec1-4258-9558-19f662fccdfe' # String | fixed asset id for single objectbegin # retrieves fixed asset by id result = api_instance.get_asset_by_id(xero_tenant_id, id) + p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_asset_by_id: #{e}" @@ -231,14 +246,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenantbegin # searches fixed asset settings result = api_instance.get_asset_settings(xero_tenant_id) + p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_asset_settings: #{e}" @@ -292,14 +312,19 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenantbegin # searches fixed asset types result = api_instance.get_asset_types(xero_tenant_id) + p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_asset_types: #{e}" @@ -353,10 +378,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant status = XeroRuby::Assets::AssetStatusQueryParam.new # AssetStatusQueryParam | Required when retrieving a collection of assets. See Asset Status Codes @@ -374,6 +403,7 @@ opts = { begin # searches fixed asset result = api_instance.get_assets(xero_tenant_id, status, opts) + p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_assets: #{e}" diff --git a/docs/projects/ProjectApi.md b/docs/projects/ProjectApi.md index 1f848443..4db51afd 100644 --- a/docs/projects/ProjectApi.md +++ b/docs/projects/ProjectApi.md @@ -44,15 +44,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_create_or_update = { "contactId":"00000000-0000-0000-000-000000000000", "name":"New Kitchen", "deadlineUtc":"2019-12-10T12:59:59Z", "estimateAmount":"99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate objectbegin # create one or more new projects result = api_instance.create_project(xero_tenant_id, project_create_or_update) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->create_project: #{e}" @@ -107,16 +112,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-26T15:00:00Z", "duration":30, "description":"My description" } # TimeEntryCreateOrUpdate | The time entry object you are creatingbegin # Allows you to create a task result = api_instance.create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->create_time_entry: #{e}" @@ -172,10 +182,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint @@ -183,6 +197,7 @@ time_entry_id = 'time_entry_id_example' # String | You can specify an individual # Allows you to delete a time entry api_instance.delete_time_entry(xero_tenant_id, project_id, time_entry_id) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->delete_time_entry: #{e}" end @@ -237,15 +252,20 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpointbegin # Allows you to retrieve a single project result = api_instance.get_project(xero_tenant_id, project_id) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_project: #{e}" @@ -300,10 +320,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant opts = { @@ -314,6 +338,7 @@ opts = { begin # list all project users result = api_instance.get_project_users(xero_tenant_id, opts) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_project_users: #{e}" @@ -369,10 +394,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant opts = { @@ -389,6 +418,7 @@ opts = { begin # list all projects result = api_instance.get_projects(xero_tenant_id, opts) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_projects: #{e}" @@ -447,16 +477,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint task_id = 'task_id_example' # String | You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}begin # Allows you to retrieve a single project result = api_instance.get_task(xero_tenant_id, project_id, task_id) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_task: #{e}" @@ -512,10 +547,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint @@ -529,6 +568,7 @@ opts = { begin # Allows you to retrieve a single project result = api_instance.get_tasks(xero_tenant_id, project_id, opts) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_tasks: #{e}" @@ -586,10 +626,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | Identifier of the project, that the task (which the time entry is logged against) belongs to. @@ -617,6 +661,7 @@ opts = { begin # Allows you to retrieve the time entries associated with a specific project result = api_instance.get_time_entries(xero_tenant_id, project_id, opts) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_time_entries: #{e}" @@ -681,16 +726,21 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpointbegin # Allows you to get a single time entry in a project result = api_instance.get_time_entry(xero_tenant_id, project_id, time_entry_id) + p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_time_entry: #{e}" @@ -746,10 +796,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint @@ -757,6 +811,7 @@ project_patch = { "status": "INPROGRESS" } # ProjectPatch | Update the status of # creates a project for the specified contact api_instance.patch_project(xero_tenant_id, project_id, project_patch) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->patch_project: #{e}" end @@ -811,10 +866,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint @@ -822,6 +881,7 @@ project_create_or_update = { "name": "New Kitchen", "deadlineUtc": "2017-04-23T1 # update a specific project api_instance.update_project(xero_tenant_id, project_id, project_create_or_update) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_project: #{e}" end @@ -876,10 +936,14 @@ token_set = fetch_valid_token_set(user) # example xero_client.refresh_token_set(token_set) -# doc assumes you are +# depending on the methods you need to use +# accounting_api api_instance = xero_client.accounting_api -# Or for methods in the Assets API +# :assets_api api_instance = xero_client.asset_api +# :projects_api +api_instance = xero_client.projects_api + xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint @@ -888,6 +952,7 @@ time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", # Allows you to update time entry in a project api_instance.update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) + rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_time_entry: #{e}" end From 96f1328a8001e7bd4d55949ed72ac43e2b444adc Mon Sep 17 00:00:00 2001 From: serknight Date: Wed, 24 Jun 2020 22:23:39 -0600 Subject: [PATCH 18/21] fix docs from mustache template gen --- docs/accounting/AccountingApi.md | 1101 +++++++++++++++--------------- docs/assets/AssetApi.md | 32 +- docs/projects/ProjectApi.md | 74 +- 3 files changed, 599 insertions(+), 608 deletions(-) diff --git a/docs/accounting/AccountingApi.md b/docs/accounting/AccountingApi.md index e6ab26ab..2551c1c2 100644 --- a/docs/accounting/AccountingApi.md +++ b/docs/accounting/AccountingApi.md @@ -254,10 +254,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api account = { code: "123456", name: "Foobar", type: XeroRuby::Accounting::AccountType::EXPENSE, description: "Hello World" } + begin - # Allows you to create a new chart of accounts + #Allows you to create a new chart of accounts result = api_instance.create_account(xero_tenant_id, account) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_account: #{e}" @@ -322,10 +322,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to create Attachment on Account +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to create Attachment on Account result = api_instance.create_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_account_attachment_by_file_name: #{e}" @@ -392,10 +392,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction file_name = 'xero-dev.jpg' # String | The name of the file being attached -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to createa an Attachment on BankTransaction by Filename +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to createa an Attachment on BankTransaction by Filename result = api_instance.create_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transaction_attachment_by_file_name: #{e}" @@ -461,10 +461,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create history record for a bank transactions +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create history record for a bank transactions result = api_instance.create_bank_transaction_history_record(xero_tenant_id, bank_transaction_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transaction_history_record: #{e}" @@ -532,10 +532,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to create one or more spend or receive money transaction + #Allows you to create one or more spend or receive money transaction result = api_instance.create_bank_transactions(xero_tenant_id, bank_transactions, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transactions: #{e}" @@ -598,10 +598,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api bank_transfers = { bank_transfers: [{ from_bank_account: { code: "000", account_id: "00000000-0000-0000-000-000000000000" }, to_bank_account: { code: "001", account_id: "00000000-0000-0000-000-000000000000" }, amount: "50.00" }]} + begin - # Allows you to create a bank transfers + #Allows you to create a bank transfers result = api_instance.create_bank_transfer(xero_tenant_id, bank_transfers) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transfer: #{e}" @@ -666,9 +666,9 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -body = 'body_example' # String | Byte array of file in body of requestbegin +body = 'body_example' # String | Byte array of file in body of request +begin result = api_instance.create_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transfer_attachment_by_file_name: #{e}" @@ -734,9 +734,9 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin result = api_instance.create_bank_transfer_history_record(xero_tenant_id, bank_transfer_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_bank_transfer_history_record: #{e}" @@ -802,10 +802,10 @@ batch_payments = { batch_payments: [{ account: { account_id: "00000000-0000-0000 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Create one or many BatchPayments for invoices + #Create one or many BatchPayments for invoices result = api_instance.create_batch_payment(xero_tenant_id, batch_payments, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_batch_payment: #{e}" @@ -870,10 +870,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create a history record for a Batch Payment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create a history record for a Batch Payment result = api_instance.create_batch_payment_history_record(xero_tenant_id, batch_payment_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_batch_payment_history_record: #{e}" @@ -935,10 +935,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api payment_service = { payment_service_id: "dede7858-14e3-4a46-bf95-4d4cc491e645", payment_service_name: "ACME Payments", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Pay Now" } + begin - # Allow for the creation of new custom payment service for specified Branding Theme + #Allow for the creation of new custom payment service for specified Branding Theme result = api_instance.create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_service) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_branding_theme_payment_services: #{e}" @@ -1004,9 +1004,9 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -body = 'body_example' # String | Byte array of file in body of requestbegin +body = 'body_example' # String | Byte array of file in body of request +begin result = api_instance.create_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_attachment_by_file_name: #{e}" @@ -1069,10 +1069,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api contact_groups = { contact_groups: [{ name: "VIPs" }]} + begin - # Allows you to create a contact group + #Allows you to create a contact group result = api_instance.create_contact_group(xero_tenant_id, contact_groups) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_group: #{e}" @@ -1133,10 +1133,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api contacts = { contacts: [{ contactID: "a3675fc4-f8dd-4f03-ba5b-f1870566bcd7" }, { contactID: "4e1753b9-018a-4775-b6aa-1bc7871cfee3" }]} + begin - # Allows you to add Contacts to a Contact Group + #Allows you to add Contacts to a Contact Group result = api_instance.create_contact_group_contacts(xero_tenant_id, contact_group_id, contacts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_group_contacts: #{e}" @@ -1201,10 +1201,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to retrieve a history records of an Contact +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to retrieve a history records of an Contact result = api_instance.create_contact_history(xero_tenant_id, contact_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contact_history: #{e}" @@ -1270,10 +1270,10 @@ contacts = { contacts: [{ name: "Bruce Banner", email_address: "hulk@avengers.co opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create a multiple contacts (bulk) in a Xero organisation + #Allows you to create a multiple contacts (bulk) in a Xero organisation result = api_instance.create_contacts(xero_tenant_id, contacts, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_contacts: #{e}" @@ -1335,10 +1335,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api allocations = { allocations: [{ amount: 1.0, date: "2019-03-05", invoice: { invoice_id: "c45720a1-ade3-4a38-a064-d15489be6841", line_items: [], type: XeroRuby::Accounting::Invoice::ACCPAY, contact: {} }}]} + begin - # Allows you to create Allocation on CreditNote + #Allows you to create Allocation on CreditNote result = api_instance.create_credit_note_allocation(xero_tenant_id, credit_note_id, allocations) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_note_allocation: #{e}" @@ -1408,10 +1408,10 @@ body = 'body_example' # String | Byte array of file in body of request opts = { include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice } + begin - # Allows you to create Attachments on CreditNote by file name + #Allows you to create Attachments on CreditNote by file name result = api_instance.create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_note_attachment_by_file_name: #{e}" @@ -1478,10 +1478,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to retrieve a history records of an CreditNote +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to retrieve a history records of an CreditNote result = api_instance.create_credit_note_history(xero_tenant_id, credit_note_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_note_history: #{e}" @@ -1549,10 +1549,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to create a credit note + #Allows you to create a credit note result = api_instance.create_credit_notes(xero_tenant_id, credit_notes, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_credit_notes: #{e}" @@ -1615,9 +1615,9 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api currency = { code: XeroRuby::Accounting::CurrencyCode::USD, description: "United States Dollar" } + begin result = api_instance.create_currency(xero_tenant_id, currency) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_currency: #{e}" @@ -1682,10 +1682,10 @@ employees = { employees: [{ first_name: "Nick", last_name: "Fury", externalink: opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create new employees used in Xero payrun + #Allows you to create new employees used in Xero payrun result = api_instance.create_employees(xero_tenant_id, employees, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_employees: #{e}" @@ -1750,10 +1750,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create a history records of an ExpenseClaim +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create a history records of an ExpenseClaim result = api_instance.create_expense_claim_history(xero_tenant_id, expense_claim_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_expense_claim_history: #{e}" @@ -1815,10 +1815,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::SUBMITTED, user: { user_id: "d1164823-0ac1-41ad-987b-b4e30fe0b273" }, receipts: [{ receipt_id: "dc1c7f6d-0a4c-402f-acac-551d62ce5816", line_items: [], contact: {}, user: {}, date: "2018-01-01" }]}]} + begin - # Allows you to retrieve expense claims + #Allows you to retrieve expense claims result = api_instance.create_expense_claims(xero_tenant_id, expense_claims) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_expense_claims: #{e}" @@ -1887,10 +1887,10 @@ body = 'body_example' # String | Byte array of file in body of request opts = { include_online: false # Boolean | Allows an attachment to be seen by the end customer within their online invoice } + begin - # Allows you to create an Attachment on invoices or purchase bills by it's filename + #Allows you to create an Attachment on invoices or purchase bills by it's filename result = api_instance.create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_invoice_attachment_by_file_name: #{e}" @@ -1957,10 +1957,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to retrieve a history records of an invoice +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to retrieve a history records of an invoice result = api_instance.create_invoice_history(xero_tenant_id, invoice_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_invoice_history: #{e}" @@ -2028,10 +2028,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to create one or more sales invoices or purchase bills + #Allows you to create one or more sales invoices or purchase bills result = api_instance.create_invoices(xero_tenant_id, invoices, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_invoices: #{e}" @@ -2097,10 +2097,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create a history record for items +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create a history record for items result = api_instance.create_item_history(xero_tenant_id, item_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_item_history: #{e}" @@ -2168,10 +2168,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to create one or more items + #Allows you to create one or more items result = api_instance.create_items(xero_tenant_id, items, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_items: #{e}" @@ -2234,10 +2234,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api linked_transaction = { source_transaction_id: "00000000-0000-0000-000-000000000000", source_line_item_id: "00000000-0000-0000-000-000000000000" } + begin - # Allows you to create linked transactions (billable expenses) + #Allows you to create linked transactions (billable expenses) result = api_instance.create_linked_transaction(xero_tenant_id, linked_transaction) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_linked_transaction: #{e}" @@ -2302,10 +2302,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to create a specified Attachment on ManualJournal by file name +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to create a specified Attachment on ManualJournal by file name result = api_instance.create_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_manual_journal_attachment_by_file_name: #{e}" @@ -2372,10 +2372,10 @@ manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14" opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create one or more manual journals + #Allows you to create one or more manual journals result = api_instance.create_manual_journals(xero_tenant_id, manual_journals, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_manual_journals: #{e}" @@ -2441,10 +2441,10 @@ allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-0 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create a single allocation for an overpayment + #Allows you to create a single allocation for an overpayment result = api_instance.create_overpayment_allocations(xero_tenant_id, overpayment_id, allocations, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_overpayment_allocations: #{e}" @@ -2510,10 +2510,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create history records of an Overpayment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create history records of an Overpayment result = api_instance.create_overpayment_history(xero_tenant_id, overpayment_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_overpayment_history: #{e}" @@ -2575,10 +2575,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api invoice = { invoice: { invoice_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, type: XeroRuby::Accounting::Invoice::ACCPAY }, account: { code: "970" }, date: "2019-03-12", amount: 1.0 } + begin - # Allows you to create a single payment for invoices or credit notes + #Allows you to create a single payment for invoices or credit notes result = api_instance.create_payment(xero_tenant_id, payment) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payment: #{e}" @@ -2642,10 +2642,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create a history record for a payment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create a history record for a payment result = api_instance.create_payment_history(xero_tenant_id, payment_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payment_history: #{e}" @@ -2707,10 +2707,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api payment_services = { payment_services: [{ payment_service_name: "PayUpNow", payment_service_url: "https://www.payupnow.com/", pay_now_text: "Time To Pay" }]} + begin - # Allows you to create payment services + #Allows you to create payment services result = api_instance.create_payment_service(xero_tenant_id, payment_services) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payment_service: #{e}" @@ -2775,10 +2775,10 @@ payments = { payments: [{ invoice: { invoice_id: "00000000-0000-0000-000-0000000 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create multiple payments for invoices or credit notes + #Allows you to create multiple payments for invoices or credit notes result = api_instance.create_payments(xero_tenant_id, payments, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_payments: #{e}" @@ -2844,10 +2844,10 @@ allocations = { allocations: [{ invoice: { invoice_id: "00000000-0000-0000-000-0 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create an Allocation for prepayments + #Allows you to create an Allocation for prepayments result = api_instance.create_prepayment_allocations(xero_tenant_id, prepayment_id, allocations, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_prepayment_allocations: #{e}" @@ -2913,10 +2913,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create a history record for an Prepayment +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create a history record for an Prepayment result = api_instance.create_prepayment_history(xero_tenant_id, prepayment_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_prepayment_history: #{e}" @@ -2981,10 +2981,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create HistoryRecord for purchase orders +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create HistoryRecord for purchase orders result = api_instance.create_purchase_order_history(xero_tenant_id, purchase_order_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_purchase_order_history: #{e}" @@ -3050,10 +3050,10 @@ purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-00 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create one or more purchase orders + #Allows you to create one or more purchase orders result = api_instance.create_purchase_orders(xero_tenant_id, purchase_orders, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_purchase_orders: #{e}" @@ -3119,10 +3119,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to create Attachment on Quote +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to create Attachment on Quote result = api_instance.create_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_quote_attachment_by_file_name: #{e}" @@ -3188,10 +3188,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to retrieve a history records of an quote +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to retrieve a history records of an quote result = api_instance.create_quote_history(xero_tenant_id, quote_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_quote_history: #{e}" @@ -3257,10 +3257,10 @@ quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-00000000000 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create one or more quotes + #Allows you to create one or more quotes result = api_instance.create_quotes(xero_tenant_id, quotes, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_quotes: #{e}" @@ -3326,10 +3326,10 @@ receipts = { receipts: [ { contact: { contact_id: "00000000-0000-0000-000-000000 opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to create draft expense claim receipts for any user + #Allows you to create draft expense claim receipts for any user result = api_instance.create_receipt(xero_tenant_id, receipts, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_receipt: #{e}" @@ -3395,10 +3395,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to create Attachment on expense claim receipts by file name +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to create Attachment on expense claim receipts by file name result = api_instance.create_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_receipt_attachment_by_file_name: #{e}" @@ -3464,10 +3464,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to retrieve a history records of an Receipt +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to retrieve a history records of an Receipt result = api_instance.create_receipt_history(xero_tenant_id, receipt_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_receipt_history: #{e}" @@ -3533,10 +3533,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to create attachment on repeating invoices by file name +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to create attachment on repeating invoices by file name result = api_instance.create_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_repeating_invoice_attachment_by_file_name: #{e}" @@ -3602,10 +3602,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice -history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of requestbegin - # Allows you to create history for a repeating invoice +history_records = { historyRecords:[ { details :"Hello World" } ] } # HistoryRecords | HistoryRecords containing an array of HistoryRecord objects in body of request +begin + #Allows you to create history for a repeating invoice result = api_instance.create_repeating_invoice_history(xero_tenant_id, repeating_invoice_id, history_records) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_repeating_invoice_history: #{e}" @@ -3667,10 +3667,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api tax_rates = { tax_rates: [{ name: "CA State Tax", tax_components: [{ name: "State Tax", rate: 2.25 }]}]} + begin - # Allows you to create one or more Tax Rates + #Allows you to create one or more Tax Rates result = api_instance.create_tax_rates(xero_tenant_id, tax_rates) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_tax_rates: #{e}" @@ -3733,10 +3733,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category = { name: "FooBar" } # TrackingCategory | TrackingCategory object in body of requestbegin - # Allows you to create tracking categories +tracking_category = { name: "FooBar" } # TrackingCategory | TrackingCategory object in body of request +begin + #Allows you to create tracking categories result = api_instance.create_tracking_category(xero_tenant_id, tracking_category) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_tracking_category: #{e}" @@ -3800,10 +3800,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_option = { name: " Bar" } # TrackingOption | TrackingOption object in body of requestbegin - # Allows you to create options for a specified tracking category +tracking_option = { name: " Bar" } # TrackingOption | TrackingOption object in body of request +begin + #Allows you to create options for a specified tracking category result = api_instance.create_tracking_options(xero_tenant_id, tracking_category_id, tracking_option) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->create_tracking_options: #{e}" @@ -3867,10 +3867,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single objectbegin - # Allows you to delete a chart of accounts +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object +begin + #Allows you to delete a chart of accounts result = api_instance.delete_account(xero_tenant_id, account_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_account: #{e}" @@ -3934,11 +3934,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin - # Allows you to delete a specific Contact from a Contact Group +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +begin + #Allows you to delete a specific Contact from a Contact Group api_instance.delete_contact_group_contact(xero_tenant_id, contact_group_id, contact_id) - - rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contact: #{e}" end @@ -4001,11 +4000,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Groupbegin - # Allows you to delete all Contacts from a Contact Group +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group +begin + #Allows you to delete all Contacts from a Contact Group api_instance.delete_contact_group_contacts(xero_tenant_id, contact_group_id) - - rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_contact_group_contacts: #{e}" end @@ -4067,11 +4065,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Itembegin - # Allows you to delete a specified item +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item +begin + #Allows you to delete a specified item api_instance.delete_item(xero_tenant_id, item_id) - - rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_item: #{e}" end @@ -4133,11 +4130,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransactionbegin - # Allows you to delete a specified linked transactions (billable expenses) +linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction +begin + #Allows you to delete a specified linked transactions (billable expenses) api_instance.delete_linked_transaction(xero_tenant_id, linked_transaction_id) - - rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_linked_transaction: #{e}" end @@ -4200,10 +4196,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment -payment_delete = { status: "DELETED" } # PaymentDelete | begin - # Allows you to update a specified payment for invoices and credit notes +payment_delete = { status: "DELETED" } # PaymentDelete | +begin + #Allows you to update a specified payment for invoices and credit notes result = api_instance.delete_payment(xero_tenant_id, payment_id, payment_delete) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_payment: #{e}" @@ -4267,10 +4263,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategorybegin - # Allows you to delete tracking categories +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory +begin + #Allows you to delete tracking categories result = api_instance.delete_tracking_category(xero_tenant_id, tracking_category_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_tracking_category: #{e}" @@ -4334,10 +4330,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Optionbegin - # Allows you to delete a specified option for a specified tracking category +tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option +begin + #Allows you to delete a specified option for a specified tracking category result = api_instance.delete_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->delete_tracking_options: #{e}" @@ -4402,11 +4398,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice -request_empty = {} # RequestEmpty | begin - # Allows you to email a copy of invoice to related Contact +request_empty = {} # RequestEmpty | +begin + #Allows you to email a copy of invoice to related Contact api_instance.email_invoice(xero_tenant_id, invoice_id, request_empty) - - rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->email_invoice: #{e}" end @@ -4469,10 +4464,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single objectbegin - # Allows you to retrieve a single chart of accounts +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object +begin + #Allows you to retrieve a single chart of accounts result = api_instance.get_account(xero_tenant_id, account_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account: #{e}" @@ -4537,10 +4532,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object file_name = 'xero-dev.jpg' # String | Name of the attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachment on Account by Filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachment on Account by Filename result = api_instance.get_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account_attachment_by_file_name: #{e}" @@ -4607,10 +4602,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve specific Attachment on Account +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve specific Attachment on Account result = api_instance.get_account_attachment_by_id(xero_tenant_id, account_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account_attachment_by_id: #{e}" @@ -4675,10 +4670,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account objectbegin - # Allows you to retrieve Attachments for accounts +account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object +begin + #Allows you to retrieve Attachments for accounts result = api_instance.get_account_attachments(xero_tenant_id, account_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_account_attachments: #{e}" @@ -4748,10 +4743,10 @@ opts = { order: 'Name ASC' # String | Order by an any element } + begin - # Allows you to retrieve the full chart of accounts + #Allows you to retrieve the full chart of accounts result = api_instance.get_accounts(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_accounts: #{e}" @@ -4820,10 +4815,10 @@ bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero gene opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve a single spend or receive money transaction + #Allows you to retrieve a single spend or receive money transaction result = api_instance.get_bank_transaction(xero_tenant_id, bank_transaction_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction: #{e}" @@ -4889,10 +4884,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction file_name = 'xero-dev.jpg' # String | The name of the file being attached -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on BankTransaction by Filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on BankTransaction by Filename result = api_instance.get_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_file_name: #{e}" @@ -4959,10 +4954,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on a specific BankTransaction +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on a specific BankTransaction result = api_instance.get_bank_transaction_attachment_by_id(xero_tenant_id, bank_transaction_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction_attachment_by_id: #{e}" @@ -5027,10 +5022,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transactionbegin - # Allows you to retrieve any attachments to bank transactions +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +begin + #Allows you to retrieve any attachments to bank transactions result = api_instance.get_bank_transaction_attachments(xero_tenant_id, bank_transaction_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transaction_attachments: #{e}" @@ -5104,10 +5099,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve any spend or receive money transactions + #Allows you to retrieve any spend or receive money transactions result = api_instance.get_bank_transactions(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transactions: #{e}" @@ -5174,10 +5169,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transactionbegin - # Allows you to retrieve history from a bank transactions +bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction +begin + #Allows you to retrieve history from a bank transactions result = api_instance.get_bank_transactions_history(xero_tenant_id, bank_transaction_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transactions_history: #{e}" @@ -5240,10 +5235,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin - # Allows you to retrieve any bank transfers +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +begin + #Allows you to retrieve any bank transfers result = api_instance.get_bank_transfer(xero_tenant_id, bank_transfer_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer: #{e}" @@ -5308,10 +5303,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on BankTransfer by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on BankTransfer by file name result = api_instance.get_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_file_name: #{e}" @@ -5378,10 +5373,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer attachment_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for an Attachment to a bank transfer -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on BankTransfer +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on BankTransfer result = api_instance.get_bank_transfer_attachment_by_id(xero_tenant_id, bank_transfer_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_attachment_by_id: #{e}" @@ -5446,10 +5441,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin - # Allows you to retrieve Attachments from bank transfers +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +begin + #Allows you to retrieve Attachments from bank transfers result = api_instance.get_bank_transfer_attachments(xero_tenant_id, bank_transfer_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_attachments: #{e}" @@ -5512,10 +5507,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transferbegin - # Allows you to retrieve history from a bank transfers +bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer +begin + #Allows you to retrieve history from a bank transfers result = api_instance.get_bank_transfer_history(xero_tenant_id, bank_transfer_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfer_history: #{e}" @@ -5585,10 +5580,10 @@ opts = { order: 'Amount ASC' # String | Order by an any element } + begin - # Allows you to retrieve all bank transfers + #Allows you to retrieve all bank transfers result = api_instance.get_bank_transfers(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_bank_transfers: #{e}" @@ -5653,10 +5648,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPaymentbegin - # Allows you to retrieve history from a Batch Payment +batch_payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for BatchPayment +begin + #Allows you to retrieve history from a Batch Payment result = api_instance.get_batch_payment_history(xero_tenant_id, batch_payment_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_batch_payment_history: #{e}" @@ -5726,10 +5721,10 @@ opts = { order: 'Date ASC' # String | Order by an any element } + begin - # Retrieve either one or many BatchPayments for invoices + #Retrieve either one or many BatchPayments for invoices result = api_instance.get_batch_payments(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_batch_payments: #{e}" @@ -5794,10 +5789,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Themebegin - # Allows you to retrieve a specific BrandingThemes +branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme +begin + #Allows you to retrieve a specific BrandingThemes result = api_instance.get_branding_theme(xero_tenant_id, branding_theme_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_branding_theme: #{e}" @@ -5860,10 +5855,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Themebegin - # Allows you to retrieve the Payment services for a Branding Theme +branding_theme_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Branding Theme +begin + #Allows you to retrieve the Payment services for a Branding Theme result = api_instance.get_branding_theme_payment_services(xero_tenant_id, branding_theme_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_branding_theme_payment_services: #{e}" @@ -5925,10 +5920,10 @@ api_instance = xero_client.asset_api api_instance = xero_client.projects_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin - # Allows you to retrieve all the BrandingThemes +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +begin + #Allows you to retrieve all the BrandingThemes result = api_instance.get_branding_themes(xero_tenant_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_branding_themes: #{e}" @@ -5990,10 +5985,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin - # Allows you to retrieve a single contacts in a Xero organisation +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +begin + #Allows you to retrieve a single contacts in a Xero organisation result = api_instance.get_contact(xero_tenant_id, contact_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact: #{e}" @@ -6058,10 +6053,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on Contacts by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on Contacts by file name result = api_instance.get_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_attachment_by_file_name: #{e}" @@ -6128,10 +6123,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on Contacts +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on Contacts result = api_instance.get_contact_attachment_by_id(xero_tenant_id, contact_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_attachment_by_id: #{e}" @@ -6196,10 +6191,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin - # Allows you to retrieve, add and update contacts in a Xero organisation +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +begin + #Allows you to retrieve, add and update contacts in a Xero organisation result = api_instance.get_contact_attachments(xero_tenant_id, contact_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_attachments: #{e}" @@ -6262,10 +6257,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_number = 'SB2' # String | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50).begin - # Allows you to retrieve a single contact by Contact Number in a Xero organisation +contact_number = 'SB2' # String | This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). +begin + #Allows you to retrieve a single contact by Contact Number in a Xero organisation result = api_instance.get_contact_by_contact_number(xero_tenant_id, contact_number) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_by_contact_number: #{e}" @@ -6328,10 +6323,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin - # Allows you to retrieve CISSettings for a contact in a Xero organisation +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +begin + #Allows you to retrieve CISSettings for a contact in a Xero organisation result = api_instance.get_contact_cis_settings(xero_tenant_id, contact_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_cis_settings: #{e}" @@ -6394,10 +6389,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Groupbegin - # Allows you to retrieve a unique Contact Group by ID +contact_group_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact Group +begin + #Allows you to retrieve a unique Contact Group by ID result = api_instance.get_contact_group(xero_tenant_id, contact_group_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_group: #{e}" @@ -6465,10 +6460,10 @@ opts = { order: 'Name ASC' # String | Order by an any element } + begin - # Allows you to retrieve the ContactID and Name of all the contacts in a contact group + #Allows you to retrieve the ContactID and Name of all the contacts in a contact group result = api_instance.get_contact_groups(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_groups: #{e}" @@ -6532,10 +6527,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contactbegin - # Allows you to retrieve a history records of an Contact +contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact +begin + #Allows you to retrieve a history records of an Contact result = api_instance.get_contact_history(xero_tenant_id, contact_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contact_history: #{e}" @@ -6611,10 +6606,10 @@ opts = { include_archived: true # Boolean | e.g. includeArchived=true - Contacts with a status of ARCHIVED will be included in the response } + begin - # Allows you to retrieve all contacts in a Xero organisation + #Allows you to retrieve all contacts in a Xero organisation result = api_instance.get_contacts(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_contacts: #{e}" @@ -6686,10 +6681,10 @@ credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identif opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve a specific credit note + #Allows you to retrieve a specific credit note result = api_instance.get_credit_note(xero_tenant_id, credit_note_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note: #{e}" @@ -6753,10 +6748,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin - # Allows you to retrieve Credit Note as PDF files +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +begin + #Allows you to retrieve Credit Note as PDF files result = api_instance.get_credit_note_as_pdf(xero_tenant_id, credit_note_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_as_pdf: #{e}" @@ -6821,10 +6816,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on CreditNote by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on CreditNote by file name result = api_instance.get_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_attachment_by_file_name: #{e}" @@ -6891,10 +6886,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on CreditNote +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on CreditNote result = api_instance.get_credit_note_attachment_by_id(xero_tenant_id, credit_note_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_attachment_by_id: #{e}" @@ -6959,10 +6954,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin - # Allows you to retrieve Attachments for credit notes +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +begin + #Allows you to retrieve Attachments for credit notes result = api_instance.get_credit_note_attachments(xero_tenant_id, credit_note_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_attachments: #{e}" @@ -7025,10 +7020,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Notebegin - # Allows you to retrieve a history records of an CreditNote +credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note +begin + #Allows you to retrieve a history records of an CreditNote result = api_instance.get_credit_note_history(xero_tenant_id, credit_note_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_note_history: #{e}" @@ -7102,10 +7097,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve any credit notes + #Allows you to retrieve any credit notes result = api_instance.get_credit_notes(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_credit_notes: #{e}" @@ -7177,10 +7172,10 @@ opts = { order: 'Code ASC' # String | Order by an any element } + begin - # Allows you to retrieve currencies for your organisation + #Allows you to retrieve currencies for your organisation result = api_instance.get_currencies(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_currencies: #{e}" @@ -7244,10 +7239,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -employee_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Employeebegin - # Allows you to retrieve a specific employee used in Xero payrun +employee_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Employee +begin + #Allows you to retrieve a specific employee used in Xero payrun result = api_instance.get_employee(xero_tenant_id, employee_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_employee: #{e}" @@ -7317,10 +7312,10 @@ opts = { order: 'ASC' # String | Order by an any element } + begin - # Allows you to retrieve employees used in Xero payrun + #Allows you to retrieve employees used in Xero payrun result = api_instance.get_employees(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_employees: #{e}" @@ -7385,10 +7380,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaimbegin - # Allows you to retrieve a specified expense claim +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim +begin + #Allows you to retrieve a specified expense claim result = api_instance.get_expense_claim(xero_tenant_id, expense_claim_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_expense_claim: #{e}" @@ -7451,10 +7446,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaimbegin - # Allows you to retrieve a history records of an ExpenseClaim +expense_claim_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ExpenseClaim +begin + #Allows you to retrieve a history records of an ExpenseClaim result = api_instance.get_expense_claim_history(xero_tenant_id, expense_claim_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_expense_claim_history: #{e}" @@ -7524,10 +7519,10 @@ opts = { order: 'Status ASC' # String | Order by an any element } + begin - # Allows you to retrieve expense claims + #Allows you to retrieve expense claims result = api_instance.get_expense_claims(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_expense_claims: #{e}" @@ -7596,10 +7591,10 @@ invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve a specified sales invoice or purchase bill + #Allows you to retrieve a specified sales invoice or purchase bill result = api_instance.get_invoice(xero_tenant_id, invoice_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice: #{e}" @@ -7663,10 +7658,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin - # Allows you to retrieve invoices or purchase bills as PDF files +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +begin + #Allows you to retrieve invoices or purchase bills as PDF files result = api_instance.get_invoice_as_pdf(xero_tenant_id, invoice_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_as_pdf: #{e}" @@ -7731,10 +7726,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice file_name = 'xero-dev.jpg' # String | Name of the file you are attaching -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachment on invoices or purchase bills by it's filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachment on invoices or purchase bills by it's filename result = api_instance.get_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_attachment_by_file_name: #{e}" @@ -7801,10 +7796,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve a specified Attachment on invoices or purchase bills by it's ID result = api_instance.get_invoice_attachment_by_id(xero_tenant_id, invoice_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_attachment_by_id: #{e}" @@ -7869,10 +7864,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin - # Allows you to retrieve Attachments on invoices or purchase bills +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +begin + #Allows you to retrieve Attachments on invoices or purchase bills result = api_instance.get_invoice_attachments(xero_tenant_id, invoice_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_attachments: #{e}" @@ -7935,10 +7930,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin - # Allows you to retrieve a history records of an invoice +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +begin + #Allows you to retrieve a history records of an invoice result = api_instance.get_invoice_history(xero_tenant_id, invoice_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_history: #{e}" @@ -8000,10 +7995,10 @@ api_instance = xero_client.asset_api api_instance = xero_client.projects_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin - # Allows you to retrieve invoice reminder settings +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +begin + #Allows you to retrieve invoice reminder settings result = api_instance.get_invoice_reminders(xero_tenant_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoice_reminders: #{e}" @@ -8088,10 +8083,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve any sales invoices or purchase bills + #Allows you to retrieve any sales invoices or purchase bills result = api_instance.get_invoices(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_invoices: #{e}" @@ -8168,10 +8163,10 @@ item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve a specified item + #Allows you to retrieve a specified item result = api_instance.get_item(xero_tenant_id, item_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_item: #{e}" @@ -8235,10 +8230,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Itembegin - # Allows you to retrieve history for items +item_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Item +begin + #Allows you to retrieve history for items result = api_instance.get_item_history(xero_tenant_id, item_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_item_history: #{e}" @@ -8310,10 +8305,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve any items + #Allows you to retrieve any items result = api_instance.get_items(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_items: #{e}" @@ -8379,10 +8374,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Journalbegin - # Allows you to retrieve a specified journals. +journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Journal +begin + #Allows you to retrieve a specified journals. result = api_instance.get_journal(xero_tenant_id, journal_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_journal: #{e}" @@ -8452,10 +8447,10 @@ opts = { payments_only: true # Boolean | Filter to retrieve journals on a cash basis. Journals are returned on an accrual basis by default. } + begin - # Allows you to retrieve any journals. + #Allows you to retrieve any journals. result = api_instance.get_journals(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_journals: #{e}" @@ -8520,10 +8515,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransactionbegin - # Allows you to retrieve a specified linked transactions (billable expenses) +linked_transaction_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a LinkedTransaction +begin + #Allows you to retrieve a specified linked transactions (billable expenses) result = api_instance.get_linked_transaction(xero_tenant_id, linked_transaction_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_linked_transaction: #{e}" @@ -8599,10 +8594,10 @@ opts = { target_transaction_id: '00000000-0000-0000-000-000000000000' # String | Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice } + begin - # Retrieve linked transactions (billable expenses) + #Retrieve linked transactions (billable expenses) result = api_instance.get_linked_transactions(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_linked_transactions: #{e}" @@ -8670,10 +8665,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournalbegin - # Allows you to retrieve a specified manual journals +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal +begin + #Allows you to retrieve a specified manual journals result = api_instance.get_manual_journal(xero_tenant_id, manual_journal_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal: #{e}" @@ -8738,10 +8733,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve specified Attachment on ManualJournal by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve specified Attachment on ManualJournal by file name result = api_instance.get_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_file_name: #{e}" @@ -8808,10 +8803,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve specified Attachment on ManualJournals +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve specified Attachment on ManualJournals result = api_instance.get_manual_journal_attachment_by_id(xero_tenant_id, manual_journal_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal_attachment_by_id: #{e}" @@ -8876,10 +8871,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournalbegin - # Allows you to retrieve Attachment for manual journals +manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal +begin + #Allows you to retrieve Attachment for manual journals result = api_instance.get_manual_journal_attachments(xero_tenant_id, manual_journal_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journal_attachments: #{e}" @@ -8951,10 +8946,10 @@ opts = { page: 1 # Integer | e.g. page=1 – Up to 100 manual journals will be returned in a single API call with line items shown for each overpayment } + begin - # Allows you to retrieve any manual journals + #Allows you to retrieve any manual journals result = api_instance.get_manual_journals(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_manual_journals: #{e}" @@ -9020,10 +9015,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoicebegin - # Allows you to retrieve a URL to an online invoice +invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice +begin + #Allows you to retrieve a URL to an online invoice result = api_instance.get_online_invoice(xero_tenant_id, invoice_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_online_invoice: #{e}" @@ -9086,10 +9081,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -organisation_id = '00000000-0000-0000-000-000000000000' # String | The unique Xero identifier for an organisationbegin - # Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. +organisation_id = '00000000-0000-0000-000-000000000000' # String | The unique Xero identifier for an organisation +begin + #Allows you To verify if an organisation is using contruction industry scheme, you can retrieve the CIS settings for the organistaion. result = api_instance.get_organisation_cis_settings(xero_tenant_id, organisation_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_organisation_cis_settings: #{e}" @@ -9151,10 +9146,10 @@ api_instance = xero_client.asset_api api_instance = xero_client.projects_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin - # Allows you to retrieve Organisation details +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +begin + #Allows you to retrieve Organisation details result = api_instance.get_organisations(xero_tenant_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_organisations: #{e}" @@ -9216,10 +9211,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpaymentbegin - # Allows you to retrieve a specified overpayments +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment +begin + #Allows you to retrieve a specified overpayments result = api_instance.get_overpayment(xero_tenant_id, overpayment_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_overpayment: #{e}" @@ -9282,10 +9277,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpaymentbegin - # Allows you to retrieve a history records of an Overpayment +overpayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Overpayment +begin + #Allows you to retrieve a history records of an Overpayment result = api_instance.get_overpayment_history(xero_tenant_id, overpayment_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_overpayment_history: #{e}" @@ -9359,10 +9354,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve overpayments + #Allows you to retrieve overpayments result = api_instance.get_overpayments(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_overpayments: #{e}" @@ -9429,10 +9424,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Paymentbegin - # Allows you to retrieve a specified payment for invoices and credit notes +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment +begin + #Allows you to retrieve a specified payment for invoices and credit notes result = api_instance.get_payment(xero_tenant_id, payment_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payment: #{e}" @@ -9495,10 +9490,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Paymentbegin - # Allows you to retrieve history records of a payment +payment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Payment +begin + #Allows you to retrieve history records of a payment result = api_instance.get_payment_history(xero_tenant_id, payment_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payment_history: #{e}" @@ -9560,10 +9555,10 @@ api_instance = xero_client.asset_api api_instance = xero_client.projects_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin - # Allows you to retrieve payment services +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +begin + #Allows you to retrieve payment services result = api_instance.get_payment_services(xero_tenant_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payment_services: #{e}" @@ -9634,10 +9629,10 @@ opts = { page: 1 # Integer | Up to 100 payments will be returned in a single API call } + begin - # Allows you to retrieve payments for invoices and credit notes + #Allows you to retrieve payments for invoices and credit notes result = api_instance.get_payments(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_payments: #{e}" @@ -9703,10 +9698,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePaymentbegin - # Allows you to retrieve a specified prepayments +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment +begin + #Allows you to retrieve a specified prepayments result = api_instance.get_prepayment(xero_tenant_id, prepayment_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_prepayment: #{e}" @@ -9769,10 +9764,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePaymentbegin - # Allows you to retrieve a history records of an Prepayment +prepayment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PrePayment +begin + #Allows you to retrieve a history records of an Prepayment result = api_instance.get_prepayment_history(xero_tenant_id, prepayment_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_prepayment_history: #{e}" @@ -9846,10 +9841,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve prepayments + #Allows you to retrieve prepayments result = api_instance.get_prepayments(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_prepayments: #{e}" @@ -9916,10 +9911,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrderbegin - # Allows you to retrieve a specified purchase orders +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder +begin + #Allows you to retrieve a specified purchase orders result = api_instance.get_purchase_order(xero_tenant_id, purchase_order_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order: #{e}" @@ -9982,10 +9977,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Orderbegin - # Allows you to retrieve purchase orders as PDF files +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Purchase Order +begin + #Allows you to retrieve purchase orders as PDF files result = api_instance.get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order_as_pdf: #{e}" @@ -10048,10 +10043,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_number = 'PO1234' # String | Unique identifier for a PurchaseOrderbegin - # Allows you to retrieve a specified purchase orders +purchase_order_number = 'PO1234' # String | Unique identifier for a PurchaseOrder +begin + #Allows you to retrieve a specified purchase orders result = api_instance.get_purchase_order_by_number(xero_tenant_id, purchase_order_number) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order_by_number: #{e}" @@ -10114,10 +10109,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrderbegin - # Allows you to retrieve history for PurchaseOrder +purchase_order_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a PurchaseOrder +begin + #Allows you to retrieve history for PurchaseOrder result = api_instance.get_purchase_order_history(xero_tenant_id, purchase_order_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_order_history: #{e}" @@ -10193,10 +10188,10 @@ opts = { page: 1 # Integer | To specify a page, append the page parameter to the URL e.g. ?page=1. If there are 100 records in the response you will need to check if there is any more data by fetching the next page e.g ?page=2 and continuing this process until no more results are returned. } + begin - # Allows you to retrieve purchase orders + #Allows you to retrieve purchase orders result = api_instance.get_purchase_orders(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_purchase_orders: #{e}" @@ -10264,10 +10259,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin - # Allows you to retrieve a specified quote +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote +begin + #Allows you to retrieve a specified quote result = api_instance.get_quote(xero_tenant_id, quote_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote: #{e}" @@ -10330,10 +10325,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin - # Allows you to retrieve quotes as PDF files +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote +begin + #Allows you to retrieve quotes as PDF files result = api_instance.get_quote_as_pdf(xero_tenant_id, quote_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_as_pdf: #{e}" @@ -10398,10 +10393,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object file_name = 'xero-dev.jpg' # String | Name of the attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachment on Quote by Filename +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachment on Quote by Filename result = api_instance.get_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_attachment_by_file_name: #{e}" @@ -10468,10 +10463,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Attachment object -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve specific Attachment on Quote +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve specific Attachment on Quote result = api_instance.get_quote_attachment_by_id(xero_tenant_id, quote_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_attachment_by_id: #{e}" @@ -10536,10 +10531,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote objectbegin - # Allows you to retrieve Attachments for Quotes +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object +begin + #Allows you to retrieve Attachments for Quotes result = api_instance.get_quote_attachments(xero_tenant_id, quote_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_attachments: #{e}" @@ -10602,10 +10597,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quotebegin - # Allows you to retrieve a history records of an quote +quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Quote +begin + #Allows you to retrieve a history records of an quote result = api_instance.get_quote_history(xero_tenant_id, quote_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quote_history: #{e}" @@ -10687,10 +10682,10 @@ opts = { order: 'ASC' # String | Order by an any element } + begin - # Allows you to retrieve any sales quotes + #Allows you to retrieve any sales quotes result = api_instance.get_quotes(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_quotes: #{e}" @@ -10765,10 +10760,10 @@ receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve a specified draft expense claim receipts + #Allows you to retrieve a specified draft expense claim receipts result = api_instance.get_receipt(xero_tenant_id, receipt_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt: #{e}" @@ -10834,10 +10829,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on expense claim receipts by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on expense claim receipts by file name result = api_instance.get_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_attachment_by_file_name: #{e}" @@ -10904,10 +10899,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve Attachments on expense claim receipts by ID +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve Attachments on expense claim receipts by ID result = api_instance.get_receipt_attachment_by_id(xero_tenant_id, receipt_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_attachment_by_id: #{e}" @@ -10972,10 +10967,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receiptbegin - # Allows you to retrieve Attachments for expense claim receipts +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +begin + #Allows you to retrieve Attachments for expense claim receipts result = api_instance.get_receipt_attachments(xero_tenant_id, receipt_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_attachments: #{e}" @@ -11038,10 +11033,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receiptbegin - # Allows you to retrieve a history records of an Receipt +receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt +begin + #Allows you to retrieve a history records of an Receipt result = api_instance.get_receipt_history(xero_tenant_id, receipt_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipt_history: #{e}" @@ -11113,10 +11108,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve draft expense claim receipts for any user + #Allows you to retrieve draft expense claim receipts for any user result = api_instance.get_receipts(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_receipts: #{e}" @@ -11182,10 +11177,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin - # Allows you to retrieve a specified repeating invoice +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +begin + #Allows you to retrieve a specified repeating invoice result = api_instance.get_repeating_invoice(xero_tenant_id, repeating_invoice_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice: #{e}" @@ -11250,10 +11245,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve specified attachment on repeating invoices by file name +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve specified attachment on repeating invoices by file name result = api_instance.get_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_file_name: #{e}" @@ -11320,10 +11315,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice attachment_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Attachment -content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdfbegin - # Allows you to retrieve a specified Attachments on repeating invoices +content_type = 'image/jpg' # String | The mime type of the attachment file you are retrieving i.e image/jpg, application/pdf +begin + #Allows you to retrieve a specified Attachments on repeating invoices result = api_instance.get_repeating_invoice_attachment_by_id(xero_tenant_id, repeating_invoice_id, attachment_id, content_type) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_attachment_by_id: #{e}" @@ -11388,10 +11383,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin - # Allows you to retrieve Attachments on repeating invoice +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +begin + #Allows you to retrieve Attachments on repeating invoice result = api_instance.get_repeating_invoice_attachments(xero_tenant_id, repeating_invoice_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_attachments: #{e}" @@ -11454,10 +11449,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoicebegin - # Allows you to retrieve history for a repeating invoice +repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice +begin + #Allows you to retrieve history for a repeating invoice result = api_instance.get_repeating_invoice_history(xero_tenant_id, repeating_invoice_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoice_history: #{e}" @@ -11525,10 +11520,10 @@ opts = { order: 'Total ASC' # String | Order by an any element } + begin - # Allows you to retrieve any repeating invoices + #Allows you to retrieve any repeating invoices result = api_instance.get_repeating_invoices(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_repeating_invoices: #{e}" @@ -11600,10 +11595,10 @@ opts = { to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Payables By Contact report } + begin - # Allows you to retrieve report for AgedPayablesByContact + #Allows you to retrieve report for AgedPayablesByContact result = api_instance.get_report_aged_payables_by_contact(xero_tenant_id, contact_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_aged_payables_by_contact: #{e}" @@ -11677,10 +11672,10 @@ opts = { to_date: Date.parse('2013-10-20') # Date | The to date of the Aged Receivables By Contact report } + begin - # Allows you to retrieve report for AgedReceivablesByContact + #Allows you to retrieve report for AgedReceivablesByContact result = api_instance.get_report_aged_receivables_by_contact(xero_tenant_id, contact_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_aged_receivables_by_contact: #{e}" @@ -11746,10 +11741,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -report_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Reportbegin - # Allows you to retrieve report for BAS only valid for AU orgs +report_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Report +begin + #Allows you to retrieve report for BAS only valid for AU orgs result = api_instance.get_report_ba_sor_gst(xero_tenant_id, report_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_ba_sor_gst: #{e}" @@ -11811,10 +11806,10 @@ api_instance = xero_client.asset_api api_instance = xero_client.projects_api -xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenantbegin - # Allows you to retrieve report for BAS only valid for AU orgs +xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant +begin + #Allows you to retrieve report for BAS only valid for AU orgs result = api_instance.get_report_ba_sor_gst_list(xero_tenant_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_ba_sor_gst_list: #{e}" @@ -11891,10 +11886,10 @@ opts = { payments_only: false # Boolean | return a cash basis for the Balance Sheet report } + begin - # Allows you to retrieve report for BalanceSheet + #Allows you to retrieve report for BalanceSheet result = api_instance.get_report_balance_sheet(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_balance_sheet: #{e}" @@ -11968,10 +11963,10 @@ opts = { to_date: Date.parse('2019-11-30') # Date | The to date for the Bank Summary report e.g. 2018-03-31 } + begin - # Allows you to retrieve report for BankSummary + #Allows you to retrieve report for BankSummary result = api_instance.get_report_bank_summary(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_bank_summary: #{e}" @@ -12042,10 +12037,10 @@ opts = { timeframe: 3 # Integer | The period size to compare to (1=month, 3=quarter, 12=year) } + begin - # Allows you to retrieve report for Budget Summary + #Allows you to retrieve report for Budget Summary result = api_instance.get_report_budget_summary(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_budget_summary: #{e}" @@ -12113,10 +12108,10 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { date: Date.parse('2019-03-31') # Date | The date for the Bank Summary report e.g. 2018-03-31 } + begin - # Allows you to retrieve report for ExecutiveSummary + #Allows you to retrieve report for ExecutiveSummary result = api_instance.get_report_executive_summary(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_executive_summary: #{e}" @@ -12200,10 +12195,10 @@ opts = { payments_only: false # Boolean | Return cash only basis for the ProfitAndLoss report } + begin - # Allows you to retrieve report for ProfitAndLoss + #Allows you to retrieve report for ProfitAndLoss result = api_instance.get_report_profit_and_loss(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_profit_and_loss: #{e}" @@ -12278,10 +12273,10 @@ xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant opts = { report_year: '2019' # String | The year of the 1099 report } + begin - # Allows you to retrieve report for TenNinetyNine + #Allows you to retrieve report for TenNinetyNine result = api_instance.get_report_ten_ninety_nine(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_ten_ninety_nine: #{e}" @@ -12349,10 +12344,10 @@ opts = { payments_only: true # Boolean | Return cash only basis for the Trial Balance report } + begin - # Allows you to retrieve report for TrialBalance + #Allows you to retrieve report for TrialBalance result = api_instance.get_report_trial_balance(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_report_trial_balance: #{e}" @@ -12423,10 +12418,10 @@ opts = { tax_type: 'INPUT' # String | Filter by tax type } + begin - # Allows you to retrieve Tax Rates + #Allows you to retrieve Tax Rates result = api_instance.get_tax_rates(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_tax_rates: #{e}" @@ -12498,10 +12493,10 @@ opts = { include_archived: true # Boolean | e.g. includeArchived=true - Categories and options with a status of ARCHIVED will be included in the response } + begin - # Allows you to retrieve tracking categories and options + #Allows you to retrieve tracking categories and options result = api_instance.get_tracking_categories(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_tracking_categories: #{e}" @@ -12566,10 +12561,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategorybegin - # Allows you to retrieve tracking categories and options for specified category +tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory +begin + #Allows you to retrieve tracking categories and options for specified category result = api_instance.get_tracking_category(xero_tenant_id, tracking_category_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_tracking_category: #{e}" @@ -12632,10 +12627,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant -user_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Userbegin - # Allows you to retrieve a specified user +user_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a User +begin + #Allows you to retrieve a specified user result = api_instance.get_user(xero_tenant_id, user_id) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_user: #{e}" @@ -12705,10 +12700,10 @@ opts = { order: 'LastName ASC' # String | Order by an any element } + begin - # Allows you to retrieve users + #Allows you to retrieve users result = api_instance.get_users(xero_tenant_id, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->get_users: #{e}" @@ -12774,10 +12769,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for retrieving single object -accounts = { accounts: [{ code: "123456", name: "BarFoo", accountID: "00000000-0000-0000-000-000000000000", type: AccountType.EXPENSE, description: "GoodBye World", taxType: TaxType.INPUT }]} # Accounts | Request of type Accounts array with one Accountbegin - # Allows you to update a chart of accounts +accounts = { accounts: [{ code: "123456", name: "BarFoo", accountID: "00000000-0000-0000-000-000000000000", type: AccountType.EXPENSE, description: "GoodBye World", taxType: TaxType.INPUT }]} # Accounts | Request of type Accounts array with one Account +begin + #Allows you to update a chart of accounts result = api_instance.update_account(xero_tenant_id, account_id, accounts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_account: #{e}" @@ -12843,10 +12838,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant account_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Account object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update Attachment on Account by Filename +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update Attachment on Account by Filename result = api_instance.update_account_attachment_by_file_name(xero_tenant_id, account_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_account_attachment_by_file_name: #{e}" @@ -12909,9 +12904,9 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api { bank_transactions: [{ type: XeroRuby::Accounting::BankTransaction::SPEND, date: "2019-02-25", reference: "You just updated", status: XeroRuby::Accounting::BankTransaction::AUTHORISED, bank_transaction_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, bank_account: { account_id: "00000000-0000-0000-000-000000000000" }}]} summary: Allows you to update a single spend or receive money transaction parameters: - required: true in: path name: BankTransactionID description: Xero generated unique identifier for a bank transaction example: "00000000-0000-0000-000-000000000000" schema: type: string format: uuid - $ref: + begin result = api_instance.update_bank_transaction(xero_tenant_id, bank_transactions) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_bank_transaction: #{e}" @@ -12976,10 +12971,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transaction_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transaction file_name = 'xero-dev.jpg' # String | The name of the file being attached -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update an Attachment on BankTransaction by Filename +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update an Attachment on BankTransaction by Filename result = api_instance.update_bank_transaction_attachment_by_file_name(xero_tenant_id, bank_transaction_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_bank_transaction_attachment_by_file_name: #{e}" @@ -13046,9 +13041,9 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant bank_transfer_id = '00000000-0000-0000-000-000000000000' # String | Xero generated unique identifier for a bank transfer file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Bank Transfer -body = 'body_example' # String | Byte array of file in body of requestbegin +body = 'body_example' # String | Byte array of file in body of request +begin result = api_instance.update_bank_transfer_attachment_by_file_name(xero_tenant_id, bank_transfer_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_bank_transfer_attachment_by_file_name: #{e}" @@ -13111,9 +13106,9 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api contacts = { contacts: [{ contact_id: "00000000-0000-0000-000-000000000000", name: "Thanos" }]} + begin result = api_instance.update_contact(xero_tenant_id, contact_id, contacts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_contact: #{e}" @@ -13179,9 +13174,9 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant contact_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Contact file_name = 'xero-dev.jpg' # String | Name for the file you are attaching -body = 'body_example' # String | Byte array of file in body of requestbegin +body = 'body_example' # String | Byte array of file in body of request +begin result = api_instance.update_contact_attachment_by_file_name(xero_tenant_id, contact_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_contact_attachment_by_file_name: #{e}" @@ -13244,10 +13239,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api contact_groups = { contact_groups: [{ name: "Vendor" }]} + begin - # Allows you to update a Contact Group + #Allows you to update a Contact Group result = api_instance.update_contact_group(xero_tenant_id, contact_group_id, contact_groups) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_contact_group: #{e}" @@ -13313,10 +13308,10 @@ credit_notes = { credit_notes: [{ type: XeroRuby::Accounting::CreditNote::ACCPAY opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to update a specific credit note + #Allows you to update a specific credit note result = api_instance.update_credit_note(xero_tenant_id, credit_note_id, credit_notes, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_credit_note: #{e}" @@ -13383,10 +13378,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant credit_note_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Credit Note file_name = 'xero-dev.jpg' # String | Name of the file you are attaching to Credit Note -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update Attachments on CreditNote by file name +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update Attachments on CreditNote by file name result = api_instance.update_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_credit_note_attachment_by_file_name: #{e}" @@ -13449,10 +13444,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api expense_claims = { expense_claims: [{ status: XeroRuby::Accounting::ExpenseClaim::AUTHORISED, user: { user_id: "00000000-0000-0000-000-000000000000" }, receipts: [{ receipt_id: "00000000-0000-0000-000-000000000000", line_items: [], contact: {}, date:"2020-01-01", user: {} }]}]} + begin - # Allows you to update specified expense claims + #Allows you to update specified expense claims result = api_instance.update_expense_claim(xero_tenant_id, expense_claim_id, expense_claims) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_expense_claim: #{e}" @@ -13518,10 +13513,10 @@ invoices = { invoices: [{ reference: "I am Iron Man", invoice_id: "00000000-0000 opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to update a specified sales invoices or purchase bills + #Allows you to update a specified sales invoices or purchase bills result = api_instance.update_invoice(xero_tenant_id, invoice_id, invoices, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_invoice: #{e}" @@ -13588,10 +13583,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for an Invoice file_name = 'xero-dev.jpg' # String | Name of the file you are attaching -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update Attachment on invoices or purchase bills by it's filename +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update Attachment on invoices or purchase bills by it's filename result = api_instance.update_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_invoice_attachment_by_file_name: #{e}" @@ -13661,10 +13656,10 @@ items = { items:[ { code:"abc123", description:"Hello Xero" } ] } # Items | opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to update a specified item + #Allows you to update a specified item result = api_instance.update_item(xero_tenant_id, item_id, items, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_item: #{e}" @@ -13727,10 +13722,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api linked_transactions = { linked_transactions: [{ source_line_item_id: "00000000-0000-0000-000-000000000000", contact_id: "00000000-0000-0000-000-000000000000" }]} + begin - # Allows you to update a specified linked transactions (billable expenses) + #Allows you to update a specified linked transactions (billable expenses) result = api_instance.update_linked_transaction(xero_tenant_id, linked_transaction_id, linked_transactions) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_linked_transaction: #{e}" @@ -13792,10 +13787,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api manual_journals = { manual_journals: [{ narration: "Hello Xero", manual_journal_id: "00000000-0000-0000-000-000000000000", journal_ines: [] }]} + begin - # Allows you to update a specified manual journal + #Allows you to update a specified manual journal result = api_instance.update_manual_journal(xero_tenant_id, manual_journal_id, manual_journals) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_manual_journal: #{e}" @@ -13861,10 +13856,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant manual_journal_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a ManualJournal file_name = 'xero-dev.jpg' # String | The name of the file being attached to a ManualJournal -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update a specified Attachment on ManualJournal by file name +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update a specified Attachment on ManualJournal by file name result = api_instance.update_manual_journal_attachment_by_file_name(xero_tenant_id, manual_journal_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_manual_journal_attachment_by_file_name: #{e}" @@ -13933,10 +13928,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to update or create one or more spend or receive money transaction + #Allows you to update or create one or more spend or receive money transaction result = api_instance.update_or_create_bank_transactions(xero_tenant_id, bank_transactions, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_bank_transactions: #{e}" @@ -14003,10 +13998,10 @@ api_instance = xero_client.projects_api opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to update OR create one or more contacts in a Xero organisation + #Allows you to update OR create one or more contacts in a Xero organisation result = api_instance.update_or_create_contacts(xero_tenant_id, contacts, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_contacts: #{e}" @@ -14074,10 +14069,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to update OR create one or more credit notes + #Allows you to update OR create one or more credit notes result = api_instance.update_or_create_credit_notes(xero_tenant_id, credit_notes, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_credit_notes: #{e}" @@ -14144,10 +14139,10 @@ employees = { employees: [{ first_name: "Nick", last_name: "Fury", external_link opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create a single new employees used in Xero payrun + #Allows you to create a single new employees used in Xero payrun result = api_instance.update_or_create_employees(xero_tenant_id, employees, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_employees: #{e}" @@ -14215,10 +14210,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to update OR create one or more sales invoices or purchase bills + #Allows you to update OR create one or more sales invoices or purchase bills result = api_instance.update_or_create_invoices(xero_tenant_id, invoices, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_invoices: #{e}" @@ -14287,10 +14282,10 @@ opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to update or create one or more items + #Allows you to update or create one or more items result = api_instance.update_or_create_items(xero_tenant_id, items, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_items: #{e}" @@ -14357,10 +14352,10 @@ manual_journals = { manual_journals: [{ narration: "Foo bar", date: "2019-03-14" opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to create a single manual journal + #Allows you to create a single manual journal result = api_instance.update_or_create_manual_journals(xero_tenant_id, manual_journals, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_manual_journals: #{e}" @@ -14426,10 +14421,10 @@ purchase_orders = { purchase_orders: [{ contact: { contact_id: "00000000-0000-00 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to update or create one or more purchase orders + #Allows you to update or create one or more purchase orders result = api_instance.update_or_create_purchase_orders(xero_tenant_id, purchase_orders, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_purchase_orders: #{e}" @@ -14495,10 +14490,10 @@ quotes = { quotes: [{ contact: { contact_id: "00000000-0000-0000-000-00000000000 opts = { summarize_errors: false # Boolean | If false return 200 OK and mix of successfully created obejcts and any with validation errors } + begin - # Allows you to update OR create one or more quotes + #Allows you to update OR create one or more quotes result = api_instance.update_or_create_quotes(xero_tenant_id, quotes, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_or_create_quotes: #{e}" @@ -14560,10 +14555,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api purchase_orders = { purchase_orders: [ { attention_to: "Peter Parker", line_items: [], contact: {} }]} + begin - # Allows you to update a specified purchase order + #Allows you to update a specified purchase order result = api_instance.update_purchase_order(xero_tenant_id, purchase_order_id, purchase_orders) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_purchase_order: #{e}" @@ -14625,10 +14620,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api quotes = { quotes: [{ reference: "I am an update", contact: { contact_id: "00000000-0000-0000-000-000000000000" }, date: "2020-02-01" }]} + begin - # Allows you to update a specified quote + #Allows you to update a specified quote result = api_instance.update_quote(xero_tenant_id, quote_id, quotes) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_quote: #{e}" @@ -14694,10 +14689,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant quote_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for Quote object file_name = 'xero-dev.jpg' # String | Name of the attachment -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update Attachment on Quote by Filename +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update Attachment on Quote by Filename result = api_instance.update_quote_attachment_by_file_name(xero_tenant_id, quote_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_quote_attachment_by_file_name: #{e}" @@ -14764,10 +14759,10 @@ receipts = { receipts: [{ user: { user_id: "00000000-0000-0000-000-000000000000" opts = { unitdp: 4 # Integer | e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts } + begin - # Allows you to retrieve a specified draft expense claim receipts + #Allows you to retrieve a specified draft expense claim receipts result = api_instance.update_receipt(xero_tenant_id, receipt_id, receipts, opts) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_receipt: #{e}" @@ -14834,10 +14829,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant receipt_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Receipt file_name = 'xero-dev.jpg' # String | The name of the file being attached to the Receipt -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update Attachment on expense claim receipts by file name +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update Attachment on expense claim receipts by file name result = api_instance.update_receipt_attachment_by_file_name(xero_tenant_id, receipt_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_receipt_attachment_by_file_name: #{e}" @@ -14904,10 +14899,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant repeating_invoice_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Repeating Invoice file_name = 'xero-dev.jpg' # String | The name of the file being attached to a Repeating Invoice -body = 'body_example' # String | Byte array of file in body of requestbegin - # Allows you to update specified attachment on repeating invoices by file name +body = 'body_example' # String | Byte array of file in body of request +begin + #Allows you to update specified attachment on repeating invoices by file name result = api_instance.update_repeating_invoice_attachment_by_file_name(xero_tenant_id, repeating_invoice_id, file_name, body) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_repeating_invoice_attachment_by_file_name: #{e}" @@ -14970,10 +14965,10 @@ api_instance = xero_client.asset_api # :projects_api api_instance = xero_client.projects_api tax_rates = { tax_rates: [{ name: "State Tax NY", tax_components: [{ name: "State Tax", rate: 2.25 }], status: XeroRuby::Accounting::TaxRate::Deleted, report_tax_type: XeroRuby::Accounting::TaxRate::INPUT }]} + begin - # Allows you to update Tax Rates + #Allows you to update Tax Rates result = api_instance.update_tax_rate(xero_tenant_id, tax_rates) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_tax_rate: #{e}" @@ -15037,10 +15032,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory -tracking_category = { name: "Avengers" } # TrackingCategory | begin - # Allows you to update tracking categories +tracking_category = { name: "Avengers" } # TrackingCategory | +begin + #Allows you to update tracking categories result = api_instance.update_tracking_category(xero_tenant_id, tracking_category_id, tracking_category) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_tracking_category: #{e}" @@ -15106,10 +15101,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'YOUR_XERO_TENANT_ID' # String | Xero identifier for Tenant tracking_category_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a TrackingCategory tracking_option_id = '00000000-0000-0000-000-000000000000' # String | Unique identifier for a Tracking Option -tracking_option = { name: "Vision" } # TrackingOption | begin - # Allows you to update options for a specified tracking category +tracking_option = { name: "Vision" } # TrackingOption | +begin + #Allows you to update options for a specified tracking category result = api_instance.update_tracking_options(xero_tenant_id, tracking_category_id, tracking_option_id, tracking_option) - p result rescue XeroRuby::Accounting::ApiError => e puts "Exception when calling AccountingApi->update_tracking_options: #{e}" diff --git a/docs/assets/AssetApi.md b/docs/assets/AssetApi.md index d1a15a3e..71ecfaae 100644 --- a/docs/assets/AssetApi.md +++ b/docs/assets/AssetApi.md @@ -49,10 +49,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -asset = { "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01", "purchasePrice":100.0, "disposalPrice":23.23, "assetStatus":"Draft", "bookDepreciationSetting":{ "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.5, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "currentCapitalGain":5.32, "currentGainLoss":3.88, "depreciationStartDate":"2020-01-02", "costLimit":100.0, "currentAccumDepreciationAmount":2.25 }, "AccountingBookValue":99.5 } # Asset | Fixed asset you are creatingbegin - # adds a fixed asset +asset = { "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01", "purchasePrice":100.0, "disposalPrice":23.23, "assetStatus":"Draft", "bookDepreciationSetting":{ "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.5, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "currentCapitalGain":5.32, "currentGainLoss":3.88, "depreciationStartDate":"2020-01-02", "costLimit":100.0, "currentAccumDepreciationAmount":2.25 }, "AccountingBookValue":99.5 } # Asset | Fixed asset you are creating +begin + #adds a fixed asset result = api_instance.create_asset(xero_tenant_id, asset) - p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->create_asset: #{e}" @@ -120,10 +120,10 @@ xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant opts = { asset_type: { "assetTypeName":"Machinery11004", "fixedAssetAccountId":"3d8d063a-c148-4bb8-8b3c-a5e2ad3b1e82", "depreciationExpenseAccountId":"d1602f69-f900-4616-8d34-90af393fa368", "accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8", "bookDepreciationSetting":{ "depreciationMethod":"DiminishingValue100", "averagingMethod":"ActualDays", "depreciationRate":0.05, "depreciationCalculationMethod":"None" } } # AssetType | Asset type to add } + begin - # adds a fixed asset type + #adds a fixed asset type result = api_instance.create_asset_type(xero_tenant_id, opts) - p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->create_asset_type: #{e}" @@ -188,10 +188,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -id = '4f7bcdcb-5ec1-4258-9558-19f662fccdfe' # String | fixed asset id for single objectbegin - # retrieves fixed asset by id +id = '4f7bcdcb-5ec1-4258-9558-19f662fccdfe' # String | fixed asset id for single object +begin + #retrieves fixed asset by id result = api_instance.get_asset_by_id(xero_tenant_id, id) - p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_asset_by_id: #{e}" @@ -255,10 +255,10 @@ api_instance = xero_client.asset_api api_instance = xero_client.projects_api -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenantbegin - # searches fixed asset settings +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +begin + #searches fixed asset settings result = api_instance.get_asset_settings(xero_tenant_id) - p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_asset_settings: #{e}" @@ -321,10 +321,10 @@ api_instance = xero_client.asset_api api_instance = xero_client.projects_api -xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenantbegin - # searches fixed asset types +xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant +begin + #searches fixed asset types result = api_instance.get_asset_types(xero_tenant_id) - p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_asset_types: #{e}" @@ -400,10 +400,10 @@ opts = { filter_by: 'Draft' # String | A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields. } + begin - # searches fixed asset + #searches fixed asset result = api_instance.get_assets(xero_tenant_id, status, opts) - p result rescue XeroRuby::Assets::ApiError => e puts "Exception when calling AssetApi->get_assets: #{e}" diff --git a/docs/projects/ProjectApi.md b/docs/projects/ProjectApi.md index 4db51afd..94cbb7a2 100644 --- a/docs/projects/ProjectApi.md +++ b/docs/projects/ProjectApi.md @@ -54,10 +54,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -project_create_or_update = { "contactId":"00000000-0000-0000-000-000000000000", "name":"New Kitchen", "deadlineUtc":"2019-12-10T12:59:59Z", "estimateAmount":"99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate objectbegin - # create one or more new projects +project_create_or_update = { "contactId":"00000000-0000-0000-000-000000000000", "name":"New Kitchen", "deadlineUtc":"2019-12-10T12:59:59Z", "estimateAmount":"99.99" } # ProjectCreateOrUpdate | Create a new project with ProjectCreateOrUpdate object +begin + #create one or more new projects result = api_instance.create_project(xero_tenant_id, project_create_or_update) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->create_project: #{e}" @@ -123,10 +123,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-26T15:00:00Z", "duration":30, "description":"My description" } # TimeEntryCreateOrUpdate | The time entry object you are creatingbegin - # Allows you to create a task +time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-26T15:00:00Z", "duration":30, "description":"My description" } # TimeEntryCreateOrUpdate | The time entry object you are creating +begin + #Allows you to create a task result = api_instance.create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->create_time_entry: #{e}" @@ -193,11 +193,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -time_entry_id = 'time_entry_id_example' # String | You can specify an individual task by appending the id to the endpointbegin - # Allows you to delete a time entry +time_entry_id = 'time_entry_id_example' # String | You can specify an individual task by appending the id to the endpoint +begin + #Allows you to delete a time entry api_instance.delete_time_entry(xero_tenant_id, project_id, time_entry_id) - - rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->delete_time_entry: #{e}" end @@ -262,10 +261,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant -project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpointbegin - # Allows you to retrieve a single project +project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint +begin + #Allows you to retrieve a single project result = api_instance.get_project(xero_tenant_id, project_id) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_project: #{e}" @@ -335,10 +334,10 @@ opts = { page_size: 50 # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. } + begin - # list all project users + #list all project users result = api_instance.get_project_users(xero_tenant_id, opts) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_project_users: #{e}" @@ -415,10 +414,10 @@ opts = { page_size: 50 # Integer | Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500. } + begin - # list all projects + #list all projects result = api_instance.get_projects(xero_tenant_id, opts) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_projects: #{e}" @@ -488,10 +487,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -task_id = 'task_id_example' # String | You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}begin - # Allows you to retrieve a single project +task_id = 'task_id_example' # String | You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId} +begin + #Allows you to retrieve a single project result = api_instance.get_task(xero_tenant_id, project_id, task_id) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_task: #{e}" @@ -565,10 +564,10 @@ opts = { task_ids: 'task_ids_example' # String | taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskId},{taskId} } + begin - # Allows you to retrieve a single project + #Allows you to retrieve a single project result = api_instance.get_tasks(xero_tenant_id, project_id, opts) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_tasks: #{e}" @@ -658,10 +657,10 @@ opts = { date_before_utc: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | ISO 8601 UTC date. Finds all time entries on or before this date filtered on the `dateUtc` field. } + begin - # Allows you to retrieve the time entries associated with a specific project + #Allows you to retrieve the time entries associated with a specific project result = api_instance.get_time_entries(xero_tenant_id, project_id, opts) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_time_entries: #{e}" @@ -737,10 +736,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpointbegin - # Allows you to get a single time entry in a project +time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpoint +begin + #Allows you to get a single time entry in a project result = api_instance.get_time_entry(xero_tenant_id, project_id, time_entry_id) - p result rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->get_time_entry: #{e}" @@ -807,11 +806,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -project_patch = { "status": "INPROGRESS" } # ProjectPatch | Update the status of an existing Projectbegin - # creates a project for the specified contact +project_patch = { "status": "INPROGRESS" } # ProjectPatch | Update the status of an existing Project +begin + #creates a project for the specified contact api_instance.patch_project(xero_tenant_id, project_id, project_patch) - - rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->patch_project: #{e}" end @@ -877,11 +875,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint -project_create_or_update = { "name": "New Kitchen", "deadlineUtc": "2017-04-23T18:25:43.511Z", "estimateAmount": 99.99 } # ProjectCreateOrUpdate | Request of type ProjectCreateOrUpdatebegin - # update a specific project +project_create_or_update = { "name": "New Kitchen", "deadlineUtc": "2017-04-23T18:25:43.511Z", "estimateAmount": 99.99 } # ProjectCreateOrUpdate | Request of type ProjectCreateOrUpdate +begin + #update a specific project api_instance.update_project(xero_tenant_id, project_id, project_create_or_update) - - rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_project: #{e}" end @@ -948,11 +945,10 @@ api_instance = xero_client.projects_api xero_tenant_id = 'xero_tenant_id_example' # String | Xero identifier for Tenant project_id = 'project_id_example' # String | You can specify an individual project by appending the projectId to the endpoint time_entry_id = 'time_entry_id_example' # String | You can specify an individual time entry by appending the id to the endpoint -time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-27T15:00:00Z", "duration":45, "description":"My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updatingbegin - # Allows you to update time entry in a project +time_entry_create_or_update = { "userId":"740add2a-a703-4b8a-a670-1093919c2040", "taskId":"7be77337-feec-4458-bb1b-dbaa5a4aafce", "dateUtc":"2020-02-27T15:00:00Z", "duration":45, "description":"My UPDATED description" } # TimeEntryCreateOrUpdate | The time entry object you are updating +begin + #Allows you to update time entry in a project api_instance.update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update) - - rescue XeroRuby::Projects::ApiError => e puts "Exception when calling ProjectApi->update_time_entry: #{e}" end From d29e7c3e6bd369bbfb92f496e31d00f8cb65cca9 Mon Sep 17 00:00:00 2001 From: serknight Date: Fri, 26 Jun 2020 11:29:27 -0600 Subject: [PATCH 19/21] add config for project_api --- lib/xero-ruby/api_client.rb | 5 +++++ lib/xero-ruby/configuration.rb | 2 ++ 2 files changed, 7 insertions(+) diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index c580498f..62379577 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -56,6 +56,11 @@ def asset_api XeroRuby::AssetApi.new(self) end + def project_api + @config.base_url = @config.project_url + XeroRuby::ProjectApi.new(self) + end + # Token Helpers def token_set XeroRuby.configure.token_set diff --git a/lib/xero-ruby/configuration.rb b/lib/xero-ruby/configuration.rb index 53ff7624..4776841d 100644 --- a/lib/xero-ruby/configuration.rb +++ b/lib/xero-ruby/configuration.rb @@ -29,6 +29,7 @@ class Configuration # Defines base paths for seperate API's attr_accessor :accounting_url attr_accessor :asset_url + attr_accessor :project_url # Defines API keys used with API Key authentications. # @@ -140,6 +141,7 @@ def initialize @token_url = 'https://identity.xero.com/connect/token' @accounting_url = 'https://api.xero.com/api.xro/2.0' @asset_url = 'https://api.xero.com/assets.xro/1.0' + @project_url = 'https://api.xero.com/projects.xro/2.0/' @api_key = {} @api_key_prefix = {} @timeout = 0 From 9fa01e214198d4fef2608895a788d6095653a67a Mon Sep 17 00:00:00 2001 From: serknight Date: Fri, 26 Jun 2020 11:41:43 -0600 Subject: [PATCH 20/21] add block for multi API set handling for projects --- lib/xero-ruby/api_client.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index 62379577..01b9ea6c 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -342,6 +342,8 @@ def convert_to_type(data, return_type) XeroRuby::Accounting.const_get(return_type).build_from_hash(data) rescue XeroRuby::Assets.const_get(return_type).build_from_hash(data) + rescue + XeroRuby::Projects.const_get(return_type).build_from_hash(data) # rescue # XeroRuby::.const_get(return_type).build_from_hash(data) end From ba6ed9797df4331a89ef06526b0f108d1a7d5368 Mon Sep 17 00:00:00 2001 From: serknight Date: Tue, 7 Jul 2020 16:00:53 -0600 Subject: [PATCH 21/21] generating from spec and mustache fixes for 3+ api sets deserialization --- docs/assets/AssetType.md | 2 +- lib/xero-ruby/api/asset_api.rb | 2 +- lib/xero-ruby/api/project_api.rb | 2 +- lib/xero-ruby/api_client.rb | 31 +++++++++++++++---- lib/xero-ruby/models/assets/asset.rb | 2 +- lib/xero-ruby/models/assets/asset_status.rb | 2 +- .../models/assets/asset_status_query_param.rb | 2 +- lib/xero-ruby/models/assets/asset_type.rb | 7 +---- lib/xero-ruby/models/assets/assets.rb | 2 +- .../models/assets/book_depreciation_detail.rb | 2 +- .../assets/book_depreciation_setting.rb | 2 +- lib/xero-ruby/models/assets/error.rb | 2 +- .../assets/field_validation_errors_element.rb | 2 +- lib/xero-ruby/models/assets/pagination.rb | 2 +- .../resource_validation_errors_element.rb | 2 +- lib/xero-ruby/models/assets/setting.rb | 2 +- lib/xero-ruby/models/projects/amount.rb | 2 +- lib/xero-ruby/models/projects/charge_type.rb | 2 +- .../models/projects/currency_code.rb | 2 +- lib/xero-ruby/models/projects/error.rb | 2 +- lib/xero-ruby/models/projects/pagination.rb | 2 +- lib/xero-ruby/models/projects/project.rb | 2 +- .../projects/project_create_or_update.rb | 2 +- .../models/projects/project_patch.rb | 2 +- .../models/projects/project_status.rb | 2 +- lib/xero-ruby/models/projects/project_user.rb | 2 +- .../models/projects/project_users.rb | 2 +- lib/xero-ruby/models/projects/projects.rb | 2 +- lib/xero-ruby/models/projects/task.rb | 2 +- .../models/projects/task_create_or_update.rb | 2 +- lib/xero-ruby/models/projects/tasks.rb | 2 +- lib/xero-ruby/models/projects/time_entries.rb | 2 +- lib/xero-ruby/models/projects/time_entry.rb | 2 +- .../projects/time_entry_create_or_update.rb | 2 +- 34 files changed, 58 insertions(+), 44 deletions(-) diff --git a/docs/assets/AssetType.md b/docs/assets/AssetType.md index cdff54ab..7301409c 100644 --- a/docs/assets/AssetType.md +++ b/docs/assets/AssetType.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**asset_type_id** | **String** | Xero generated unique identifier for asset types | +**asset_type_id** | **String** | Xero generated unique identifier for asset types | [optional] **asset_type_name** | **String** | The name of the asset type | **fixed_asset_account_id** | **String** | The asset account for fixed assets of this type | [optional] **depreciation_expense_account_id** | **String** | The expense account for the depreciation of fixed assets of this type | [optional] diff --git a/lib/xero-ruby/api/asset_api.rb b/lib/xero-ruby/api/asset_api.rb index f3bb6d62..a5b13a61 100644 --- a/lib/xero-ruby/api/asset_api.rb +++ b/lib/xero-ruby/api/asset_api.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api/project_api.rb b/lib/xero-ruby/api/project_api.rb index 722800f3..d76c0ed5 100644 --- a/lib/xero-ruby/api/project_api.rb +++ b/lib/xero-ruby/api/project_api.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/api_client.rb b/lib/xero-ruby/api_client.rb index 01b9ea6c..1dffa2ad 100644 --- a/lib/xero-ruby/api_client.rb +++ b/lib/xero-ruby/api_client.rb @@ -14,6 +14,7 @@ require 'json' require 'logger' require 'tempfile' +require 'find' require 'faraday' module XeroRuby @@ -298,9 +299,9 @@ def deserialize(response, return_type) else raise e end - end + end - convert_to_type data, return_type + convert_to_type(data, return_type) end # Convert data to the given return type. @@ -338,16 +339,34 @@ def convert_to_type(data, return_type) data.each { |k, v| hash[k] = convert_to_type(v, sub_type) } end else - begin + api_set = api_set_prefix(return_type) + case api_set + when 'accounting' XeroRuby::Accounting.const_get(return_type).build_from_hash(data) - rescue + when 'assets' XeroRuby::Assets.const_get(return_type).build_from_hash(data) - rescue + when 'projects' XeroRuby::Projects.const_get(return_type).build_from_hash(data) - # rescue + # when 'newapiset' # add new namespace # XeroRuby::.const_get(return_type).build_from_hash(data) + else + XeroRuby::Accounting.const_get(return_type).build_from_hash(data) + end + end + end + + # Traverses the model tree to find the model's namespacing + # based on the deserializing model/return_type name + def api_set_prefix(return_type) + api_set = '' + Find.find("#{File.dirname(__FILE__)}/models/") do |path| + model_path = path.split('/') + matching_name = model_path.last.gsub('.rb','').gsub("_",'') + if return_type.downcase === matching_name + api_set = path.split('/')[-2] end end + return api_set end # Save response body into a file in (the defined) temporary folder, using the filename diff --git a/lib/xero-ruby/models/assets/asset.rb b/lib/xero-ruby/models/assets/asset.rb index 73a0a095..4cf74508 100644 --- a/lib/xero-ruby/models/assets/asset.rb +++ b/lib/xero-ruby/models/assets/asset.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_status.rb b/lib/xero-ruby/models/assets/asset_status.rb index 1cd81b77..eb6522bc 100644 --- a/lib/xero-ruby/models/assets/asset_status.rb +++ b/lib/xero-ruby/models/assets/asset_status.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_status_query_param.rb b/lib/xero-ruby/models/assets/asset_status_query_param.rb index 0c072cf7..5c4caee8 100644 --- a/lib/xero-ruby/models/assets/asset_status_query_param.rb +++ b/lib/xero-ruby/models/assets/asset_status_query_param.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/asset_type.rb b/lib/xero-ruby/models/assets/asset_type.rb index b223c8c0..7cf715b0 100644 --- a/lib/xero-ruby/models/assets/asset_type.rb +++ b/lib/xero-ruby/models/assets/asset_type.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 @@ -110,10 +110,6 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new - if @asset_type_id.nil? - invalid_properties.push('invalid value for "asset_type_id", asset_type_id cannot be nil.') - end - if @asset_type_name.nil? invalid_properties.push('invalid value for "asset_type_name", asset_type_name cannot be nil.') end @@ -128,7 +124,6 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - return false if @asset_type_id.nil? return false if @asset_type_name.nil? return false if @book_depreciation_setting.nil? true diff --git a/lib/xero-ruby/models/assets/assets.rb b/lib/xero-ruby/models/assets/assets.rb index 597fa203..21940e74 100644 --- a/lib/xero-ruby/models/assets/assets.rb +++ b/lib/xero-ruby/models/assets/assets.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/book_depreciation_detail.rb b/lib/xero-ruby/models/assets/book_depreciation_detail.rb index c8d98032..7e5ed608 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_detail.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_detail.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/book_depreciation_setting.rb b/lib/xero-ruby/models/assets/book_depreciation_setting.rb index 0e24dd7c..9dfcb759 100644 --- a/lib/xero-ruby/models/assets/book_depreciation_setting.rb +++ b/lib/xero-ruby/models/assets/book_depreciation_setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/error.rb b/lib/xero-ruby/models/assets/error.rb index 3de6ac19..4773e6f5 100644 --- a/lib/xero-ruby/models/assets/error.rb +++ b/lib/xero-ruby/models/assets/error.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/field_validation_errors_element.rb b/lib/xero-ruby/models/assets/field_validation_errors_element.rb index 7efd8ec3..f71b439a 100644 --- a/lib/xero-ruby/models/assets/field_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/field_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/pagination.rb b/lib/xero-ruby/models/assets/pagination.rb index c97f957d..dea85e2e 100644 --- a/lib/xero-ruby/models/assets/pagination.rb +++ b/lib/xero-ruby/models/assets/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb index 1e86623f..4a48745b 100644 --- a/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +++ b/lib/xero-ruby/models/assets/resource_validation_errors_element.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/assets/setting.rb b/lib/xero-ruby/models/assets/setting.rb index 4bf87982..08ceb34c 100644 --- a/lib/xero-ruby/models/assets/setting.rb +++ b/lib/xero-ruby/models/assets/setting.rb @@ -3,7 +3,7 @@ #This is the Xero Assets API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/amount.rb b/lib/xero-ruby/models/projects/amount.rb index 65d65821..df2c25b0 100644 --- a/lib/xero-ruby/models/projects/amount.rb +++ b/lib/xero-ruby/models/projects/amount.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/charge_type.rb b/lib/xero-ruby/models/projects/charge_type.rb index d8dfdc73..69fe7a20 100644 --- a/lib/xero-ruby/models/projects/charge_type.rb +++ b/lib/xero-ruby/models/projects/charge_type.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/currency_code.rb b/lib/xero-ruby/models/projects/currency_code.rb index 0abc666c..1fdc00a1 100644 --- a/lib/xero-ruby/models/projects/currency_code.rb +++ b/lib/xero-ruby/models/projects/currency_code.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/error.rb b/lib/xero-ruby/models/projects/error.rb index c76cdf79..5cb68bd8 100644 --- a/lib/xero-ruby/models/projects/error.rb +++ b/lib/xero-ruby/models/projects/error.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/pagination.rb b/lib/xero-ruby/models/projects/pagination.rb index 5fd5bb43..dee8c4dd 100644 --- a/lib/xero-ruby/models/projects/pagination.rb +++ b/lib/xero-ruby/models/projects/pagination.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project.rb b/lib/xero-ruby/models/projects/project.rb index 85eb0703..df0c0640 100644 --- a/lib/xero-ruby/models/projects/project.rb +++ b/lib/xero-ruby/models/projects/project.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_create_or_update.rb b/lib/xero-ruby/models/projects/project_create_or_update.rb index 7681732b..c6be2367 100644 --- a/lib/xero-ruby/models/projects/project_create_or_update.rb +++ b/lib/xero-ruby/models/projects/project_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_patch.rb b/lib/xero-ruby/models/projects/project_patch.rb index c7e54be8..9abe8074 100644 --- a/lib/xero-ruby/models/projects/project_patch.rb +++ b/lib/xero-ruby/models/projects/project_patch.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_status.rb b/lib/xero-ruby/models/projects/project_status.rb index 01fcffac..0da2a0f3 100644 --- a/lib/xero-ruby/models/projects/project_status.rb +++ b/lib/xero-ruby/models/projects/project_status.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_user.rb b/lib/xero-ruby/models/projects/project_user.rb index a752a373..27892a4f 100644 --- a/lib/xero-ruby/models/projects/project_user.rb +++ b/lib/xero-ruby/models/projects/project_user.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/project_users.rb b/lib/xero-ruby/models/projects/project_users.rb index de9817b5..90f42836 100644 --- a/lib/xero-ruby/models/projects/project_users.rb +++ b/lib/xero-ruby/models/projects/project_users.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/projects.rb b/lib/xero-ruby/models/projects/projects.rb index 71b1f657..41c136dc 100644 --- a/lib/xero-ruby/models/projects/projects.rb +++ b/lib/xero-ruby/models/projects/projects.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/task.rb b/lib/xero-ruby/models/projects/task.rb index 97d41acf..901300e3 100644 --- a/lib/xero-ruby/models/projects/task.rb +++ b/lib/xero-ruby/models/projects/task.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/task_create_or_update.rb b/lib/xero-ruby/models/projects/task_create_or_update.rb index a4d1bdb4..ba47e44e 100644 --- a/lib/xero-ruby/models/projects/task_create_or_update.rb +++ b/lib/xero-ruby/models/projects/task_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/tasks.rb b/lib/xero-ruby/models/projects/tasks.rb index 21db457a..7f8f95f9 100644 --- a/lib/xero-ruby/models/projects/tasks.rb +++ b/lib/xero-ruby/models/projects/tasks.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entries.rb b/lib/xero-ruby/models/projects/time_entries.rb index faabdbd5..af66bf25 100644 --- a/lib/xero-ruby/models/projects/time_entries.rb +++ b/lib/xero-ruby/models/projects/time_entries.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entry.rb b/lib/xero-ruby/models/projects/time_entry.rb index d3ee2a2a..bb151bbf 100644 --- a/lib/xero-ruby/models/projects/time_entry.rb +++ b/lib/xero-ruby/models/projects/time_entry.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1 diff --git a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb index 996f75fd..d551e415 100644 --- a/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +++ b/lib/xero-ruby/models/projects/time_entry_create_or_update.rb @@ -3,7 +3,7 @@ #This is the Xero Projects API -The version of the OpenAPI document: 2.2.4 +The version of the OpenAPI document: 2.2.6 Contact: api@xero.com Generated by: https://openapi-generator.tech OpenAPI Generator version: 4.3.1