@teemill/gtins 0.2.1 → 0.4.1

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 (77) hide show
  1. package/.openapi-generator/FILES +6 -10
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +3 -3
  4. package/api.ts +781 -0
  5. package/base.ts +86 -0
  6. package/common.ts +150 -0
  7. package/configuration.ts +110 -0
  8. package/dist/api.d.ts +447 -0
  9. package/dist/api.js +536 -0
  10. package/dist/base.d.ts +66 -0
  11. package/dist/base.js +65 -0
  12. package/dist/common.d.ts +65 -0
  13. package/dist/common.js +161 -0
  14. package/dist/configuration.d.ts +91 -0
  15. package/dist/configuration.js +43 -0
  16. package/dist/esm/api.d.ts +447 -0
  17. package/dist/esm/api.js +529 -0
  18. package/dist/esm/base.d.ts +66 -0
  19. package/dist/esm/base.js +60 -0
  20. package/dist/esm/common.d.ts +65 -0
  21. package/dist/esm/common.js +149 -0
  22. package/dist/esm/configuration.d.ts +91 -0
  23. package/dist/esm/configuration.js +39 -0
  24. package/dist/esm/index.d.ts +13 -3
  25. package/dist/esm/index.js +13 -3
  26. package/dist/index.d.ts +13 -3
  27. package/dist/index.js +15 -5
  28. package/git_push.sh +57 -0
  29. package/index.ts +18 -0
  30. package/package.json +15 -3
  31. package/tsconfig.json +4 -6
  32. package/dist/apis/GTINsApi.d.ts +0 -77
  33. package/dist/apis/GTINsApi.js +0 -213
  34. package/dist/apis/index.d.ts +0 -1
  35. package/dist/apis/index.js +0 -19
  36. package/dist/esm/apis/GTINsApi.d.ts +0 -77
  37. package/dist/esm/apis/GTINsApi.js +0 -209
  38. package/dist/esm/apis/index.d.ts +0 -1
  39. package/dist/esm/apis/index.js +0 -3
  40. package/dist/esm/models/ApiError.d.ts +0 -37
  41. package/dist/esm/models/ApiError.js +0 -42
  42. package/dist/esm/models/AssignGtinRequest.d.ts +0 -31
  43. package/dist/esm/models/AssignGtinRequest.js +0 -40
  44. package/dist/esm/models/GTIN.d.ts +0 -37
  45. package/dist/esm/models/GTIN.js +0 -44
  46. package/dist/esm/models/GTINsResponse.d.ts +0 -38
  47. package/dist/esm/models/GTINsResponse.js +0 -41
  48. package/dist/esm/models/ImportGtins202Response.d.ts +0 -31
  49. package/dist/esm/models/ImportGtins202Response.js +0 -38
  50. package/dist/esm/models/index.d.ts +0 -5
  51. package/dist/esm/models/index.js +0 -7
  52. package/dist/esm/runtime.d.ts +0 -187
  53. package/dist/esm/runtime.js +0 -333
  54. package/dist/models/ApiError.d.ts +0 -37
  55. package/dist/models/ApiError.js +0 -49
  56. package/dist/models/AssignGtinRequest.d.ts +0 -31
  57. package/dist/models/AssignGtinRequest.js +0 -47
  58. package/dist/models/GTIN.d.ts +0 -37
  59. package/dist/models/GTIN.js +0 -51
  60. package/dist/models/GTINsResponse.d.ts +0 -38
  61. package/dist/models/GTINsResponse.js +0 -48
  62. package/dist/models/ImportGtins202Response.d.ts +0 -31
  63. package/dist/models/ImportGtins202Response.js +0 -45
  64. package/dist/models/index.d.ts +0 -5
  65. package/dist/models/index.js +0 -23
  66. package/dist/runtime.d.ts +0 -187
  67. package/dist/runtime.js +0 -349
  68. package/src/apis/GTINsApi.ts +0 -311
  69. package/src/apis/index.ts +0 -3
  70. package/src/index.ts +0 -5
  71. package/src/models/ApiError.ts +0 -69
  72. package/src/models/AssignGtinRequest.ts +0 -61
  73. package/src/models/GTIN.ts +0 -70
  74. package/src/models/GTINsResponse.ts +0 -75
  75. package/src/models/ImportGtins202Response.ts +0 -60
  76. package/src/models/index.ts +0 -7
  77. package/src/runtime.ts +0 -441
