xero-ruby 3.9.0 → 7.0.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 +2 -2
- data/lib/xero-ruby/api/accounting_api.rb +1136 -46
- data/lib/xero-ruby/api/app_store_api.rb +244 -0
- data/lib/xero-ruby/api/asset_api.rb +16 -6
- data/lib/xero-ruby/api/files_api.rb +156 -20
- data/lib/xero-ruby/api/payroll_au_api.rb +326 -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 +286 -2
- data/lib/xero-ruby/api_client.rb +9 -3
- data/lib/xero-ruby/models/accounting/account.rb +1 -1
- 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/batch_payment.rb +2 -2
- data/lib/xero-ruby/models/accounting/batch_payment_delete.rb +244 -0
- data/lib/xero-ruby/models/accounting/batch_payment_delete_by_url_param.rb +229 -0
- data/lib/xero-ruby/models/accounting/contact.rb +1 -11
- data/lib/xero-ruby/models/accounting/currency_code.rb +10 -8
- 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 +6 -2
- data/lib/xero-ruby/models/accounting/payment.rb +26 -4
- data/lib/xero-ruby/models/accounting/repeating_invoice.rb +53 -5
- data/lib/xero-ruby/models/accounting/tax_rate.rb +23 -5
- data/lib/xero-ruby/models/accounting/tax_type.rb +60 -3
- data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +75 -4
- 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/files/association.rb +31 -1
- data/lib/xero-ruby/models/finance/problem_type.rb +1 -0
- data/lib/xero-ruby/models/finance/statement_line_response.rb +11 -1
- data/lib/xero-ruby/models/finance/statement_response.rb +24 -4
- data/lib/xero-ruby/models/payroll_au/allowance_type.rb +0 -1
- data/lib/xero-ruby/models/payroll_au/country_of_residence.rb +284 -0
- data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +21 -1
- data/lib/xero-ruby/models/payroll_au/earnings_type.rb +2 -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_application.rb +11 -1
- data/lib/xero-ruby/models/payroll_au/leave_category_code.rb +46 -0
- data/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +14 -4
- 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_au/leave_type.rb +24 -4
- data/lib/xero-ruby/models/payroll_au/opening_balances.rb +16 -4
- data/lib/xero-ruby/models/payroll_au/paid_leave_earnings_line.rb +272 -0
- data/lib/xero-ruby/models/payroll_au/pay_out_type.rb +36 -0
- 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 +51 -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/models/payroll_nz/employee.rb +14 -4
- data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +3 -3
- data/lib/xero-ruby/models/projects/currency_code.rb +0 -1
- data/lib/xero-ruby/models/projects/task.rb +6 -6
- data/lib/xero-ruby/models/projects/task_create_or_update.rb +1 -1
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby/where.rb +2 -0
- data/lib/xero-ruby.rb +15 -0
- metadata +30 -15
@@ -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'
|
@@ -404,10 +418,14 @@ module XeroRuby
|
|
404
418
|
end
|
405
419
|
|
406
420
|
# Retrieves an association object using a unique object ID
|
407
|
-
# By passing in the appropriate options,
|
421
|
+
# By passing in the appropriate options, you can retrieve an association
|
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)
|
@@ -415,10 +433,14 @@ module XeroRuby
|
|
415
433
|
end
|
416
434
|
|
417
435
|
# Retrieves an association object using a unique object ID
|
418
|
-
# By passing in the appropriate options,
|
436
|
+
# By passing in the appropriate options, you can retrieve an association
|
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?
|
@@ -480,6 +522,84 @@ module XeroRuby
|
|
480
522
|
return data, status_code, headers
|
481
523
|
end
|
482
524
|
|
525
|
+
# Retrieves a count of associations for a list of objects.
|
526
|
+
# By passing in the appropriate options, you can retrieve the association count for objects
|
527
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
528
|
+
# @param object_ids [Array<String>] A comma-separated list of object ids
|
529
|
+
# @param [Hash] opts the optional parameters
|
530
|
+
# @return [Object]
|
531
|
+
def get_associations_count(xero_tenant_id, object_ids, opts = {})
|
532
|
+
data, _status_code, _headers = get_associations_count_with_http_info(xero_tenant_id, object_ids, opts)
|
533
|
+
data
|
534
|
+
end
|
535
|
+
|
536
|
+
# Retrieves a count of associations for a list of objects.
|
537
|
+
# By passing in the appropriate options, you can retrieve the association count for objects
|
538
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
539
|
+
# @param object_ids [Array<String>] A comma-separated list of object ids
|
540
|
+
# @param [Hash] opts the optional parameters
|
541
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
542
|
+
def get_associations_count_with_http_info(xero_tenant_id, object_ids, options = {})
|
543
|
+
opts = options.dup
|
544
|
+
if @api_client.config.debugging
|
545
|
+
@api_client.config.logger.debug 'Calling API: FilesApi.get_associations_count ...'
|
546
|
+
end
|
547
|
+
# verify the required parameter 'xero_tenant_id' is set
|
548
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
549
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FilesApi.get_associations_count"
|
550
|
+
end
|
551
|
+
# verify the required parameter 'object_ids' is set
|
552
|
+
if @api_client.config.client_side_validation && object_ids.nil?
|
553
|
+
fail ArgumentError, "Missing the required parameter 'object_ids' when calling FilesApi.get_associations_count"
|
554
|
+
end
|
555
|
+
# resource path
|
556
|
+
local_var_path = '/Associations/Count'
|
557
|
+
|
558
|
+
# camelize keys of incoming `where` opts
|
559
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
560
|
+
|
561
|
+
# query parameters
|
562
|
+
query_params = opts[:query_params] || {}
|
563
|
+
query_params[:'ObjectIds'] = @api_client.build_collection_param(object_ids, :multi)
|
564
|
+
|
565
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
566
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
567
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
568
|
+
|
569
|
+
# header parameters
|
570
|
+
header_params = opts[:header_params] || {}
|
571
|
+
# HTTP header 'Accept' (if needed)
|
572
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
573
|
+
header_params[:'xero-tenant-id'] = xero_tenant_id
|
574
|
+
|
575
|
+
# form parameters
|
576
|
+
form_params = opts[:form_params] || {}
|
577
|
+
|
578
|
+
# http body (model)
|
579
|
+
post_body = opts[:body]
|
580
|
+
|
581
|
+
# return_type
|
582
|
+
return_type = opts[:return_type] || 'Object'
|
583
|
+
|
584
|
+
# auth_names
|
585
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
586
|
+
|
587
|
+
new_options = opts.merge(
|
588
|
+
:header_params => header_params,
|
589
|
+
:query_params => query_params,
|
590
|
+
:form_params => form_params,
|
591
|
+
:body => post_body,
|
592
|
+
:auth_names => auth_names,
|
593
|
+
:return_type => return_type
|
594
|
+
)
|
595
|
+
|
596
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FilesApi", new_options)
|
597
|
+
if @api_client.config.debugging
|
598
|
+
@api_client.config.logger.debug "API called: FilesApi#get_associations_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
599
|
+
end
|
600
|
+
return data, status_code, headers
|
601
|
+
end
|
602
|
+
|
483
603
|
# Retrieves a file by a unique file ID
|
484
604
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
485
605
|
# @param file_id [String] File id for single object
|
@@ -1029,11 +1149,12 @@ module XeroRuby
|
|
1029
1149
|
# Updates file properties of a single file
|
1030
1150
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1031
1151
|
# @param file_id [String] File id for single object
|
1152
|
+
# @param file_object [FileObject]
|
1032
1153
|
# @param [Hash] opts the optional parameters
|
1033
|
-
# @option opts [
|
1154
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1034
1155
|
# @return [FileObject]
|
1035
|
-
def update_file(xero_tenant_id, file_id, opts = {})
|
1036
|
-
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)
|
1037
1158
|
data
|
1038
1159
|
end
|
1039
1160
|
|
@@ -1041,10 +1162,11 @@ module XeroRuby
|
|
1041
1162
|
# Updates file properties of a single file
|
1042
1163
|
# @param xero_tenant_id [String] Xero identifier for Tenant
|
1043
1164
|
# @param file_id [String] File id for single object
|
1165
|
+
# @param file_object [FileObject]
|
1044
1166
|
# @param [Hash] opts the optional parameters
|
1045
|
-
# @option opts [
|
1167
|
+
# @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
|
1046
1168
|
# @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers
|
1047
|
-
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 = {})
|
1048
1170
|
opts = options.dup
|
1049
1171
|
if @api_client.config.debugging
|
1050
1172
|
@api_client.config.logger.debug 'Calling API: FilesApi.update_file ...'
|
@@ -1057,6 +1179,10 @@ module XeroRuby
|
|
1057
1179
|
if @api_client.config.client_side_validation && file_id.nil?
|
1058
1180
|
fail ArgumentError, "Missing the required parameter 'file_id' when calling FilesApi.update_file"
|
1059
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
|
1060
1186
|
# resource path
|
1061
1187
|
local_var_path = '/Files/{FileId}'.sub('{' + 'FileId' + '}', file_id.to_s)
|
1062
1188
|
|
@@ -1077,12 +1203,13 @@ module XeroRuby
|
|
1077
1203
|
# HTTP header 'Content-Type'
|
1078
1204
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1079
1205
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1206
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1080
1207
|
|
1081
1208
|
# form parameters
|
1082
1209
|
form_params = opts[:form_params] || {}
|
1083
1210
|
|
1084
1211
|
# http body (model)
|
1085
|
-
post_body = opts[:body] || @api_client.object_to_http_body(
|
1212
|
+
post_body = opts[:body] || @api_client.object_to_http_body(file_object)
|
1086
1213
|
|
1087
1214
|
# return_type
|
1088
1215
|
return_type = opts[:return_type] || 'FileObject'
|
@@ -1112,6 +1239,7 @@ module XeroRuby
|
|
1112
1239
|
# @param folder_id [String] Folder id for single object
|
1113
1240
|
# @param folder [Folder]
|
1114
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.
|
1115
1243
|
# @return [Folder]
|
1116
1244
|
def update_folder(xero_tenant_id, folder_id, folder, opts = {})
|
1117
1245
|
data, _status_code, _headers = update_folder_with_http_info(xero_tenant_id, folder_id, folder, opts)
|
@@ -1124,6 +1252,7 @@ module XeroRuby
|
|
1124
1252
|
# @param folder_id [String] Folder id for single object
|
1125
1253
|
# @param folder [Folder]
|
1126
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.
|
1127
1256
|
# @return [Array<(Folder, Integer, Hash)>] Folder data, response status code and response headers
|
1128
1257
|
def update_folder_with_http_info(xero_tenant_id, folder_id, folder, options = {})
|
1129
1258
|
opts = options.dup
|
@@ -1162,6 +1291,7 @@ module XeroRuby
|
|
1162
1291
|
# HTTP header 'Content-Type'
|
1163
1292
|
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1164
1293
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1294
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1165
1295
|
|
1166
1296
|
# form parameters
|
1167
1297
|
form_params = opts[:form_params] || {}
|
@@ -1197,6 +1327,7 @@ module XeroRuby
|
|
1197
1327
|
# @param name [String] exact name of the file you are uploading
|
1198
1328
|
# @param filename [String]
|
1199
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.
|
1200
1331
|
# @option opts [String] :mime_type
|
1201
1332
|
# @return [FileObject]
|
1202
1333
|
def upload_file(xero_tenant_id, body, name, filename, opts = {})
|
@@ -1210,6 +1341,7 @@ module XeroRuby
|
|
1210
1341
|
# @param name [String] exact name of the file you are uploading
|
1211
1342
|
# @param filename [String]
|
1212
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.
|
1213
1345
|
# @option opts [String] :mime_type
|
1214
1346
|
# @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers
|
1215
1347
|
def upload_file_with_http_info(xero_tenant_id, body, name, filename, options = {})
|
@@ -1253,6 +1385,7 @@ module XeroRuby
|
|
1253
1385
|
# HTTP header 'Content-Type'
|
1254
1386
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
1255
1387
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1388
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1256
1389
|
|
1257
1390
|
# form parameters
|
1258
1391
|
form_params = opts[:form_params] || {}
|
@@ -1293,6 +1426,7 @@ module XeroRuby
|
|
1293
1426
|
# @param name [String] exact name of the file you are uploading
|
1294
1427
|
# @param filename [String]
|
1295
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.
|
1296
1430
|
# @option opts [String] :mime_type
|
1297
1431
|
# @return [FileObject]
|
1298
1432
|
def upload_file_to_folder(xero_tenant_id, folder_id, body, name, filename, opts = {})
|
@@ -1307,6 +1441,7 @@ module XeroRuby
|
|
1307
1441
|
# @param name [String] exact name of the file you are uploading
|
1308
1442
|
# @param filename [String]
|
1309
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.
|
1310
1445
|
# @option opts [String] :mime_type
|
1311
1446
|
# @return [Array<(FileObject, Integer, Hash)>] FileObject data, response status code and response headers
|
1312
1447
|
def upload_file_to_folder_with_http_info(xero_tenant_id, folder_id, body, name, filename, options = {})
|
@@ -1354,6 +1489,7 @@ module XeroRuby
|
|
1354
1489
|
# HTTP header 'Content-Type'
|
1355
1490
|
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
1356
1491
|
header_params[:'xero-tenant-id'] = xero_tenant_id
|
1492
|
+
header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
|
1357
1493
|
|
1358
1494
|
# form parameters
|
1359
1495
|
form_params = opts[:form_params] || {}
|