@emilgroup/account-sdk 1.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.
- package/.openapi-generator/FILES +24 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +52 -0
- package/api/accounts-api.ts +527 -0
- package/api.ts +32 -0
- package/base.ts +182 -0
- package/common.ts +138 -0
- package/configuration.ts +109 -0
- package/dist/api/accounts-api.d.ts +255 -0
- package/dist/api/accounts-api.js +637 -0
- package/dist/api.d.ts +16 -0
- package/dist/api.js +36 -0
- package/dist/base.d.ts +68 -0
- package/dist/base.js +243 -0
- package/dist/common.d.ts +65 -0
- package/dist/common.js +243 -0
- package/dist/configuration.d.ts +90 -0
- package/dist/configuration.js +44 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +35 -0
- package/dist/models/account-class.d.ts +132 -0
- package/dist/models/account-class.js +15 -0
- package/dist/models/create-account-request-dto.d.ts +102 -0
- package/dist/models/create-account-request-dto.js +21 -0
- package/dist/models/create-account-response-class.d.ts +25 -0
- package/dist/models/create-account-response-class.js +15 -0
- package/dist/models/delete-request-dto.d.ts +24 -0
- package/dist/models/delete-request-dto.js +15 -0
- package/dist/models/get-account-request-dto.d.ts +30 -0
- package/dist/models/get-account-request-dto.js +15 -0
- package/dist/models/get-account-response-class.d.ts +25 -0
- package/dist/models/get-account-response-class.js +15 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +26 -0
- package/dist/models/list-accounts-response-class.d.ts +31 -0
- package/dist/models/list-accounts-response-class.js +15 -0
- package/dist/models/register-policy-request-dto.d.ts +36 -0
- package/dist/models/register-policy-request-dto.js +15 -0
- package/dist/models/update-account-request-dto.d.ts +108 -0
- package/dist/models/update-account-request-dto.js +21 -0
- package/dist/models/update-account-response-class.d.ts +25 -0
- package/dist/models/update-account-response-class.js +15 -0
- package/git_push.sh +57 -0
- package/index.ts +19 -0
- package/models/account-class.ts +138 -0
- package/models/create-account-request-dto.ts +111 -0
- package/models/create-account-response-class.ts +31 -0
- package/models/delete-request-dto.ts +30 -0
- package/models/get-account-request-dto.ts +36 -0
- package/models/get-account-response-class.ts +31 -0
- package/models/index.ts +10 -0
- package/models/list-accounts-response-class.ts +37 -0
- package/models/register-policy-request-dto.ts +42 -0
- package/models/update-account-request-dto.ts +117 -0
- package/models/update-account-response-class.ts +31 -0
- package/package.json +27 -0
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.gitignore
|
|
2
|
+
.npmignore
|
|
3
|
+
.openapi-generator-ignore
|
|
4
|
+
README.md
|
|
5
|
+
api.ts
|
|
6
|
+
api/accounts-api.ts
|
|
7
|
+
base.ts
|
|
8
|
+
common.ts
|
|
9
|
+
configuration.ts
|
|
10
|
+
git_push.sh
|
|
11
|
+
index.ts
|
|
12
|
+
models/account-class.ts
|
|
13
|
+
models/create-account-request-dto.ts
|
|
14
|
+
models/create-account-response-class.ts
|
|
15
|
+
models/delete-request-dto.ts
|
|
16
|
+
models/get-account-request-dto.ts
|
|
17
|
+
models/get-account-response-class.ts
|
|
18
|
+
models/index.ts
|
|
19
|
+
models/list-accounts-response-class.ts
|
|
20
|
+
models/register-policy-request-dto.ts
|
|
21
|
+
models/update-account-request-dto.ts
|
|
22
|
+
models/update-account-response-class.ts
|
|
23
|
+
package.json
|
|
24
|
+
tsconfig.json
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
5.4.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# OpenAPI Generator Ignore
|
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
|
3
|
+
|
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
|
6
|
+
|
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
|
9
|
+
#ApiClient.cs
|
|
10
|
+
|
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
|
12
|
+
#foo/*/qux
|
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
|
14
|
+
|
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
|
16
|
+
#foo/**/qux
|
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
|
18
|
+
|
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
|
21
|
+
#docs/*.md
|
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
|
23
|
+
#!docs/README.md
|
package/README.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
## @emilgroup/account-sdk@1.0.0
|
|
2
|
+
|
|
3
|
+
This TypeScript/JavaScript client utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
|
|
4
|
+
|
|
5
|
+
Environment
|
|
6
|
+
* Node.js
|
|
7
|
+
* Webpack
|
|
8
|
+
* Browserify
|
|
9
|
+
|
|
10
|
+
Language level
|
|
11
|
+
* ES5 - you must have a Promises/A+ library installed
|
|
12
|
+
* ES6
|
|
13
|
+
|
|
14
|
+
Module system
|
|
15
|
+
* CommonJS
|
|
16
|
+
* ES6 module system
|
|
17
|
+
|
|
18
|
+
It can be used in both TypeScript and JavaScript. In TypeScript, the definition should be automatically resolved via `package.json`. ([Reference](http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html))
|
|
19
|
+
|
|
20
|
+
### Consuming
|
|
21
|
+
|
|
22
|
+
navigate to the folder of your consuming project and run one of the following commands.
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
npm install @emilgroup/account-sdk@1.0.0 --save
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
And then you can import `EmilApi`.
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { EmilApi } from '@emilgroup/typescript-axios-sdk';
|
|
32
|
+
|
|
33
|
+
const emilApi = new EmilApi();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
To use authentication protected endpoints, you have to first authorize. To do so, use the `authorize` function in `EmilApi`:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
async function listAccounts(): Promise<Void> {
|
|
40
|
+
try {
|
|
41
|
+
const emilApi = new EmilApi();
|
|
42
|
+
|
|
43
|
+
await emilApi.authorize('username', 'password');
|
|
44
|
+
|
|
45
|
+
const { data: { items } } = await emilApi.accounts.listAccounts();
|
|
46
|
+
|
|
47
|
+
console.log(items);
|
|
48
|
+
} catch(error) {
|
|
49
|
+
// process error
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* EMIL AccountService
|
|
5
|
+
* The EMIL AccountService API description
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import globalAxios, { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
17
|
+
import { Configuration } from '../configuration';
|
|
18
|
+
// Some imports not used depending on template conditions
|
|
19
|
+
// @ts-ignore
|
|
20
|
+
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
|
|
21
|
+
// @ts-ignore
|
|
22
|
+
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
import { CreateAccountRequestDto } from '../models';
|
|
25
|
+
// @ts-ignore
|
|
26
|
+
import { CreateAccountResponseClass } from '../models';
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
import { GetAccountResponseClass } from '../models';
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
import { ListAccountsResponseClass } from '../models';
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
import { UpdateAccountRequestDto } from '../models';
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
import { UpdateAccountResponseClass } from '../models';
|
|
35
|
+
/**
|
|
36
|
+
* AccountsApi - axios parameter creator
|
|
37
|
+
* @export
|
|
38
|
+
*/
|
|
39
|
+
export const AccountsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
40
|
+
return {
|
|
41
|
+
/**
|
|
42
|
+
* This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
|
|
43
|
+
* @summary Create the account
|
|
44
|
+
* @param {CreateAccountRequestDto} createAccountRequestDto
|
|
45
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
46
|
+
* @param {*} [options] Override http request option.
|
|
47
|
+
* @throws {RequiredError}
|
|
48
|
+
*/
|
|
49
|
+
createAccount: async (createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
50
|
+
// verify required parameter 'createAccountRequestDto' is not null or undefined
|
|
51
|
+
assertParamExists('createAccount', 'createAccountRequestDto', createAccountRequestDto)
|
|
52
|
+
const localVarPath = `/accountservice/v1/accounts`;
|
|
53
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
54
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
55
|
+
let baseOptions;
|
|
56
|
+
let baseAccessToken;
|
|
57
|
+
if (configuration) {
|
|
58
|
+
baseOptions = configuration.baseOptions;
|
|
59
|
+
baseAccessToken = configuration.accessToken;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
63
|
+
const localVarHeaderParameter = {} as any;
|
|
64
|
+
const localVarQueryParameter = {} as any;
|
|
65
|
+
|
|
66
|
+
// authentication bearer required
|
|
67
|
+
// http bearer authentication required
|
|
68
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
69
|
+
|
|
70
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
71
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
77
|
+
|
|
78
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
79
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
80
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
81
|
+
localVarRequestOptions.data = serializeDataIfNeeded(createAccountRequestDto, localVarRequestOptions, configuration)
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
url: toPathString(localVarUrlObj),
|
|
85
|
+
options: localVarRequestOptions,
|
|
86
|
+
};
|
|
87
|
+
},
|
|
88
|
+
/**
|
|
89
|
+
* Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
|
|
90
|
+
* @summary Delete the account
|
|
91
|
+
* @param {string} code Unique identifier for the object.
|
|
92
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
93
|
+
* @param {*} [options] Override http request option.
|
|
94
|
+
* @throws {RequiredError}
|
|
95
|
+
*/
|
|
96
|
+
deleteAccount: async (code: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
97
|
+
// verify required parameter 'code' is not null or undefined
|
|
98
|
+
assertParamExists('deleteAccount', 'code', code)
|
|
99
|
+
const localVarPath = `/accountservice/v1/accounts/{code}`
|
|
100
|
+
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
101
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
102
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
103
|
+
let baseOptions;
|
|
104
|
+
let baseAccessToken;
|
|
105
|
+
if (configuration) {
|
|
106
|
+
baseOptions = configuration.baseOptions;
|
|
107
|
+
baseAccessToken = configuration.accessToken;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
|
111
|
+
const localVarHeaderParameter = {} as any;
|
|
112
|
+
const localVarQueryParameter = {} as any;
|
|
113
|
+
|
|
114
|
+
// authentication bearer required
|
|
115
|
+
// http bearer authentication required
|
|
116
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
117
|
+
|
|
118
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
119
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
125
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
126
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
url: toPathString(localVarUrlObj),
|
|
130
|
+
options: localVarRequestOptions,
|
|
131
|
+
};
|
|
132
|
+
},
|
|
133
|
+
/**
|
|
134
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
135
|
+
* @summary Retrieve the account
|
|
136
|
+
* @param {string} code Unique identifier for the object.
|
|
137
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
138
|
+
* @param {string} [expand] Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
|
|
139
|
+
* @param {*} [options] Override http request option.
|
|
140
|
+
* @throws {RequiredError}
|
|
141
|
+
*/
|
|
142
|
+
getAccount: async (code: string, authorization?: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
143
|
+
// verify required parameter 'code' is not null or undefined
|
|
144
|
+
assertParamExists('getAccount', 'code', code)
|
|
145
|
+
const localVarPath = `/accountservice/v1/accounts/{code}`
|
|
146
|
+
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
147
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
148
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
149
|
+
let baseOptions;
|
|
150
|
+
let baseAccessToken;
|
|
151
|
+
if (configuration) {
|
|
152
|
+
baseOptions = configuration.baseOptions;
|
|
153
|
+
baseAccessToken = configuration.accessToken;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
157
|
+
const localVarHeaderParameter = {} as any;
|
|
158
|
+
const localVarQueryParameter = {} as any;
|
|
159
|
+
|
|
160
|
+
// authentication bearer required
|
|
161
|
+
// http bearer authentication required
|
|
162
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
163
|
+
|
|
164
|
+
if (expand !== undefined) {
|
|
165
|
+
localVarQueryParameter['expand'] = expand;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
169
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
175
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
176
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
url: toPathString(localVarUrlObj),
|
|
180
|
+
options: localVarRequestOptions,
|
|
181
|
+
};
|
|
182
|
+
},
|
|
183
|
+
/**
|
|
184
|
+
* Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
|
|
185
|
+
* @summary List accounts
|
|
186
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
187
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
188
|
+
* @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
189
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
|
|
190
|
+
* @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
|
|
191
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
|
|
192
|
+
* @param {*} [options] Override http request option.
|
|
193
|
+
* @throws {RequiredError}
|
|
194
|
+
*/
|
|
195
|
+
listAccounts: async (authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
196
|
+
const localVarPath = `/accountservice/v1/accounts`;
|
|
197
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
198
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
199
|
+
let baseOptions;
|
|
200
|
+
let baseAccessToken;
|
|
201
|
+
if (configuration) {
|
|
202
|
+
baseOptions = configuration.baseOptions;
|
|
203
|
+
baseAccessToken = configuration.accessToken;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
207
|
+
const localVarHeaderParameter = {} as any;
|
|
208
|
+
const localVarQueryParameter = {} as any;
|
|
209
|
+
|
|
210
|
+
// authentication bearer required
|
|
211
|
+
// http bearer authentication required
|
|
212
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
213
|
+
|
|
214
|
+
if (pageSize !== undefined) {
|
|
215
|
+
localVarQueryParameter['pageSize'] = pageSize;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (pageToken !== undefined) {
|
|
219
|
+
localVarQueryParameter['pageToken'] = pageToken;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
if (filter !== undefined) {
|
|
223
|
+
localVarQueryParameter['filter'] = filter;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (order !== undefined) {
|
|
227
|
+
localVarQueryParameter['order'] = order;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (expand !== undefined) {
|
|
231
|
+
localVarQueryParameter['expand'] = expand;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
235
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
241
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
242
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
243
|
+
|
|
244
|
+
return {
|
|
245
|
+
url: toPathString(localVarUrlObj),
|
|
246
|
+
options: localVarRequestOptions,
|
|
247
|
+
};
|
|
248
|
+
},
|
|
249
|
+
/**
|
|
250
|
+
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
251
|
+
* @summary Update the account
|
|
252
|
+
* @param {string} code Unique identifier for the object.
|
|
253
|
+
* @param {UpdateAccountRequestDto} updateAccountRequestDto
|
|
254
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
255
|
+
* @param {*} [options] Override http request option.
|
|
256
|
+
* @throws {RequiredError}
|
|
257
|
+
*/
|
|
258
|
+
updateAccount: async (code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
259
|
+
// verify required parameter 'code' is not null or undefined
|
|
260
|
+
assertParamExists('updateAccount', 'code', code)
|
|
261
|
+
// verify required parameter 'updateAccountRequestDto' is not null or undefined
|
|
262
|
+
assertParamExists('updateAccount', 'updateAccountRequestDto', updateAccountRequestDto)
|
|
263
|
+
const localVarPath = `/accountservice/v1/accounts/{code}`
|
|
264
|
+
.replace(`{${"code"}}`, encodeURIComponent(String(code)));
|
|
265
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
266
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
267
|
+
let baseOptions;
|
|
268
|
+
let baseAccessToken;
|
|
269
|
+
if (configuration) {
|
|
270
|
+
baseOptions = configuration.baseOptions;
|
|
271
|
+
baseAccessToken = configuration.accessToken;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
|
|
275
|
+
const localVarHeaderParameter = {} as any;
|
|
276
|
+
const localVarQueryParameter = {} as any;
|
|
277
|
+
|
|
278
|
+
// authentication bearer required
|
|
279
|
+
// http bearer authentication required
|
|
280
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
281
|
+
|
|
282
|
+
if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
|
|
283
|
+
localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
289
|
+
|
|
290
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
291
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
292
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
293
|
+
localVarRequestOptions.data = serializeDataIfNeeded(updateAccountRequestDto, localVarRequestOptions, configuration)
|
|
294
|
+
|
|
295
|
+
return {
|
|
296
|
+
url: toPathString(localVarUrlObj),
|
|
297
|
+
options: localVarRequestOptions,
|
|
298
|
+
};
|
|
299
|
+
},
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
|
|
303
|
+
/**
|
|
304
|
+
* AccountsApi - functional programming interface
|
|
305
|
+
* @export
|
|
306
|
+
*/
|
|
307
|
+
export const AccountsApiFp = function(configuration?: Configuration) {
|
|
308
|
+
const localVarAxiosParamCreator = AccountsApiAxiosParamCreator(configuration)
|
|
309
|
+
return {
|
|
310
|
+
/**
|
|
311
|
+
* This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
|
|
312
|
+
* @summary Create the account
|
|
313
|
+
* @param {CreateAccountRequestDto} createAccountRequestDto
|
|
314
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
315
|
+
* @param {*} [options] Override http request option.
|
|
316
|
+
* @throws {RequiredError}
|
|
317
|
+
*/
|
|
318
|
+
async createAccount(createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateAccountResponseClass>> {
|
|
319
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createAccount(createAccountRequestDto, authorization, options);
|
|
320
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
321
|
+
},
|
|
322
|
+
/**
|
|
323
|
+
* Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
|
|
324
|
+
* @summary Delete the account
|
|
325
|
+
* @param {string} code Unique identifier for the object.
|
|
326
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
327
|
+
* @param {*} [options] Override http request option.
|
|
328
|
+
* @throws {RequiredError}
|
|
329
|
+
*/
|
|
330
|
+
async deleteAccount(code: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>> {
|
|
331
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.deleteAccount(code, authorization, options);
|
|
332
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
333
|
+
},
|
|
334
|
+
/**
|
|
335
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
336
|
+
* @summary Retrieve the account
|
|
337
|
+
* @param {string} code Unique identifier for the object.
|
|
338
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
339
|
+
* @param {string} [expand] Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
|
|
340
|
+
* @param {*} [options] Override http request option.
|
|
341
|
+
* @throws {RequiredError}
|
|
342
|
+
*/
|
|
343
|
+
async getAccount(code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetAccountResponseClass>> {
|
|
344
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getAccount(code, authorization, expand, options);
|
|
345
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
346
|
+
},
|
|
347
|
+
/**
|
|
348
|
+
* Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
|
|
349
|
+
* @summary List accounts
|
|
350
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
351
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
352
|
+
* @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
353
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
|
|
354
|
+
* @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
|
|
355
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
|
|
356
|
+
* @param {*} [options] Override http request option.
|
|
357
|
+
* @throws {RequiredError}
|
|
358
|
+
*/
|
|
359
|
+
async listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListAccountsResponseClass>> {
|
|
360
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.listAccounts(authorization, pageSize, pageToken, filter, order, expand, options);
|
|
361
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
362
|
+
},
|
|
363
|
+
/**
|
|
364
|
+
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
365
|
+
* @summary Update the account
|
|
366
|
+
* @param {string} code Unique identifier for the object.
|
|
367
|
+
* @param {UpdateAccountRequestDto} updateAccountRequestDto
|
|
368
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
369
|
+
* @param {*} [options] Override http request option.
|
|
370
|
+
* @throws {RequiredError}
|
|
371
|
+
*/
|
|
372
|
+
async updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateAccountResponseClass>> {
|
|
373
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.updateAccount(code, updateAccountRequestDto, authorization, options);
|
|
374
|
+
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
|
|
375
|
+
},
|
|
376
|
+
}
|
|
377
|
+
};
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* AccountsApi - factory interface
|
|
381
|
+
* @export
|
|
382
|
+
*/
|
|
383
|
+
export const AccountsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
384
|
+
const localVarFp = AccountsApiFp(configuration)
|
|
385
|
+
return {
|
|
386
|
+
/**
|
|
387
|
+
* This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
|
|
388
|
+
* @summary Create the account
|
|
389
|
+
* @param {CreateAccountRequestDto} createAccountRequestDto
|
|
390
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
391
|
+
* @param {*} [options] Override http request option.
|
|
392
|
+
* @throws {RequiredError}
|
|
393
|
+
*/
|
|
394
|
+
createAccount(createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options?: any): AxiosPromise<CreateAccountResponseClass> {
|
|
395
|
+
return localVarFp.createAccount(createAccountRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
396
|
+
},
|
|
397
|
+
/**
|
|
398
|
+
* Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
|
|
399
|
+
* @summary Delete the account
|
|
400
|
+
* @param {string} code Unique identifier for the object.
|
|
401
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
402
|
+
* @param {*} [options] Override http request option.
|
|
403
|
+
* @throws {RequiredError}
|
|
404
|
+
*/
|
|
405
|
+
deleteAccount(code: string, authorization?: string, options?: any): AxiosPromise<object> {
|
|
406
|
+
return localVarFp.deleteAccount(code, authorization, options).then((request) => request(axios, basePath));
|
|
407
|
+
},
|
|
408
|
+
/**
|
|
409
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
410
|
+
* @summary Retrieve the account
|
|
411
|
+
* @param {string} code Unique identifier for the object.
|
|
412
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
413
|
+
* @param {string} [expand] Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
|
|
414
|
+
* @param {*} [options] Override http request option.
|
|
415
|
+
* @throws {RequiredError}
|
|
416
|
+
*/
|
|
417
|
+
getAccount(code: string, authorization?: string, expand?: string, options?: any): AxiosPromise<GetAccountResponseClass> {
|
|
418
|
+
return localVarFp.getAccount(code, authorization, expand, options).then((request) => request(axios, basePath));
|
|
419
|
+
},
|
|
420
|
+
/**
|
|
421
|
+
* Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
|
|
422
|
+
* @summary List accounts
|
|
423
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
424
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
425
|
+
* @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
426
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
|
|
427
|
+
* @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
|
|
428
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
|
|
429
|
+
* @param {*} [options] Override http request option.
|
|
430
|
+
* @throws {RequiredError}
|
|
431
|
+
*/
|
|
432
|
+
listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: any): AxiosPromise<ListAccountsResponseClass> {
|
|
433
|
+
return localVarFp.listAccounts(authorization, pageSize, pageToken, filter, order, expand, options).then((request) => request(axios, basePath));
|
|
434
|
+
},
|
|
435
|
+
/**
|
|
436
|
+
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
437
|
+
* @summary Update the account
|
|
438
|
+
* @param {string} code Unique identifier for the object.
|
|
439
|
+
* @param {UpdateAccountRequestDto} updateAccountRequestDto
|
|
440
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
441
|
+
* @param {*} [options] Override http request option.
|
|
442
|
+
* @throws {RequiredError}
|
|
443
|
+
*/
|
|
444
|
+
updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateAccountResponseClass> {
|
|
445
|
+
return localVarFp.updateAccount(code, updateAccountRequestDto, authorization, options).then((request) => request(axios, basePath));
|
|
446
|
+
},
|
|
447
|
+
};
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* AccountsApi - object-oriented interface
|
|
452
|
+
* @export
|
|
453
|
+
* @class AccountsApi
|
|
454
|
+
* @extends {BaseAPI}
|
|
455
|
+
*/
|
|
456
|
+
export class AccountsApi extends BaseAPI {
|
|
457
|
+
/**
|
|
458
|
+
* This will create an account in the database. Account creation is usually part of a complex workflow that starts with lead creation. Creating directly an account without prior knowledge might result in an unusable account. Look into lead creation for more information.
|
|
459
|
+
* @summary Create the account
|
|
460
|
+
* @param {CreateAccountRequestDto} createAccountRequestDto
|
|
461
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
462
|
+
* @param {*} [options] Override http request option.
|
|
463
|
+
* @throws {RequiredError}
|
|
464
|
+
* @memberof AccountsApi
|
|
465
|
+
*/
|
|
466
|
+
public createAccount(createAccountRequestDto: CreateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig) {
|
|
467
|
+
return AccountsApiFp(this.configuration).createAccount(createAccountRequestDto, authorization, options).then((request) => request(this.axios, this.basePath));
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Permanently deletes the account. Supply the unique code that was returned when you created the account and this will delete it.
|
|
472
|
+
* @summary Delete the account
|
|
473
|
+
* @param {string} code Unique identifier for the object.
|
|
474
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
475
|
+
* @param {*} [options] Override http request option.
|
|
476
|
+
* @throws {RequiredError}
|
|
477
|
+
* @memberof AccountsApi
|
|
478
|
+
*/
|
|
479
|
+
public deleteAccount(code: string, authorization?: string, options?: AxiosRequestConfig) {
|
|
480
|
+
return AccountsApiFp(this.configuration).deleteAccount(code, authorization, options).then((request) => request(this.axios, this.basePath));
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Retrieves the details of the account that was previously created. Supply the unique account code that was returned when you created it and Emil Api will return the corresponding account information.
|
|
485
|
+
* @summary Retrieve the account
|
|
486
|
+
* @param {string} code Unique identifier for the object.
|
|
487
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
488
|
+
* @param {string} [expand] Use the expand query parameter when you need additional information. The expand query parameter increases the set of fields that appear in the response in addition to the default fields. Expanding resources reduces the number of API calls required to accomplish a task.
|
|
489
|
+
* @param {*} [options] Override http request option.
|
|
490
|
+
* @throws {RequiredError}
|
|
491
|
+
* @memberof AccountsApi
|
|
492
|
+
*/
|
|
493
|
+
public getAccount(code: string, authorization?: string, expand?: string, options?: AxiosRequestConfig) {
|
|
494
|
+
return AccountsApiFp(this.configuration).getAccount(code, authorization, expand, options).then((request) => request(this.axios, this.basePath));
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Returns a list of accounts you have previously created. The accounts are returned in sorted order, with the oldest account appearing first. For more information about pagination, read the Pagination documentation.
|
|
499
|
+
* @summary List accounts
|
|
500
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
501
|
+
* @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
|
|
502
|
+
* @param {string} [pageToken] A cursor for use in pagination. *pageToken* is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken=1, your subsequent call can include pageToken=2 in order to fetch the next page of the list.
|
|
503
|
+
* @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time. Parameters: **code**, **firstName**, **lastName**, **accountNumber**, **email**, **zipCode**, **birthDate**
|
|
504
|
+
* @param {string} [order] The order parameter determines how the results should be sorted according to a specified field. It functions similarly to an SQL ORDER BY. Sorting can be performed in either ascending (ASC) or descending (DESC) order. Default: ASC. Parameters: **firstName**, **lastName**, **accountNumber**, **email**.
|
|
505
|
+
* @param {string} [expand] Use this parameter to fetch additional information about the list items. The expand query parameter increases the set of fields that appear in the response in addition to the default ones. Expanding resources can reduce the number of API calls required to accomplish a task. However, use this with parsimony as some expanded fields can drastically increase payload size. Parameters: **policy**.
|
|
506
|
+
* @param {*} [options] Override http request option.
|
|
507
|
+
* @throws {RequiredError}
|
|
508
|
+
* @memberof AccountsApi
|
|
509
|
+
*/
|
|
510
|
+
public listAccounts(authorization?: string, pageSize?: number, pageToken?: string, filter?: string, order?: string, expand?: string, options?: AxiosRequestConfig) {
|
|
511
|
+
return AccountsApiFp(this.configuration).listAccounts(authorization, pageSize, pageToken, filter, order, expand, options).then((request) => request(this.axios, this.basePath));
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Updates the specified account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
|
|
516
|
+
* @summary Update the account
|
|
517
|
+
* @param {string} code Unique identifier for the object.
|
|
518
|
+
* @param {UpdateAccountRequestDto} updateAccountRequestDto
|
|
519
|
+
* @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
|
|
520
|
+
* @param {*} [options] Override http request option.
|
|
521
|
+
* @throws {RequiredError}
|
|
522
|
+
* @memberof AccountsApi
|
|
523
|
+
*/
|
|
524
|
+
public updateAccount(code: string, updateAccountRequestDto: UpdateAccountRequestDto, authorization?: string, options?: AxiosRequestConfig) {
|
|
525
|
+
return AccountsApiFp(this.configuration).updateAccount(code, updateAccountRequestDto, authorization, options).then((request) => request(this.axios, this.basePath));
|
|
526
|
+
}
|
|
527
|
+
}
|