package/api.ts ADDED
@@ -0,0 +1,781 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GTINs API
5
+ * Manage GTINs
6
+ *
7
+ * The version of the OpenAPI document: 0.4.1
8
+ * Contact: hello@teemill.com
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 AssignGtinRequest
49
+ */
50
+ export interface AssignGtinRequest {
51
+ /**
52
+ * A reference to the resource location
53
+ * @type {string}
54
+ * @memberof AssignGtinRequest
55
+ */
56
+ 'variantRef': string;
57
+ }
58
+ /**
59
+ *
60
+ * @export
61
+ * @interface GTIN
62
+ */
63
+ export interface GTIN {
64
+ /**
65
+ * The GTIN
66
+ * @type {string}
67
+ * @memberof GTIN
68
+ */
69
+ 'number': string;
70
+ /**
71
+ * A reference to the resource location
72
+ * @type {string}
73
+ * @memberof GTIN
74
+ */
75
+ 'variantRef': string;
76
+ }
77
+ /**
78
+ *
79
+ * @export
80
+ * @interface GTINsResponse
81
+ */
82
+ export interface GTINsResponse {
83
+ /**
84
+ *
85
+ * @type {Array<GTIN>}
86
+ * @memberof GTINsResponse
87
+ */
88
+ 'gtins'?: Array<GTIN>;
89
+ /**
90
+ *
91
+ * @type {number}
92
+ * @memberof GTINsResponse
93
+ */
94
+ 'nextPageToken'?: number | null;
95
+ }
96
+ /**
97
+ *
98
+ * @export
99
+ * @interface ImportGtins202Response
100
+ */
101
+ export interface ImportGtins202Response {
102
+ /**
103
+ * Id of the GTINs import
104
+ * @type {string}
105
+ * @memberof ImportGtins202Response
106
+ */
107
+ 'importId'?: string;
108
+ }
109
+
110
+ /**
111
+ * GTINsApi - axios parameter creator
112
+ * @export
113
+ */
114
+ export const GTINsApiAxiosParamCreator = function (configuration?: Configuration) {
115
+ return {
116
+ /**
117
+ * Assign a GTIN to a variant
118
+ * @summary Assign GTIN
119
+ * @param {string} project What project it is
120
+ * @param {string} gtin GTIN
121
+ * @param {AssignGtinRequest} [assignGtinRequest] Assign a GTIN to a variant
122
+ * @param {*} [options] Override http request option.
123
+ * @throws {RequiredError}
124
+ */
125
+ assignGtin: async (project: string, gtin: string, assignGtinRequest?: AssignGtinRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
126
+ // verify required parameter 'project' is not null or undefined
127
+ assertParamExists('assignGtin', 'project', project)
128
+ // verify required parameter 'gtin' is not null or undefined
129
+ assertParamExists('assignGtin', 'gtin', gtin)
130
+ const localVarPath = `/v1/gtins/{gtin}/assign`
131
+ .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
132
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
133
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
134
+ let baseOptions;
135
+ if (configuration) {
136
+ baseOptions = configuration.baseOptions;
137
+ }
138
+
139
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
140
+ const localVarHeaderParameter = {} as any;
141
+ const localVarQueryParameter = {} as any;
142
+
143
+ // authentication session-oauth required
144
+ // oauth required
145
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
146
+
147
+ // authentication api-key required
148
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
149
+
150
+ if (project !== undefined) {
151
+ localVarQueryParameter['project'] = project;
152
+ }
153
+
154
+
155
+
156
+ localVarHeaderParameter['Content-Type'] = 'application/json';
157
+
158
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
159
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
160
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
161
+ localVarRequestOptions.data = serializeDataIfNeeded(assignGtinRequest, localVarRequestOptions, configuration)
162
+
163
+ return {
164
+ url: toPathString(localVarUrlObj),
165
+ options: localVarRequestOptions,
166
+ };
167
+ },
168
+ /**
169
+ * Export a CSV of a project\'s GTINs
170
+ * @summary Export GTINs
171
+ * @param {*} [options] Override http request option.
172
+ * @throws {RequiredError}
173
+ */
174
+ exportGtins: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
175
+ const localVarPath = `/v1/gtins/export`;
176
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
177
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
178
+ let baseOptions;
179
+ if (configuration) {
180
+ baseOptions = configuration.baseOptions;
181
+ }
182
+
183
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
184
+ const localVarHeaderParameter = {} as any;
185
+ const localVarQueryParameter = {} as any;
186
+
187
+ // authentication session-oauth required
188
+ // oauth required
189
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
190
+
191
+ // authentication api-key required
192
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
193
+
194
+
195
+
196
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
197
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
198
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
199
+
200
+ return {
201
+ url: toPathString(localVarUrlObj),
202
+ options: localVarRequestOptions,
203
+ };
204
+ },
205
+ /**
206
+ * Get a GTIN
207
+ * @summary Get GTIN
208
+ * @param {string} project What project it is
209
+ * @param {string} gtin GTIN
210
+ * @param {*} [options] Override http request option.
211
+ * @throws {RequiredError}
212
+ */
213
+ getGtin: async (project: string, gtin: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
214
+ // verify required parameter 'project' is not null or undefined
215
+ assertParamExists('getGtin', 'project', project)
216
+ // verify required parameter 'gtin' is not null or undefined
217
+ assertParamExists('getGtin', 'gtin', gtin)
218
+ const localVarPath = `/v1/gtins/{gtin}`
219
+ .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
220
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
221
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
222
+ let baseOptions;
223
+ if (configuration) {
224
+ baseOptions = configuration.baseOptions;
225
+ }
226
+
227
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
228
+ const localVarHeaderParameter = {} as any;
229
+ const localVarQueryParameter = {} as any;
230
+
231
+ // authentication session-oauth required
232
+ // oauth required
233
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
234
+
235
+ // authentication api-key required
236
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
237
+
238
+ if (project !== undefined) {
239
+ localVarQueryParameter['project'] = project;
240
+ }
241
+
242
+
243
+
244
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
245
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
246
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
247
+
248
+ return {
249
+ url: toPathString(localVarUrlObj),
250
+ options: localVarRequestOptions,
251
+ };
252
+ },
253
+ /**
254
+ * Initiates a GTINs import from a CSV file. The result will be available as a notification in the dashboard.
255
+ * @summary Import GTINs
256
+ * @param {string} project What project it is
257
+ * @param {string} [body] A data URL of a CSV file containing GTINs
258
+ * @param {*} [options] Override http request option.
259
+ * @throws {RequiredError}
260
+ */
261
+ importGtins: async (project: string, body?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
262
+ // verify required parameter 'project' is not null or undefined
263
+ assertParamExists('importGtins', 'project', project)
264
+ const localVarPath = `/v1/gtins/import`;
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
+ if (configuration) {
269
+ baseOptions = configuration.baseOptions;
270
+ }
271
+
272
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
273
+ const localVarHeaderParameter = {} as any;
274
+ const localVarQueryParameter = {} as any;
275
+
276
+ // authentication session-oauth required
277
+ // oauth required
278
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
279
+
280
+ // authentication api-key required
281
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
282
+
283
+ if (project !== undefined) {
284
+ localVarQueryParameter['project'] = project;
285
+ }
286
+
287
+
288
+
289
+ localVarHeaderParameter['Content-Type'] = 'text/csv';
290
+
291
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
292
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
293
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
294
+ localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)
295
+
296
+ return {
297
+ url: toPathString(localVarUrlObj),
298
+ options: localVarRequestOptions,
299
+ };
300
+ },
301
+ /**
302
+ * List GTINs
303
+ * @summary List gtins
304
+ * @param {string} project What project it is
305
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
306
+ * @param {number} [pageToken] Page reference token
307
+ * @param {string} [search] Search term to filter based on GTIN based on the GTIN
308
+ * @param {*} [options] Override http request option.
309
+ * @throws {RequiredError}
310
+ */
311
+ listGtins: async (project: string, pageSize?: number, pageToken?: number, search?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
312
+ // verify required parameter 'project' is not null or undefined
313
+ assertParamExists('listGtins', 'project', project)
314
+ const localVarPath = `/v1/gtins`;
315
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
316
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
317
+ let baseOptions;
318
+ if (configuration) {
319
+ baseOptions = configuration.baseOptions;
320
+ }
321
+
322
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
323
+ const localVarHeaderParameter = {} as any;
324
+ const localVarQueryParameter = {} as any;
325
+
326
+ // authentication session-oauth required
327
+ // oauth required
328
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
329
+
330
+ // authentication api-key required
331
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
332
+
333
+ if (project !== undefined) {
334
+ localVarQueryParameter['project'] = project;
335
+ }
336
+
337
+ if (pageSize !== undefined) {
338
+ localVarQueryParameter['pageSize'] = pageSize;
339
+ }
340
+
341
+ if (pageToken !== undefined) {
342
+ localVarQueryParameter['pageToken'] = pageToken;
343
+ }
344
+
345
+ if (search !== undefined) {
346
+ localVarQueryParameter['search'] = search;
347
+ }
348
+
349
+
350
+
351
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
352
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
353
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
354
+
355
+ return {
356
+ url: toPathString(localVarUrlObj),
357
+ options: localVarRequestOptions,
358
+ };
359
+ },
360
+ /**
361
+ * Unassign a GTIN from a variant
362
+ * @summary Unassign GTIN
363
+ * @param {string} project What project it is
364
+ * @param {string} gtin GTIN
365
+ * @param {*} [options] Override http request option.
366
+ * @throws {RequiredError}
367
+ */
368
+ unassignGtin: async (project: string, gtin: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
369
+ // verify required parameter 'project' is not null or undefined
370
+ assertParamExists('unassignGtin', 'project', project)
371
+ // verify required parameter 'gtin' is not null or undefined
372
+ assertParamExists('unassignGtin', 'gtin', gtin)
373
+ const localVarPath = `/v1/gtins/{gtin}/unassign`
374
+ .replace(`{${"gtin"}}`, encodeURIComponent(String(gtin)));
375
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
376
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
377
+ let baseOptions;
378
+ if (configuration) {
379
+ baseOptions = configuration.baseOptions;
380
+ }
381
+
382
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
383
+ const localVarHeaderParameter = {} as any;
384
+ const localVarQueryParameter = {} as any;
385
+
386
+ // authentication session-oauth required
387
+ // oauth required
388
+ await setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration)
389
+
390
+ // authentication api-key required
391
+ await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
392
+
393
+ if (project !== undefined) {
394
+ localVarQueryParameter['project'] = project;
395
+ }
396
+
397
+
398
+
399
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
400
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
401
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
402
+
403
+ return {
404
+ url: toPathString(localVarUrlObj),
405
+ options: localVarRequestOptions,
406
+ };
407
+ },
408
+ }
409
+ };
410
+
411
+ /**
412
+ * GTINsApi - functional programming interface
413
+ * @export
414
+ */
415
+ export const GTINsApiFp = function(configuration?: Configuration) {
416
+ const localVarAxiosParamCreator = GTINsApiAxiosParamCreator(configuration)
417
+ return {
418
+ /**
419
+ * Assign a GTIN to a variant
420
+ * @summary Assign GTIN
421
+ * @param {string} project What project it is
422
+ * @param {string} gtin GTIN
423
+ * @param {AssignGtinRequest} [assignGtinRequest] Assign a GTIN to a variant
424
+ * @param {*} [options] Override http request option.
425
+ * @throws {RequiredError}
426
+ */
427
+ async assignGtin(project: string, gtin: string, assignGtinRequest?: AssignGtinRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GTIN>> {
428
+ const localVarAxiosArgs = await localVarAxiosParamCreator.assignGtin(project, gtin, assignGtinRequest, options);
429
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
430
+ const localVarOperationServerBasePath = operationServerMap['GTINsApi.assignGtin']?.[localVarOperationServerIndex]?.url;
431
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
432
+ },
433
+ /**
434
+ * Export a CSV of a project\'s GTINs
435
+ * @summary Export GTINs
436
+ * @param {*} [options] Override http request option.
437
+ * @throws {RequiredError}
438
+ */
439
+ async exportGtins(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
440
+ const localVarAxiosArgs = await localVarAxiosParamCreator.exportGtins(options);
441
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
442
+ const localVarOperationServerBasePath = operationServerMap['GTINsApi.exportGtins']?.[localVarOperationServerIndex]?.url;
443
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
444
+ },
445
+ /**
446
+ * Get a GTIN
447
+ * @summary Get GTIN
448
+ * @param {string} project What project it is
449
+ * @param {string} gtin GTIN
450
+ * @param {*} [options] Override http request option.
451
+ * @throws {RequiredError}
452
+ */
453
+ async getGtin(project: string, gtin: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GTIN>> {
454
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getGtin(project, gtin, options);
455
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
456
+ const localVarOperationServerBasePath = operationServerMap['GTINsApi.getGtin']?.[localVarOperationServerIndex]?.url;
457
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
458
+ },
459
+ /**
460
+ * Initiates a GTINs import from a CSV file. The result will be available as a notification in the dashboard.
461
+ * @summary Import GTINs
462
+ * @param {string} project What project it is
463
+ * @param {string} [body] A data URL of a CSV file containing GTINs
464
+ * @param {*} [options] Override http request option.
465
+ * @throws {RequiredError}
466
+ */
467
+ async importGtins(project: string, body?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ImportGtins202Response>> {
468
+ const localVarAxiosArgs = await localVarAxiosParamCreator.importGtins(project, body, options);
469
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
470
+ const localVarOperationServerBasePath = operationServerMap['GTINsApi.importGtins']?.[localVarOperationServerIndex]?.url;
471
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
472
+ },
473
+ /**
474
+ * List GTINs
475
+ * @summary List gtins
476
+ * @param {string} project What project it is
477
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
478
+ * @param {number} [pageToken] Page reference token
479
+ * @param {string} [search] Search term to filter based on GTIN based on the GTIN
480
+ * @param {*} [options] Override http request option.
481
+ * @throws {RequiredError}
482
+ */
483
+ async listGtins(project: string, pageSize?: number, pageToken?: number, search?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GTINsResponse>> {
484
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listGtins(project, pageSize, pageToken, search, options);
485
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
486
+ const localVarOperationServerBasePath = operationServerMap['GTINsApi.listGtins']?.[localVarOperationServerIndex]?.url;
487
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
488
+ },
489
+ /**
490
+ * Unassign a GTIN from a variant
491
+ * @summary Unassign GTIN
492
+ * @param {string} project What project it is
493
+ * @param {string} gtin GTIN
494
+ * @param {*} [options] Override http request option.
495
+ * @throws {RequiredError}
496
+ */
497
+ async unassignGtin(project: string, gtin: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
498
+ const localVarAxiosArgs = await localVarAxiosParamCreator.unassignGtin(project, gtin, options);
499
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
500
+ const localVarOperationServerBasePath = operationServerMap['GTINsApi.unassignGtin']?.[localVarOperationServerIndex]?.url;
501
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
502
+ },
503
+ }
504
+ };
505
+
506
+ /**
507
+ * GTINsApi - factory interface
508
+ * @export
509
+ */
510
+ export const GTINsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
511
+ const localVarFp = GTINsApiFp(configuration)
512
+ return {
513
+ /**
514
+ * Assign a GTIN to a variant
515
+ * @summary Assign GTIN
516
+ * @param {GTINsApiAssignGtinRequest} requestParameters Request parameters.
517
+ * @param {*} [options] Override http request option.
518
+ * @throws {RequiredError}
519
+ */
520
+ assignGtin(requestParameters: GTINsApiAssignGtinRequest, options?: RawAxiosRequestConfig): AxiosPromise<GTIN> {
521
+ return localVarFp.assignGtin(requestParameters.project, requestParameters.gtin, requestParameters.assignGtinRequest, options).then((request) => request(axios, basePath));
522
+ },
523
+ /**
524
+ * Export a CSV of a project\'s GTINs
525
+ * @summary Export GTINs
526
+ * @param {*} [options] Override http request option.
527
+ * @throws {RequiredError}
528
+ */
529
+ exportGtins(options?: RawAxiosRequestConfig): AxiosPromise<File> {
530
+ return localVarFp.exportGtins(options).then((request) => request(axios, basePath));
531
+ },
532
+ /**
533
+ * Get a GTIN
534
+ * @summary Get GTIN
535
+ * @param {GTINsApiGetGtinRequest} requestParameters Request parameters.
536
+ * @param {*} [options] Override http request option.
537
+ * @throws {RequiredError}
538
+ */
539
+ getGtin(requestParameters: GTINsApiGetGtinRequest, options?: RawAxiosRequestConfig): AxiosPromise<GTIN> {
540
+ return localVarFp.getGtin(requestParameters.project, requestParameters.gtin, options).then((request) => request(axios, basePath));
541
+ },
542
+ /**
543
+ * Initiates a GTINs import from a CSV file. The result will be available as a notification in the dashboard.
544
+ * @summary Import GTINs
545
+ * @param {GTINsApiImportGtinsRequest} requestParameters Request parameters.
546
+ * @param {*} [options] Override http request option.
547
+ * @throws {RequiredError}
548
+ */
549
+ importGtins(requestParameters: GTINsApiImportGtinsRequest, options?: RawAxiosRequestConfig): AxiosPromise<ImportGtins202Response> {
550
+ return localVarFp.importGtins(requestParameters.project, requestParameters.body, options).then((request) => request(axios, basePath));
551
+ },
552
+ /**
553
+ * List GTINs
554
+ * @summary List gtins
555
+ * @param {GTINsApiListGtinsRequest} requestParameters Request parameters.
556
+ * @param {*} [options] Override http request option.
557
+ * @throws {RequiredError}
558
+ */
559
+ listGtins(requestParameters: GTINsApiListGtinsRequest, options?: RawAxiosRequestConfig): AxiosPromise<GTINsResponse> {
560
+ return localVarFp.listGtins(requestParameters.project, requestParameters.pageSize, requestParameters.pageToken, requestParameters.search, options).then((request) => request(axios, basePath));
561
+ },
562
+ /**
563
+ * Unassign a GTIN from a variant
564
+ * @summary Unassign GTIN
565
+ * @param {GTINsApiUnassignGtinRequest} requestParameters Request parameters.
566
+ * @param {*} [options] Override http request option.
567
+ * @throws {RequiredError}
568
+ */
569
+ unassignGtin(requestParameters: GTINsApiUnassignGtinRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
570
+ return localVarFp.unassignGtin(requestParameters.project, requestParameters.gtin, options).then((request) => request(axios, basePath));
571
+ },
572
+ };
573
+ };
574
+
575
+ /**
576
+ * Request parameters for assignGtin operation in GTINsApi.
577
+ * @export
578
+ * @interface GTINsApiAssignGtinRequest
579
+ */
580
+ export interface GTINsApiAssignGtinRequest {
581
+ /**
582
+ * What project it is
583
+ * @type {string}
584
+ * @memberof GTINsApiAssignGtin
585
+ */
586
+ readonly project: string
587
+
588
+ /**
589
+ * GTIN
590
+ * @type {string}
591
+ * @memberof GTINsApiAssignGtin
592
+ */
593
+ readonly gtin: string
594
+
595
+ /**
596
+ * Assign a GTIN to a variant
597
+ * @type {AssignGtinRequest}
598
+ * @memberof GTINsApiAssignGtin
599
+ */
600
+ readonly assignGtinRequest?: AssignGtinRequest
601
+ }
602
+
603
+ /**
604
+ * Request parameters for getGtin operation in GTINsApi.
605
+ * @export
606
+ * @interface GTINsApiGetGtinRequest
607
+ */
608
+ export interface GTINsApiGetGtinRequest {
609
+ /**
610
+ * What project it is
611
+ * @type {string}
612
+ * @memberof GTINsApiGetGtin
613
+ */
614
+ readonly project: string
615
+
616
+ /**
617
+ * GTIN
618
+ * @type {string}
619
+ * @memberof GTINsApiGetGtin
620
+ */
621
+ readonly gtin: string
622
+ }
623
+
624
+ /**
625
+ * Request parameters for importGtins operation in GTINsApi.
626
+ * @export
627
+ * @interface GTINsApiImportGtinsRequest
628
+ */
629
+ export interface GTINsApiImportGtinsRequest {
630
+ /**
631
+ * What project it is
632
+ * @type {string}
633
+ * @memberof GTINsApiImportGtins
634
+ */
635
+ readonly project: string
636
+
637
+ /**
638
+ * A data URL of a CSV file containing GTINs
639
+ * @type {string}
640
+ * @memberof GTINsApiImportGtins
641
+ */
642
+ readonly body?: string
643
+ }
644
+
645
+ /**
646
+ * Request parameters for listGtins operation in GTINsApi.
647
+ * @export
648
+ * @interface GTINsApiListGtinsRequest
649
+ */
650
+ export interface GTINsApiListGtinsRequest {
651
+ /**
652
+ * What project it is
653
+ * @type {string}
654
+ * @memberof GTINsApiListGtins
655
+ */
656
+ readonly project: string
657
+
658
+ /**
659
+ * Max page size. This is the maximum page size that will be returned, but it might be smaller.
660
+ * @type {number}
661
+ * @memberof GTINsApiListGtins
662
+ */
663
+ readonly pageSize?: number
664
+
665
+ /**
666
+ * Page reference token
667
+ * @type {number}
668
+ * @memberof GTINsApiListGtins
669
+ */
670
+ readonly pageToken?: number
671
+
672
+ /**
673
+ * Search term to filter based on GTIN based on the GTIN
674
+ * @type {string}
675
+ * @memberof GTINsApiListGtins
676
+ */
677
+ readonly search?: string
678
+ }
679
+
680
+ /**
681
+ * Request parameters for unassignGtin operation in GTINsApi.
682
+ * @export
683
+ * @interface GTINsApiUnassignGtinRequest
684
+ */
685
+ export interface GTINsApiUnassignGtinRequest {
686
+ /**
687
+ * What project it is
688
+ * @type {string}
689
+ * @memberof GTINsApiUnassignGtin
690
+ */
691
+ readonly project: string
692
+
693
+ /**
694
+ * GTIN
695
+ * @type {string}
696
+ * @memberof GTINsApiUnassignGtin
697
+ */
698
+ readonly gtin: string
699
+ }
700
+
701
+ /**
702
+ * GTINsApi - object-oriented interface
703
+ * @export
704
+ * @class GTINsApi
705
+ * @extends {BaseAPI}
706
+ */
707
+ export class GTINsApi extends BaseAPI {
708
+ /**
709
+ * Assign a GTIN to a variant
710
+ * @summary Assign GTIN
711
+ * @param {GTINsApiAssignGtinRequest} requestParameters Request parameters.
712
+ * @param {*} [options] Override http request option.
713
+ * @throws {RequiredError}
714
+ * @memberof GTINsApi
715
+ */
716
+ public assignGtin(requestParameters: GTINsApiAssignGtinRequest, options?: RawAxiosRequestConfig) {
717
+ return GTINsApiFp(this.configuration).assignGtin(requestParameters.project, requestParameters.gtin, requestParameters.assignGtinRequest, options).then((request) => request(this.axios, this.basePath));
718
+ }
719
+
720
+ /**
721
+ * Export a CSV of a project\'s GTINs
722
+ * @summary Export GTINs
723
+ * @param {*} [options] Override http request option.
724
+ * @throws {RequiredError}
725
+ * @memberof GTINsApi
726
+ */
727
+ public exportGtins(options?: RawAxiosRequestConfig) {
728
+ return GTINsApiFp(this.configuration).exportGtins(options).then((request) => request(this.axios, this.basePath));
729
+ }
730
+
731
+ /**
732
+ * Get a GTIN
733
+ * @summary Get GTIN
734
+ * @param {GTINsApiGetGtinRequest} requestParameters Request parameters.
735
+ * @param {*} [options] Override http request option.
736
+ * @throws {RequiredError}
737
+ * @memberof GTINsApi
738
+ */
739
+ public getGtin(requestParameters: GTINsApiGetGtinRequest, options?: RawAxiosRequestConfig) {
740
+ return GTINsApiFp(this.configuration).getGtin(requestParameters.project, requestParameters.gtin, options).then((request) => request(this.axios, this.basePath));
741
+ }
742
+
743
+ /**
744
+ * Initiates a GTINs import from a CSV file. The result will be available as a notification in the dashboard.
745
+ * @summary Import GTINs
746
+ * @param {GTINsApiImportGtinsRequest} requestParameters Request parameters.
747
+ * @param {*} [options] Override http request option.
748
+ * @throws {RequiredError}
749
+ * @memberof GTINsApi
750
+ */
751
+ public importGtins(requestParameters: GTINsApiImportGtinsRequest, options?: RawAxiosRequestConfig) {
752
+ return GTINsApiFp(this.configuration).importGtins(requestParameters.project, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
753
+ }
754
+
755
+ /**
756
+ * List GTINs
757
+ * @summary List gtins
758
+ * @param {GTINsApiListGtinsRequest} requestParameters Request parameters.
759
+ * @param {*} [options] Override http request option.
760
+ * @throws {RequiredError}
761
+ * @memberof GTINsApi
762
+ */
763
+ public listGtins(requestParameters: GTINsApiListGtinsRequest, options?: RawAxiosRequestConfig) {
764
+ return GTINsApiFp(this.configuration).listGtins(requestParameters.project, requestParameters.pageSize, requestParameters.pageToken, requestParameters.search, options).then((request) => request(this.axios, this.basePath));
765
+ }
766
+
767
+ /**
768
+ * Unassign a GTIN from a variant
769
+ * @summary Unassign GTIN
770
+ * @param {GTINsApiUnassignGtinRequest} requestParameters Request parameters.
771
+ * @param {*} [options] Override http request option.
772
+ * @throws {RequiredError}
773
+ * @memberof GTINsApi
774
+ */
775
+ public unassignGtin(requestParameters: GTINsApiUnassignGtinRequest, options?: RawAxiosRequestConfig) {
776
+ return GTINsApiFp(this.configuration).unassignGtin(requestParameters.project, requestParameters.gtin, options).then((request) => request(this.axios, this.basePath));
777
+ }
778
+ }
779
+
780
+
781
+