xero-ruby 3.11.0 → 3.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/xero-ruby/api/accounting_api.rb +84 -9
- data/lib/xero-ruby/api/app_store_api.rb +238 -0
- data/lib/xero-ruby/api/project_api.rb +7 -7
- data/lib/xero-ruby/api_client.rb +7 -1
- data/lib/xero-ruby/models/accounting/account.rb +1 -1
- data/lib/xero-ruby/models/accounting/batch_payment.rb +2 -2
- data/lib/xero-ruby/models/accounting/journal_line.rb +1 -1
- data/lib/xero-ruby/models/accounting/line_item.rb +2 -2
- data/lib/xero-ruby/models/accounting/organisation.rb +3 -2
- data/lib/xero-ruby/models/accounting/payment.rb +11 -1
- data/lib/xero-ruby/models/accounting/tax_rate.rb +12 -2
- data/lib/xero-ruby/models/accounting/tax_type.rb +15 -0
- data/lib/xero-ruby/models/accounting/time_zone.rb +123 -91
- data/lib/xero-ruby/models/app_store/create_usage_record.rb +243 -0
- data/lib/xero-ruby/models/app_store/update_usage_record.rb +228 -0
- data/lib/xero-ruby/models/app_store/usage_record.rb +332 -0
- data/lib/xero-ruby/models/app_store/usage_records_list.rb +230 -0
- data/lib/xero-ruby/models/payroll_au/country_of_residence.rb +285 -0
- data/lib/xero-ruby/models/payroll_au/employee.rb +42 -2
- data/lib/xero-ruby/models/payroll_au/employment_basis.rb +1 -0
- data/lib/xero-ruby/models/payroll_au/employment_type.rb +36 -0
- data/lib/xero-ruby/models/payroll_au/income_type.rb +39 -0
- data/lib/xero-ruby/models/payroll_au/leave_category_code.rb +46 -0
- data/lib/xero-ruby/models/payroll_au/leave_type.rb +24 -4
- data/lib/xero-ruby/models/payroll_au/senior_marital_status.rb +37 -0
- data/lib/xero-ruby/models/payroll_au/settings.rb +14 -4
- data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +41 -1
- data/lib/xero-ruby/models/payroll_au/tax_scale_type.rb +40 -0
- data/lib/xero-ruby/models/payroll_au/work_condition.rb +37 -0
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby/where.rb +2 -0
- data/lib/xero-ruby.rb +11 -0
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd27a05f0bb738c8238e1972b8f72085f6589bec2e56259b25900b472a7ebae6
|
4
|
+
data.tar.gz: ca2c2f2ad209d4c5c3dfd40e9c4961d13490d8776d74a0b64b42edb2559bd475
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b281f34599bbea6407a0d4bd1af0a49f4dc67087489a1d75e36531dc53532cedca1587380004fb7747461c3c1fb549f8e16cf6c7b25da0662f57447ea785c6
|
7
|
+
data.tar.gz: 1512846c0cef01d14b24f68df2f5061ab3eed4263d570c6604436b67f16b0c1e291732a03b0b106545e03156079688873662bb623ca07fdd55d5f2da5d6f4d4e
|
data/README.md
CHANGED
@@ -175,7 +175,7 @@ xero_app_store_client ||= XeroRuby::ApiClient.new(credentials: {
|
|
175
175
|
client_id: ENV['CLIENT_ID'],
|
176
176
|
client_secret: ENV['CLIENT_SECRET'],
|
177
177
|
grant_type: 'client_credentials'
|
178
|
-
scopes:
|
178
|
+
scopes: 'marketplace.billing openid profile email'
|
179
179
|
})
|
180
180
|
|
181
181
|
xero_app_store_client.get_client_credentials_token
|
@@ -850,21 +850,21 @@ module XeroRuby
|
|
850
850
|
# Creates a new custom payment service for a specific branding theme
|
851
851
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
852
852
|
# @param branding_theme_id [String] Unique identifier for a Branding Theme
|
853
|
-
# @param
|
853
|
+
# @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request
|
854
854
|
# @param [Hash] opts the optional parameters
|
855
855
|
# @return [PaymentServices]
|
856
|
-
def create_branding_theme_payment_services(xero_tenant_id, branding_theme_id,
|
857
|
-
data, _status_code, _headers = create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id,
|
856
|
+
def create_branding_theme_payment_services(xero_tenant_id, branding_theme_id, payment_services, opts = {})
|
857
|
+
data, _status_code, _headers = create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_services, opts)
|
858
858
|
data
|
859
859
|
end
|
860
860
|
|
861
861
|
# Creates a new custom payment service for a specific branding theme
|
862
862
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
863
863
|
# @param branding_theme_id [String] Unique identifier for a Branding Theme
|
864
|
-
# @param
|
864
|
+
# @param payment_services [PaymentServices] PaymentServices array with PaymentService object in body of request
|
865
865
|
# @param [Hash] opts the optional parameters
|
866
866
|
# @return [Array<(PaymentServices, Integer, Hash)>] PaymentServices data, response status code and response headers
|
867
|
-
def create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id,
|
867
|
+
def create_branding_theme_payment_services_with_http_info(xero_tenant_id, branding_theme_id, payment_services, options = {})
|
868
868
|
opts = options.dup
|
869
869
|
if @api_client.config.debugging
|
870
870
|
@api_client.config.logger.debug 'Calling API: AccountingApi.create_branding_theme_payment_services ...'
|
@@ -877,9 +877,9 @@ module XeroRuby
|
|
877
877
|
if @api_client.config.client_side_validation && branding_theme_id.nil?
|
878
878
|
fail ArgumentError, "Missing the required parameter 'branding_theme_id' when calling AccountingApi.create_branding_theme_payment_services"
|
879
879
|
end
|
880
|
-
# verify the required parameter '
|
881
|
-
if @api_client.config.client_side_validation &&
|
882
|
-
fail ArgumentError, "Missing the required parameter '
|
880
|
+
# verify the required parameter 'payment_services' is set
|
881
|
+
if @api_client.config.client_side_validation && payment_services.nil?
|
882
|
+
fail ArgumentError, "Missing the required parameter 'payment_services' when calling AccountingApi.create_branding_theme_payment_services"
|
883
883
|
end
|
884
884
|
# resource path
|
885
885
|
local_var_path = '/BrandingThemes/{BrandingThemeID}/PaymentServices'.sub('{' + 'BrandingThemeID' + '}', branding_theme_id.to_s)
|
@@ -906,7 +906,7 @@ module XeroRuby
|
|
906
906
|
form_params = opts[:form_params] || {}
|
907
907
|
|
908
908
|
# http body (model)
|
909
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
909
|
+
post_body = opts[:body] || @api_client.object_to_http_body(payment_services)
|
910
910
|
|
911
911
|
# return_type
|
912
912
|
return_type = opts[:return_type] || 'PaymentServices'
|
@@ -6886,6 +6886,81 @@ module XeroRuby
|
|
6886
6886
|
return data, status_code, headers
|
6887
6887
|
end
|
6888
6888
|
|
6889
|
+
# Retrieves a specific batch payment using a unique batch payment Id
|
6890
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6891
|
+
# @param batch_payment_id [String] Unique identifier for BatchPayment
|
6892
|
+
# @param [Hash] opts the optional parameters
|
6893
|
+
# @return [BatchPayments]
|
6894
|
+
def get_batch_payment(xero_tenant_id, batch_payment_id, opts = {})
|
6895
|
+
data, _status_code, _headers = get_batch_payment_with_http_info(xero_tenant_id, batch_payment_id, opts)
|
6896
|
+
data
|
6897
|
+
end
|
6898
|
+
|
6899
|
+
# Retrieves a specific batch payment using a unique batch payment Id
|
6900
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6901
|
+
# @param batch_payment_id [String] Unique identifier for BatchPayment
|
6902
|
+
# @param [Hash] opts the optional parameters
|
6903
|
+
# @return [Array<(BatchPayments, Integer, Hash)>] BatchPayments data, response status code and response headers
|
6904
|
+
def get_batch_payment_with_http_info(xero_tenant_id, batch_payment_id, options = {})
|
6905
|
+
opts = options.dup
|
6906
|
+
if @api_client.config.debugging
|
6907
|
+
@api_client.config.logger.debug 'Calling API: AccountingApi.get_batch_payment ...'
|
6908
|
+
end
|
6909
|
+
# verify the required parameter 'xero_tenant_id' is set
|
6910
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
6911
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_batch_payment"
|
6912
|
+
end
|
6913
|
+
# verify the required parameter 'batch_payment_id' is set
|
6914
|
+
if @api_client.config.client_side_validation && batch_payment_id.nil?
|
6915
|
+
fail ArgumentError, "Missing the required parameter 'batch_payment_id' when calling AccountingApi.get_batch_payment"
|
6916
|
+
end
|
6917
|
+
# resource path
|
6918
|
+
local_var_path = '/BatchPayments/{BatchPaymentID}'.sub('{' + 'BatchPaymentID' + '}', batch_payment_id.to_s)
|
6919
|
+
|
6920
|
+
# camelize keys of incoming `where` opts
|
6921
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
6922
|
+
|
6923
|
+
# query parameters
|
6924
|
+
query_params = opts[:query_params] || {}
|
6925
|
+
|
6926
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
6927
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
6928
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
6929
|
+
|
6930
|
+
# header parameters
|
6931
|
+
header_params = opts[:header_params] || {}
|
6932
|
+
# HTTP header 'Accept' (if needed)
|
6933
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
6934
|
+
header_params[:'xero-tenant-id'] = xero_tenant_id
|
6935
|
+
|
6936
|
+
# form parameters
|
6937
|
+
form_params = opts[:form_params] || {}
|
6938
|
+
|
6939
|
+
# http body (model)
|
6940
|
+
post_body = opts[:body]
|
6941
|
+
|
6942
|
+
# return_type
|
6943
|
+
return_type = opts[:return_type] || 'BatchPayments'
|
6944
|
+
|
6945
|
+
# auth_names
|
6946
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
6947
|
+
|
6948
|
+
new_options = opts.merge(
|
6949
|
+
:header_params => header_params,
|
6950
|
+
:query_params => query_params,
|
6951
|
+
:form_params => form_params,
|
6952
|
+
:body => post_body,
|
6953
|
+
:auth_names => auth_names,
|
6954
|
+
:return_type => return_type
|
6955
|
+
)
|
6956
|
+
|
6957
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AccountingApi", new_options)
|
6958
|
+
if @api_client.config.debugging
|
6959
|
+
@api_client.config.logger.debug "API called: AccountingApi#get_batch_payment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
6960
|
+
end
|
6961
|
+
return data, status_code, headers
|
6962
|
+
end
|
6963
|
+
|
6889
6964
|
# Retrieves history from a specific batch payment
|
6890
6965
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
6891
6966
|
# @param batch_payment_id [String] Unique identifier for BatchPayment
|
@@ -83,5 +83,243 @@ module XeroRuby
|
|
83
83
|
end
|
84
84
|
return data, status_code, headers
|
85
85
|
end
|
86
|
+
|
87
|
+
# Gets all usage records related to the subscription
|
88
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
89
|
+
# @param [Hash] opts the optional parameters
|
90
|
+
# @return [UsageRecordsList]
|
91
|
+
def get_usage_records(subscription_id, opts = {})
|
92
|
+
data, _status_code, _headers = get_usage_records_with_http_info(subscription_id, opts)
|
93
|
+
data
|
94
|
+
end
|
95
|
+
|
96
|
+
# Gets all usage records related to the subscription
|
97
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
98
|
+
# @param [Hash] opts the optional parameters
|
99
|
+
# @return [Array<(UsageRecordsList, Integer, Hash)>] UsageRecordsList data, response status code and response headers
|
100
|
+
def get_usage_records_with_http_info(subscription_id, options = {})
|
101
|
+
opts = options.dup
|
102
|
+
if @api_client.config.debugging
|
103
|
+
@api_client.config.logger.debug 'Calling API: AppStoreApi.get_usage_records ...'
|
104
|
+
end
|
105
|
+
# verify the required parameter 'subscription_id' is set
|
106
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
107
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AppStoreApi.get_usage_records"
|
108
|
+
end
|
109
|
+
# resource path
|
110
|
+
local_var_path = '/subscriptions/{subscriptionId}/usage-records'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)
|
111
|
+
|
112
|
+
# camelize keys of incoming `where` opts
|
113
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
114
|
+
|
115
|
+
# query parameters
|
116
|
+
query_params = opts[:query_params] || {}
|
117
|
+
|
118
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
119
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
120
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
121
|
+
|
122
|
+
# header parameters
|
123
|
+
header_params = opts[:header_params] || {}
|
124
|
+
# HTTP header 'Accept' (if needed)
|
125
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
126
|
+
|
127
|
+
# form parameters
|
128
|
+
form_params = opts[:form_params] || {}
|
129
|
+
|
130
|
+
# http body (model)
|
131
|
+
post_body = opts[:body]
|
132
|
+
|
133
|
+
# return_type
|
134
|
+
return_type = opts[:return_type] || 'UsageRecordsList'
|
135
|
+
|
136
|
+
# auth_names
|
137
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
138
|
+
|
139
|
+
new_options = opts.merge(
|
140
|
+
:header_params => header_params,
|
141
|
+
:query_params => query_params,
|
142
|
+
:form_params => form_params,
|
143
|
+
:body => post_body,
|
144
|
+
:auth_names => auth_names,
|
145
|
+
:return_type => return_type
|
146
|
+
)
|
147
|
+
|
148
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AppStoreApi", new_options)
|
149
|
+
if @api_client.config.debugging
|
150
|
+
@api_client.config.logger.debug "API called: AppStoreApi#get_usage_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
151
|
+
end
|
152
|
+
return data, status_code, headers
|
153
|
+
end
|
154
|
+
|
155
|
+
# Send metered usage belonging to this subscription and subscription item
|
156
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
157
|
+
# @param subscription_item_id [String] The unique identifier of the subscriptionItem
|
158
|
+
# @param create_usage_record [CreateUsageRecord] Contains the quantity for the usage record to create
|
159
|
+
# @param [Hash] opts the optional parameters
|
160
|
+
# @return [UsageRecord]
|
161
|
+
def post_usage_records(subscription_id, subscription_item_id, create_usage_record, opts = {})
|
162
|
+
data, _status_code, _headers = post_usage_records_with_http_info(subscription_id, subscription_item_id, create_usage_record, opts)
|
163
|
+
data
|
164
|
+
end
|
165
|
+
|
166
|
+
# Send metered usage belonging to this subscription and subscription item
|
167
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
168
|
+
# @param subscription_item_id [String] The unique identifier of the subscriptionItem
|
169
|
+
# @param create_usage_record [CreateUsageRecord] Contains the quantity for the usage record to create
|
170
|
+
# @param [Hash] opts the optional parameters
|
171
|
+
# @return [Array<(UsageRecord, Integer, Hash)>] UsageRecord data, response status code and response headers
|
172
|
+
def post_usage_records_with_http_info(subscription_id, subscription_item_id, create_usage_record, options = {})
|
173
|
+
opts = options.dup
|
174
|
+
if @api_client.config.debugging
|
175
|
+
@api_client.config.logger.debug 'Calling API: AppStoreApi.post_usage_records ...'
|
176
|
+
end
|
177
|
+
# verify the required parameter 'subscription_id' is set
|
178
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
179
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AppStoreApi.post_usage_records"
|
180
|
+
end
|
181
|
+
# verify the required parameter 'subscription_item_id' is set
|
182
|
+
if @api_client.config.client_side_validation && subscription_item_id.nil?
|
183
|
+
fail ArgumentError, "Missing the required parameter 'subscription_item_id' when calling AppStoreApi.post_usage_records"
|
184
|
+
end
|
185
|
+
# verify the required parameter 'create_usage_record' is set
|
186
|
+
if @api_client.config.client_side_validation && create_usage_record.nil?
|
187
|
+
fail ArgumentError, "Missing the required parameter 'create_usage_record' when calling AppStoreApi.post_usage_records"
|
188
|
+
end
|
189
|
+
# resource path
|
190
|
+
local_var_path = '/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'subscriptionItemId' + '}', subscription_item_id.to_s)
|
191
|
+
|
192
|
+
# camelize keys of incoming `where` opts
|
193
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
194
|
+
|
195
|
+
# query parameters
|
196
|
+
query_params = opts[:query_params] || {}
|
197
|
+
|
198
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
199
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
200
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
201
|
+
|
202
|
+
# header parameters
|
203
|
+
header_params = opts[:header_params] || {}
|
204
|
+
# HTTP header 'Accept' (if needed)
|
205
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
206
|
+
# HTTP header 'Content-Type'
|
207
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
208
|
+
|
209
|
+
# form parameters
|
210
|
+
form_params = opts[:form_params] || {}
|
211
|
+
|
212
|
+
# http body (model)
|
213
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_usage_record)
|
214
|
+
|
215
|
+
# return_type
|
216
|
+
return_type = opts[:return_type] || 'UsageRecord'
|
217
|
+
|
218
|
+
# auth_names
|
219
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
220
|
+
|
221
|
+
new_options = opts.merge(
|
222
|
+
:header_params => header_params,
|
223
|
+
:query_params => query_params,
|
224
|
+
:form_params => form_params,
|
225
|
+
:body => post_body,
|
226
|
+
:auth_names => auth_names,
|
227
|
+
:return_type => return_type
|
228
|
+
)
|
229
|
+
|
230
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AppStoreApi", new_options)
|
231
|
+
if @api_client.config.debugging
|
232
|
+
@api_client.config.logger.debug "API called: AppStoreApi#post_usage_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
233
|
+
end
|
234
|
+
return data, status_code, headers
|
235
|
+
end
|
236
|
+
|
237
|
+
# Update and existing metered usage belonging to this subscription and subscription item
|
238
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
239
|
+
# @param subscription_item_id [String] The unique identifier of the subscriptionItem
|
240
|
+
# @param usage_record_id [String] The unique identifier of the usage record
|
241
|
+
# @param update_usage_record [UpdateUsageRecord] Contains the quantity for the usage record to update
|
242
|
+
# @param [Hash] opts the optional parameters
|
243
|
+
# @return [UsageRecord]
|
244
|
+
def put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record, opts = {})
|
245
|
+
data, _status_code, _headers = put_usage_records_with_http_info(subscription_id, subscription_item_id, usage_record_id, update_usage_record, opts)
|
246
|
+
data
|
247
|
+
end
|
248
|
+
|
249
|
+
# Update and existing metered usage belonging to this subscription and subscription item
|
250
|
+
# @param subscription_id [String] Unique identifier for Subscription object
|
251
|
+
# @param subscription_item_id [String] The unique identifier of the subscriptionItem
|
252
|
+
# @param usage_record_id [String] The unique identifier of the usage record
|
253
|
+
# @param update_usage_record [UpdateUsageRecord] Contains the quantity for the usage record to update
|
254
|
+
# @param [Hash] opts the optional parameters
|
255
|
+
# @return [Array<(UsageRecord, Integer, Hash)>] UsageRecord data, response status code and response headers
|
256
|
+
def put_usage_records_with_http_info(subscription_id, subscription_item_id, usage_record_id, update_usage_record, options = {})
|
257
|
+
opts = options.dup
|
258
|
+
if @api_client.config.debugging
|
259
|
+
@api_client.config.logger.debug 'Calling API: AppStoreApi.put_usage_records ...'
|
260
|
+
end
|
261
|
+
# verify the required parameter 'subscription_id' is set
|
262
|
+
if @api_client.config.client_side_validation && subscription_id.nil?
|
263
|
+
fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AppStoreApi.put_usage_records"
|
264
|
+
end
|
265
|
+
# verify the required parameter 'subscription_item_id' is set
|
266
|
+
if @api_client.config.client_side_validation && subscription_item_id.nil?
|
267
|
+
fail ArgumentError, "Missing the required parameter 'subscription_item_id' when calling AppStoreApi.put_usage_records"
|
268
|
+
end
|
269
|
+
# verify the required parameter 'usage_record_id' is set
|
270
|
+
if @api_client.config.client_side_validation && usage_record_id.nil?
|
271
|
+
fail ArgumentError, "Missing the required parameter 'usage_record_id' when calling AppStoreApi.put_usage_records"
|
272
|
+
end
|
273
|
+
# verify the required parameter 'update_usage_record' is set
|
274
|
+
if @api_client.config.client_side_validation && update_usage_record.nil?
|
275
|
+
fail ArgumentError, "Missing the required parameter 'update_usage_record' when calling AppStoreApi.put_usage_records"
|
276
|
+
end
|
277
|
+
# resource path
|
278
|
+
local_var_path = '/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'subscriptionItemId' + '}', subscription_item_id.to_s).sub('{' + 'usageRecordId' + '}', usage_record_id.to_s)
|
279
|
+
|
280
|
+
# camelize keys of incoming `where` opts
|
281
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
282
|
+
|
283
|
+
# query parameters
|
284
|
+
query_params = opts[:query_params] || {}
|
285
|
+
|
286
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
287
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
288
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
289
|
+
|
290
|
+
# header parameters
|
291
|
+
header_params = opts[:header_params] || {}
|
292
|
+
# HTTP header 'Accept' (if needed)
|
293
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
294
|
+
# HTTP header 'Content-Type'
|
295
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
296
|
+
|
297
|
+
# form parameters
|
298
|
+
form_params = opts[:form_params] || {}
|
299
|
+
|
300
|
+
# http body (model)
|
301
|
+
post_body = opts[:body] || @api_client.object_to_http_body(update_usage_record)
|
302
|
+
|
303
|
+
# return_type
|
304
|
+
return_type = opts[:return_type] || 'UsageRecord'
|
305
|
+
|
306
|
+
# auth_names
|
307
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
308
|
+
|
309
|
+
new_options = opts.merge(
|
310
|
+
:header_params => header_params,
|
311
|
+
:query_params => query_params,
|
312
|
+
:form_params => form_params,
|
313
|
+
:body => post_body,
|
314
|
+
:auth_names => auth_names,
|
315
|
+
:return_type => return_type
|
316
|
+
)
|
317
|
+
|
318
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AppStoreApi", new_options)
|
319
|
+
if @api_client.config.debugging
|
320
|
+
@api_client.config.logger.debug "API called: AppStoreApi#put_usage_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
321
|
+
end
|
322
|
+
return data, status_code, headers
|
323
|
+
end
|
86
324
|
end
|
87
325
|
end
|
@@ -99,10 +99,10 @@ module XeroRuby
|
|
99
99
|
# @param project_id [String] You can create a task on a specified projectId
|
100
100
|
# @param task_create_or_update [TaskCreateOrUpdate] The task object you are creating
|
101
101
|
# @param [Hash] opts the optional parameters
|
102
|
-
# @return [
|
102
|
+
# @return [Task]
|
103
103
|
def create_task(xero_tenant_id, project_id, task_create_or_update, opts = {})
|
104
|
-
create_task_with_http_info(xero_tenant_id, project_id, task_create_or_update, opts)
|
105
|
-
|
104
|
+
data, _status_code, _headers = create_task_with_http_info(xero_tenant_id, project_id, task_create_or_update, opts)
|
105
|
+
data
|
106
106
|
end
|
107
107
|
|
108
108
|
# Allows you to create a task
|
@@ -111,7 +111,7 @@ module XeroRuby
|
|
111
111
|
# @param project_id [String] You can create a task on a specified projectId
|
112
112
|
# @param task_create_or_update [TaskCreateOrUpdate] The task object you are creating
|
113
113
|
# @param [Hash] opts the optional parameters
|
114
|
-
# @return [Array<(
|
114
|
+
# @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers
|
115
115
|
def create_task_with_http_info(xero_tenant_id, project_id, task_create_or_update, options = {})
|
116
116
|
opts = options.dup
|
117
117
|
if @api_client.config.debugging
|
@@ -157,7 +157,7 @@ module XeroRuby
|
|
157
157
|
post_body = opts[:body] || @api_client.object_to_http_body(task_create_or_update)
|
158
158
|
|
159
159
|
# return_type
|
160
|
-
return_type = opts[:return_type]
|
160
|
+
return_type = opts[:return_type] || 'Task'
|
161
161
|
|
162
162
|
# auth_names
|
163
163
|
auth_names = opts[:auth_names] || ['OAuth2']
|
@@ -775,7 +775,7 @@ module XeroRuby
|
|
775
775
|
# @param [Hash] opts the optional parameters
|
776
776
|
# @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.
|
777
777
|
# @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.
|
778
|
-
# @option opts [String] :task_ids
|
778
|
+
# @option opts [String] :task_ids Search for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskID},{taskID}
|
779
779
|
# @option opts [ChargeType] :charge_type
|
780
780
|
# @return [Tasks]
|
781
781
|
def get_tasks(xero_tenant_id, project_id, opts = {})
|
@@ -790,7 +790,7 @@ module XeroRuby
|
|
790
790
|
# @param [Hash] opts the optional parameters
|
791
791
|
# @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.
|
792
792
|
# @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.
|
793
|
-
# @option opts [String] :task_ids
|
793
|
+
# @option opts [String] :task_ids Search for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds={taskID},{taskID}
|
794
794
|
# @option opts [ChargeType] :charge_type
|
795
795
|
# @return [Array<(Tasks, Integer, Hash)>] Tasks data, response status code and response headers
|
796
796
|
def get_tasks_with_http_info(xero_tenant_id, project_id, options = {})
|
data/lib/xero-ruby/api_client.rb
CHANGED
@@ -196,7 +196,12 @@ module XeroRuby
|
|
196
196
|
|
197
197
|
def decode_jwt(tkn, verify=true)
|
198
198
|
if verify == true
|
199
|
-
|
199
|
+
|
200
|
+
response = Faraday.get('https://identity.xero.com/.well-known/openid-configuration/jwks') do |req|
|
201
|
+
req.headers['User-Agent'] = @user_agent
|
202
|
+
end
|
203
|
+
|
204
|
+
jwks_data = JSON.parse(response.body)
|
200
205
|
jwk_set = JSON::JWK::Set.new(jwks_data)
|
201
206
|
JSON::JWT.decode(tkn, jwk_set)
|
202
207
|
else
|
@@ -230,6 +235,7 @@ module XeroRuby
|
|
230
235
|
response = Faraday.post("#{@config.token_url}#{path}") do |req|
|
231
236
|
req.headers['Authorization'] = "Basic " + Base64.strict_encode64("#{@client_id}:#{@client_secret}")
|
232
237
|
req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
|
238
|
+
req.headers['User-Agent'] = @user_agent
|
233
239
|
req.body = URI.encode_www_form(data)
|
234
240
|
end
|
235
241
|
return_error(response) unless response.success?
|
@@ -132,9 +132,9 @@ module XeroRuby::Accounting
|
|
132
132
|
:'payments' => :'Array<Payment>',
|
133
133
|
:'type' => :'String',
|
134
134
|
:'status' => :'String',
|
135
|
-
:'total_amount' => :'
|
135
|
+
:'total_amount' => :'BigDecimal',
|
136
136
|
:'updated_date_utc' => :'DateTime',
|
137
|
-
:'is_reconciled' => :'
|
137
|
+
:'is_reconciled' => :'Boolean',
|
138
138
|
:'validation_errors' => :'Array<ValidationError>'
|
139
139
|
}
|
140
140
|
end
|
@@ -46,7 +46,7 @@ module XeroRuby::Accounting
|
|
46
46
|
|
47
47
|
attr_accessor :item
|
48
48
|
|
49
|
-
# If you wish to omit either
|
49
|
+
# 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
|
50
50
|
attr_accessor :line_amount
|
51
51
|
|
52
52
|
# Optional Tracking Category – see Tracking. Any LineItem can have a maximum of 2 <TrackingCategory> elements.
|
@@ -55,7 +55,7 @@ module XeroRuby::Accounting
|
|
55
55
|
# 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
|
56
56
|
attr_accessor :discount_rate
|
57
57
|
|
58
|
-
# Discount amount being applied to a line item. Only supported on ACCREC invoices
|
58
|
+
# 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.
|
59
59
|
attr_accessor :discount_amount
|
60
60
|
|
61
61
|
# The Xero identifier for a Repeating Invoice
|
@@ -167,6 +167,7 @@ module XeroRuby::Accounting
|
|
167
167
|
GST_CASHBOOK ||= "GST_CASHBOOK".freeze
|
168
168
|
NON_GST_CASHBOOK ||= "NON_GST_CASHBOOK".freeze
|
169
169
|
ULTIMATE ||= "ULTIMATE".freeze
|
170
|
+
LITE ||= "LITE".freeze
|
170
171
|
|
171
172
|
# BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing)
|
172
173
|
attr_accessor :edition
|
@@ -462,7 +463,7 @@ module XeroRuby::Accounting
|
|
462
463
|
return false unless sales_tax_period_validator.valid?(@sales_tax_period)
|
463
464
|
organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
|
464
465
|
return false unless organisation_entity_type_validator.valid?(@organisation_entity_type)
|
465
|
-
_class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE"])
|
466
|
+
_class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE"])
|
466
467
|
return false unless _class_validator.valid?(@_class)
|
467
468
|
edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"])
|
468
469
|
return false unless edition_validator.valid?(@edition)
|
@@ -522,7 +523,7 @@ module XeroRuby::Accounting
|
|
522
523
|
# Custom attribute writer method checking allowed values (enum).
|
523
524
|
# @param [Object] _class Object to be assigned
|
524
525
|
def _class=(_class)
|
525
|
-
validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE"])
|
526
|
+
validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE"])
|
526
527
|
unless validator.valid?(_class)
|
527
528
|
fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
|
528
529
|
end
|
@@ -35,6 +35,9 @@ module XeroRuby::Accounting
|
|
35
35
|
attr_accessor :credit_note_number
|
36
36
|
|
37
37
|
|
38
|
+
attr_accessor :batch_payment
|
39
|
+
|
40
|
+
|
38
41
|
attr_accessor :account
|
39
42
|
|
40
43
|
# Code of account you are using to make the payment e.g. 001 (note- not all accounts have a code value)
|
@@ -135,6 +138,7 @@ module XeroRuby::Accounting
|
|
135
138
|
:'overpayment' => :'Overpayment',
|
136
139
|
:'invoice_number' => :'InvoiceNumber',
|
137
140
|
:'credit_note_number' => :'CreditNoteNumber',
|
141
|
+
:'batch_payment' => :'BatchPayment',
|
138
142
|
:'account' => :'Account',
|
139
143
|
:'code' => :'Code',
|
140
144
|
:'date' => :'Date',
|
@@ -167,6 +171,7 @@ module XeroRuby::Accounting
|
|
167
171
|
:'overpayment' => :'Overpayment',
|
168
172
|
:'invoice_number' => :'String',
|
169
173
|
:'credit_note_number' => :'String',
|
174
|
+
:'batch_payment' => :'BatchPayment',
|
170
175
|
:'account' => :'Account',
|
171
176
|
:'code' => :'String',
|
172
177
|
:'date' => :'Date',
|
@@ -229,6 +234,10 @@ module XeroRuby::Accounting
|
|
229
234
|
self.credit_note_number = attributes[:'credit_note_number']
|
230
235
|
end
|
231
236
|
|
237
|
+
if attributes.key?(:'batch_payment')
|
238
|
+
self.batch_payment = attributes[:'batch_payment']
|
239
|
+
end
|
240
|
+
|
232
241
|
if attributes.key?(:'account')
|
233
242
|
self.account = attributes[:'account']
|
234
243
|
end
|
@@ -364,6 +373,7 @@ module XeroRuby::Accounting
|
|
364
373
|
overpayment == o.overpayment &&
|
365
374
|
invoice_number == o.invoice_number &&
|
366
375
|
credit_note_number == o.credit_note_number &&
|
376
|
+
batch_payment == o.batch_payment &&
|
367
377
|
account == o.account &&
|
368
378
|
code == o.code &&
|
369
379
|
date == o.date &&
|
@@ -395,7 +405,7 @@ module XeroRuby::Accounting
|
|
395
405
|
# Calculates hash code according to all attributes.
|
396
406
|
# @return [Integer] Hash code
|
397
407
|
def hash
|
398
|
-
[invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, account, code, date, currency_rate, amount, bank_amount, reference, is_reconciled, status, payment_type, updated_date_utc, payment_id, batch_payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors].hash
|
408
|
+
[invoice, credit_note, prepayment, overpayment, invoice_number, credit_note_number, batch_payment, account, code, date, currency_rate, amount, bank_amount, reference, is_reconciled, status, payment_type, updated_date_utc, payment_id, batch_payment_id, bank_account_number, particulars, details, has_account, has_validation_errors, status_attribute_string, validation_errors].hash
|
399
409
|
end
|
400
410
|
|
401
411
|
# Builds the object from hash
|