@teemill/inserts 0.1.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.
@@ -0,0 +1,591 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Inserts API
5
+ * An API for managing order inserts in PodOS that automatically adds a free item to a customer\'s order when specific conditions are met, such as a first-time purchase.
6
+ *
7
+ * The version of the OpenAPI document: 0.1.1
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import globalAxios from 'axios';
24
+ // Some imports not used depending on template conditions
25
+ // @ts-ignore
26
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from './common';
27
+ // @ts-ignore
28
+ import { BASE_PATH, BaseAPI, operationServerMap } from './base';
29
+ /**
30
+ * InsertsApi - axios parameter creator
31
+ * @export
32
+ */
33
+ export const InsertsApiAxiosParamCreator = function (configuration) {
34
+ return {
35
+ /**
36
+ * Create an insert for a project
37
+ * @summary Create an insert
38
+ * @param {string} project
39
+ * @param {CreateInsertRequest} createInsertRequest Create an insert
40
+ * @param {*} [options] Override http request option.
41
+ * @throws {RequiredError}
42
+ */
43
+ createInsert: (project_1, createInsertRequest_1, ...args_1) => __awaiter(this, [project_1, createInsertRequest_1, ...args_1], void 0, function* (project, createInsertRequest, options = {}) {
44
+ // verify required parameter 'project' is not null or undefined
45
+ assertParamExists('createInsert', 'project', project);
46
+ // verify required parameter 'createInsertRequest' is not null or undefined
47
+ assertParamExists('createInsert', 'createInsertRequest', createInsertRequest);
48
+ const localVarPath = `/v1/inserts`;
49
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
50
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
51
+ let baseOptions;
52
+ if (configuration) {
53
+ baseOptions = configuration.baseOptions;
54
+ }
55
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
56
+ const localVarHeaderParameter = {};
57
+ const localVarQueryParameter = {};
58
+ // authentication session-oauth required
59
+ // oauth required
60
+ yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
61
+ // authentication api-key required
62
+ yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
63
+ if (project !== undefined) {
64
+ localVarQueryParameter['project'] = project;
65
+ }
66
+ localVarHeaderParameter['Content-Type'] = 'application/json';
67
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
68
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
69
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
70
+ localVarRequestOptions.data = serializeDataIfNeeded(createInsertRequest, localVarRequestOptions, configuration);
71
+ return {
72
+ url: toPathString(localVarUrlObj),
73
+ options: localVarRequestOptions,
74
+ };
75
+ }),
76
+ /**
77
+ * Retrieve details for a specific insert for a project
78
+ * @summary Retrieve an insert for a project
79
+ * @param {string} insertId Filter by insert ID
80
+ * @param {string} project
81
+ * @param {*} [options] Override http request option.
82
+ * @throws {RequiredError}
83
+ */
84
+ getInsert: (insertId_1, project_1, ...args_1) => __awaiter(this, [insertId_1, project_1, ...args_1], void 0, function* (insertId, project, options = {}) {
85
+ // verify required parameter 'insertId' is not null or undefined
86
+ assertParamExists('getInsert', 'insertId', insertId);
87
+ // verify required parameter 'project' is not null or undefined
88
+ assertParamExists('getInsert', 'project', project);
89
+ const localVarPath = `/v1/inserts/{insertId}`
90
+ .replace(`{${"insertId"}}`, encodeURIComponent(String(insertId)));
91
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
92
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
93
+ let baseOptions;
94
+ if (configuration) {
95
+ baseOptions = configuration.baseOptions;
96
+ }
97
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
98
+ const localVarHeaderParameter = {};
99
+ const localVarQueryParameter = {};
100
+ // authentication session-oauth required
101
+ // oauth required
102
+ yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
103
+ // authentication api-key required
104
+ yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
105
+ if (project !== undefined) {
106
+ localVarQueryParameter['project'] = project;
107
+ }
108
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
109
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
110
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
111
+ return {
112
+ url: toPathString(localVarUrlObj),
113
+ options: localVarRequestOptions,
114
+ };
115
+ }),
116
+ /**
117
+ * List your project inserts
118
+ * @summary List project inserts
119
+ * @param {string} project
120
+ * @param {number} [pageToken] Page reference token
121
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
122
+ * @param {string} [search] Search for inserts by id or name
123
+ * @param {*} [options] Override http request option.
124
+ * @throws {RequiredError}
125
+ */
126
+ listInserts: (project_1, pageToken_1, pageSize_1, search_1, ...args_1) => __awaiter(this, [project_1, pageToken_1, pageSize_1, search_1, ...args_1], void 0, function* (project, pageToken, pageSize, search, options = {}) {
127
+ // verify required parameter 'project' is not null or undefined
128
+ assertParamExists('listInserts', 'project', project);
129
+ const localVarPath = `/v1/inserts`;
130
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
131
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
132
+ let baseOptions;
133
+ if (configuration) {
134
+ baseOptions = configuration.baseOptions;
135
+ }
136
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
137
+ const localVarHeaderParameter = {};
138
+ const localVarQueryParameter = {};
139
+ // authentication session-oauth required
140
+ // oauth required
141
+ yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
142
+ // authentication api-key required
143
+ yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
144
+ if (project !== undefined) {
145
+ localVarQueryParameter['project'] = project;
146
+ }
147
+ if (pageToken !== undefined) {
148
+ localVarQueryParameter['pageToken'] = pageToken;
149
+ }
150
+ if (pageSize !== undefined) {
151
+ localVarQueryParameter['pageSize'] = pageSize;
152
+ }
153
+ if (search !== undefined) {
154
+ localVarQueryParameter['search'] = search;
155
+ }
156
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
157
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
158
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
159
+ return {
160
+ url: toPathString(localVarUrlObj),
161
+ options: localVarRequestOptions,
162
+ };
163
+ }),
164
+ /**
165
+ * Update an insert for a project
166
+ * @summary Update an insert
167
+ * @param {string} insertId Filter by insert ID
168
+ * @param {string} project
169
+ * @param {UpdateInsertRequest} updateInsertRequest Update an insert
170
+ * @param {*} [options] Override http request option.
171
+ * @throws {RequiredError}
172
+ */
173
+ updateInsert: (insertId_1, project_1, updateInsertRequest_1, ...args_1) => __awaiter(this, [insertId_1, project_1, updateInsertRequest_1, ...args_1], void 0, function* (insertId, project, updateInsertRequest, options = {}) {
174
+ // verify required parameter 'insertId' is not null or undefined
175
+ assertParamExists('updateInsert', 'insertId', insertId);
176
+ // verify required parameter 'project' is not null or undefined
177
+ assertParamExists('updateInsert', 'project', project);
178
+ // verify required parameter 'updateInsertRequest' is not null or undefined
179
+ assertParamExists('updateInsert', 'updateInsertRequest', updateInsertRequest);
180
+ const localVarPath = `/v1/inserts/{insertId}`
181
+ .replace(`{${"insertId"}}`, encodeURIComponent(String(insertId)));
182
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
183
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
184
+ let baseOptions;
185
+ if (configuration) {
186
+ baseOptions = configuration.baseOptions;
187
+ }
188
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
189
+ const localVarHeaderParameter = {};
190
+ const localVarQueryParameter = {};
191
+ // authentication session-oauth required
192
+ // oauth required
193
+ yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
194
+ // authentication api-key required
195
+ yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
196
+ if (project !== undefined) {
197
+ localVarQueryParameter['project'] = project;
198
+ }
199
+ localVarHeaderParameter['Content-Type'] = 'application/json';
200
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
201
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
202
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
203
+ localVarRequestOptions.data = serializeDataIfNeeded(updateInsertRequest, localVarRequestOptions, configuration);
204
+ return {
205
+ url: toPathString(localVarUrlObj),
206
+ options: localVarRequestOptions,
207
+ };
208
+ }),
209
+ };
210
+ };
211
+ /**
212
+ * InsertsApi - functional programming interface
213
+ * @export
214
+ */
215
+ export const InsertsApiFp = function (configuration) {
216
+ const localVarAxiosParamCreator = InsertsApiAxiosParamCreator(configuration);
217
+ return {
218
+ /**
219
+ * Create an insert for a project
220
+ * @summary Create an insert
221
+ * @param {string} project
222
+ * @param {CreateInsertRequest} createInsertRequest Create an insert
223
+ * @param {*} [options] Override http request option.
224
+ * @throws {RequiredError}
225
+ */
226
+ createInsert(project, createInsertRequest, options) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ var _a, _b, _c;
229
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createInsert(project, createInsertRequest, options);
230
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
231
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InsertsApi.createInsert']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
232
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
233
+ });
234
+ },
235
+ /**
236
+ * Retrieve details for a specific insert for a project
237
+ * @summary Retrieve an insert for a project
238
+ * @param {string} insertId Filter by insert ID
239
+ * @param {string} project
240
+ * @param {*} [options] Override http request option.
241
+ * @throws {RequiredError}
242
+ */
243
+ getInsert(insertId, project, options) {
244
+ return __awaiter(this, void 0, void 0, function* () {
245
+ var _a, _b, _c;
246
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getInsert(insertId, project, options);
247
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
248
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InsertsApi.getInsert']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
249
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
250
+ });
251
+ },
252
+ /**
253
+ * List your project inserts
254
+ * @summary List project inserts
255
+ * @param {string} project
256
+ * @param {number} [pageToken] Page reference token
257
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
258
+ * @param {string} [search] Search for inserts by id or name
259
+ * @param {*} [options] Override http request option.
260
+ * @throws {RequiredError}
261
+ */
262
+ listInserts(project, pageToken, pageSize, search, options) {
263
+ return __awaiter(this, void 0, void 0, function* () {
264
+ var _a, _b, _c;
265
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listInserts(project, pageToken, pageSize, search, options);
266
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
267
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InsertsApi.listInserts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
268
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
269
+ });
270
+ },
271
+ /**
272
+ * Update an insert for a project
273
+ * @summary Update an insert
274
+ * @param {string} insertId Filter by insert ID
275
+ * @param {string} project
276
+ * @param {UpdateInsertRequest} updateInsertRequest Update an insert
277
+ * @param {*} [options] Override http request option.
278
+ * @throws {RequiredError}
279
+ */
280
+ updateInsert(insertId, project, updateInsertRequest, options) {
281
+ return __awaiter(this, void 0, void 0, function* () {
282
+ var _a, _b, _c;
283
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateInsert(insertId, project, updateInsertRequest, options);
284
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
285
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InsertsApi.updateInsert']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
286
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
287
+ });
288
+ },
289
+ };
290
+ };
291
+ /**
292
+ * InsertsApi - factory interface
293
+ * @export
294
+ */
295
+ export const InsertsApiFactory = function (configuration, basePath, axios) {
296
+ const localVarFp = InsertsApiFp(configuration);
297
+ return {
298
+ /**
299
+ * Create an insert for a project
300
+ * @summary Create an insert
301
+ * @param {InsertsApiCreateInsertRequest} requestParameters Request parameters.
302
+ * @param {*} [options] Override http request option.
303
+ * @throws {RequiredError}
304
+ */
305
+ createInsert(requestParameters, options) {
306
+ return localVarFp.createInsert(requestParameters.project, requestParameters.createInsertRequest, options).then((request) => request(axios, basePath));
307
+ },
308
+ /**
309
+ * Retrieve details for a specific insert for a project
310
+ * @summary Retrieve an insert for a project
311
+ * @param {InsertsApiGetInsertRequest} requestParameters Request parameters.
312
+ * @param {*} [options] Override http request option.
313
+ * @throws {RequiredError}
314
+ */
315
+ getInsert(requestParameters, options) {
316
+ return localVarFp.getInsert(requestParameters.insertId, requestParameters.project, options).then((request) => request(axios, basePath));
317
+ },
318
+ /**
319
+ * List your project inserts
320
+ * @summary List project inserts
321
+ * @param {InsertsApiListInsertsRequest} requestParameters Request parameters.
322
+ * @param {*} [options] Override http request option.
323
+ * @throws {RequiredError}
324
+ */
325
+ listInserts(requestParameters, options) {
326
+ return localVarFp.listInserts(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(axios, basePath));
327
+ },
328
+ /**
329
+ * Update an insert for a project
330
+ * @summary Update an insert
331
+ * @param {InsertsApiUpdateInsertRequest} requestParameters Request parameters.
332
+ * @param {*} [options] Override http request option.
333
+ * @throws {RequiredError}
334
+ */
335
+ updateInsert(requestParameters, options) {
336
+ return localVarFp.updateInsert(requestParameters.insertId, requestParameters.project, requestParameters.updateInsertRequest, options).then((request) => request(axios, basePath));
337
+ },
338
+ };
339
+ };
340
+ /**
341
+ * InsertsApi - object-oriented interface
342
+ * @export
343
+ * @class InsertsApi
344
+ * @extends {BaseAPI}
345
+ */
346
+ export class InsertsApi extends BaseAPI {
347
+ /**
348
+ * Create an insert for a project
349
+ * @summary Create an insert
350
+ * @param {InsertsApiCreateInsertRequest} requestParameters Request parameters.
351
+ * @param {*} [options] Override http request option.
352
+ * @throws {RequiredError}
353
+ * @memberof InsertsApi
354
+ */
355
+ createInsert(requestParameters, options) {
356
+ return InsertsApiFp(this.configuration).createInsert(requestParameters.project, requestParameters.createInsertRequest, options).then((request) => request(this.axios, this.basePath));
357
+ }
358
+ /**
359
+ * Retrieve details for a specific insert for a project
360
+ * @summary Retrieve an insert for a project
361
+ * @param {InsertsApiGetInsertRequest} requestParameters Request parameters.
362
+ * @param {*} [options] Override http request option.
363
+ * @throws {RequiredError}
364
+ * @memberof InsertsApi
365
+ */
366
+ getInsert(requestParameters, options) {
367
+ return InsertsApiFp(this.configuration).getInsert(requestParameters.insertId, requestParameters.project, options).then((request) => request(this.axios, this.basePath));
368
+ }
369
+ /**
370
+ * List your project inserts
371
+ * @summary List project inserts
372
+ * @param {InsertsApiListInsertsRequest} requestParameters Request parameters.
373
+ * @param {*} [options] Override http request option.
374
+ * @throws {RequiredError}
375
+ * @memberof InsertsApi
376
+ */
377
+ listInserts(requestParameters, options) {
378
+ return InsertsApiFp(this.configuration).listInserts(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(this.axios, this.basePath));
379
+ }
380
+ /**
381
+ * Update an insert for a project
382
+ * @summary Update an insert
383
+ * @param {InsertsApiUpdateInsertRequest} requestParameters Request parameters.
384
+ * @param {*} [options] Override http request option.
385
+ * @throws {RequiredError}
386
+ * @memberof InsertsApi
387
+ */
388
+ updateInsert(requestParameters, options) {
389
+ return InsertsApiFp(this.configuration).updateInsert(requestParameters.insertId, requestParameters.project, requestParameters.updateInsertRequest, options).then((request) => request(this.axios, this.basePath));
390
+ }
391
+ }
392
+ /**
393
+ * InsertsTypesApi - axios parameter creator
394
+ * @export
395
+ */
396
+ export const InsertsTypesApiAxiosParamCreator = function (configuration) {
397
+ return {
398
+ /**
399
+ * Retrieve details for a specific insert type
400
+ * @summary Retrieve an insert type
401
+ * @param {string} insertTypeId Filter by insert type ID
402
+ * @param {string} project
403
+ * @param {*} [options] Override http request option.
404
+ * @throws {RequiredError}
405
+ */
406
+ getInsertType: (insertTypeId_1, project_1, ...args_1) => __awaiter(this, [insertTypeId_1, project_1, ...args_1], void 0, function* (insertTypeId, project, options = {}) {
407
+ // verify required parameter 'insertTypeId' is not null or undefined
408
+ assertParamExists('getInsertType', 'insertTypeId', insertTypeId);
409
+ // verify required parameter 'project' is not null or undefined
410
+ assertParamExists('getInsertType', 'project', project);
411
+ const localVarPath = `/v1/inserts/types/{insertTypeId}`
412
+ .replace(`{${"insertTypeId"}}`, encodeURIComponent(String(insertTypeId)));
413
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
414
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
415
+ let baseOptions;
416
+ if (configuration) {
417
+ baseOptions = configuration.baseOptions;
418
+ }
419
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
420
+ const localVarHeaderParameter = {};
421
+ const localVarQueryParameter = {};
422
+ // authentication session-oauth required
423
+ // oauth required
424
+ yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
425
+ // authentication api-key required
426
+ yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
427
+ if (project !== undefined) {
428
+ localVarQueryParameter['project'] = project;
429
+ }
430
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
431
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
432
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
433
+ return {
434
+ url: toPathString(localVarUrlObj),
435
+ options: localVarRequestOptions,
436
+ };
437
+ }),
438
+ /**
439
+ * List all insert types
440
+ * @summary List insert types
441
+ * @param {string} project
442
+ * @param {number} [pageToken] Page reference token
443
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
444
+ * @param {string} [search] Search for inserts by id or name
445
+ * @param {*} [options] Override http request option.
446
+ * @throws {RequiredError}
447
+ */
448
+ listInsertTypes: (project_1, pageToken_1, pageSize_1, search_1, ...args_1) => __awaiter(this, [project_1, pageToken_1, pageSize_1, search_1, ...args_1], void 0, function* (project, pageToken, pageSize, search, options = {}) {
449
+ // verify required parameter 'project' is not null or undefined
450
+ assertParamExists('listInsertTypes', 'project', project);
451
+ const localVarPath = `/v1/inserts/types`;
452
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
453
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
454
+ let baseOptions;
455
+ if (configuration) {
456
+ baseOptions = configuration.baseOptions;
457
+ }
458
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
459
+ const localVarHeaderParameter = {};
460
+ const localVarQueryParameter = {};
461
+ // authentication session-oauth required
462
+ // oauth required
463
+ yield setOAuthToObject(localVarHeaderParameter, "session-oauth", [], configuration);
464
+ // authentication api-key required
465
+ yield setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration);
466
+ if (project !== undefined) {
467
+ localVarQueryParameter['project'] = project;
468
+ }
469
+ if (pageToken !== undefined) {
470
+ localVarQueryParameter['pageToken'] = pageToken;
471
+ }
472
+ if (pageSize !== undefined) {
473
+ localVarQueryParameter['pageSize'] = pageSize;
474
+ }
475
+ if (search !== undefined) {
476
+ localVarQueryParameter['search'] = search;
477
+ }
478
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
479
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
480
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
481
+ return {
482
+ url: toPathString(localVarUrlObj),
483
+ options: localVarRequestOptions,
484
+ };
485
+ }),
486
+ };
487
+ };
488
+ /**
489
+ * InsertsTypesApi - functional programming interface
490
+ * @export
491
+ */
492
+ export const InsertsTypesApiFp = function (configuration) {
493
+ const localVarAxiosParamCreator = InsertsTypesApiAxiosParamCreator(configuration);
494
+ return {
495
+ /**
496
+ * Retrieve details for a specific insert type
497
+ * @summary Retrieve an insert type
498
+ * @param {string} insertTypeId Filter by insert type ID
499
+ * @param {string} project
500
+ * @param {*} [options] Override http request option.
501
+ * @throws {RequiredError}
502
+ */
503
+ getInsertType(insertTypeId, project, options) {
504
+ return __awaiter(this, void 0, void 0, function* () {
505
+ var _a, _b, _c;
506
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getInsertType(insertTypeId, project, options);
507
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
508
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InsertsTypesApi.getInsertType']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
509
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
510
+ });
511
+ },
512
+ /**
513
+ * List all insert types
514
+ * @summary List insert types
515
+ * @param {string} project
516
+ * @param {number} [pageToken] Page reference token
517
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
518
+ * @param {string} [search] Search for inserts by id or name
519
+ * @param {*} [options] Override http request option.
520
+ * @throws {RequiredError}
521
+ */
522
+ listInsertTypes(project, pageToken, pageSize, search, options) {
523
+ return __awaiter(this, void 0, void 0, function* () {
524
+ var _a, _b, _c;
525
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listInsertTypes(project, pageToken, pageSize, search, options);
526
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
527
+ const localVarOperationServerBasePath = (_c = (_b = operationServerMap['InsertsTypesApi.listInsertTypes']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
528
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
529
+ });
530
+ },
531
+ };
532
+ };
533
+ /**
534
+ * InsertsTypesApi - factory interface
535
+ * @export
536
+ */
537
+ export const InsertsTypesApiFactory = function (configuration, basePath, axios) {
538
+ const localVarFp = InsertsTypesApiFp(configuration);
539
+ return {
540
+ /**
541
+ * Retrieve details for a specific insert type
542
+ * @summary Retrieve an insert type
543
+ * @param {InsertsTypesApiGetInsertTypeRequest} requestParameters Request parameters.
544
+ * @param {*} [options] Override http request option.
545
+ * @throws {RequiredError}
546
+ */
547
+ getInsertType(requestParameters, options) {
548
+ return localVarFp.getInsertType(requestParameters.insertTypeId, requestParameters.project, options).then((request) => request(axios, basePath));
549
+ },
550
+ /**
551
+ * List all insert types
552
+ * @summary List insert types
553
+ * @param {InsertsTypesApiListInsertTypesRequest} requestParameters Request parameters.
554
+ * @param {*} [options] Override http request option.
555
+ * @throws {RequiredError}
556
+ */
557
+ listInsertTypes(requestParameters, options) {
558
+ return localVarFp.listInsertTypes(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(axios, basePath));
559
+ },
560
+ };
561
+ };
562
+ /**
563
+ * InsertsTypesApi - object-oriented interface
564
+ * @export
565
+ * @class InsertsTypesApi
566
+ * @extends {BaseAPI}
567
+ */
568
+ export class InsertsTypesApi extends BaseAPI {
569
+ /**
570
+ * Retrieve details for a specific insert type
571
+ * @summary Retrieve an insert type
572
+ * @param {InsertsTypesApiGetInsertTypeRequest} requestParameters Request parameters.
573
+ * @param {*} [options] Override http request option.
574
+ * @throws {RequiredError}
575
+ * @memberof InsertsTypesApi
576
+ */
577
+ getInsertType(requestParameters, options) {
578
+ return InsertsTypesApiFp(this.configuration).getInsertType(requestParameters.insertTypeId, requestParameters.project, options).then((request) => request(this.axios, this.basePath));
579
+ }
580
+ /**
581
+ * List all insert types
582
+ * @summary List insert types
583
+ * @param {InsertsTypesApiListInsertTypesRequest} requestParameters Request parameters.
584
+ * @param {*} [options] Override http request option.
585
+ * @throws {RequiredError}
586
+ * @memberof InsertsTypesApi
587
+ */
588
+ listInsertTypes(requestParameters, options) {
589
+ return InsertsTypesApiFp(this.configuration).listInsertTypes(requestParameters.project, requestParameters.pageToken, requestParameters.pageSize, requestParameters.search, options).then((request) => request(this.axios, this.basePath));
590
+ }
591
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Inserts API
3
+ * An API for managing order inserts in PodOS that automatically adds a free item to a customer\'s order when specific conditions are met, such as a first-time purchase.
4
+ *
5
+ * The version of the OpenAPI document: 0.1.1
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Configuration } from './configuration';
13
+ import type { AxiosInstance, RawAxiosRequestConfig } from 'axios';
14
+ export declare const BASE_PATH: string;
15
+ /**
16
+ *
17
+ * @export
18
+ */
19
+ export declare const COLLECTION_FORMATS: {
20
+ csv: string;
21
+ ssv: string;
22
+ tsv: string;
23
+ pipes: string;
24
+ };
25
+ /**
26
+ *
27
+ * @export
28
+ * @interface RequestArgs
29
+ */
30
+ export interface RequestArgs {
31
+ url: string;
32
+ options: RawAxiosRequestConfig;
33
+ }
34
+ /**
35
+ *
36
+ * @export
37
+ * @class BaseAPI
38
+ */
39
+ export declare class BaseAPI {
40
+ protected basePath: string;
41
+ protected axios: AxiosInstance;
42
+ protected configuration: Configuration | undefined;
43
+ constructor(configuration?: Configuration, basePath?: string, axios?: AxiosInstance);
44
+ }
45
+ /**
46
+ *
47
+ * @export
48
+ * @class RequiredError
49
+ * @extends {Error}
50
+ */
51
+ export declare class RequiredError extends Error {
52
+ field: string;
53
+ constructor(field: string, msg?: string);
54
+ }
55
+ interface ServerMap {
56
+ [key: string]: {
57
+ url: string;
58
+ description: string;
59
+ }[];
60
+ }
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export declare const operationServerMap: ServerMap;
66
+ export {};