xero-ruby 18.4.0 → 19.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/lib/xero-ruby/api/feed_connections_api.rb +410 -0
- data/lib/xero-ruby/api_client.rb +42 -24
- data/lib/xero-ruby/configuration.rb +10 -6
- data/lib/xero-ruby/models/accounting/budget.rb +25 -1
- data/lib/xero-ruby/models/accounting/budget_balance.rb +4 -39
- data/lib/xero-ruby/models/bankfeeds_v2/account_type.rb +36 -0
- data/lib/xero-ruby/models/{finance/lock_history_response.rb → bankfeeds_v2/bulk_feed_connection_response.rb} +16 -35
- data/lib/xero-ruby/models/bankfeeds_v2/bulk_feed_connection_result.rb +300 -0
- data/lib/xero-ruby/models/bankfeeds_v2/delete_feed_connections_request.rb +229 -0
- data/lib/xero-ruby/models/bankfeeds_v2/existing_account_feed_connection.rb +373 -0
- data/lib/xero-ruby/models/bankfeeds_v2/existing_account_feed_connections_request.rb +229 -0
- data/lib/xero-ruby/models/{finance/account_usage.rb → bankfeeds_v2/feed_connection.rb} +59 -108
- data/lib/xero-ruby/models/{finance/account_usage_response.rb → bankfeeds_v2/feed_connection_to_delete.rb} +20 -47
- data/lib/xero-ruby/models/bankfeeds_v2/item_error.rb +358 -0
- data/lib/xero-ruby/models/bankfeeds_v2/new_account_feed_connection.rb +406 -0
- data/lib/xero-ruby/models/{finance/user_activities_response.rb → bankfeeds_v2/new_account_feed_connections_request.rb} +21 -36
- data/lib/xero-ruby/models/{finance/report_history_response.rb → bankfeeds_v2/paged_feed_connections.rb} +22 -32
- data/lib/xero-ruby/models/{finance/practice_response.rb → bankfeeds_v2/pagination.rb} +36 -46
- data/lib/xero-ruby/models/bankfeeds_v2/problem.rb +368 -0
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby.rb +143 -128
- metadata +369 -364
- data/lib/xero-ruby/models/finance/history_record_response.rb +0 -262
- data/lib/xero-ruby/models/finance/lock_history_model.rb +0 -242
- data/lib/xero-ruby/models/finance/report_history_model.rb +0 -242
- data/lib/xero-ruby/models/finance/user_response.rb +0 -336
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a718ffc850a4c7736fce275be1530f225aadc2ae934c187d9f3a70d17285d027
|
|
4
|
+
data.tar.gz: d9c9b9d33ff0d7137da8338d7ad59eb5edfb462f2da76b0f24b8fb5daec5aa99
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f0ae7dc531f27a27d75076744f434f1828e8f9289e93989889b67fe047e427fa5f50c11054f2b888a4880bf81326b36d3b9ab8fdf1548dfcf9baef7d9439bfd0
|
|
7
|
+
data.tar.gz: 8b123ac25caab8ba09245319a81c3ca159ffe6a6fc701fb1bb4c3a60b0cac09f07880a6ee9747b8bec8feb27c987eb6935cc27a3c71f38034f933bdf123f534e
|
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero Bank Feeds API v2
|
|
3
|
+
|
|
4
|
+
#The Bank Feeds API is available to financial institutions with a Xero partnership and approved app partners. For non-bank apps, it automates statement imports into Xero bank and credit card accounts; it does not create a direct bank feed. Feed Connections 2.0 is intended to replace 1.0. The customer chooses whether to connect an existing Xero account or create a new one. Use ExistingAccount with the chosen accountId, or NewAccount to create an account; Xero does not guess which account to connect or silently change an account name. The GET and delete operations also use 2.0. Statements continue to use 1.0. Partial failures are rare, and nearly all are recoverable by your app with no need to contact Xero support. If an item in a write response has `status` `PARTIAL_FAILURE`, handle only that item and read its `error.type`. For `partial-failure-new-account-creation`, do not resend the NewAccount item: connect `error.accountId` with `POST /FeedConnections/ExistingAccount`. For `partial-failure-new-account-existence-not-confirmed`, the account named in `error.accountName` may or may not exist. Use the Accounting API to check whether an account with that name exists. If it does, connect it with `POST /FeedConnections/ExistingAccount`. If it does not, resend the NewAccount item. If your app has a user, you can show them this message instead: \"Something went wrong. Please check whether your chosen account name now exists. If it does, connect it. If not, try creating the new one again.\" For any other `partial-failure-*` type, resend the same item. If the recovery request for `partial-failure-new-account-creation`, `partial-failure-previous-connection-deletion` or `partial-failure-connection-creation` returns 409 `feed-already-connected-in-current-organisation`, the earlier attempt succeeded: treat the item as created and use `GET /FeedConnections` to find its `id`. `error.subtype` is optional diagnostics; do not branch on it, and never parse `title` or `detail`. Full detail: https://developer.xero.com/documentation/api/bankfeeds/feedconnections-2-0-errors/#partial-failures
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
module XeroRuby
|
|
13
|
+
class FeedConnectionsApi
|
|
14
|
+
attr_accessor :api_client
|
|
15
|
+
|
|
16
|
+
def initialize(api_client = ApiClient.new)
|
|
17
|
+
@api_client = api_client
|
|
18
|
+
end
|
|
19
|
+
# Connect feeds to Xero Bank Accounts that already exist
|
|
20
|
+
# Creates Feed Connections against Xero Bank Accounts the Organisation already has. Each item must include the `accountId` of the account it connects to. Xero performs no matching of its own, and `accountNumber` and `accountName` are ignored if supplied. Use this endpoint whenever the customer has chosen an account, including when they are reconnecting a feed that was previously terminated. Each item is processed independently, and the response has one result per request item in request order.
|
|
21
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
22
|
+
# @param existing_account_feed_connections_request [ExistingAccountFeedConnectionsRequest]
|
|
23
|
+
# @param [Hash] opts the optional parameters
|
|
24
|
+
# @return [BulkFeedConnectionResponse]
|
|
25
|
+
def create_feed_connections_for_existing_accounts(xero_tenant_id, existing_account_feed_connections_request, opts = {})
|
|
26
|
+
data, _status_code, _headers = create_feed_connections_for_existing_accounts_with_http_info(xero_tenant_id, existing_account_feed_connections_request, opts)
|
|
27
|
+
data
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Connect feeds to Xero Bank Accounts that already exist
|
|
31
|
+
# Creates Feed Connections against Xero Bank Accounts the Organisation already has. Each item must include the `accountId` of the account it connects to. Xero performs no matching of its own, and `accountNumber` and `accountName` are ignored if supplied. Use this endpoint whenever the customer has chosen an account, including when they are reconnecting a feed that was previously terminated. Each item is processed independently, and the response has one result per request item in request order.
|
|
32
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
33
|
+
# @param existing_account_feed_connections_request [ExistingAccountFeedConnectionsRequest]
|
|
34
|
+
# @param [Hash] opts the optional parameters
|
|
35
|
+
# @return [Array<(BulkFeedConnectionResponse, Integer, Hash)>] BulkFeedConnectionResponse data, response status code and response headers
|
|
36
|
+
def create_feed_connections_for_existing_accounts_with_http_info(xero_tenant_id, existing_account_feed_connections_request, options = {})
|
|
37
|
+
opts = options.dup
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: FeedConnectionsApi.create_feed_connections_for_existing_accounts ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'xero_tenant_id' is set
|
|
42
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FeedConnectionsApi.create_feed_connections_for_existing_accounts"
|
|
44
|
+
end
|
|
45
|
+
# verify the required parameter 'existing_account_feed_connections_request' is set
|
|
46
|
+
if @api_client.config.client_side_validation && existing_account_feed_connections_request.nil?
|
|
47
|
+
fail ArgumentError, "Missing the required parameter 'existing_account_feed_connections_request' when calling FeedConnectionsApi.create_feed_connections_for_existing_accounts"
|
|
48
|
+
end
|
|
49
|
+
# resource path
|
|
50
|
+
local_var_path = '/FeedConnections/ExistingAccount'
|
|
51
|
+
|
|
52
|
+
# camelize keys of incoming `where` opts
|
|
53
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
|
54
|
+
|
|
55
|
+
# query parameters
|
|
56
|
+
query_params = opts[:query_params] || {}
|
|
57
|
+
|
|
58
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
|
59
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
|
60
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
|
61
|
+
|
|
62
|
+
# header parameters
|
|
63
|
+
header_params = opts[:header_params] || {}
|
|
64
|
+
# HTTP header 'Accept' (if needed)
|
|
65
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json', ])
|
|
66
|
+
# HTTP header 'Content-Type'
|
|
67
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
68
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
|
69
|
+
|
|
70
|
+
# form parameters
|
|
71
|
+
form_params = opts[:form_params] || {}
|
|
72
|
+
|
|
73
|
+
# http body (model)
|
|
74
|
+
post_body = opts[:body] || @api_client.object_to_http_body(existing_account_feed_connections_request)
|
|
75
|
+
|
|
76
|
+
# return_type
|
|
77
|
+
return_type = opts[:return_type] || 'BulkFeedConnectionResponse'
|
|
78
|
+
|
|
79
|
+
# auth_names
|
|
80
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
|
81
|
+
|
|
82
|
+
new_options = opts.merge(
|
|
83
|
+
:header_params => header_params,
|
|
84
|
+
:query_params => query_params,
|
|
85
|
+
:form_params => form_params,
|
|
86
|
+
:body => post_body,
|
|
87
|
+
:auth_names => auth_names,
|
|
88
|
+
:return_type => return_type
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, "FeedConnectionsApi", new_options)
|
|
92
|
+
if @api_client.config.debugging
|
|
93
|
+
@api_client.config.logger.debug "API called: FeedConnectionsApi#create_feed_connections_for_existing_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
94
|
+
end
|
|
95
|
+
return data, status_code, headers
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# Create Xero Bank Accounts and connect feeds to them
|
|
99
|
+
# Creates a new Xero Bank Account for each item and connects a feed to it. `accountId` must not be supplied. An item that includes one — including an all-zeros GUID, or a value that is not a GUID at all — is rejected, because supplying an account identifier means the Application intends to connect an account that already exists, which is what `/FeedConnections/ExistingAccount` is for. `accountNumber` and `accountName` are required here, since they describe the account being created. If the Organisation already has an account with the requested name, the item is rejected with `account-name-already-exists` naming that account, and no account is created. The same applies to a second item in the same request that uses a name an earlier item has just taken.
|
|
100
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
101
|
+
# @param new_account_feed_connections_request [NewAccountFeedConnectionsRequest]
|
|
102
|
+
# @param [Hash] opts the optional parameters
|
|
103
|
+
# @return [BulkFeedConnectionResponse]
|
|
104
|
+
def create_feed_connections_for_new_accounts(xero_tenant_id, new_account_feed_connections_request, opts = {})
|
|
105
|
+
data, _status_code, _headers = create_feed_connections_for_new_accounts_with_http_info(xero_tenant_id, new_account_feed_connections_request, opts)
|
|
106
|
+
data
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# Create Xero Bank Accounts and connect feeds to them
|
|
110
|
+
# Creates a new Xero Bank Account for each item and connects a feed to it. `accountId` must not be supplied. An item that includes one — including an all-zeros GUID, or a value that is not a GUID at all — is rejected, because supplying an account identifier means the Application intends to connect an account that already exists, which is what `/FeedConnections/ExistingAccount` is for. `accountNumber` and `accountName` are required here, since they describe the account being created. If the Organisation already has an account with the requested name, the item is rejected with `account-name-already-exists` naming that account, and no account is created. The same applies to a second item in the same request that uses a name an earlier item has just taken.
|
|
111
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
112
|
+
# @param new_account_feed_connections_request [NewAccountFeedConnectionsRequest]
|
|
113
|
+
# @param [Hash] opts the optional parameters
|
|
114
|
+
# @return [Array<(BulkFeedConnectionResponse, Integer, Hash)>] BulkFeedConnectionResponse data, response status code and response headers
|
|
115
|
+
def create_feed_connections_for_new_accounts_with_http_info(xero_tenant_id, new_account_feed_connections_request, options = {})
|
|
116
|
+
opts = options.dup
|
|
117
|
+
if @api_client.config.debugging
|
|
118
|
+
@api_client.config.logger.debug 'Calling API: FeedConnectionsApi.create_feed_connections_for_new_accounts ...'
|
|
119
|
+
end
|
|
120
|
+
# verify the required parameter 'xero_tenant_id' is set
|
|
121
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
|
122
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FeedConnectionsApi.create_feed_connections_for_new_accounts"
|
|
123
|
+
end
|
|
124
|
+
# verify the required parameter 'new_account_feed_connections_request' is set
|
|
125
|
+
if @api_client.config.client_side_validation && new_account_feed_connections_request.nil?
|
|
126
|
+
fail ArgumentError, "Missing the required parameter 'new_account_feed_connections_request' when calling FeedConnectionsApi.create_feed_connections_for_new_accounts"
|
|
127
|
+
end
|
|
128
|
+
# resource path
|
|
129
|
+
local_var_path = '/FeedConnections/NewAccount'
|
|
130
|
+
|
|
131
|
+
# camelize keys of incoming `where` opts
|
|
132
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
|
133
|
+
|
|
134
|
+
# query parameters
|
|
135
|
+
query_params = opts[:query_params] || {}
|
|
136
|
+
|
|
137
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
|
138
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
|
139
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
|
140
|
+
|
|
141
|
+
# header parameters
|
|
142
|
+
header_params = opts[:header_params] || {}
|
|
143
|
+
# HTTP header 'Accept' (if needed)
|
|
144
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json', ])
|
|
145
|
+
# HTTP header 'Content-Type'
|
|
146
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
147
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
|
148
|
+
|
|
149
|
+
# form parameters
|
|
150
|
+
form_params = opts[:form_params] || {}
|
|
151
|
+
|
|
152
|
+
# http body (model)
|
|
153
|
+
post_body = opts[:body] || @api_client.object_to_http_body(new_account_feed_connections_request)
|
|
154
|
+
|
|
155
|
+
# return_type
|
|
156
|
+
return_type = opts[:return_type] || 'BulkFeedConnectionResponse'
|
|
157
|
+
|
|
158
|
+
# auth_names
|
|
159
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
|
160
|
+
|
|
161
|
+
new_options = opts.merge(
|
|
162
|
+
:header_params => header_params,
|
|
163
|
+
:query_params => query_params,
|
|
164
|
+
:form_params => form_params,
|
|
165
|
+
:body => post_body,
|
|
166
|
+
:auth_names => auth_names,
|
|
167
|
+
:return_type => return_type
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, "FeedConnectionsApi", new_options)
|
|
171
|
+
if @api_client.config.debugging
|
|
172
|
+
@api_client.config.logger.debug "API called: FeedConnectionsApi#create_feed_connections_for_new_accounts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
173
|
+
end
|
|
174
|
+
return data, status_code, headers
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Terminate Feed Connections
|
|
178
|
+
# Terminates the Feed Connections named in the request. Terminating a Feed Connection discontinues the bank feed, and does not otherwise affect the customer's data in Xero. Each item is identified by the Feed Connection `id` alone. An item naming a Feed Connection that does not exist, has already been terminated, or belongs to a different Application is reported as `feed-not-found-or-already-deleted` with `status` `SUCCESS` and `statusCode` `204` — there was nothing to terminate, which is not a failure, and is reported the same way a real termination is. The same identifier may not appear twice in one request. Re-sending a completed delete is idempotent. If an item reports `PARTIAL_FAILURE`, or the original response was lost, resend the same DeleteRequests item. The retry checks whether the connection remains and terminates it if needed. A `SUCCESS` item on the resend means the deletion is complete, including `feed-not-found-or-already-deleted` at `statusCode` `204`. If a retry keeps reporting `PARTIAL_FAILURE`, contact Xero support with the connection id in `error.connectionId`.
|
|
179
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
180
|
+
# @param delete_feed_connections_request [DeleteFeedConnectionsRequest]
|
|
181
|
+
# @param [Hash] opts the optional parameters
|
|
182
|
+
# @return [BulkFeedConnectionResponse]
|
|
183
|
+
def delete_feed_connections(xero_tenant_id, delete_feed_connections_request, opts = {})
|
|
184
|
+
data, _status_code, _headers = delete_feed_connections_with_http_info(xero_tenant_id, delete_feed_connections_request, opts)
|
|
185
|
+
data
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
# Terminate Feed Connections
|
|
189
|
+
# Terminates the Feed Connections named in the request. Terminating a Feed Connection discontinues the bank feed, and does not otherwise affect the customer's data in Xero. Each item is identified by the Feed Connection `id` alone. An item naming a Feed Connection that does not exist, has already been terminated, or belongs to a different Application is reported as `feed-not-found-or-already-deleted` with `status` `SUCCESS` and `statusCode` `204` — there was nothing to terminate, which is not a failure, and is reported the same way a real termination is. The same identifier may not appear twice in one request. Re-sending a completed delete is idempotent. If an item reports `PARTIAL_FAILURE`, or the original response was lost, resend the same DeleteRequests item. The retry checks whether the connection remains and terminates it if needed. A `SUCCESS` item on the resend means the deletion is complete, including `feed-not-found-or-already-deleted` at `statusCode` `204`. If a retry keeps reporting `PARTIAL_FAILURE`, contact Xero support with the connection id in `error.connectionId`.
|
|
190
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
191
|
+
# @param delete_feed_connections_request [DeleteFeedConnectionsRequest]
|
|
192
|
+
# @param [Hash] opts the optional parameters
|
|
193
|
+
# @return [Array<(BulkFeedConnectionResponse, Integer, Hash)>] BulkFeedConnectionResponse data, response status code and response headers
|
|
194
|
+
def delete_feed_connections_with_http_info(xero_tenant_id, delete_feed_connections_request, options = {})
|
|
195
|
+
opts = options.dup
|
|
196
|
+
if @api_client.config.debugging
|
|
197
|
+
@api_client.config.logger.debug 'Calling API: FeedConnectionsApi.delete_feed_connections ...'
|
|
198
|
+
end
|
|
199
|
+
# verify the required parameter 'xero_tenant_id' is set
|
|
200
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
|
201
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FeedConnectionsApi.delete_feed_connections"
|
|
202
|
+
end
|
|
203
|
+
# verify the required parameter 'delete_feed_connections_request' is set
|
|
204
|
+
if @api_client.config.client_side_validation && delete_feed_connections_request.nil?
|
|
205
|
+
fail ArgumentError, "Missing the required parameter 'delete_feed_connections_request' when calling FeedConnectionsApi.delete_feed_connections"
|
|
206
|
+
end
|
|
207
|
+
# resource path
|
|
208
|
+
local_var_path = '/FeedConnections/DeleteRequests'
|
|
209
|
+
|
|
210
|
+
# camelize keys of incoming `where` opts
|
|
211
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
|
212
|
+
|
|
213
|
+
# query parameters
|
|
214
|
+
query_params = opts[:query_params] || {}
|
|
215
|
+
|
|
216
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
|
217
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
|
218
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
|
219
|
+
|
|
220
|
+
# header parameters
|
|
221
|
+
header_params = opts[:header_params] || {}
|
|
222
|
+
# HTTP header 'Accept' (if needed)
|
|
223
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json', ])
|
|
224
|
+
# HTTP header 'Content-Type'
|
|
225
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
226
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
|
227
|
+
|
|
228
|
+
# form parameters
|
|
229
|
+
form_params = opts[:form_params] || {}
|
|
230
|
+
|
|
231
|
+
# http body (model)
|
|
232
|
+
post_body = opts[:body] || @api_client.object_to_http_body(delete_feed_connections_request)
|
|
233
|
+
|
|
234
|
+
# return_type
|
|
235
|
+
return_type = opts[:return_type] || 'BulkFeedConnectionResponse'
|
|
236
|
+
|
|
237
|
+
# auth_names
|
|
238
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
|
239
|
+
|
|
240
|
+
new_options = opts.merge(
|
|
241
|
+
:header_params => header_params,
|
|
242
|
+
:query_params => query_params,
|
|
243
|
+
:form_params => form_params,
|
|
244
|
+
:body => post_body,
|
|
245
|
+
:auth_names => auth_names,
|
|
246
|
+
:return_type => return_type
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, "FeedConnectionsApi", new_options)
|
|
250
|
+
if @api_client.config.debugging
|
|
251
|
+
@api_client.config.logger.debug "API called: FeedConnectionsApi#delete_feed_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
252
|
+
end
|
|
253
|
+
return data, status_code, headers
|
|
254
|
+
end
|
|
255
|
+
|
|
256
|
+
# Retrieve a single Feed Connection
|
|
257
|
+
# Returns one Feed Connection, as a bare object rather than inside an envelope. The response is `404 bank-feed-not-found` when the identifier names no Feed Connection, when it names one belonging to a different Application, when it is an all-zeros GUID, and when it is not a GUID at all. These cases are deliberately indistinguishable from one another, so an Application cannot use this endpoint to discover what another Application has.
|
|
258
|
+
# @param id [String] The Feed Connection identifier.
|
|
259
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
260
|
+
# @param [Hash] opts the optional parameters
|
|
261
|
+
# @return [FeedConnection]
|
|
262
|
+
def get_feed_connection(id, xero_tenant_id, opts = {})
|
|
263
|
+
data, _status_code, _headers = get_feed_connection_with_http_info(id, xero_tenant_id, opts)
|
|
264
|
+
data
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Retrieve a single Feed Connection
|
|
268
|
+
# Returns one Feed Connection, as a bare object rather than inside an envelope. The response is `404 bank-feed-not-found` when the identifier names no Feed Connection, when it names one belonging to a different Application, when it is an all-zeros GUID, and when it is not a GUID at all. These cases are deliberately indistinguishable from one another, so an Application cannot use this endpoint to discover what another Application has.
|
|
269
|
+
# @param id [String] The Feed Connection identifier.
|
|
270
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
271
|
+
# @param [Hash] opts the optional parameters
|
|
272
|
+
# @return [Array<(FeedConnection, Integer, Hash)>] FeedConnection data, response status code and response headers
|
|
273
|
+
def get_feed_connection_with_http_info(id, xero_tenant_id, options = {})
|
|
274
|
+
opts = options.dup
|
|
275
|
+
if @api_client.config.debugging
|
|
276
|
+
@api_client.config.logger.debug 'Calling API: FeedConnectionsApi.get_feed_connection ...'
|
|
277
|
+
end
|
|
278
|
+
# verify the required parameter 'id' is set
|
|
279
|
+
if @api_client.config.client_side_validation && id.nil?
|
|
280
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling FeedConnectionsApi.get_feed_connection"
|
|
281
|
+
end
|
|
282
|
+
# verify the required parameter 'xero_tenant_id' is set
|
|
283
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
|
284
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FeedConnectionsApi.get_feed_connection"
|
|
285
|
+
end
|
|
286
|
+
# resource path
|
|
287
|
+
local_var_path = '/FeedConnections/{id}'.sub('{' + 'id' + '}', id.to_s)
|
|
288
|
+
|
|
289
|
+
# camelize keys of incoming `where` opts
|
|
290
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
|
291
|
+
|
|
292
|
+
# query parameters
|
|
293
|
+
query_params = opts[:query_params] || {}
|
|
294
|
+
|
|
295
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
|
296
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
|
297
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
|
298
|
+
|
|
299
|
+
# header parameters
|
|
300
|
+
header_params = opts[:header_params] || {}
|
|
301
|
+
# HTTP header 'Accept' (if needed)
|
|
302
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
|
303
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
|
304
|
+
|
|
305
|
+
# form parameters
|
|
306
|
+
form_params = opts[:form_params] || {}
|
|
307
|
+
|
|
308
|
+
# http body (model)
|
|
309
|
+
post_body = opts[:body]
|
|
310
|
+
|
|
311
|
+
# return_type
|
|
312
|
+
return_type = opts[:return_type] || 'FeedConnection'
|
|
313
|
+
|
|
314
|
+
# auth_names
|
|
315
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
|
316
|
+
|
|
317
|
+
new_options = opts.merge(
|
|
318
|
+
:header_params => header_params,
|
|
319
|
+
:query_params => query_params,
|
|
320
|
+
:form_params => form_params,
|
|
321
|
+
:body => post_body,
|
|
322
|
+
:auth_names => auth_names,
|
|
323
|
+
:return_type => return_type
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FeedConnectionsApi", new_options)
|
|
327
|
+
if @api_client.config.debugging
|
|
328
|
+
@api_client.config.logger.debug "API called: FeedConnectionsApi#get_feed_connection\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
329
|
+
end
|
|
330
|
+
return data, status_code, headers
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
# Retrieve the Feed Connections for an Organisation
|
|
334
|
+
# Returns the Feed Connections belonging to both the Organisation in `Xero-Tenant-Id` and the Application associated with the OAuth client. Connections belonging to another Application are not returned, and there is no way to observe that they exist. A `page` beyond the end of the collection returns an empty `items` array rather than an error.
|
|
335
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
336
|
+
# @param [Hash] opts the optional parameters
|
|
337
|
+
# @option opts [Integer] :page The page to return, counting from 1. (default to 1)
|
|
338
|
+
# @option opts [Integer] :page_size How many Feed Connections to return per page. No maximum is enforced. (default to 10)
|
|
339
|
+
# @return [PagedFeedConnections]
|
|
340
|
+
def get_feed_connections(xero_tenant_id, opts = {})
|
|
341
|
+
data, _status_code, _headers = get_feed_connections_with_http_info(xero_tenant_id, opts)
|
|
342
|
+
data
|
|
343
|
+
end
|
|
344
|
+
|
|
345
|
+
# Retrieve the Feed Connections for an Organisation
|
|
346
|
+
# Returns the Feed Connections belonging to both the Organisation in `Xero-Tenant-Id` and the Application associated with the OAuth client. Connections belonging to another Application are not returned, and there is no way to observe that they exist. A `page` beyond the end of the collection returns an empty `items` array rather than an error.
|
|
347
|
+
# @param xero_tenant_id [String] Xero identifier for Tenant
|
|
348
|
+
# @param [Hash] opts the optional parameters
|
|
349
|
+
# @option opts [Integer] :page The page to return, counting from 1.
|
|
350
|
+
# @option opts [Integer] :page_size How many Feed Connections to return per page. No maximum is enforced.
|
|
351
|
+
# @return [Array<(PagedFeedConnections, Integer, Hash)>] PagedFeedConnections data, response status code and response headers
|
|
352
|
+
def get_feed_connections_with_http_info(xero_tenant_id, options = {})
|
|
353
|
+
opts = options.dup
|
|
354
|
+
if @api_client.config.debugging
|
|
355
|
+
@api_client.config.logger.debug 'Calling API: FeedConnectionsApi.get_feed_connections ...'
|
|
356
|
+
end
|
|
357
|
+
# verify the required parameter 'xero_tenant_id' is set
|
|
358
|
+
if @api_client.config.client_side_validation && xero_tenant_id.nil?
|
|
359
|
+
fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling FeedConnectionsApi.get_feed_connections"
|
|
360
|
+
end
|
|
361
|
+
# resource path
|
|
362
|
+
local_var_path = '/FeedConnections'
|
|
363
|
+
|
|
364
|
+
# camelize keys of incoming `where` opts
|
|
365
|
+
opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
|
|
366
|
+
|
|
367
|
+
# query parameters
|
|
368
|
+
query_params = opts[:query_params] || {}
|
|
369
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
370
|
+
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
371
|
+
|
|
372
|
+
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
|
373
|
+
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
|
374
|
+
query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
|
|
375
|
+
|
|
376
|
+
# header parameters
|
|
377
|
+
header_params = opts[:header_params] || {}
|
|
378
|
+
# HTTP header 'Accept' (if needed)
|
|
379
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/problem+json'])
|
|
380
|
+
header_params[:'Xero-Tenant-Id'] = xero_tenant_id
|
|
381
|
+
|
|
382
|
+
# form parameters
|
|
383
|
+
form_params = opts[:form_params] || {}
|
|
384
|
+
|
|
385
|
+
# http body (model)
|
|
386
|
+
post_body = opts[:body]
|
|
387
|
+
|
|
388
|
+
# return_type
|
|
389
|
+
return_type = opts[:return_type] || 'PagedFeedConnections'
|
|
390
|
+
|
|
391
|
+
# auth_names
|
|
392
|
+
auth_names = opts[:auth_names] || ['OAuth2']
|
|
393
|
+
|
|
394
|
+
new_options = opts.merge(
|
|
395
|
+
:header_params => header_params,
|
|
396
|
+
:query_params => query_params,
|
|
397
|
+
:form_params => form_params,
|
|
398
|
+
:body => post_body,
|
|
399
|
+
:auth_names => auth_names,
|
|
400
|
+
:return_type => return_type
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, "FeedConnectionsApi", new_options)
|
|
404
|
+
if @api_client.config.debugging
|
|
405
|
+
@api_client.config.logger.debug "API called: FeedConnectionsApi#get_feed_connections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
406
|
+
end
|
|
407
|
+
return data, status_code, headers
|
|
408
|
+
end
|
|
409
|
+
end
|
|
410
|
+
end
|
data/lib/xero-ruby/api_client.rb
CHANGED
|
@@ -80,29 +80,34 @@ module XeroRuby
|
|
|
80
80
|
XeroRuby::AssetApi.new(self)
|
|
81
81
|
end
|
|
82
82
|
|
|
83
|
-
def
|
|
84
|
-
@config.base_url = @config.
|
|
85
|
-
XeroRuby::
|
|
83
|
+
def payroll_au_api
|
|
84
|
+
@config.base_url = @config.payroll_au_url
|
|
85
|
+
XeroRuby::PayrollAuApi.new(self)
|
|
86
86
|
end
|
|
87
87
|
|
|
88
|
-
def
|
|
89
|
-
@config.base_url = @config.
|
|
90
|
-
XeroRuby::
|
|
88
|
+
def payroll_au_v2_api
|
|
89
|
+
@config.base_url = @config.payroll_au_v2_url
|
|
90
|
+
XeroRuby::PayrollAuV2Api.new(self)
|
|
91
91
|
end
|
|
92
92
|
|
|
93
|
-
def
|
|
94
|
-
@config.base_url = @config.
|
|
95
|
-
XeroRuby::
|
|
93
|
+
def payroll_uk_api
|
|
94
|
+
@config.base_url = @config.payroll_uk_url
|
|
95
|
+
XeroRuby::PayrollUkApi.new(self)
|
|
96
96
|
end
|
|
97
97
|
|
|
98
98
|
def payroll_nz_api
|
|
99
99
|
@config.base_url = @config.payroll_nz_url
|
|
100
100
|
XeroRuby::PayrollNzApi.new(self)
|
|
101
101
|
end
|
|
102
|
-
|
|
103
|
-
def
|
|
104
|
-
@config.base_url = @config.
|
|
105
|
-
XeroRuby::
|
|
102
|
+
|
|
103
|
+
def project_api
|
|
104
|
+
@config.base_url = @config.project_url
|
|
105
|
+
XeroRuby::ProjectApi.new(self)
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
def files_api
|
|
109
|
+
@config.base_url = @config.files_url
|
|
110
|
+
XeroRuby::FilesApi.new(self)
|
|
106
111
|
end
|
|
107
112
|
|
|
108
113
|
def app_store_api
|
|
@@ -120,6 +125,11 @@ module XeroRuby
|
|
|
120
125
|
XeroRuby::AccountDataApi.new(self)
|
|
121
126
|
end
|
|
122
127
|
|
|
128
|
+
def bankfeeds_v2_api
|
|
129
|
+
@config.base_url = @config.bankfeeds_v2_url
|
|
130
|
+
XeroRuby::FeedConnectionsApi.new(self)
|
|
131
|
+
end
|
|
132
|
+
|
|
123
133
|
# Token Helpers
|
|
124
134
|
def token_set
|
|
125
135
|
@config.token_set
|
|
@@ -290,28 +300,32 @@ module XeroRuby
|
|
|
290
300
|
method_base_url = @config.accounting_url
|
|
291
301
|
when "AssetApi"
|
|
292
302
|
method_base_url = @config.asset_url
|
|
293
|
-
when "FilesApi"
|
|
294
|
-
method_base_url = @config.files_url
|
|
295
303
|
when "PayrollAuApi"
|
|
296
304
|
method_base_url = @config.payroll_au_url
|
|
297
|
-
when "
|
|
298
|
-
method_base_url = @config.
|
|
305
|
+
when "PayrollAuV2Api"
|
|
306
|
+
method_base_url = @config.payroll_au_v2_url
|
|
299
307
|
when "PayrollUkApi"
|
|
300
308
|
method_base_url = @config.payroll_uk_url
|
|
309
|
+
when "PayrollNzApi"
|
|
310
|
+
method_base_url = @config.payroll_nz_url
|
|
301
311
|
when "ProjectApi"
|
|
302
312
|
method_base_url = @config.project_url
|
|
313
|
+
when "FilesApi"
|
|
314
|
+
method_base_url = @config.files_url
|
|
303
315
|
when "AppStoreApi"
|
|
304
316
|
method_base_url = @config.app_store_url
|
|
305
317
|
when "FinanceApi"
|
|
306
318
|
method_base_url = @config.finance_url
|
|
307
319
|
when "AccountDataApi"
|
|
308
320
|
method_base_url = @config.account_data_url
|
|
321
|
+
when "FeedConnectionsApi"
|
|
322
|
+
method_base_url = @config.bankfeeds_v2_url
|
|
309
323
|
else
|
|
310
324
|
method_base_url = @config.accounting_url
|
|
311
325
|
end
|
|
312
326
|
|
|
313
327
|
connection = Faraday.new(:url => method_base_url, :ssl => ssl_options) do |conn|
|
|
314
|
-
conn.options.params_encoder = Faraday::FlatParamsEncoder if
|
|
328
|
+
conn.options.params_encoder = Faraday::FlatParamsEncoder if %w[ AccountDataApi ].include?(api_client)
|
|
315
329
|
conn.request(:authorization, :basic, config.username, config.password)
|
|
316
330
|
if opts[:header_params]["Content-Type"] == "multipart/form-data"
|
|
317
331
|
conn.request :multipart
|
|
@@ -519,22 +533,26 @@ module XeroRuby
|
|
|
519
533
|
XeroRuby::Accounting.const_get(return_type).build_from_hash(data)
|
|
520
534
|
when 'AssetApi'
|
|
521
535
|
XeroRuby::Assets.const_get(return_type).build_from_hash(data)
|
|
522
|
-
when 'ProjectApi'
|
|
523
|
-
XeroRuby::Projects.const_get(return_type).build_from_hash(data)
|
|
524
|
-
when 'FilesApi'
|
|
525
|
-
XeroRuby::Files.const_get(return_type).build_from_hash(data)
|
|
526
536
|
when 'PayrollAuApi'
|
|
527
537
|
XeroRuby::PayrollAu.const_get(return_type).build_from_hash(data)
|
|
528
|
-
when '
|
|
529
|
-
XeroRuby::
|
|
538
|
+
when 'PayrollAuV2Api'
|
|
539
|
+
XeroRuby::PayrollAuV2.const_get(return_type).build_from_hash(data)
|
|
530
540
|
when 'PayrollUkApi'
|
|
531
541
|
XeroRuby::PayrollUk.const_get(return_type).build_from_hash(data)
|
|
542
|
+
when 'PayrollNzApi'
|
|
543
|
+
XeroRuby::PayrollNz.const_get(return_type).build_from_hash(data)
|
|
544
|
+
when 'ProjectApi'
|
|
545
|
+
XeroRuby::Projects.const_get(return_type).build_from_hash(data)
|
|
546
|
+
when 'FilesApi'
|
|
547
|
+
XeroRuby::Files.const_get(return_type).build_from_hash(data)
|
|
532
548
|
when 'AppStoreApi'
|
|
533
549
|
XeroRuby::AppStore.const_get(return_type).build_from_hash(data)
|
|
534
550
|
when 'FinanceApi'
|
|
535
551
|
XeroRuby::Finance.const_get(return_type).build_from_hash(data)
|
|
536
552
|
when 'AccountDataApi'
|
|
537
553
|
XeroRuby::AccountData.const_get(return_type).build_from_hash(data)
|
|
554
|
+
when 'FeedConnectionsApi'
|
|
555
|
+
XeroRuby::BankfeedsV2.const_get(return_type).build_from_hash(data)
|
|
538
556
|
else
|
|
539
557
|
XeroRuby::Accounting.const_get(return_type).build_from_hash(data)
|
|
540
558
|
end
|
|
@@ -28,14 +28,16 @@ module XeroRuby
|
|
|
28
28
|
# Defines base paths for seperate API's
|
|
29
29
|
attr_accessor :accounting_url
|
|
30
30
|
attr_accessor :asset_url
|
|
31
|
-
attr_accessor :project_url
|
|
32
|
-
attr_accessor :files_url
|
|
33
31
|
attr_accessor :payroll_au_url
|
|
34
|
-
attr_accessor :
|
|
32
|
+
attr_accessor :payroll_au_v2_url
|
|
35
33
|
attr_accessor :payroll_uk_url
|
|
34
|
+
attr_accessor :payroll_nz_url
|
|
35
|
+
attr_accessor :project_url
|
|
36
|
+
attr_accessor :files_url
|
|
36
37
|
attr_accessor :app_store_url
|
|
37
38
|
attr_accessor :finance_url
|
|
38
39
|
attr_accessor :account_data_url
|
|
40
|
+
attr_accessor :bankfeeds_v2_url
|
|
39
41
|
|
|
40
42
|
# Defines API keys used with API Key authentications.
|
|
41
43
|
#
|
|
@@ -147,14 +149,16 @@ module XeroRuby
|
|
|
147
149
|
@token_url = 'https://identity.xero.com/connect'
|
|
148
150
|
@accounting_url = 'https://api.xero.com/api.xro/2.0'
|
|
149
151
|
@asset_url = 'https://api.xero.com/assets.xro/1.0'
|
|
150
|
-
@project_url = 'https://api.xero.com/projects.xro/2.0/'
|
|
151
|
-
@files_url = 'https://api.xero.com/files.xro/1.0/'
|
|
152
152
|
@payroll_au_url = 'https://api.xero.com/payroll.xro/1.0/'
|
|
153
|
-
@
|
|
153
|
+
@payroll_au_v2_url = 'https://api.xero.com/payroll.xro/2.0/'
|
|
154
154
|
@payroll_uk_url = 'https://api.xero.com/payroll.xro/2.0/'
|
|
155
|
+
@payroll_nz_url = 'https://api.xero.com/payroll.xro/2.0/'
|
|
156
|
+
@project_url = 'https://api.xero.com/projects.xro/2.0/'
|
|
157
|
+
@files_url = 'https://api.xero.com/files.xro/1.0/'
|
|
155
158
|
@app_store_url = 'https://api.xero.com/appstore/2.0/'
|
|
156
159
|
@finance_url = 'https://api.xero.com/finance.xro/1.0/'
|
|
157
160
|
@account_data_url = 'https://api.xero.com/accountdata.xro/1.0/'
|
|
161
|
+
@bankfeeds_v2_url = 'https://api.xero.com/bankfeeds.xro/2.0/'
|
|
158
162
|
@access_token = nil
|
|
159
163
|
@id_token = nil
|
|
160
164
|
@api_key = {}
|