xero-ruby 4.3.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xero-ruby/api/accounting_api.rb +540 -0
- data/lib/xero-ruby/api/app_store_api.rb +6 -0
- data/lib/xero-ruby/api/asset_api.rb +16 -6
- data/lib/xero-ruby/api/files_api.rb +76 -18
- data/lib/xero-ruby/api/payroll_au_api.rb +95 -30
- data/lib/xero-ruby/api/payroll_nz_api.rb +87 -0
- data/lib/xero-ruby/api/payroll_uk_api.rb +81 -0
- data/lib/xero-ruby/api/project_api.rb +21 -0
- data/lib/xero-ruby/models/accounting/account_type.rb +0 -4
- data/lib/xero-ruby/models/accounting/allocation.rb +21 -1
- data/lib/xero-ruby/models/accounting/contact.rb +1 -11
- data/lib/xero-ruby/models/accounting/currency_code.rb +0 -1
- data/lib/xero-ruby/models/accounting/tax_rate.rb +3 -2
- data/lib/xero-ruby/models/accounting/tax_type.rb +24 -0
- data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +75 -4
- data/lib/xero-ruby/models/finance/problem_type.rb +1 -0
- data/lib/xero-ruby/models/payroll_au/country_of_residence.rb +0 -1
- data/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb +0 -1
- data/lib/xero-ruby/models/payroll_au/leave_period_status.rb +2 -0
- data/lib/xero-ruby/models/payroll_nz/employee.rb +14 -4
- data/lib/xero-ruby/models/projects/currency_code.rb +0 -1
- data/lib/xero-ruby/version.rb +2 -2
- metadata +9 -9
@@ -157,6 +157,7 @@ module XeroRuby
|
|
157
157
|
# @param subscription_item_id [String] The unique identifier of the subscriptionItem
|
158
158
|
# @param create_usage_record [CreateUsageRecord] Contains the quantity for the usage record to create
|
159
159
|
# @param [Hash] opts the optional parameters
|
160
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
160
161
|
# @return [UsageRecord]
|
161
162
|
def post_usage_records(subscription_id, subscription_item_id, create_usage_record, opts = {})
|
162
163
|
data, _status_code, _headers = post_usage_records_with_http_info(subscription_id, subscription_item_id, create_usage_record, opts)
|
@@ -168,6 +169,7 @@ module XeroRuby
|
|
168
169
|
# @param subscription_item_id [String] The unique identifier of the subscriptionItem
|
169
170
|
# @param create_usage_record [CreateUsageRecord] Contains the quantity for the usage record to create
|
170
171
|
# @param [Hash] opts the optional parameters
|
172
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
171
173
|
# @return [Array<(UsageRecord, Integer, Hash)>] UsageRecord data, response status code and response headers
|
172
174
|
def post_usage_records_with_http_info(subscription_id, subscription_item_id, create_usage_record, options = {})
|
173
175
|
opts = options.dup
|
@@ -205,6 +207,7 @@ module XeroRuby
|
|
205
207
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
206
208
|
# HTTP header 'Content-Type'
|
207
209
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
210
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
208
211
|
|
209
212
|
# form parameters
|
210
213
|
form_params = opts[:form_params] || {}
|
@@ -240,6 +243,7 @@ module XeroRuby
|
|
240
243
|
# @param usage_record_id [String] The unique identifier of the usage record
|
241
244
|
# @param update_usage_record [UpdateUsageRecord] Contains the quantity for the usage record to update
|
242
245
|
# @param [Hash] opts the optional parameters
|
246
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
243
247
|
# @return [UsageRecord]
|
244
248
|
def put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record, opts = {})
|
245
249
|
data, _status_code, _headers = put_usage_records_with_http_info(subscription_id, subscription_item_id, usage_record_id, update_usage_record, opts)
|
@@ -252,6 +256,7 @@ module XeroRuby
|
|
252
256
|
# @param usage_record_id [String] The unique identifier of the usage record
|
253
257
|
# @param update_usage_record [UpdateUsageRecord] Contains the quantity for the usage record to update
|
254
258
|
# @param [Hash] opts the optional parameters
|
259
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
255
260
|
# @return [Array<(UsageRecord, Integer, Hash)>] UsageRecord data, response status code and response headers
|
256
261
|
def put_usage_records_with_http_info(subscription_id, subscription_item_id, usage_record_id, update_usage_record, options = {})
|
257
262
|
opts = options.dup
|
@@ -293,6 +298,7 @@ module XeroRuby
|
|
293
298
|
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
294
299
|
# HTTP header 'Content-Type'
|
295
300
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
301
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
296
302
|
|
297
303
|
# form parameters
|
298
304
|
form_params = opts[:form_params] || {}
|
@@ -21,6 +21,7 @@ module XeroRuby
|
|
21
21
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
22
22
|
# @param asset [Asset] Fixed asset you are creating
|
23
23
|
# @param [Hash] opts the optional parameters
|
24
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
24
25
|
# @return [Asset]
|
25
26
|
def create_asset(xero_tenant_id, asset, opts = {})
|
26
27
|
data, _status_code, _headers = create_asset_with_http_info(xero_tenant_id, asset, opts)
|
@@ -32,6 +33,7 @@ module XeroRuby
|
|
32
33
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
33
34
|
# @param asset [Asset] Fixed asset you are creating
|
34
35
|
# @param [Hash] opts the optional parameters
|
36
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
35
37
|
# @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers
|
36
38
|
def create_asset_with_http_info(xero_tenant_id, asset, options = {})
|
37
39
|
opts = options.dup
|
@@ -66,6 +68,7 @@ module XeroRuby
|
|
66
68
|
# HTTP header 'Content-Type'
|
67
69
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
68
70
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
71
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
69
72
|
|
70
73
|
# form parameters
|
71
74
|
form_params = opts[:form_params] || {}
|
@@ -98,21 +101,23 @@ module XeroRuby
|
|
98
101
|
# adds a fixed asset type
|
99
102
|
# Adds an fixed asset type to the system
|
100
103
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
104
|
+
# @param asset_type [AssetType] Asset type to add
|
101
105
|
# @param [Hash] opts the optional parameters
|
102
|
-
# @option opts [
|
106
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
103
107
|
# @return [AssetType]
|
104
|
-
def create_asset_type(xero_tenant_id, opts = {})
|
105
|
-
data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, opts)
|
108
|
+
def create_asset_type(xero_tenant_id, asset_type, opts = {})
|
109
|
+
data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, asset_type, opts)
|
106
110
|
data
|
107
111
|
end
|
108
112
|
|
109
113
|
# adds a fixed asset type
|
110
114
|
# Adds an fixed asset type to the system
|
111
115
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
116
|
+
# @param asset_type [AssetType] Asset type to add
|
112
117
|
# @param [Hash] opts the optional parameters
|
113
|
-
# @option opts [
|
118
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
114
119
|
# @return [Array<(AssetType, Integer, Hash)>] AssetType data, response status code and response headers
|
115
|
-
def create_asset_type_with_http_info(xero_tenant_id, options = {})
|
120
|
+
def create_asset_type_with_http_info(xero_tenant_id, asset_type, options = {})
|
116
121
|
opts = options.dup
|
117
122
|
if @api_client.config.debugging
|
118
123
|
@api_client.config.logger.debug 'Calling API: AssetApi.create_asset_type ...'
|
@@ -121,6 +126,10 @@ module XeroRuby
|
|
121
126
|
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
122
127
|
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset_type"
|
123
128
|
end
|
129
|
+
# verify the required parameter 'asset_type' is set
|
130
|
+
if @api_client.config.client_side_validation && asset_type.nil?
|
131
|
+
fail ArgumentError, "Missing the required parameter 'asset_type' when calling AssetApi.create_asset_type"
|
132
|
+
end
|
124
133
|
# resource path
|
125
134
|
local_var_path = '/AssetTypes'
|
126
135
|
|
@@ -141,12 +150,13 @@ module XeroRuby
|
|
141
150
|
# HTTP header 'Content-Type'
|
142
151
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
143
152
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
153
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
144
154
|
|
145
155
|
# form parameters
|
146
156
|
form_params = opts[:form_params] || {}
|
147
157
|
|
148
158
|
# http body (model)
|
149
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
159
|
+
post_body = opts[:body] || @api_client.object_to_http_body(asset_type)
|
150
160
|
|
151
161
|
# return_type
|
152
162
|
return_type = opts[:return_type] || 'AssetType'
|
@@ -20,11 +20,12 @@ module XeroRuby
|
|
20
20
|
# By passing in the appropriate options, you can create a new folder
|
21
21
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
22
22
|
# @param file_id [String] File id for single object
|
23
|
+
# @param association [Association]
|
23
24
|
# @param [Hash] opts the optional parameters
|
24
|
-
# @option opts [
|
25
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
25
26
|
# @return [Association]
|
26
|
-
def create_file_association(xero_tenant_id, file_id, opts = {})
|
27
|
-
data, _status_code, _headers = create_file_association_with_http_info(xero_tenant_id, file_id, opts)
|
27
|
+
def create_file_association(xero_tenant_id, file_id, association, opts = {})
|
28
|
+
data, _status_code, _headers = create_file_association_with_http_info(xero_tenant_id, file_id, association, opts)
|
28
29
|
data
|
29
30
|
end
|
30
31
|
|
@@ -32,10 +33,11 @@ module XeroRuby
|
|
32
33
|
# By passing in the appropriate options, you can create a new folder
|
33
34
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
34
35
|
# @param file_id [String] File id for single object
|
36
|
+
# @param association [Association]
|
35
37
|
# @param [Hash] opts the optional parameters
|
36
|
-
# @option opts [
|
38
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
37
39
|
# @return [Array<(Association, Integer, Hash)>] Association data, response status code and response headers
|
38
|
-
def create_file_association_with_http_info(xero_tenant_id, file_id, options = {})
|
40
|
+
def create_file_association_with_http_info(xero_tenant_id, file_id, association, options = {})
|
39
41
|
opts = options.dup
|
40
42
|
if @api_client.config.debugging
|
41
43
|
@api_client.config.logger.debug 'Calling API: FilesApi.create_file_association ...'
|
@@ -48,6 +50,10 @@ module XeroRuby
|
|
48
50
|
if @api_client.config.client_side_validation && file_id.nil?
|
49
51
|
fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.create_file_association"
|
50
52
|
end
|
53
|
+
# verify the required parameter 'association' is set
|
54
|
+
if @api_client.config.client_side_validation && association.nil?
|
55
|
+
fail ArgumentError, "Missing the required parameter 'association' when calling FilesApi.create_file_association"
|
56
|
+
end
|
51
57
|
# resource path
|
52
58
|
local_var_path = '/Files/{FileId}/Associations'.sub('{' + 'FileId' + '}', file_id.to_s)
|
53
59
|
|
@@ -68,12 +74,13 @@ module XeroRuby
|
|
68
74
|
# HTTP header 'Content-Type'
|
69
75
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
70
76
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
77
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
71
78
|
|
72
79
|
# form parameters
|
73
80
|
form_params = opts[:form_params] || {}
|
74
81
|
|
75
82
|
# http body (model)
|
76
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
83
|
+
post_body = opts[:body] || @api_client.object_to_http_body(association)
|
77
84
|
|
78
85
|
# return_type
|
79
86
|
return_type = opts[:return_type] || 'Association'
|
@@ -100,21 +107,23 @@ module XeroRuby
|
|
100
107
|
# Creates a new folder
|
101
108
|
# By passing in the appropriate properties, you can create a new folder
|
102
109
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
110
|
+
# @param folder [Folder]
|
103
111
|
# @param [Hash] opts the optional parameters
|
104
|
-
# @option opts [
|
112
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
105
113
|
# @return [Folder]
|
106
|
-
def create_folder(xero_tenant_id, opts = {})
|
107
|
-
data, _status_code, _headers = create_folder_with_http_info(xero_tenant_id, opts)
|
114
|
+
def create_folder(xero_tenant_id, folder, opts = {})
|
115
|
+
data, _status_code, _headers = create_folder_with_http_info(xero_tenant_id, folder, opts)
|
108
116
|
data
|
109
117
|
end
|
110
118
|
|
111
119
|
# Creates a new folder
|
112
120
|
# By passing in the appropriate properties, you can create a new folder
|
113
121
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
122
|
+
# @param folder [Folder]
|
114
123
|
# @param [Hash] opts the optional parameters
|
115
|
-
# @option opts [
|
124
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
116
125
|
# @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
|
117
|
-
def create_folder_with_http_info(xero_tenant_id, options = {})
|
126
|
+
def create_folder_with_http_info(xero_tenant_id, folder, options = {})
|
118
127
|
opts = options.dup
|
119
128
|
if @api_client.config.debugging
|
120
129
|
@api_client.config.logger.debug 'Calling API: FilesApi.create_folder ...'
|
@@ -123,6 +132,10 @@ module XeroRuby
|
|
123
132
|
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
124
133
|
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.create_folder"
|
125
134
|
end
|
135
|
+
# verify the required parameter 'folder' is set
|
136
|
+
if @api_client.config.client_side_validation && folder.nil?
|
137
|
+
fail ArgumentError, "Missing the required parameter 'folder' when calling FilesApi.create_folder"
|
138
|
+
end
|
126
139
|
# resource path
|
127
140
|
local_var_path = '/Folders'
|
128
141
|
|
@@ -143,12 +156,13 @@ module XeroRuby
|
|
143
156
|
# HTTP header 'Content-Type'
|
144
157
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
145
158
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
159
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
146
160
|
|
147
161
|
# form parameters
|
148
162
|
form_params = opts[:form_params] || {}
|
149
163
|
|
150
164
|
# http body (model)
|
151
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
165
|
+
post_body = opts[:body] || @api_client.object_to_http_body(folder)
|
152
166
|
|
153
167
|
# return_type
|
154
168
|
return_type = opts[:return_type] || 'Folder'
|
@@ -408,6 +422,10 @@ module XeroRuby
|
|
408
422
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
409
423
|
# @param object_id [String] Object id for single object
|
410
424
|
# @param [Hash] opts the optional parameters
|
425
|
+
# @option opts [Integer] :pagesize pass an optional page size value
|
426
|
+
# @option opts [Integer] :page number of records to skip for pagination
|
427
|
+
# @option opts [String] :sort values to sort by
|
428
|
+
# @option opts [String] :direction direction to sort by
|
411
429
|
# @return [Array<Association>]
|
412
430
|
def get_associations_by_object(xero_tenant_id, object_id, opts = {})
|
413
431
|
data, _status_code, _headers = get_associations_by_object_with_http_info(xero_tenant_id, object_id, opts)
|
@@ -419,6 +437,10 @@ module XeroRuby
|
|
419
437
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
420
438
|
# @param object_id [String] Object id for single object
|
421
439
|
# @param [Hash] opts the optional parameters
|
440
|
+
# @option opts [Integer] :pagesize pass an optional page size value
|
441
|
+
# @option opts [Integer] :page number of records to skip for pagination
|
442
|
+
# @option opts [String] :sort values to sort by
|
443
|
+
# @option opts [String] :direction direction to sort by
|
422
444
|
# @return [Array<(Array<Association>, Integer, Hash)>] Array<Association> data, response status code and response headers
|
423
445
|
def get_associations_by_object_with_http_info(xero_tenant_id, object_id, options = {})
|
424
446
|
opts = options.dup
|
@@ -433,6 +455,22 @@ module XeroRuby
|
|
433
455
|
if @api_client.config.client_side_validation && object_id.nil?
|
434
456
|
fail ArgumentError, "Missing the required parameter 'object_id' when calling FilesApi.get_associations_by_object"
|
435
457
|
end
|
458
|
+
if @api_client.config.client_side_validation && !opts[:'pagesize'].nil? && opts[:'pagesize'] > 100
|
459
|
+
fail ArgumentError, 'invalid value for "opts[:"pagesize"]" when calling FilesApi.get_associations_by_object, must be smaller than or equal to 100.'
|
460
|
+
end
|
461
|
+
|
462
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'] < 1
|
463
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling FilesApi.get_associations_by_object, must be greater than or equal to 1.'
|
464
|
+
end
|
465
|
+
|
466
|
+
allowable_values = ["Name", "CreatedDateUTC"]
|
467
|
+
if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
|
468
|
+
fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
|
469
|
+
end
|
470
|
+
allowable_values = ["ASC", "DESC"]
|
471
|
+
if @api_client.config.client_side_validation && opts[:'direction'] && !allowable_values.include?(opts[:'direction'])
|
472
|
+
fail ArgumentError, "invalid value for \"direction\", must be one of #{allowable_values}"
|
473
|
+
end
|
436
474
|
# resource path
|
437
475
|
local_var_path = '/Associations/{ObjectId}'.sub('{' + 'ObjectId' + '}', object_id.to_s)
|
438
476
|
|
@@ -441,6 +479,10 @@ module XeroRuby
|
|
441
479
|
|
442
480
|
# query parameters
|
443
481
|
query_params = opts[:query_params] || {}
|
482
|
+
query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil?
|
483
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
484
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
485
|
+
query_params[:'direction'] = opts[:'direction'] if !opts[:'direction'].nil?
|
444
486
|
|
445
487
|
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
446
488
|
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
@@ -1107,11 +1149,12 @@ module XeroRuby
|
|
1107
1149
|
# Updates file properties of a single file
|
1108
1150
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1109
1151
|
# @param file_id [String] File id for single object
|
1152
|
+
# @param file_object [FileObject]
|
1110
1153
|
# @param [Hash] opts the optional parameters
|
1111
|
-
# @option opts [
|
1154
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1112
1155
|
# @return [FileObject]
|
1113
|
-
def update_file(xero_tenant_id, file_id, opts = {})
|
1114
|
-
data, _status_code, _headers = update_file_with_http_info(xero_tenant_id, file_id, opts)
|
1156
|
+
def update_file(xero_tenant_id, file_id, file_object, opts = {})
|
1157
|
+
data, _status_code, _headers = update_file_with_http_info(xero_tenant_id, file_id, file_object, opts)
|
1115
1158
|
data
|
1116
1159
|
end
|
1117
1160
|
|
@@ -1119,10 +1162,11 @@ module XeroRuby
|
|
1119
1162
|
# Updates file properties of a single file
|
1120
1163
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1121
1164
|
# @param file_id [String] File id for single object
|
1165
|
+
# @param file_object [FileObject]
|
1122
1166
|
# @param [Hash] opts the optional parameters
|
1123
|
-
# @option opts [
|
1167
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1124
1168
|
# @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers
|
1125
|
-
def update_file_with_http_info(xero_tenant_id, file_id, options = {})
|
1169
|
+
def update_file_with_http_info(xero_tenant_id, file_id, file_object, options = {})
|
1126
1170
|
opts = options.dup
|
1127
1171
|
if @api_client.config.debugging
|
1128
1172
|
@api_client.config.logger.debug 'Calling API: FilesApi.update_file ...'
|
@@ -1135,6 +1179,10 @@ module XeroRuby
|
|
1135
1179
|
if @api_client.config.client_side_validation && file_id.nil?
|
1136
1180
|
fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.update_file"
|
1137
1181
|
end
|
1182
|
+
# verify the required parameter 'file_object' is set
|
1183
|
+
if @api_client.config.client_side_validation && file_object.nil?
|
1184
|
+
fail ArgumentError, "Missing the required parameter 'file_object' when calling FilesApi.update_file"
|
1185
|
+
end
|
1138
1186
|
# resource path
|
1139
1187
|
local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s)
|
1140
1188
|
|
@@ -1155,12 +1203,13 @@ module XeroRuby
|
|
1155
1203
|
# HTTP header 'Content-Type'
|
1156
1204
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1157
1205
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1206
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1158
1207
|
|
1159
1208
|
# form parameters
|
1160
1209
|
form_params = opts[:form_params] || {}
|
1161
1210
|
|
1162
1211
|
# http body (model)
|
1163
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
1212
|
+
post_body = opts[:body] || @api_client.object_to_http_body(file_object)
|
1164
1213
|
|
1165
1214
|
# return_type
|
1166
1215
|
return_type = opts[:return_type] || 'FileObject'
|
@@ -1190,6 +1239,7 @@ module XeroRuby
|
|
1190
1239
|
# @param folder_id [String] Folder id for single object
|
1191
1240
|
# @param folder [Folder]
|
1192
1241
|
# @param [Hash] opts the optional parameters
|
1242
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1193
1243
|
# @return [Folder]
|
1194
1244
|
def update_folder(xero_tenant_id, folder_id, folder, opts = {})
|
1195
1245
|
data, _status_code, _headers = update_folder_with_http_info(xero_tenant_id, folder_id, folder, opts)
|
@@ -1202,6 +1252,7 @@ module XeroRuby
|
|
1202
1252
|
# @param folder_id [String] Folder id for single object
|
1203
1253
|
# @param folder [Folder]
|
1204
1254
|
# @param [Hash] opts the optional parameters
|
1255
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1205
1256
|
# @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
|
1206
1257
|
def update_folder_with_http_info(xero_tenant_id, folder_id, folder, options = {})
|
1207
1258
|
opts = options.dup
|
@@ -1240,6 +1291,7 @@ module XeroRuby
|
|
1240
1291
|
# HTTP header 'Content-Type'
|
1241
1292
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1242
1293
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1294
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1243
1295
|
|
1244
1296
|
# form parameters
|
1245
1297
|
form_params = opts[:form_params] || {}
|
@@ -1275,6 +1327,7 @@ module XeroRuby
|
|
1275
1327
|
# @param name [String] exact name of the file you are uploading
|
1276
1328
|
# @param filename [String]
|
1277
1329
|
# @param [Hash] opts the optional parameters
|
1330
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1278
1331
|
# @option opts [String] :mime_type
|
1279
1332
|
# @return [FileObject]
|
1280
1333
|
def upload_file(xero_tenant_id, body, name, filename, opts = {})
|
@@ -1288,6 +1341,7 @@ module XeroRuby
|
|
1288
1341
|
# @param name [String] exact name of the file you are uploading
|
1289
1342
|
# @param filename [String]
|
1290
1343
|
# @param [Hash] opts the optional parameters
|
1344
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1291
1345
|
# @option opts [String] :mime_type
|
1292
1346
|
# @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers
|
1293
1347
|
def upload_file_with_http_info(xero_tenant_id, body, name, filename, options = {})
|
@@ -1331,6 +1385,7 @@ module XeroRuby
|
|
1331
1385
|
# HTTP header 'Content-Type'
|
1332
1386
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
1333
1387
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1388
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1334
1389
|
|
1335
1390
|
# form parameters
|
1336
1391
|
form_params = opts[:form_params] || {}
|
@@ -1371,6 +1426,7 @@ module XeroRuby
|
|
1371
1426
|
# @param name [String] exact name of the file you are uploading
|
1372
1427
|
# @param filename [String]
|
1373
1428
|
# @param [Hash] opts the optional parameters
|
1429
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1374
1430
|
# @option opts [String] :mime_type
|
1375
1431
|
# @return [FileObject]
|
1376
1432
|
def upload_file_to_folder(xero_tenant_id, folder_id, body, name, filename, opts = {})
|
@@ -1385,6 +1441,7 @@ module XeroRuby
|
|
1385
1441
|
# @param name [String] exact name of the file you are uploading
|
1386
1442
|
# @param filename [String]
|
1387
1443
|
# @param [Hash] opts the optional parameters
|
1444
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1388
1445
|
# @option opts [String] :mime_type
|
1389
1446
|
# @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers
|
1390
1447
|
def upload_file_to_folder_with_http_info(xero_tenant_id, folder_id, body, name, filename, options = {})
|
@@ -1432,6 +1489,7 @@ module XeroRuby
|
|
1432
1489
|
# HTTP header 'Content-Type'
|
1433
1490
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
1434
1491
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1492
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1435
1493
|
|
1436
1494
|
# form parameters
|
1437
1495
|
form_params = opts[:form_params] || {}
|