Skip to content

Commit 34b44b1

Browse files
authored
Merge pull request #238 from XeroAPI/xero-ruby-3.15.0
generates xero-ruby 3.15.0 from OAS 2.31.0
2 parents f1bf70c + ea6fd69 commit 34b44b1

File tree

23 files changed

+2078
-17
lines changed

23 files changed

+2078
-17
lines changed

docs/accounting/LineItem.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Name | Type | Description | Notes
1414
**tax_type** | **String** | The tax type from TaxRates | [optional]
1515
**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]
1616
**item** | [**LineItemItem**](LineItemItem.md) | | [optional]
17-
**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]
17+
**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]
1818
**tracking** | [**Array<LineItemTracking>**](LineItemTracking.md) | Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements. | [optional]
1919
**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]
20-
**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]
20+
**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]
2121
**repeating_invoice_id** | **String** | The Xero identifier for a Repeating Invoice | [optional]
2222

2323
## Code Sample

docs/accounting/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,7 +3577,7 @@
35773577
},
35783578
"LineAmount" : {
35793579
"type" : "number",
3580-
"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)",
3580+
"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",
35813581
"format" : "double",
35823582
"x-is-money" : true
35833583
},
@@ -3596,7 +3596,7 @@
35963596
},
35973597
"DiscountAmount" : {
35983598
"type" : "number",
3599-
"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.",
3599+
"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.",
36003600
"format" : "double",
36013601
"x-is-money" : true
36023602
},
@@ -6069,7 +6069,7 @@
60696069
<nav id="scrollingNav">
60706070
<ul class="sidenav nav nav-list">
60716071
<li class="nav-header" data-group="Accounting"><strong>SDK: </strong><span id='sdk-name'></span></li>
6072-
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>3.14.0</li>
6072+
<li class="nav-header" data-group="Accounting"><strong>VSN: </strong>3.15.0</li>
60736073
<li class="nav-header" data-group="Accounting"><a href="#api-Accounting">Methods</a></li>
60746074
<li data-group="Accounting" data-name="createAccount" class="">
60756075
<a href="#api-Accounting-createAccount">createAccount</a>

