Skip to content

Commit

Permalink
Merge pull request #238 from XeroAPI/xero-ruby-3.15.0
Browse files Browse the repository at this point in the history
generates xero-ruby 3.15.0 from OAS 2.31.0
  • Loading branch information
RettBehrens authored Nov 8, 2022
2 parents f1bf70c + ea6fd69 commit 34b44b1
Show file tree
Hide file tree
Showing 23 changed files with 2,078 additions and 17 deletions.
4 changes: 2 additions & 2 deletions docs/accounting/LineItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Name | Type | Description | Notes
**tax_type** | **String** | The tax type from TaxRates | [optional]
**tax_amount** | **BigDecimal** | 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]
**item** | [**LineItemItem**](LineItemItem.md) | | [optional]
**line_amount** | **BigDecimal** | 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]
**line_amount** | **BigDecimal** | If you wish to omit either 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 either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount | [optional]
**tracking** | [**Array<LineItemTracking>**](LineItemTracking.md) | Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. | [optional]
**discount_rate** | **BigDecimal** | 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** | **BigDecimal** | 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]
**discount_amount** | **BigDecimal** | Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. 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
Expand Down
6 changes: 3 additions & 3 deletions docs/accounting/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3577,7 +3577,7 @@
},
"LineAmount" : {
"type" : "number",
"description" : "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)",
"description" : "If you wish to omit either 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 either a DiscountRate or DiscountAmount has been used i.e. LineAmount = Quantity * Unit Amount * ((100 - DiscountRate)/100) or LineAmount = (Quantity * UnitAmount) - DiscountAmount",
"format" : "double",
"x-is-money" : true
},
Expand All @@ -3596,7 +3596,7 @@
},
"DiscountAmount" : {
"type" : "number",
"description" : "Discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts.",
"description" : "Discount amount being applied to a line item. Only supported on ACCREC invoices and quotes. ACCPAY invoices and credit notes in Xero do not support discounts.",
"format" : "double",
"x-is-money" : true
},
Expand Down Expand Up @@ -6069,7 +6069,7 @@
<nav id="scrollingNav">
<ul class="sidenav nav nav-list">
<li class="nav-header" data-group="Accounting"><strong>SDK: </strong><span id='sdk-name'></span></li>
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>3.14.0</li>
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>3.15.0</li>
<li class="nav-header" data-group="Accounting"><a href="#api-Accounting">Methods</a></li>
<li data-group="Accounting" data-name="createAccount" class="">
<a href="#api-Accounting-createAccount">createAccount</a>
Expand Down
199 changes: 199 additions & 0 deletions docs/app_store/AppStoreApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ All URIs are relative to *https://api.xero.com/appstore/2.0*
Method | HTTP request | Description
------------- | ------------- | -------------
[**get_subscription**](AppStoreApi.md#get_subscription) | **GET** /subscriptions/{subscriptionId} | Retrieves a subscription for a given subscriptionId
[**get_usage_records**](AppStoreApi.md#get_usage_records) | **GET** /subscriptions/{subscriptionId}/usage-records | Gets all usage records related to the subscription
[**post_usage_records**](AppStoreApi.md#post_usage_records) | **POST** /subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records | Send metered usage belonging to this subscription and subscription item
[**put_usage_records**](AppStoreApi.md#put_usage_records) | **PUT** /subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId} | Update and existing metered usage belonging to this subscription and subscription item



Expand Down Expand Up @@ -69,3 +72,199 @@ Name | Type | Description | Notes
- **Content-Type**: Not defined
- **Accept**: application/json


## get_usage_records

> UsageRecordsList get_usage_records(subscription_id)
Gets all usage records related to the subscription

### Example

```ruby
# load the gem
require 'xero-ruby'

creds = {
client_id: ENV['CLIENT_ID'],
client_secret: ENV['CLIENT_SECRET'],
redirect_uri: ENV['REDIRECT_URI'],
scopes: ENV['SCOPES']
}
xero_client = XeroRuby::ApiClient.new(credentials: creds)

token_set = fetch_valid_token_set(user) # example

xero_client.refresh_token_set(token_set)

# You need to namespace your api method call to one of the following api sets
# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api, :app_store_api]

api_instance = xero_client.<api_set>



subscription_id = '00000000-0000-0000-0000-000000000000' # String | Unique identifier for Subscription object
begin
#Gets all usage records related to the subscription
result = api_instance.get_usage_records(subscription_id)
p result
rescue XeroRuby::AppStore::ApiError => e
puts "Exception when calling AppStoreApi->get_usage_records: #{e}"
end
```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**subscription_id** | [**String**](.md)| Unique identifier for Subscription object |

### Return type

[**UsageRecordsList**](UsageRecordsList.md)

### Authorization

[OAuth2](../README.md#OAuth2)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json


## post_usage_records

> UsageRecord post_usage_records(subscription_id, subscription_item_id, create_usage_record)
Send metered usage belonging to this subscription and subscription 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)

# You need to namespace your api method call to one of the following api sets
# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api, :app_store_api]

api_instance = xero_client.<api_set>



subscription_id = '00000000-0000-0000-0000-000000000000' # String | Unique identifier for Subscription object
subscription_item_id = '00000000-0000-0000-0000-000000000000' # String | The unique identifier of the subscriptionItem
create_usage_record = { "timestamp": "2022-01-21T13:01:00Z", "quantity": 10 } # CreateUsageRecord | Contains the quantity for the usage record to create
begin
#Send metered usage belonging to this subscription and subscription item
result = api_instance.post_usage_records(subscription_id, subscription_item_id, create_usage_record)
p result
rescue XeroRuby::AppStore::ApiError => e
puts "Exception when calling AppStoreApi->post_usage_records: #{e}"
end
```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**subscription_id** | [**String**](.md)| Unique identifier for Subscription object |
**subscription_item_id** | [**String**](.md)| The unique identifier of the subscriptionItem |
**create_usage_record** | [**CreateUsageRecord**](CreateUsageRecord.md)| Contains the quantity for the usage record to create |

### Return type

[**UsageRecord**](UsageRecord.md)

### Authorization

[OAuth2](../README.md#OAuth2)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json


## put_usage_records

> UsageRecord put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record)
Update and existing metered usage belonging to this subscription and subscription 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)

# You need to namespace your api method call to one of the following api sets
# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api, :app_store_api]

api_instance = xero_client.<api_set>



subscription_id = '00000000-0000-0000-0000-000000000000' # String | Unique identifier for Subscription object
subscription_item_id = '00000000-0000-0000-0000-000000000000' # String | The unique identifier of the subscriptionItem
usage_record_id = '00000000-0000-0000-0000-000000000000' # String | The unique identifier of the usage record
update_usage_record = { "quantity": 10 } # UpdateUsageRecord | Contains the quantity for the usage record to update
begin
#Update and existing metered usage belonging to this subscription and subscription item
result = api_instance.put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record)
p result
rescue XeroRuby::AppStore::ApiError => e
puts "Exception when calling AppStoreApi->put_usage_records: #{e}"
end
```

### Parameters


Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**subscription_id** | [**String**](.md)| Unique identifier for Subscription object |
**subscription_item_id** | [**String**](.md)| The unique identifier of the subscriptionItem |
**usage_record_id** | [**String**](.md)| The unique identifier of the usage record |
**update_usage_record** | [**UpdateUsageRecord**](UpdateUsageRecord.md)| Contains the quantity for the usage record to update |

### Return type

[**UsageRecord**](UsageRecord.md)

### Authorization

[OAuth2](../README.md#OAuth2)

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: application/json

19 changes: 19 additions & 0 deletions docs/app_store/CreateUsageRecord.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# XeroRuby::AppStore::CreateUsageRecord

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**quantity** | **Integer** | The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 |
**timestamp** | **DateTime** | DateTime in UTC of when the the product was consumed/used |

## Code Sample

```ruby
require 'XeroRuby::AppStore'

instance = XeroRuby::AppStore::CreateUsageRecord.new(quantity: null,
timestamp: null)
```


17 changes: 17 additions & 0 deletions docs/app_store/UpdateUsageRecord.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# XeroRuby::AppStore::UpdateUsageRecord

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**quantity** | **Integer** | The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 |

## Code Sample

```ruby
require 'XeroRuby::AppStore'

instance = XeroRuby::AppStore::UpdateUsageRecord.new(quantity: null)
```


31 changes: 31 additions & 0 deletions docs/app_store/UsageRecord.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# XeroRuby::AppStore::UsageRecord

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**quantity** | **Integer** | The quantity recorded |
**subscription_id** | **String** | The unique identifier of the Subscription. |
**subscription_item_id** | **String** | The unique identifier of the SubscriptionItem. |
**test_mode** | **Boolean** | If the subscription is a test subscription |
**recorded_at** | **DateTime** | The time when this usage was recorded in UTC |
**usage_record_id** | **String** | The unique identifier of the usageRecord. |
**price_per_unit** | **Float** | The price per unit |
**product_id** | **String** | The unique identifier of the linked Product |

## Code Sample

```ruby
require 'XeroRuby::AppStore'

instance = XeroRuby::AppStore::UsageRecord.new(quantity: null,
subscription_id: null,
subscription_item_id: null,
test_mode: null,
recorded_at: null,
usage_record_id: null,
price_per_unit: null,
product_id: null)
```


17 changes: 17 additions & 0 deletions docs/app_store/UsageRecordsList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# XeroRuby::AppStore::UsageRecordsList

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**usage_records** | [**Array&lt;UsageRecord&gt;**](UsageRecord.md) | A collection of usage records |

## Code Sample

```ruby
require 'XeroRuby::AppStore'

instance = XeroRuby::AppStore::UsageRecordsList.new(usage_records: null)
```


Loading

0 comments on commit 34b44b1

Please sign in to comment.