Skip to content

Commit

Permalink
Merge pull request #49 from XeroAPI/specs_fixed_projects_added_and_do…
Browse files Browse the repository at this point in the history
…cumentation_updates

Rspec + documentation + projects / updates
  • Loading branch information
SerKnight authored Jul 8, 2020
2 parents f5cbc6f + ba6ed97 commit 0fc044f
Show file tree
Hide file tree
Showing 209 changed files with 11,231 additions and 1,917 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: test-hook

on: [push]

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
rspec spec/
68 changes: 68 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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
2,282 changes: 1,497 additions & 785 deletions docs/accounting/AccountingApi.md

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion docs/accounting/Allocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@
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&lt;ValidationError&gt;**](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)
date: null,
status_attribute_string: null,
validation_errors: null)
```


2 changes: 1 addition & 1 deletion docs/accounting/BankTransfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**from_bank_account** | [**Account**](Account.md) | |
**to_bank_account** | [**Account**](Account.md) | |
**amount** | **String** | amount of the transaction |
**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]
Expand Down
2 changes: 1 addition & 1 deletion docs/accounting/BatchPayment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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&lt;Payment&gt;**](Payment.md) | | [optional]
**payments** | [**Array&lt;Payment&gt;**](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]
Expand Down
4 changes: 2 additions & 2 deletions docs/accounting/Contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Name | Type | Description | Notes
**attachments** | [**Array&lt;Attachment&gt;**](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&lt;ValidationError&gt;**](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]
**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
Expand Down Expand Up @@ -86,7 +86,7 @@ instance = XeroRuby::Accounting::Contact.new(contact_id: null,
attachments: null,
has_attachments: false,
validation_errors: null,
has_validation_errors: null,
has_validation_errors: false,
status_attribute_string: null)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/accounting/CreditNote.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Name | Type | Description | Notes
**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]
**has_errors** | **Boolean** | A boolean to indicate if a credit note has an validation errors | [optional] [default to false]
**validation_errors** | [**Array&lt;ValidationError&gt;**](ValidationError.md) | Displays array of validation error messages from the API | [optional]

## Code Sample
Expand Down Expand Up @@ -60,7 +60,7 @@ instance = XeroRuby::Accounting::CreditNote.new(type: null,
branding_theme_id: null,
status_attribute_string: null,
has_attachments: false,
has_errors: null,
has_errors: false,
validation_errors: null)
```

Expand Down
4 changes: 2 additions & 2 deletions docs/accounting/Invoice.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Name | Type | Description | Notes
**updated_date_utc** | **DateTime** | Last modified date UTC format | [optional]
**credit_notes** | [**Array&lt;CreditNote&gt;**](CreditNote.md) | Details of credit notes that have been applied to an invoice | [optional]
**attachments** | [**Array&lt;Attachment&gt;**](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]
**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&lt;ValidationError&gt;**](ValidationError.md) | Displays array of validation error messages from the API | [optional]
**warnings** | [**Array&lt;ValidationError&gt;**](ValidationError.md) | Displays array of warning messages from the API | [optional]
Expand Down Expand Up @@ -82,7 +82,7 @@ instance = XeroRuby::Accounting::Invoice.new(type: null,
updated_date_utc: null,
credit_notes: null,
attachments: null,
has_errors: null,
has_errors: false,
status_attribute_string: null,
validation_errors: null,
warnings: null)
Expand Down
2 changes: 2 additions & 0 deletions docs/accounting/Organisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Name | Type | Description | Notes
**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 &amp; 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]
Expand Down Expand Up @@ -54,6 +55,7 @@ instance = XeroRuby::Accounting::Organisation.new(organisation_id: 8be9db36-3598
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,
Expand Down
8 changes: 4 additions & 4 deletions docs/accounting/Payment.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Name | Type | Description | Notes
**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&#39;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]
**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&lt;ValidationError&gt;**](ValidationError.md) | Displays array of validation error messages from the API | [optional]

Expand Down Expand Up @@ -54,8 +54,8 @@ instance = XeroRuby::Accounting::Payment.new(invoice: null,
bank_account_number: null,
particulars: null,
details: null,
has_account: null,
has_validation_errors: null,
has_account: false,
has_validation_errors: false,
status_attribute_string: null,
validation_errors: null)
```
Expand Down
6 changes: 5 additions & 1 deletion docs/accounting/Quote.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Name | Type | Description | Notes
**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&lt;ValidationError&gt;**](ValidationError.md) | Displays array of validation error messages from the API | [optional]

## Code Sample

Expand Down Expand Up @@ -53,7 +55,9 @@ instance = XeroRuby::Accounting::Quote.new(quote_id: null,
summary: null,
branding_theme_id: null,
updated_date_utc: null,
line_amount_types: null)
line_amount_types: null,
status_attribute_string: null,
validation_errors: null)
```


56 changes: 40 additions & 16 deletions docs/assets/AssetApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ token_set = fetch_valid_token_set(user) # example

xero_client.refresh_token_set(token_set)

# If using the Accounting API
# 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 creating

begin
#adds a fixed asset
result = api_instance.create_asset(xero_tenant_id, asset)
Expand Down Expand Up @@ -104,10 +107,14 @@ token_set = fetch_valid_token_set(user) # example

xero_client.refresh_token_set(token_set)

# If using the Accounting API
# 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 = {
Expand Down Expand Up @@ -171,14 +178,17 @@ token_set = fetch_valid_token_set(user) # example

xero_client.refresh_token_set(token_set)

# If using the Accounting API
# 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 object

begin
#retrieves fixed asset by id
result = api_instance.get_asset_by_id(xero_tenant_id, id)
Expand Down Expand Up @@ -236,13 +246,16 @@ token_set = fetch_valid_token_set(user) # example

xero_client.refresh_token_set(token_set)

# If using the Accounting API
# 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

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)
Expand Down Expand Up @@ -299,13 +312,16 @@ token_set = fetch_valid_token_set(user) # example

xero_client.refresh_token_set(token_set)

# If using the Accounting API
# 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

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)
Expand Down Expand Up @@ -362,18 +378,26 @@ token_set = fetch_valid_token_set(user) # example

xero_client.refresh_token_set(token_set)

# If using the Accounting API
# 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
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.
}

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/AssetType.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Loading

0 comments on commit 0fc044f

Please sign in to comment.