@emilgroup/translation-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.
Files changed (55) hide show
  1. package/.openapi-generator/FILES +23 -0
  2. package/.openapi-generator/VERSION +1 -0
  3. package/.openapi-generator-ignore +23 -0
  4. package/README.md +68 -0
  5. package/api/translation-api.ts +1145 -0
  6. package/api.ts +31 -0
  7. package/base.ts +284 -0
  8. package/common.ts +199 -0
  9. package/configuration.ts +109 -0
  10. package/dist/api/translation-api.d.ts +649 -0
  11. package/dist/api/translation-api.js +989 -0
  12. package/dist/api.d.ts +12 -0
  13. package/dist/api.js +30 -0
  14. package/dist/base.d.ts +77 -0
  15. package/dist/base.js +393 -0
  16. package/dist/common.d.ts +92 -0
  17. package/dist/common.js +277 -0
  18. package/dist/configuration.d.ts +90 -0
  19. package/dist/configuration.js +44 -0
  20. package/dist/index.d.ts +15 -0
  21. package/dist/index.js +36 -0
  22. package/dist/models/create-product-language-request-dto.d.ts +58 -0
  23. package/dist/models/create-product-language-request-dto.js +37 -0
  24. package/dist/models/create-product-language-response-class.d.ts +25 -0
  25. package/dist/models/create-product-language-response-class.js +15 -0
  26. package/dist/models/index.d.ts +9 -0
  27. package/dist/models/index.js +25 -0
  28. package/dist/models/list-product-languages-response-class.d.ts +31 -0
  29. package/dist/models/list-product-languages-response-class.js +15 -0
  30. package/dist/models/list-translations-response-class.d.ts +31 -0
  31. package/dist/models/list-translations-response-class.js +15 -0
  32. package/dist/models/product-language-class.d.ts +82 -0
  33. package/dist/models/product-language-class.js +37 -0
  34. package/dist/models/translation-class.d.ts +54 -0
  35. package/dist/models/translation-class.js +15 -0
  36. package/dist/models/update-product-language-request-dto.d.ts +58 -0
  37. package/dist/models/update-product-language-request-dto.js +37 -0
  38. package/dist/models/update-product-language-response-class.d.ts +25 -0
  39. package/dist/models/update-product-language-response-class.js +15 -0
  40. package/dist/models/upload-product-translations-response-class.d.ts +25 -0
  41. package/dist/models/upload-product-translations-response-class.js +15 -0
  42. package/git_push.sh +57 -0
  43. package/index.ts +19 -0
  44. package/models/create-product-language-request-dto.ts +67 -0
  45. package/models/create-product-language-response-class.ts +31 -0
  46. package/models/index.ts +9 -0
  47. package/models/list-product-languages-response-class.ts +37 -0
  48. package/models/list-translations-response-class.ts +37 -0
  49. package/models/product-language-class.ts +91 -0
  50. package/models/translation-class.ts +60 -0
  51. package/models/update-product-language-request-dto.ts +67 -0
  52. package/models/update-product-language-response-class.ts +31 -0
  53. package/models/upload-product-translations-response-class.ts +31 -0
  54. package/package.json +29 -0
  55. package/tsconfig.json +22 -0