docs/app_store/AppStoreApi.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All URIs are relative to *https://api.xero.com/appstore/2.0*
55
Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**get_subscription**](AppStoreApi.md#get_subscription) | **GET** /subscriptions/{subscriptionId} | Retrieves a subscription for a given subscriptionId
8+
[**get_usage_records**](AppStoreApi.md#get_usage_records) | **GET** /subscriptions/{subscriptionId}/usage-records | Gets all usage records related to the subscription
9+
[**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
10+
[**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
811

912

1013

@@ -69,3 +72,199 @@ Name | Type | Description | Notes
6972
- **Content-Type**: Not defined
7073
- **Accept**: application/json
7174

75+
76+
## get_usage_records
77+
78+
> UsageRecordsList get_usage_records(subscription_id)
79+
80+
Gets all usage records related to the subscription
81+
82+
### Example
83+
84+
```ruby
85+
# load the gem
86+
require 'xero-ruby'
87+
88+
creds = {
89+
client_id: ENV['CLIENT_ID'],
90+
client_secret: ENV['CLIENT_SECRET'],
91+
redirect_uri: ENV['REDIRECT_URI'],
92+
scopes: ENV['SCOPES']
93+
}
94+
xero_client = XeroRuby::ApiClient.new(credentials: creds)
95+
96+
token_set = fetch_valid_token_set(user) # example
97+
98+
xero_client.refresh_token_set(token_set)
99+
100+
# You need to namespace your api method call to one of the following api sets
101+
# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api, :app_store_api]
102+
103+
api_instance = xero_client.<api_set>
104+
105+
106+
107+
subscription_id = '00000000-0000-0000-0000-000000000000' # String | Unique identifier for Subscription object
108+
begin
109+
#Gets all usage records related to the subscription
110+
result = api_instance.get_usage_records(subscription_id)
111+
p result
112+
rescue XeroRuby::AppStore::ApiError => e
113+
puts "Exception when calling AppStoreApi->get_usage_records: #{e}"
114+
end
115+
```
116+
117+
### Parameters
118+
119+
120+
Name | Type | Description | Notes
121+
------------- | ------------- | ------------- | -------------
122+
**subscription_id** | [**String**](.md)| Unique identifier for Subscription object |
123+
124+
### Return type
125+
126+
[**UsageRecordsList**](UsageRecordsList.md)
127+
128+
### Authorization
129+
130+
[OAuth2](../README.md#OAuth2)
131+
132+
### HTTP request headers
133+
134+
- **Content-Type**: Not defined
135+
- **Accept**: application/json
136+
137+
138+
## post_usage_records
139+
140+
> UsageRecord post_usage_records(subscription_id, subscription_item_id, create_usage_record)
141+
142+
Send metered usage belonging to this subscription and subscription item
143+
144+
### Example
145+
146+
```ruby
147+
# load the gem
148+
require 'xero-ruby'
149+
150+
creds = {
151+
client_id: ENV['CLIENT_ID'],
152+
client_secret: ENV['CLIENT_SECRET'],
153+
redirect_uri: ENV['REDIRECT_URI'],
154+
scopes: ENV['SCOPES']
155+
}
156+
xero_client = XeroRuby::ApiClient.new(credentials: creds)
157+
158+
token_set = fetch_valid_token_set(user) # example
159+
160+
xero_client.refresh_token_set(token_set)
161+
162+
# You need to namespace your api method call to one of the following api sets
163+
# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api, :app_store_api]
164+
165+
api_instance = xero_client.<api_set>
166+
167+
168+
169+
subscription_id = '00000000-0000-0000-0000-000000000000' # String | Unique identifier for Subscription object
170+
subscription_item_id = '00000000-0000-0000-0000-000000000000' # String | The unique identifier of the subscriptionItem
171+
create_usage_record = { "timestamp": "2022-01-21T13:01:00Z", "quantity": 10 } # CreateUsageRecord | Contains the quantity for the usage record to create
172+
begin
173+
#Send metered usage belonging to this subscription and subscription item
174+
result = api_instance.post_usage_records(subscription_id, subscription_item_id, create_usage_record)
175+
p result
176+
rescue XeroRuby::AppStore::ApiError => e
177+
puts "Exception when calling AppStoreApi->post_usage_records: #{e}"
178+
end
179+
```
180+
181+
### Parameters
182+
183+
184+
Name | Type | Description | Notes
185+
------------- | ------------- | ------------- | -------------
186+
**subscription_id** | [**String**](.md)| Unique identifier for Subscription object |
187+
**subscription_item_id** | [**String**](.md)| The unique identifier of the subscriptionItem |
188+
**create_usage_record** | [**CreateUsageRecord**](CreateUsageRecord.md)| Contains the quantity for the usage record to create |
189+
190+
### Return type
191+
192+
[**UsageRecord**](UsageRecord.md)
193+
194+
### Authorization
195+
196+
[OAuth2](../README.md#OAuth2)
197+
198+
### HTTP request headers
199+
200+
- **Content-Type**: application/json
201+
- **Accept**: application/json
202+
203+
204+
## put_usage_records
205+
206+
> UsageRecord put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record)
207+
208+
Update and existing metered usage belonging to this subscription and subscription item
209+
210+
### Example
211+
212+
```ruby
213+
# load the gem
214+
require 'xero-ruby'
215+
216+
creds = {
217+
client_id: ENV['CLIENT_ID'],
218+
client_secret: ENV['CLIENT_SECRET'],
219+
redirect_uri: ENV['REDIRECT_URI'],
220+
scopes: ENV['SCOPES']
221+
}
222+
xero_client = XeroRuby::ApiClient.new(credentials: creds)
223+
224+
token_set = fetch_valid_token_set(user) # example
225+
226+
xero_client.refresh_token_set(token_set)
227+
228+
# You need to namespace your api method call to one of the following api sets
229+
# [:accounting_api, :assets_api, :projects_api, :files_api, :payroll_au_api, :payroll_nz_api, :payroll_uk_api, :app_store_api]
230+
231+
api_instance = xero_client.<api_set>
232+
233+
234+
235+
subscription_id = '00000000-0000-0000-0000-000000000000' # String | Unique identifier for Subscription object
236+
subscription_item_id = '00000000-0000-0000-0000-000000000000' # String | The unique identifier of the subscriptionItem
237+
usage_record_id = '00000000-0000-0000-0000-000000000000' # String | The unique identifier of the usage record
238+
update_usage_record = { "quantity": 10 } # UpdateUsageRecord | Contains the quantity for the usage record to update
239+
begin
240+
#Update and existing metered usage belonging to this subscription and subscription item
241+
result = api_instance.put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record)
242+
p result
243+
rescue XeroRuby::AppStore::ApiError => e
244+
puts "Exception when calling AppStoreApi->put_usage_records: #{e}"
245+
end
246+
```
247+
248+
### Parameters
249+
250+
251+
Name | Type | Description | Notes
252+
------------- | ------------- | ------------- | -------------
253+
**subscription_id** | [**String**](.md)| Unique identifier for Subscription object |
254+
**subscription_item_id** | [**String**](.md)| The unique identifier of the subscriptionItem |
255+
**usage_record_id** | [**String**](.md)| The unique identifier of the usage record |
256+
**update_usage_record** | [**UpdateUsageRecord**](UpdateUsageRecord.md)| Contains the quantity for the usage record to update |
257+
258+
### Return type
259+
260+
[**UsageRecord**](UsageRecord.md)
261+
262+
### Authorization
263+
264+
[OAuth2](../README.md#OAuth2)
265+
266+
### HTTP request headers
267+
268+
- **Content-Type**: application/json
269+
- **Accept**: application/json
270+

docs/app_store/CreateUsageRecord.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# XeroRuby::AppStore::CreateUsageRecord
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**quantity** | **Integer** | The initial quantity for the usage record. Must be a whole number that is greater than or equal to 0 |
8+
**timestamp** | **DateTime** | DateTime in UTC of when the the product was consumed/used |
9+
10+
## Code Sample
11+
12+
```ruby
13+
require 'XeroRuby::AppStore'
14+
15+
instance = XeroRuby::AppStore::CreateUsageRecord.new(quantity: null,
16+
timestamp: null)
17+
```
18+
19+

docs/app_store/UpdateUsageRecord.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# XeroRuby::AppStore::UpdateUsageRecord
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**quantity** | **Integer** | The new quantity for the usage record. Must be a whole number that is greater than or equal to 0 |
8+
9+
## Code Sample
10+
11+
```ruby
12+
require 'XeroRuby::AppStore'
13+
14+
instance = XeroRuby::AppStore::UpdateUsageRecord.new(quantity: null)
15+
```
16+
17+

docs/app_store/UsageRecord.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# XeroRuby::AppStore::UsageRecord
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**quantity** | **Integer** | The quantity recorded |
8+
**subscription_id** | **String** | The unique identifier of the Subscription. |
9+
**subscription_item_id** | **String** | The unique identifier of the SubscriptionItem. |
10+
**test_mode** | **Boolean** | If the subscription is a test subscription |
11+
**recorded_at** | **DateTime** | The time when this usage was recorded in UTC |
12+
**usage_record_id** | **String** | The unique identifier of the usageRecord. |
13+
**price_per_unit** | **Float** | The price per unit |
14+
**product_id** | **String** | The unique identifier of the linked Product |
15+
16+
## Code Sample
17+
18+
```ruby
19+
require 'XeroRuby::AppStore'
20+
21+
instance = XeroRuby::AppStore::UsageRecord.new(quantity: null,
22+
subscription_id: null,
23+
subscription_item_id: null,
24+
test_mode: null,
25+
recorded_at: null,
26+
usage_record_id: null,
27+
price_per_unit: null,
28+
product_id: null)
29+
```
30+
31+

docs/app_store/UsageRecordsList.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# XeroRuby::AppStore::UsageRecordsList
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**usage_records** | [**Array&lt;UsageRecord&gt;**](UsageRecord.md) | A collection of usage records |
8+
9+
## Code Sample
10+
11+
```ruby
12+
require 'XeroRuby::AppStore'
13+
14+
instance = XeroRuby::AppStore::UsageRecordsList.new(usage_records: null)
15+
```
16+
17+

0 commit comments

Comments
 (0)