@teemill/warehouse-packaging 0.1.0 → 0.1.2

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.
Files changed (59) hide show
  1. package/README.md +41 -3
  2. package/api.ts +364 -0
  3. package/base.ts +86 -0
  4. package/common.ts +150 -0
  5. package/configuration.ts +115 -0
  6. package/dist/api.d.ts +232 -0
  7. package/dist/api.js +230 -0
  8. package/dist/base.d.ts +66 -0
  9. package/dist/base.js +65 -0
  10. package/dist/common.d.ts +65 -0
  11. package/dist/common.js +161 -0
  12. package/dist/configuration.d.ts +91 -0
  13. package/dist/configuration.js +44 -0
  14. package/dist/esm/api.d.ts +232 -0
  15. package/dist/esm/api.js +223 -0
  16. package/dist/esm/base.d.ts +66 -0
  17. package/dist/esm/base.js +60 -0
  18. package/dist/esm/common.d.ts +65 -0
  19. package/dist/esm/common.js +149 -0
  20. package/dist/esm/configuration.d.ts +91 -0
  21. package/dist/esm/configuration.js +40 -0
  22. package/dist/esm/index.d.ts +13 -0
  23. package/dist/esm/index.js +15 -0
  24. package/dist/index.d.ts +13 -3
  25. package/dist/index.js +15 -5
  26. package/docs/ApiError.md +22 -0
  27. package/docs/Packaging.md +28 -0
  28. package/docs/PackagingApi.md +128 -0
  29. package/docs/PackagingListResponse.md +22 -0
  30. package/git_push.sh +57 -0
  31. package/index.ts +18 -0
  32. package/package.json +18 -4
  33. package/tsconfig.esm.json +7 -0
  34. package/tsconfig.json +4 -6
  35. package/.openapi-generator/FILES +0 -13
  36. package/.openapi-generator/VERSION +0 -1
  37. package/.openapi-generator-ignore +0 -23
  38. package/dist/apis/PackagingApi.d.ts +0 -47
  39. package/dist/apis/PackagingApi.js +0 -227
  40. package/dist/apis/index.d.ts +0 -1
  41. package/dist/apis/index.js +0 -19
  42. package/dist/models/ApiError.d.ts +0 -37
  43. package/dist/models/ApiError.js +0 -53
  44. package/dist/models/Packaging.d.ts +0 -55
  45. package/dist/models/Packaging.js +0 -62
  46. package/dist/models/PackagingListResponse.d.ts +0 -38
  47. package/dist/models/PackagingListResponse.js +0 -54
  48. package/dist/models/index.d.ts +0 -3
  49. package/dist/models/index.js +0 -21
  50. package/dist/runtime.d.ts +0 -187
  51. package/dist/runtime.js +0 -565
  52. package/src/apis/PackagingApi.ts +0 -169
  53. package/src/apis/index.ts +0 -3
  54. package/src/index.ts +0 -5
  55. package/src/models/ApiError.ts +0 -74
  56. package/src/models/Packaging.ts +0 -102
  57. package/src/models/PackagingListResponse.ts +0 -82
  58. package/src/models/index.ts +0 -5
  59. package/src/runtime.ts +0 -441
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- ## @teemill/warehouse-packaging@0.1.0
1
+ ## @teemill/warehouse-packaging@0.1.2
2
2
 
3
- This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
3
+ This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
4
4
 
5
5
  Environment
6
6
  * Node.js
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @teemill/warehouse-packaging@0.1.0 --save
39
+ npm install @teemill/warehouse-packaging@0.1.2 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -44,3 +44,41 @@ _unPublished (not recommended):_
44
44
  ```
45
45
  npm install PATH_TO_GENERATED_PACKAGE --save
46
46
  ```