@@ -0,0 +1,1145 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * EMIL TranslationService
5
+ * The EMIL TranslationService API description
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ * Contact: kontakt@emil.de
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 { CreateProductLanguageRequestDto } from '../models';
25
+ // @ts-ignore
26
+ import { CreateProductLanguageResponseClass } from '../models';
27
+ // @ts-ignore
28
+ import { ListProductLanguagesResponseClass } from '../models';
29
+ // @ts-ignore
30
+ import { ListTranslationsResponseClass } from '../models';
31
+ // @ts-ignore
32
+ import { UpdateProductLanguageRequestDto } from '../models';
33
+ // @ts-ignore
34
+ import { UpdateProductLanguageResponseClass } from '../models';
35
+ // @ts-ignore
36
+ import { UploadProductTranslationsResponseClass } from '../models';
37
+ // URLSearchParams not necessarily used
38
+ // @ts-ignore
39
+ import { URL, URLSearchParams } from 'url';
40
+ const FormData = require('form-data');
41
+ /**
42
+ * TranslationApi - axios parameter creator
43
+ * @export
44
+ */
45
+ export const TranslationApiAxiosParamCreator = function (configuration?: Configuration) {
46
+ return {
47
+ /**
48
+ * This creates a product language.
49
+ * @summary Create the product language
50
+ * @param {string} productSlug
51
+ * @param {CreateProductLanguageRequestDto} createProductLanguageRequestDto
52
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
53
+ * @param {*} [options] Override http request option.
54
+ * @throws {RequiredError}
55
+ */
56
+ createProductLanguage: async (productSlug: string, createProductLanguageRequestDto: CreateProductLanguageRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
57
+ // verify required parameter 'productSlug' is not null or undefined
58
+ assertParamExists('createProductLanguage', 'productSlug', productSlug)
59
+ // verify required parameter 'createProductLanguageRequestDto' is not null or undefined
60
+ assertParamExists('createProductLanguage', 'createProductLanguageRequestDto', createProductLanguageRequestDto)
61
+ const localVarPath = `/translationservice/v1/product/{productSlug}/language`
62
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
63
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
64
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
65
+ let baseOptions;
66
+ let baseAccessToken;
67
+ if (configuration) {
68
+ baseOptions = configuration.baseOptions;
69
+ baseAccessToken = configuration.accessToken;
70
+ }
71
+
72
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
73
+ const localVarHeaderParameter = {} as any;
74
+ const localVarQueryParameter = {} as any;
75
+
76
+ // authentication bearer required
77
+ // http bearer authentication required
78
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
79
+
80
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
81
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
82
+ }
83
+
84
+
85
+
86
+ localVarHeaderParameter['Content-Type'] = 'application/json';
87
+
88
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
89
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
90
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
91
+ localVarRequestOptions.data = serializeDataIfNeeded(createProductLanguageRequestDto, localVarRequestOptions, configuration)
92
+
93
+ return {
94
+ url: toPathString(localVarUrlObj),
95
+ options: localVarRequestOptions,
96
+ };
97
+ },
98
+ /**
99
+ * Permanently deletes the product language. Supply the unique id that was returned when you created the product language and this will delete it.
100
+ * @summary Delete the product language
101
+ * @param {number} id Id of the product language.
102
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
103
+ * @param {*} [options] Override http request option.
104
+ * @throws {RequiredError}
105
+ */
106
+ deleteProductLanguage: async (id: number, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
107
+ // verify required parameter 'id' is not null or undefined
108
+ assertParamExists('deleteProductLanguage', 'id', id)
109
+ const localVarPath = `/translationservice/v1/product/{productSlug}/language/{id}`
110
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)));
111
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
112
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
113
+ let baseOptions;
114
+ let baseAccessToken;
115
+ if (configuration) {
116
+ baseOptions = configuration.baseOptions;
117
+ baseAccessToken = configuration.accessToken;
118
+ }
119
+
120
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
121
+ const localVarHeaderParameter = {} as any;
122
+ const localVarQueryParameter = {} as any;
123
+
124
+ // authentication bearer required
125
+ // http bearer authentication required
126
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
127
+
128
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
129
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
130
+ }
131
+
132
+
133
+
134
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
135
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
136
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
137
+
138
+ return {
139
+ url: toPathString(localVarUrlObj),
140
+ options: localVarRequestOptions,
141
+ };
142
+ },
143
+ /**
144
+ * This downloads the list of translatable fields for a given product.
145
+ * @summary Retrieve the product translations
146
+ * @param {string} productSlug
147
+ * @param {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'} language
148
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
149
+ * @param {*} [options] Override http request option.
150
+ * @throws {RequiredError}
151
+ */
152
+ downloadProductTranslations: async (productSlug: string, language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian', authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
153
+ // verify required parameter 'productSlug' is not null or undefined
154
+ assertParamExists('downloadProductTranslations', 'productSlug', productSlug)
155
+ // verify required parameter 'language' is not null or undefined
156
+ assertParamExists('downloadProductTranslations', 'language', language)
157
+ const localVarPath = `/translationservice/v1/product/{productSlug}/download`
158
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
159
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
160
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
161
+ let baseOptions;
162
+ let baseAccessToken;
163
+ if (configuration) {
164
+ baseOptions = configuration.baseOptions;
165
+ baseAccessToken = configuration.accessToken;
166
+ }
167
+
168
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
169
+ const localVarHeaderParameter = {} as any;
170
+ const localVarQueryParameter = {} as any;
171
+
172
+ // authentication bearer required
173
+ // http bearer authentication required
174
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
175
+
176
+ if (language !== undefined) {
177
+ localVarQueryParameter['language'] = language;
178
+ }
179
+
180
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
181
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
182
+ }
183
+
184
+
185
+
186
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
187
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
188
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
189
+
190
+ return {
191
+ url: toPathString(localVarUrlObj),
192
+ options: localVarRequestOptions,
193
+ };
194
+ },
195
+ /**
196
+ * This gets a product language.
197
+ * @summary Retrieve the product language
198
+ * @param {number} id Id of the product language.
199
+ * @param {string} productSlug Product slug of the product.
200
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
201
+ * @param {*} [options] Override http request option.
202
+ * @throws {RequiredError}
203
+ */
204
+ getProductLanguage: async (id: number, productSlug: string, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
205
+ // verify required parameter 'id' is not null or undefined
206
+ assertParamExists('getProductLanguage', 'id', id)
207
+ // verify required parameter 'productSlug' is not null or undefined
208
+ assertParamExists('getProductLanguage', 'productSlug', productSlug)
209
+ const localVarPath = `/translationservice/v1/product/{productSlug}/language/{id}`
210
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
211
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
212
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
213
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
214
+ let baseOptions;
215
+ let baseAccessToken;
216
+ if (configuration) {
217
+ baseOptions = configuration.baseOptions;
218
+ baseAccessToken = configuration.accessToken;
219
+ }
220
+
221
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
222
+ const localVarHeaderParameter = {} as any;
223
+ const localVarQueryParameter = {} as any;
224
+
225
+ // authentication bearer required
226
+ // http bearer authentication required
227
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
228
+
229
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
230
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
231
+ }
232
+
233
+
234
+
235
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
236
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
237
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
238
+
239
+ return {
240
+ url: toPathString(localVarUrlObj),
241
+ options: localVarRequestOptions,
242
+ };
243
+ },
244
+ /**
245
+ * This lists the product languages.
246
+ * @summary List product languages
247
+ * @param {string} productSlug Product slug of the product.
248
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
249
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
250
+ * @param {any} [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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
251
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
252
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
253
+ * @param {any} [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.
254
+ * @param {any} [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.
255
+ * @param {*} [options] Override http request option.
256
+ * @throws {RequiredError}
257
+ */
258
+ listProductLanguages: async (productSlug: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
259
+ // verify required parameter 'productSlug' is not null or undefined
260
+ assertParamExists('listProductLanguages', 'productSlug', productSlug)
261
+ const localVarPath = `/translationservice/v1/product/{productSlug}/language`
262
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
263
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
264
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
265
+ let baseOptions;
266
+ let baseAccessToken;
267
+ if (configuration) {
268
+ baseOptions = configuration.baseOptions;
269
+ baseAccessToken = configuration.accessToken;
270
+ }
271
+
272
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
273
+ const localVarHeaderParameter = {} as any;
274
+ const localVarQueryParameter = {} as any;
275
+
276
+ // authentication bearer required
277
+ // http bearer authentication required
278
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
279
+
280
+ if (pageSize !== undefined) {
281
+ localVarQueryParameter['pageSize'] = pageSize;
282
+ }
283
+
284
+ if (pageToken !== undefined) {
285
+ localVarQueryParameter['pageToken'] = pageToken;
286
+ }
287
+
288
+ if (filter !== undefined) {
289
+ localVarQueryParameter['filter'] = filter;
290
+ }
291
+
292
+ if (search !== undefined) {
293
+ localVarQueryParameter['search'] = search;
294
+ }
295
+
296
+ if (order !== undefined) {
297
+ localVarQueryParameter['order'] = order;
298
+ }
299
+
300
+ if (expand !== undefined) {
301
+ localVarQueryParameter['expand'] = expand;
302
+ }
303
+
304
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
305
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
306
+ }
307
+
308
+
309
+
310
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
311
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
312
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
313
+
314
+ return {
315
+ url: toPathString(localVarUrlObj),
316
+ options: localVarRequestOptions,
317
+ };
318
+ },
319
+ /**
320
+ * Returns a list of translations you have previously created. The translations are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
321
+ * @summary List translations
322
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
323
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
324
+ * @param {any} [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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
325
+ * @param {'key'} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
326
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
327
+ * @param {'0' | '1' | '2'} [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.
328
+ * @param {number} [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.
329
+ * @param {*} [options] Override http request option.
330
+ * @throws {RequiredError}
331
+ */
332
+ listTranslations: async (authorization?: string, pageSize?: any, pageToken?: any, filter?: 'key', search?: any, order?: '0' | '1' | '2', expand?: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
333
+ const localVarPath = `/translationservice/v1/translations`;
334
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
335
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
336
+ let baseOptions;
337
+ let baseAccessToken;
338
+ if (configuration) {
339
+ baseOptions = configuration.baseOptions;
340
+ baseAccessToken = configuration.accessToken;
341
+ }
342
+
343
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
344
+ const localVarHeaderParameter = {} as any;
345
+ const localVarQueryParameter = {} as any;
346
+
347
+ // authentication bearer required
348
+ // http bearer authentication required
349
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
350
+
351
+ if (pageSize !== undefined) {
352
+ localVarQueryParameter['pageSize'] = pageSize;
353
+ }
354
+
355
+ if (pageToken !== undefined) {
356
+ localVarQueryParameter['pageToken'] = pageToken;
357
+ }
358
+
359
+ if (filter !== undefined) {
360
+ localVarQueryParameter['filter'] = filter;
361
+ }
362
+
363
+ if (search !== undefined) {
364
+ localVarQueryParameter['search'] = search;
365
+ }
366
+
367
+ if (order !== undefined) {
368
+ localVarQueryParameter['order'] = order;
369
+ }
370
+
371
+ if (expand !== undefined) {
372
+ localVarQueryParameter['expand'] = expand;
373
+ }
374
+
375
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
376
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
377
+ }
378
+
379
+
380
+
381
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
382
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
383
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
384
+
385
+ return {
386
+ url: toPathString(localVarUrlObj),
387
+ options: localVarRequestOptions,
388
+ };
389
+ },
390
+ /**
391
+ * This updates the product language with the specified id.
392
+ * @summary Update the product language
393
+ * @param {number} id Id of the product language.
394
+ * @param {string} productSlug Product slug of the product.
395
+ * @param {UpdateProductLanguageRequestDto} updateProductLanguageRequestDto
396
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
397
+ * @param {*} [options] Override http request option.
398
+ * @throws {RequiredError}
399
+ */
400
+ updateProductLanguage: async (id: number, productSlug: string, updateProductLanguageRequestDto: UpdateProductLanguageRequestDto, authorization?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
401
+ // verify required parameter 'id' is not null or undefined
402
+ assertParamExists('updateProductLanguage', 'id', id)
403
+ // verify required parameter 'productSlug' is not null or undefined
404
+ assertParamExists('updateProductLanguage', 'productSlug', productSlug)
405
+ // verify required parameter 'updateProductLanguageRequestDto' is not null or undefined
406
+ assertParamExists('updateProductLanguage', 'updateProductLanguageRequestDto', updateProductLanguageRequestDto)
407
+ const localVarPath = `/translationservice/v1/product/{productSlug}/language/{id}`
408
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
409
+ .replace(`{${"product slug"}}`, encodeURIComponent(String(productSlug)));
410
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
411
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
412
+ let baseOptions;
413
+ let baseAccessToken;
414
+ if (configuration) {
415
+ baseOptions = configuration.baseOptions;
416
+ baseAccessToken = configuration.accessToken;
417
+ }
418
+
419
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
420
+ const localVarHeaderParameter = {} as any;
421
+ const localVarQueryParameter = {} as any;
422
+
423
+ // authentication bearer required
424
+ // http bearer authentication required
425
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
426
+
427
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
428
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
429
+ }
430
+
431
+
432
+
433
+ localVarHeaderParameter['Content-Type'] = 'application/json';
434
+
435
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
436
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
437
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
438
+ localVarRequestOptions.data = serializeDataIfNeeded(updateProductLanguageRequestDto, localVarRequestOptions, configuration)
439
+
440
+ return {
441
+ url: toPathString(localVarUrlObj),
442
+ options: localVarRequestOptions,
443
+ };
444
+ },
445
+ /**
446
+ * This uploads the translations for a given product.
447
+ * @summary Create the product translations
448
+ * @param {string} productSlug
449
+ * @param {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'} language
450
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
451
+ * @param {any} [file]
452
+ * @param {*} [options] Override http request option.
453
+ * @throws {RequiredError}
454
+ */
455
+ uploadProductTranslations: async (productSlug: string, language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian', authorization?: string, file?: any, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
456
+ // verify required parameter 'productSlug' is not null or undefined
457
+ assertParamExists('uploadProductTranslations', 'productSlug', productSlug)
458
+ // verify required parameter 'language' is not null or undefined
459
+ assertParamExists('uploadProductTranslations', 'language', language)
460
+ const localVarPath = `/translationservice/v1/product/{productSlug}/upload`
461
+ .replace(`{${"productSlug"}}`, encodeURIComponent(String(productSlug)));
462
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
463
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
464
+ let baseOptions;
465
+ let baseAccessToken;
466
+ if (configuration) {
467
+ baseOptions = configuration.baseOptions;
468
+ baseAccessToken = configuration.accessToken;
469
+ }
470
+
471
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
472
+ const localVarHeaderParameter = {} as any;
473
+ const localVarQueryParameter = {} as any;
474
+ const localVarFormParams = new ((configuration && configuration.formDataCtor) || FormData)();
475
+
476
+ // authentication bearer required
477
+ // http bearer authentication required
478
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
479
+
480
+ if (language !== undefined) {
481
+ localVarQueryParameter['language'] = language;
482
+ }
483
+
484
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
485
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
486
+ }
487
+
488
+
489
+ if (file !== undefined) {
490
+ localVarFormParams.append('file', file as any);
491
+ }
492
+
493
+
494
+ localVarHeaderParameter['Content-Type'] = 'multipart/form-data; boundary=' + localVarFormParams.getBoundary();
495
+
496
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
497
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
498
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
499
+ localVarRequestOptions.data = localVarFormParams;
500
+
501
+ return {
502
+ url: toPathString(localVarUrlObj),
503
+ options: localVarRequestOptions,
504
+ };
505
+ },
506
+ }
507
+ };
508
+
509
+ /**
510
+ * TranslationApi - functional programming interface
511
+ * @export
512
+ */
513
+ export const TranslationApiFp = function(configuration?: Configuration) {
514
+ const localVarAxiosParamCreator = TranslationApiAxiosParamCreator(configuration)
515
+ return {
516
+ /**
517
+ * This creates a product language.
518
+ * @summary Create the product language
519
+ * @param {string} productSlug
520
+ * @param {CreateProductLanguageRequestDto} createProductLanguageRequestDto
521
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
522
+ * @param {*} [options] Override http request option.
523
+ * @throws {RequiredError}
524
+ */
525
+ async createProductLanguage(productSlug: string, createProductLanguageRequestDto: CreateProductLanguageRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateProductLanguageResponseClass>> {
526
+ const localVarAxiosArgs = await localVarAxiosParamCreator.createProductLanguage(productSlug, createProductLanguageRequestDto, authorization, options);
527
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
528
+ },
529
+ /**
530
+ * Permanently deletes the product language. Supply the unique id that was returned when you created the product language and this will delete it.
531
+ * @summary Delete the product language
532
+ * @param {number} id Id of the product language.
533
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
534
+ * @param {*} [options] Override http request option.
535
+ * @throws {RequiredError}
536
+ */
537
+ async deleteProductLanguage(id: number, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
538
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteProductLanguage(id, authorization, options);
539
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
540
+ },
541
+ /**
542
+ * This downloads the list of translatable fields for a given product.
543
+ * @summary Retrieve the product translations
544
+ * @param {string} productSlug
545
+ * @param {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'} language
546
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
547
+ * @param {*} [options] Override http request option.
548
+ * @throws {RequiredError}
549
+ */
550
+ async downloadProductTranslations(productSlug: string, language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian', authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
551
+ const localVarAxiosArgs = await localVarAxiosParamCreator.downloadProductTranslations(productSlug, language, authorization, options);
552
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
553
+ },
554
+ /**
555
+ * This gets a product language.
556
+ * @summary Retrieve the product language
557
+ * @param {number} id Id of the product language.
558
+ * @param {string} productSlug Product slug of the product.
559
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
560
+ * @param {*} [options] Override http request option.
561
+ * @throws {RequiredError}
562
+ */
563
+ async getProductLanguage(id: number, productSlug: string, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CreateProductLanguageResponseClass>> {
564
+ const localVarAxiosArgs = await localVarAxiosParamCreator.getProductLanguage(id, productSlug, authorization, options);
565
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
566
+ },
567
+ /**
568
+ * This lists the product languages.
569
+ * @summary List product languages
570
+ * @param {string} productSlug Product slug of the product.
571
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
572
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
573
+ * @param {any} [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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
574
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
575
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
576
+ * @param {any} [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.
577
+ * @param {any} [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.
578
+ * @param {*} [options] Override http request option.
579
+ * @throws {RequiredError}
580
+ */
581
+ async listProductLanguages(productSlug: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListProductLanguagesResponseClass>> {
582
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listProductLanguages(productSlug, authorization, pageSize, pageToken, filter, search, order, expand, options);
583
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
584
+ },
585
+ /**
586
+ * Returns a list of translations you have previously created. The translations are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
587
+ * @summary List translations
588
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
589
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
590
+ * @param {any} [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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
591
+ * @param {'key'} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
592
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
593
+ * @param {'0' | '1' | '2'} [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.
594
+ * @param {number} [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.
595
+ * @param {*} [options] Override http request option.
596
+ * @throws {RequiredError}
597
+ */
598
+ async listTranslations(authorization?: string, pageSize?: any, pageToken?: any, filter?: 'key', search?: any, order?: '0' | '1' | '2', expand?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListTranslationsResponseClass>> {
599
+ const localVarAxiosArgs = await localVarAxiosParamCreator.listTranslations(authorization, pageSize, pageToken, filter, search, order, expand, options);
600
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
601
+ },
602
+ /**
603
+ * This updates the product language with the specified id.
604
+ * @summary Update the product language
605
+ * @param {number} id Id of the product language.
606
+ * @param {string} productSlug Product slug of the product.
607
+ * @param {UpdateProductLanguageRequestDto} updateProductLanguageRequestDto
608
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
609
+ * @param {*} [options] Override http request option.
610
+ * @throws {RequiredError}
611
+ */
612
+ async updateProductLanguage(id: number, productSlug: string, updateProductLanguageRequestDto: UpdateProductLanguageRequestDto, authorization?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UpdateProductLanguageResponseClass>> {
613
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateProductLanguage(id, productSlug, updateProductLanguageRequestDto, authorization, options);
614
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
615
+ },
616
+ /**
617
+ * This uploads the translations for a given product.
618
+ * @summary Create the product translations
619
+ * @param {string} productSlug
620
+ * @param {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'} language
621
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
622
+ * @param {any} [file]
623
+ * @param {*} [options] Override http request option.
624
+ * @throws {RequiredError}
625
+ */
626
+ async uploadProductTranslations(productSlug: string, language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian', authorization?: string, file?: any, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<UploadProductTranslationsResponseClass>> {
627
+ const localVarAxiosArgs = await localVarAxiosParamCreator.uploadProductTranslations(productSlug, language, authorization, file, options);
628
+ return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
629
+ },
630
+ }
631
+ };
632
+
633
+ /**
634
+ * TranslationApi - factory interface
635
+ * @export
636
+ */
637
+ export const TranslationApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
638
+ const localVarFp = TranslationApiFp(configuration)
639
+ return {
640
+ /**
641
+ * This creates a product language.
642
+ * @summary Create the product language
643
+ * @param {string} productSlug
644
+ * @param {CreateProductLanguageRequestDto} createProductLanguageRequestDto
645
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
646
+ * @param {*} [options] Override http request option.
647
+ * @throws {RequiredError}
648
+ */
649
+ createProductLanguage(productSlug: string, createProductLanguageRequestDto: CreateProductLanguageRequestDto, authorization?: string, options?: any): AxiosPromise<CreateProductLanguageResponseClass> {
650
+ return localVarFp.createProductLanguage(productSlug, createProductLanguageRequestDto, authorization, options).then((request) => request(axios, basePath));
651
+ },
652
+ /**
653
+ * Permanently deletes the product language. Supply the unique id that was returned when you created the product language and this will delete it.
654
+ * @summary Delete the product language
655
+ * @param {number} id Id of the product language.
656
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
657
+ * @param {*} [options] Override http request option.
658
+ * @throws {RequiredError}
659
+ */
660
+ deleteProductLanguage(id: number, authorization?: string, options?: any): AxiosPromise<void> {
661
+ return localVarFp.deleteProductLanguage(id, authorization, options).then((request) => request(axios, basePath));
662
+ },
663
+ /**
664
+ * This downloads the list of translatable fields for a given product.
665
+ * @summary Retrieve the product translations
666
+ * @param {string} productSlug
667
+ * @param {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'} language
668
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
669
+ * @param {*} [options] Override http request option.
670
+ * @throws {RequiredError}
671
+ */
672
+ downloadProductTranslations(productSlug: string, language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian', authorization?: string, options?: any): AxiosPromise<any> {
673
+ return localVarFp.downloadProductTranslations(productSlug, language, authorization, options).then((request) => request(axios, basePath));
674
+ },
675
+ /**
676
+ * This gets a product language.
677
+ * @summary Retrieve the product language
678
+ * @param {number} id Id of the product language.
679
+ * @param {string} productSlug Product slug of the product.
680
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
681
+ * @param {*} [options] Override http request option.
682
+ * @throws {RequiredError}
683
+ */
684
+ getProductLanguage(id: number, productSlug: string, authorization?: string, options?: any): AxiosPromise<CreateProductLanguageResponseClass> {
685
+ return localVarFp.getProductLanguage(id, productSlug, authorization, options).then((request) => request(axios, basePath));
686
+ },
687
+ /**
688
+ * This lists the product languages.
689
+ * @summary List product languages
690
+ * @param {string} productSlug Product slug of the product.
691
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
692
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
693
+ * @param {any} [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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
694
+ * @param {any} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
695
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
696
+ * @param {any} [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.
697
+ * @param {any} [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.
698
+ * @param {*} [options] Override http request option.
699
+ * @throws {RequiredError}
700
+ */
701
+ listProductLanguages(productSlug: string, authorization?: string, pageSize?: any, pageToken?: any, filter?: any, search?: any, order?: any, expand?: any, options?: any): AxiosPromise<ListProductLanguagesResponseClass> {
702
+ return localVarFp.listProductLanguages(productSlug, authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
703
+ },
704
+ /**
705
+ * Returns a list of translations you have previously created. The translations are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
706
+ * @summary List translations
707
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
708
+ * @param {any} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
709
+ * @param {any} [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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
710
+ * @param {'key'} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
711
+ * @param {any} [search] Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
712
+ * @param {'0' | '1' | '2'} [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.
713
+ * @param {number} [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.
714
+ * @param {*} [options] Override http request option.
715
+ * @throws {RequiredError}
716
+ */
717
+ listTranslations(authorization?: string, pageSize?: any, pageToken?: any, filter?: 'key', search?: any, order?: '0' | '1' | '2', expand?: number, options?: any): AxiosPromise<ListTranslationsResponseClass> {
718
+ return localVarFp.listTranslations(authorization, pageSize, pageToken, filter, search, order, expand, options).then((request) => request(axios, basePath));
719
+ },
720
+ /**
721
+ * This updates the product language with the specified id.
722
+ * @summary Update the product language
723
+ * @param {number} id Id of the product language.
724
+ * @param {string} productSlug Product slug of the product.
725
+ * @param {UpdateProductLanguageRequestDto} updateProductLanguageRequestDto
726
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
727
+ * @param {*} [options] Override http request option.
728
+ * @throws {RequiredError}
729
+ */
730
+ updateProductLanguage(id: number, productSlug: string, updateProductLanguageRequestDto: UpdateProductLanguageRequestDto, authorization?: string, options?: any): AxiosPromise<UpdateProductLanguageResponseClass> {
731
+ return localVarFp.updateProductLanguage(id, productSlug, updateProductLanguageRequestDto, authorization, options).then((request) => request(axios, basePath));
732
+ },
733
+ /**
734
+ * This uploads the translations for a given product.
735
+ * @summary Create the product translations
736
+ * @param {string} productSlug
737
+ * @param {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'} language
738
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
739
+ * @param {any} [file]
740
+ * @param {*} [options] Override http request option.
741
+ * @throws {RequiredError}
742
+ */
743
+ uploadProductTranslations(productSlug: string, language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian', authorization?: string, file?: any, options?: any): AxiosPromise<UploadProductTranslationsResponseClass> {
744
+ return localVarFp.uploadProductTranslations(productSlug, language, authorization, file, options).then((request) => request(axios, basePath));
745
+ },
746
+ };
747
+ };
748
+
749
+ /**
750
+ * Request parameters for createProductLanguage operation in TranslationApi.
751
+ * @export
752
+ * @interface TranslationApiCreateProductLanguageRequest
753
+ */
754
+ export interface TranslationApiCreateProductLanguageRequest {
755
+ /**
756
+ *
757
+ * @type {string}
758
+ * @memberof TranslationApiCreateProductLanguage
759
+ */
760
+ readonly productSlug: string
761
+
762
+ /**
763
+ *
764
+ * @type {CreateProductLanguageRequestDto}
765
+ * @memberof TranslationApiCreateProductLanguage
766
+ */
767
+ readonly createProductLanguageRequestDto: CreateProductLanguageRequestDto
768
+
769
+ /**
770
+ * Bearer Token: provided by the login endpoint under the name accessToken.
771
+ * @type {string}
772
+ * @memberof TranslationApiCreateProductLanguage
773
+ */
774
+ readonly authorization?: string
775
+ }
776
+
777
+ /**
778
+ * Request parameters for deleteProductLanguage operation in TranslationApi.
779
+ * @export
780
+ * @interface TranslationApiDeleteProductLanguageRequest
781
+ */
782
+ export interface TranslationApiDeleteProductLanguageRequest {
783
+ /**
784
+ * Id of the product language.
785
+ * @type {number}
786
+ * @memberof TranslationApiDeleteProductLanguage
787
+ */
788
+ readonly id: number
789
+
790
+ /**
791
+ * Bearer Token: provided by the login endpoint under the name accessToken.
792
+ * @type {string}
793
+ * @memberof TranslationApiDeleteProductLanguage
794
+ */
795
+ readonly authorization?: string
796
+ }
797
+
798
+ /**
799
+ * Request parameters for downloadProductTranslations operation in TranslationApi.
800
+ * @export
801
+ * @interface TranslationApiDownloadProductTranslationsRequest
802
+ */
803
+ export interface TranslationApiDownloadProductTranslationsRequest {
804
+ /**
805
+ *
806
+ * @type {string}
807
+ * @memberof TranslationApiDownloadProductTranslations
808
+ */
809
+ readonly productSlug: string
810
+
811
+ /**
812
+ *
813
+ * @type {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'}
814
+ * @memberof TranslationApiDownloadProductTranslations
815
+ */
816
+ readonly language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'
817
+
818
+ /**
819
+ * Bearer Token: provided by the login endpoint under the name accessToken.
820
+ * @type {string}
821
+ * @memberof TranslationApiDownloadProductTranslations
822
+ */
823
+ readonly authorization?: string
824
+ }
825
+
826
+ /**
827
+ * Request parameters for getProductLanguage operation in TranslationApi.
828
+ * @export
829
+ * @interface TranslationApiGetProductLanguageRequest
830
+ */
831
+ export interface TranslationApiGetProductLanguageRequest {
832
+ /**
833
+ * Id of the product language.
834
+ * @type {number}
835
+ * @memberof TranslationApiGetProductLanguage
836
+ */
837
+ readonly id: number
838
+
839
+ /**
840
+ * Product slug of the product.
841
+ * @type {string}
842
+ * @memberof TranslationApiGetProductLanguage
843
+ */
844
+ readonly productSlug: string
845
+
846
+ /**
847
+ * Bearer Token: provided by the login endpoint under the name accessToken.
848
+ * @type {string}
849
+ * @memberof TranslationApiGetProductLanguage
850
+ */
851
+ readonly authorization?: string
852
+ }
853
+
854
+ /**
855
+ * Request parameters for listProductLanguages operation in TranslationApi.
856
+ * @export
857
+ * @interface TranslationApiListProductLanguagesRequest
858
+ */
859
+ export interface TranslationApiListProductLanguagesRequest {
860
+ /**
861
+ * Product slug of the product.
862
+ * @type {string}
863
+ * @memberof TranslationApiListProductLanguages
864
+ */
865
+ readonly productSlug: string
866
+
867
+ /**
868
+ * Bearer Token: provided by the login endpoint under the name accessToken.
869
+ * @type {string}
870
+ * @memberof TranslationApiListProductLanguages
871
+ */
872
+ readonly authorization?: string
873
+
874
+ /**
875
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
876
+ * @type {any}
877
+ * @memberof TranslationApiListProductLanguages
878
+ */
879
+ readonly pageSize?: any
880
+
881
+ /**
882
+ * 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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
883
+ * @type {any}
884
+ * @memberof TranslationApiListProductLanguages
885
+ */
886
+ readonly pageToken?: any
887
+
888
+ /**
889
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
890
+ * @type {any}
891
+ * @memberof TranslationApiListProductLanguages
892
+ */
893
+ readonly filter?: any
894
+
895
+ /**
896
+ * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
897
+ * @type {any}
898
+ * @memberof TranslationApiListProductLanguages
899
+ */
900
+ readonly search?: any
901
+
902
+ /**
903
+ * 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.
904
+ * @type {any}
905
+ * @memberof TranslationApiListProductLanguages
906
+ */
907
+ readonly order?: any
908
+
909
+ /**
910
+ * 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.
911
+ * @type {any}
912
+ * @memberof TranslationApiListProductLanguages
913
+ */
914
+ readonly expand?: any
915
+ }
916
+
917
+ /**
918
+ * Request parameters for listTranslations operation in TranslationApi.
919
+ * @export
920
+ * @interface TranslationApiListTranslationsRequest
921
+ */
922
+ export interface TranslationApiListTranslationsRequest {
923
+ /**
924
+ * Bearer Token: provided by the login endpoint under the name accessToken.
925
+ * @type {string}
926
+ * @memberof TranslationApiListTranslations
927
+ */
928
+ readonly authorization?: string
929
+
930
+ /**
931
+ * A limit on the number of objects to be returned. Limit ranges between 1 and 100. Default: 10.
932
+ * @type {any}
933
+ * @memberof TranslationApiListTranslations
934
+ */
935
+ readonly pageSize?: any
936
+
937
+ /**
938
+ * 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&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
939
+ * @type {any}
940
+ * @memberof TranslationApiListTranslations
941
+ */
942
+ readonly pageToken?: any
943
+
944
+ /**
945
+ * Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.
946
+ * @type {'key'}
947
+ * @memberof TranslationApiListTranslations
948
+ */
949
+ readonly filter?: 'key'
950
+
951
+ /**
952
+ * Search the list by any field. For instance, if you want to search by code add code&#x3D;xxx in order to fetch the result.
953
+ * @type {any}
954
+ * @memberof TranslationApiListTranslations
955
+ */
956
+ readonly search?: any
957
+
958
+ /**
959
+ * 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.
960
+ * @type {'0' | '1' | '2'}
961
+ * @memberof TranslationApiListTranslations
962
+ */
963
+ readonly order?: '0' | '1' | '2'
964
+
965
+ /**
966
+ * 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.
967
+ * @type {number}
968
+ * @memberof TranslationApiListTranslations
969
+ */
970
+ readonly expand?: number
971
+ }
972
+
973
+ /**
974
+ * Request parameters for updateProductLanguage operation in TranslationApi.
975
+ * @export
976
+ * @interface TranslationApiUpdateProductLanguageRequest
977
+ */
978
+ export interface TranslationApiUpdateProductLanguageRequest {
979
+ /**
980
+ * Id of the product language.
981
+ * @type {number}
982
+ * @memberof TranslationApiUpdateProductLanguage
983
+ */
984
+ readonly id: number
985
+
986
+ /**
987
+ * Product slug of the product.
988
+ * @type {string}
989
+ * @memberof TranslationApiUpdateProductLanguage
990
+ */
991
+ readonly productSlug: string
992
+
993
+ /**
994
+ *
995
+ * @type {UpdateProductLanguageRequestDto}
996
+ * @memberof TranslationApiUpdateProductLanguage
997
+ */
998
+ readonly updateProductLanguageRequestDto: UpdateProductLanguageRequestDto
999
+
1000
+ /**
1001
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1002
+ * @type {string}
1003
+ * @memberof TranslationApiUpdateProductLanguage
1004
+ */
1005
+ readonly authorization?: string
1006
+ }
1007
+
1008
+ /**
1009
+ * Request parameters for uploadProductTranslations operation in TranslationApi.
1010
+ * @export
1011
+ * @interface TranslationApiUploadProductTranslationsRequest
1012
+ */
1013
+ export interface TranslationApiUploadProductTranslationsRequest {
1014
+ /**
1015
+ *
1016
+ * @type {string}
1017
+ * @memberof TranslationApiUploadProductTranslations
1018
+ */
1019
+ readonly productSlug: string
1020
+
1021
+ /**
1022
+ *
1023
+ * @type {'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'}
1024
+ * @memberof TranslationApiUploadProductTranslations
1025
+ */
1026
+ readonly language: 'German' | 'English' | 'Polish' | 'French' | 'Italian' | 'Spanish' | 'Portuguese' | 'Russian' | 'Japanese' | 'Chinese' | 'Korean' | 'Turkish' | 'Arabic' | 'Hindi' | 'Indonesian' | 'Thai' | 'Vietnamese' | 'Persian' | 'Romanian'
1027
+
1028
+ /**
1029
+ * Bearer Token: provided by the login endpoint under the name accessToken.
1030
+ * @type {string}
1031
+ * @memberof TranslationApiUploadProductTranslations
1032
+ */
1033
+ readonly authorization?: string
1034
+
1035
+ /**
1036
+ *
1037
+ * @type {any}
1038
+ * @memberof TranslationApiUploadProductTranslations
1039
+ */
1040
+ readonly file?: any
1041
+ }
1042
+
1043
+ /**
1044
+ * TranslationApi - object-oriented interface
1045
+ * @export
1046
+ * @class TranslationApi
1047
+ * @extends {BaseAPI}
1048
+ */
1049
+ export class TranslationApi extends BaseAPI {
1050
+ /**
1051
+ * This creates a product language.
1052
+ * @summary Create the product language
1053
+ * @param {TranslationApiCreateProductLanguageRequest} requestParameters Request parameters.
1054
+ * @param {*} [options] Override http request option.
1055
+ * @throws {RequiredError}
1056
+ * @memberof TranslationApi
1057
+ */
1058
+ public createProductLanguage(requestParameters: TranslationApiCreateProductLanguageRequest, options?: AxiosRequestConfig) {
1059
+ return TranslationApiFp(this.configuration).createProductLanguage(requestParameters.productSlug, requestParameters.createProductLanguageRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1060
+ }
1061
+
1062
+ /**
1063
+ * Permanently deletes the product language. Supply the unique id that was returned when you created the product language and this will delete it.
1064
+ * @summary Delete the product language
1065
+ * @param {TranslationApiDeleteProductLanguageRequest} requestParameters Request parameters.
1066
+ * @param {*} [options] Override http request option.
1067
+ * @throws {RequiredError}
1068
+ * @memberof TranslationApi
1069
+ */
1070
+ public deleteProductLanguage(requestParameters: TranslationApiDeleteProductLanguageRequest, options?: AxiosRequestConfig) {
1071
+ return TranslationApiFp(this.configuration).deleteProductLanguage(requestParameters.id, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1072
+ }
1073
+
1074
+ /**
1075
+ * This downloads the list of translatable fields for a given product.
1076
+ * @summary Retrieve the product translations
1077
+ * @param {TranslationApiDownloadProductTranslationsRequest} requestParameters Request parameters.
1078
+ * @param {*} [options] Override http request option.
1079
+ * @throws {RequiredError}
1080
+ * @memberof TranslationApi
1081
+ */
1082
+ public downloadProductTranslations(requestParameters: TranslationApiDownloadProductTranslationsRequest, options?: AxiosRequestConfig) {
1083
+ return TranslationApiFp(this.configuration).downloadProductTranslations(requestParameters.productSlug, requestParameters.language, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1084
+ }
1085
+
1086
+ /**
1087
+ * This gets a product language.
1088
+ * @summary Retrieve the product language
1089
+ * @param {TranslationApiGetProductLanguageRequest} requestParameters Request parameters.
1090
+ * @param {*} [options] Override http request option.
1091
+ * @throws {RequiredError}
1092
+ * @memberof TranslationApi
1093
+ */
1094
+ public getProductLanguage(requestParameters: TranslationApiGetProductLanguageRequest, options?: AxiosRequestConfig) {
1095
+ return TranslationApiFp(this.configuration).getProductLanguage(requestParameters.id, requestParameters.productSlug, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1096
+ }
1097
+
1098
+ /**
1099
+ * This lists the product languages.
1100
+ * @summary List product languages
1101
+ * @param {TranslationApiListProductLanguagesRequest} requestParameters Request parameters.
1102
+ * @param {*} [options] Override http request option.
1103
+ * @throws {RequiredError}
1104
+ * @memberof TranslationApi
1105
+ */
1106
+ public listProductLanguages(requestParameters: TranslationApiListProductLanguagesRequest, options?: AxiosRequestConfig) {
1107
+ return TranslationApiFp(this.configuration).listProductLanguages(requestParameters.productSlug, requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
1108
+ }
1109
+
1110
+ /**
1111
+ * Returns a list of translations you have previously created. The translations are returned in sorted order, with the oldest one appearing first. For more information about pagination, read the Pagination documentation.
1112
+ * @summary List translations
1113
+ * @param {TranslationApiListTranslationsRequest} requestParameters Request parameters.
1114
+ * @param {*} [options] Override http request option.
1115
+ * @throws {RequiredError}
1116
+ * @memberof TranslationApi
1117
+ */
1118
+ public listTranslations(requestParameters: TranslationApiListTranslationsRequest = {}, options?: AxiosRequestConfig) {
1119
+ return TranslationApiFp(this.configuration).listTranslations(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, options).then((request) => request(this.axios, this.basePath));
1120
+ }
1121
+
1122
+ /**
1123
+ * This updates the product language with the specified id.
1124
+ * @summary Update the product language
1125
+ * @param {TranslationApiUpdateProductLanguageRequest} requestParameters Request parameters.
1126
+ * @param {*} [options] Override http request option.
1127
+ * @throws {RequiredError}
1128
+ * @memberof TranslationApi
1129
+ */
1130
+ public updateProductLanguage(requestParameters: TranslationApiUpdateProductLanguageRequest, options?: AxiosRequestConfig) {
1131
+ return TranslationApiFp(this.configuration).updateProductLanguage(requestParameters.id, requestParameters.productSlug, requestParameters.updateProductLanguageRequestDto, requestParameters.authorization, options).then((request) => request(this.axios, this.basePath));
1132
+ }
1133
+
1134
+ /**
1135
+ * This uploads the translations for a given product.
1136
+ * @summary Create the product translations
1137
+ * @param {TranslationApiUploadProductTranslationsRequest} requestParameters Request parameters.
1138
+ * @param {*} [options] Override http request option.
1139
+ * @throws {RequiredError}
1140
+ * @memberof TranslationApi
1141
+ */
1142
+ public uploadProductTranslations(requestParameters: TranslationApiUploadProductTranslationsRequest, options?: AxiosRequestConfig) {
1143
+ return TranslationApiFp(this.configuration).uploadProductTranslations(requestParameters.productSlug, requestParameters.language, requestParameters.authorization, requestParameters.file, options).then((request) => request(this.axios, this.basePath));
1144
+ }
1145
+ }