47
+
48
+ ### Documentation for API Endpoints
49
+
50
+ All URIs are relative to *https://api.podos.io*
51
+
52
+ Class | Method | HTTP request | Description
53
+ ------------ | ------------- | ------------- | -------------
54
+ *PackagingApi* | [**getPackaging**](docs/PackagingApi.md#getpackaging) | **GET** /v1/warehouse/packaging/{packagingId} | Get a packaging resource
55
+ *PackagingApi* | [**listPackaging**](docs/PackagingApi.md#listpackaging) | **GET** /v1/warehouse/packaging | List packaging
56
+
57
+
58
+ ### Documentation For Models
59
+
60
+ - [ApiError](docs/ApiError.md)
61
+ - [Packaging](docs/Packaging.md)
62
+ - [PackagingListResponse](docs/PackagingListResponse.md)
63
+
64
+
65
+ <a id="documentation-for-authorization"></a>
66
+ ## Documentation For Authorization
67
+
68
+
69
+ Authentication schemes defined for the API:
70
+ <a id="api-key"></a>
71
+ ### api-key
72
+
73
+ - **Type**: API key
74
+ - **API key parameter name**: Authorization
75
+ - **Location**: HTTP header
76
+
77
+ <a id="session-oauth"></a>
78
+ ### session-oauth
79
+
80
+ - **Type**: OAuth
81
+ - **Flow**: password
82
+ - **Authorization URL**:
83
+ - **Scopes**: N/A
84
+
package/api.ts ADDED
@@ -0,0 +1,364 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Packaging API
5
+ * Manage Packaging
6
+ *
7
+ * The version of the OpenAPI document: 0.1.2
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 type { Configuration } from './configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
22
+ import type { RequestArgs } from './base';
23
+ // @ts-ignore
24
+ import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap } from './base';
25
+
26
+ /**
27
+ *
28
+ * @export
29
+ * @interface ApiError
30
+ */
31
+ export interface ApiError {
32
+ /**
33
+ *
34
+ * @type {string}
35
+ * @memberof ApiError
36
+ */
37
+ 'code'?: string;
38
+ /**
39
+ *
40
+ * @type {string}
41
+ * @memberof ApiError
42
+ */
43
+ 'message': string;
44
+ }
45
+ /**
46
+ *
47
+ * @export
48
+ * @interface Packaging
49
+ */
50
+ export interface Packaging {
51
+ /**
52
+ * Unique object identifier
53
+ * @type {string}
54
+ * @memberof Packaging
55
+ */
56
+ 'id': string;
57
+ /**
58
+ * A reference to the resource location
59
+ * @type {string}
60
+ * @memberof Packaging
61
+ */
62
+ 'ref': string;
63
+ /**
64
+ *
65
+ * @type {string}
66
+ * @memberof Packaging
67
+ */
68
+ 'name': string;
69
+ /**
70
+ *
71
+ * @type {string}
72
+ * @memberof Packaging
73
+ */
74
+ 'image': string;
75
+ /**
76
+ * Weight in grams
77
+ * @type {number}
78
+ * @memberof Packaging
79
+ */
80
+ 'weight': number;
81
+ }
82
+ /**
83
+ *
84
+ * @export
85
+ * @interface PackagingListResponse
86
+ */
87
+ export interface PackagingListResponse {
88
+ /**
89
+ *
90
+ * @type {Array<Packaging>}
91
+ * @memberof PackagingListResponse
92
+ */
93
+ 'packaging': Array<Packaging>;
94
+ /**
95
+ *
96
+ * @type {number}
97
+ * @memberof PackagingListResponse
98
+ */
99
+ 'nextPageToken': number;
100
+ }
101
+
102
+ /**
103
+ * PackagingApi - axios parameter creator
104
+ * @export
105
+ */
106
+ export const PackagingApiAxiosParamCreator = function (configuration?: Configuration) {
107
+ return {
108
+ /**
109
+ * Get packaging
110
+ * @summary Get a packaging resource
111
+ * @param {string} project What project it is
112
+ * @param {string} packagingId Unique identifier of packaging
113
+ * @param {*} [options] Override http request option.
114
+ * @throws {RequiredError}
115
+ */
116
+ getPackaging: async (project: string, packagingId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
117
+ // verify required parameter 'project' is not null or undefined
118
+ assertParamExists('getPackaging', 'project', project)
119
+ // verify required parameter 'packagingId' is not null or undefined
120
+ assertParamExists('getPackaging', 'packagingId', packagingId)
121
+ const localVarPath = `/v1/warehouse/packaging/{packagingId}`
122
+ .replace(`{${"packagingId"}}`, encodeURIComponent(String(packagingId)));
123
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
124
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
125
+ let baseOptions;
126
+ if (configuration) {
127
+ baseOptions = configuration.baseOptions;
128
+ }
129
+
130
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
131
+ const localVarHeaderParameter = {} as any;
132
+ const localVarQueryParameter = {} as any;
133
+
134
+ // authentication session-oauth required
135
+ // oauth required
136
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
137
+
138
+ // authentication api-key required
139
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
140
+
141
+ if (project !== undefined) {
142
+ localVarQueryParameter['project'] = project;
143
+ }
144
+
145
+
146
+
147
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
148
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
149
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
150
+
151
+ return {
152
+ url: toPathString(localVarUrlObj),
153
+ options: localVarRequestOptions,
154
+ };
155
+ },
156
+ /**
157
+ * Lists packaging items paginated into chunks
158
+ * @summary List packaging
159
+ * @param {string} project What project it is
160
+ * @param {number} [pageToken] Page reference token
161
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
162
+ * @param {*} [options] Override http request option.
163
+ * @throws {RequiredError}
164
+ */
165
+ listPackaging: async (project: string, pageToken?: number, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
166
+ // verify required parameter 'project' is not null or undefined
167
+ assertParamExists('listPackaging', 'project', project)
168
+ const localVarPath = `/v1/warehouse/packaging`;
169
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
170
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
171
+ let baseOptions;
172
+ if (configuration) {
173
+ baseOptions = configuration.baseOptions;
174
+ }
175
+
176
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
177
+ const localVarHeaderParameter = {} as any;
178
+ const localVarQueryParameter = {} as any;
179
+
180
+ // authentication session-oauth required
181
+ // oauth required
182
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
183
+
184
+ // authentication api-key required
185
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
186
+
187
+ if (project !== undefined) {
188
+ localVarQueryParameter['project'] = project;
189
+ }
190
+
191
+ if (pageToken !== undefined) {
192
+ localVarQueryParameter['pageToken'] = pageToken;
193
+ }
194
+
195
+ if (pageSize !== undefined) {
196
+ localVarQueryParameter['pageSize'] = pageSize;
197
+ }
198
+
199
+
200
+
201
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
202
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
203
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
204
+
205
+ return {
206
+ url: toPathString(localVarUrlObj),
207
+ options: localVarRequestOptions,
208
+ };
209
+ },
210
+ }
211
+ };
212
+
213
+ /**
214
+ * PackagingApi - functional programming interface
215
+ * @export
216
+ */
217
+ export const PackagingApiFp = function(configuration?: Configuration) {
218
+ const localVarAxiosParamCreator = PackagingApiAxiosParamCreator(configuration)
219
+ return {
220
+ /**
221
+ * Get packaging
222
+ * @summary Get a packaging resource
223
+ * @param {string} project What project it is
224
+ * @param {string} packagingId Unique identifier of packaging
225
+ * @param {*} [options] Override http request option.
226
+ * @throws {RequiredError}
227
+ */
228
+ async getPackaging(project: string, packagingId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Packaging>> {
229
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getPackaging(project, packagingId, options);
230
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
231
+ const localVarOperationServerBasePath = operationServerMap['PackagingApi.getPackaging']?.[localVarOperationServerIndex]?.url;
232
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
233
+ },
234
+ /**
235
+ * Lists packaging items paginated into chunks
236
+ * @summary List packaging
237
+ * @param {string} project What project it is
238
+ * @param {number} [pageToken] Page reference token
239
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ */
243
+ async listPackaging(project: string, pageToken?: number, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PackagingListResponse>> {
244
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listPackaging(project, pageToken, pageSize, options);
245
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
246
+ const localVarOperationServerBasePath = operationServerMap['PackagingApi.listPackaging']?.[localVarOperationServerIndex]?.url;
247
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
248
+ },
249
+ }
250
+ };
251
+
252
+ /**
253
+ * PackagingApi - factory interface
254
+ * @export
255
+ */
256
+ export const PackagingApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
257
+ const localVarFp = PackagingApiFp(configuration)
258
+ return {
259
+ /**
260
+ * Get packaging
261
+ * @summary Get a packaging resource
262
+ * @param {PackagingApiGetPackagingRequest} requestParameters Request parameters.
263
+ * @param {*} [options] Override http request option.
264
+ * @throws {RequiredError}
265
+ */
266
+ getPackaging(requestParameters: PackagingApiGetPackagingRequest, options?: RawAxiosRequestConfig): AxiosPromise<Packaging> {
267
+ return localVarFp.getPackaging(requestParameters.project, requestParameters.packagingId, options).then((request) => request(axios, basePath));
268
+ },
269
+ /**
270
+ * Lists packaging items paginated into chunks
271
+ * @summary List packaging
272
+ * @param {PackagingApiListPackagingRequest} requestParameters Request parameters.
273
+ * @param {*} [options] Override http request option.
274
+ * @throws {RequiredError}
275
+ */
276
+ listPackaging(requestParameters: PackagingApiListPackagingRequest, options?: RawAxiosRequestConfig): AxiosPromise<PackagingListResponse> {
277
+ return localVarFp.listPackaging(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, options).then((request) => request(axios, basePath));
278
+ },
279
+ };
280
+ };
281
+
282
+ /**
283
+ * Request parameters for getPackaging operation in PackagingApi.
284
+ * @export
285
+ * @interface PackagingApiGetPackagingRequest
286
+ */
287
+ export interface PackagingApiGetPackagingRequest {
288
+ /**
289
+ * What project it is
290
+ * @type {string}
291
+ * @memberof PackagingApiGetPackaging
292
+ */
293
+ readonly project: string
294
+
295
+ /**
296
+ * Unique identifier of packaging
297
+ * @type {string}
298
+ * @memberof PackagingApiGetPackaging
299
+ */
300
+ readonly packagingId: string
301
+ }
302
+
303
+ /**
304
+ * Request parameters for listPackaging operation in PackagingApi.
305
+ * @export
306
+ * @interface PackagingApiListPackagingRequest
307
+ */
308
+ export interface PackagingApiListPackagingRequest {
309
+ /**
310
+ * What project it is
311
+ * @type {string}
312
+ * @memberof PackagingApiListPackaging
313
+ */
314
+ readonly project: string
315
+
316
+ /**
317
+ * Page reference token
318
+ * @type {number}
319
+ * @memberof PackagingApiListPackaging
320
+ */
321
+ readonly pageToken?: number
322
+
323
+ /**
324
+ * Max page size. This is the maximum page size that will be returned, but it might be smaller.
325
+ * @type {number}
326
+ * @memberof PackagingApiListPackaging
327
+ */
328
+ readonly pageSize?: number
329
+ }
330
+
331
+ /**
332
+ * PackagingApi - object-oriented interface
333
+ * @export
334
+ * @class PackagingApi
335
+ * @extends {BaseAPI}
336
+ */
337
+ export class PackagingApi extends BaseAPI {
338
+ /**
339
+ * Get packaging
340
+ * @summary Get a packaging resource
341
+ * @param {PackagingApiGetPackagingRequest} requestParameters Request parameters.
342
+ * @param {*} [options] Override http request option.
343
+ * @throws {RequiredError}
344
+ * @memberof PackagingApi
345
+ */
346
+ public getPackaging(requestParameters: PackagingApiGetPackagingRequest, options?: RawAxiosRequestConfig) {
347
+ return PackagingApiFp(this.configuration).getPackaging(requestParameters.project, requestParameters.packagingId, options).then((request) => request(this.axios, this.basePath));
348
+ }
349
+
350
+ /**
351
+ * Lists packaging items paginated into chunks
352
+ * @summary List packaging
353
+ * @param {PackagingApiListPackagingRequest} requestParameters Request parameters.
354
+ * @param {*} [options] Override http request option.
355
+ * @throws {RequiredError}
356
+ * @memberof PackagingApi
357
+ */
358
+ public listPackaging(requestParameters: PackagingApiListPackagingRequest, options?: RawAxiosRequestConfig) {
359
+ return PackagingApiFp(this.configuration).listPackaging(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath));
360
+ }
361
+ }
362
+
363
+
364
+
package/base.ts ADDED
@@ -0,0 +1,86 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Packaging API
5
+ * Manage Packaging
6
+ *
7
+ * The version of the OpenAPI document: 0.1.2
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 type { Configuration } from './configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
19
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
20
+ import globalAxios from 'axios';
21
+
22
+ export const BASE_PATH = "https://api.podos.io".replace(/\/+$/, "");
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ */
28
+ export const COLLECTION_FORMATS = {
29
+ csv: ",",
30
+ ssv: " ",
31
+ tsv: "\t",
32
+ pipes: "|",
33
+ };
34
+
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface RequestArgs
39
+ */
40
+ export interface RequestArgs {
41
+ url: string;
42
+ options: RawAxiosRequestConfig;
43
+ }
44
+
45
+ /**
46
+ *
47
+ * @export
48
+ * @class BaseAPI
49
+ */
50
+ export class BaseAPI {
51
+ protected configuration: Configuration | undefined;
52
+
53
+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
54
+ if (configuration) {
55
+ this.configuration = configuration;
56
+ this.basePath = configuration.basePath ?? basePath;
57
+ }
58
+ }
59
+ };
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ * @class RequiredError
65
+ * @extends {Error}
66
+ */
67
+ export class RequiredError extends Error {
68
+ constructor(public field: string, msg?: string) {
69
+ super(msg);
70
+ this.name = "RequiredError"
71
+ }
72
+ }
73
+
74
+ interface ServerMap {
75
+ [key: string]: {
76
+ url: string,
77
+ description: string,
78
+ }[];
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @export
84
+ */
85
+ export const operationServerMap: ServerMap = {
86
+ }
package/common.ts ADDED
@@ -0,0 +1,150 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Packaging API
5
+ * Manage Packaging
6
+ *
7
+ * The version of the OpenAPI document: 0.1.2
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 type { Configuration } from "./configuration";
17
+ import type { RequestArgs } from "./base";
18
+ import type { AxiosInstance, AxiosResponse } from 'axios';
19
+ import { RequiredError } from "./base";
20
+
21
+ /**
22
+ *
23
+ * @export
24
+ */
25
+ export const DUMMY_BASE_URL = 'https://example.com'
26
+
27
+ /**
28
+ *
29
+ * @throws {RequiredError}
30
+ * @export
31
+ */
32
+ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
36
+ }
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ */
42
+ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
43
+ if (configuration && configuration.apiKey) {
44
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
45
+ ? await configuration.apiKey(keyParamName)
46
+ : await configuration.apiKey;
47
+ object[keyParamName] = localVarApiKeyValue;
48
+ }
49
+ }
50
+
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
56
+ if (configuration && (configuration.username || configuration.password)) {
57
+ object["auth"] = { username: configuration.username, password: configuration.password };
58
+ }
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
66
+ if (configuration && configuration.accessToken) {
67
+ const accessToken = typeof configuration.accessToken === 'function'
68
+ ? await configuration.accessToken()
69
+ : await configuration.accessToken;
70
+ object["Authorization"] = "Bearer " + accessToken;
71
+ }
72
+ }
73
+
74
+ /**
75
+ *
76
+ * @export
77
+ */
78
+ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
79
+ if (configuration && configuration.accessToken) {
80
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
81
+ ? await configuration.accessToken(name, scopes)
82
+ : await configuration.accessToken;
83
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
84
+ }
85
+ }
86
+
87
+ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
88
+ if (parameter == null) return;
89
+ if (typeof parameter === "object") {
90
+ if (Array.isArray(parameter)) {
91
+ (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key !== '' ? `${key}[]` : key));
92
+ }
93
+ else {
94
+ Object.keys(parameter).forEach(currentKey =>
95
+ setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
96
+ );
97
+ }
98
+ }
99
+ else {
100
+ if (urlSearchParams.has(key)) {
101
+ urlSearchParams.append(key, parameter);
102
+ }
103
+ else {
104
+ urlSearchParams.set(key, parameter);
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ *
111
+ * @export
112
+ */
113
+ export const setSearchParams = function (url: URL, ...objects: any[]) {
114
+ const searchParams = new URLSearchParams(url.search);
115
+ setFlattenedQueryParams(searchParams, objects);
116
+ url.search = decodeURIComponent(searchParams.toString());
117
+ }
118
+
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ }
132
+
133
+ /**
134
+ *
135
+ * @export
136
+ */
137
+ export const toPathString = function (url: URL) {
138
+ return url.pathname + url.search + url.hash
139
+ }
140
+
141
+ /**
142
+ *
143
+ * @export
144
+ */
145
+ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
150
+ }