@teemill/product-catalog 1.11.1 → 1.13.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 (202) hide show
  1. package/.openapi-generator/FILES +6 -29
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +3 -3
  4. package/api.ts +1598 -0
  5. package/base.ts +86 -0
  6. package/common.ts +150 -0
  7. package/configuration.ts +110 -0
  8. package/dist/api.d.ts +1126 -0
  9. package/dist/api.js +819 -0
  10. package/dist/base.d.ts +66 -0
  11. package/dist/base.js +65 -0
  12. package/dist/common.d.ts +65 -0
  13. package/dist/common.js +161 -0
  14. package/dist/configuration.d.ts +91 -0
  15. package/dist/configuration.js +43 -0
  16. package/dist/esm/api.d.ts +1126 -0
  17. package/dist/esm/api.js +808 -0
  18. package/dist/esm/base.d.ts +66 -0
  19. package/dist/esm/base.js +60 -0
  20. package/dist/esm/common.d.ts +65 -0
  21. package/dist/esm/common.js +149 -0
  22. package/dist/esm/configuration.d.ts +91 -0
  23. package/dist/esm/configuration.js +39 -0
  24. package/dist/esm/index.d.ts +13 -3
  25. package/dist/esm/index.js +13 -3
  26. package/dist/index.d.ts +13 -3
  27. package/dist/index.js +15 -5
  28. package/git_push.sh +57 -0
  29. package/index.ts +18 -0
  30. package/package.json +15 -3
  31. package/tsconfig.json +4 -6
  32. package/dist/apis/ProductsApi.d.ts +0 -107
  33. package/dist/apis/ProductsApi.js +0 -304
  34. package/dist/apis/VariantsApi.d.ts +0 -50
  35. package/dist/apis/VariantsApi.js +0 -131
  36. package/dist/apis/index.d.ts +0 -2
  37. package/dist/apis/index.js +0 -20
  38. package/dist/esm/apis/ProductsApi.d.ts +0 -107
  39. package/dist/esm/apis/ProductsApi.js +0 -300
  40. package/dist/esm/apis/VariantsApi.d.ts +0 -50
  41. package/dist/esm/apis/VariantsApi.js +0 -127
  42. package/dist/esm/apis/index.d.ts +0 -2
  43. package/dist/esm/apis/index.js +0 -4
  44. package/dist/esm/models/ApiError.d.ts +0 -37
  45. package/dist/esm/models/ApiError.js +0 -42
  46. package/dist/esm/models/Attribute.d.ts +0 -50
  47. package/dist/esm/models/Attribute.js +0 -49
  48. package/dist/esm/models/AttributeThumbnail.d.ts +0 -46
  49. package/dist/esm/models/AttributeThumbnail.js +0 -48
  50. package/dist/esm/models/CreateProductRequest.d.ts +0 -88
  51. package/dist/esm/models/CreateProductRequest.js +0 -63
  52. package/dist/esm/models/CreateProductRequestAdditionalFilesInner.d.ts +0 -31
  53. package/dist/esm/models/CreateProductRequestAdditionalFilesInner.js +0 -43
  54. package/dist/esm/models/CreateProductRequestImagesInner.d.ts +0 -31
  55. package/dist/esm/models/CreateProductRequestImagesInner.js +0 -38
  56. package/dist/esm/models/CreateProductRequestSeoMetadata.d.ts +0 -31
  57. package/dist/esm/models/CreateProductRequestSeoMetadata.js +0 -38
  58. package/dist/esm/models/CreateProductRequestVariantsInner.d.ts +0 -59
  59. package/dist/esm/models/CreateProductRequestVariantsInner.js +0 -57
  60. package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +0 -63
  61. package/dist/esm/models/CreateProductRequestVariantsInnerApplicationsInner.js +0 -67
  62. package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +0 -37
  63. package/dist/esm/models/CreateProductRequestVariantsInnerAttributesInner.js +0 -46
  64. package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.d.ts +0 -31
  65. package/dist/esm/models/CreateProductRequestVariantsInnerImagesInner.js +0 -43
  66. package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +0 -37
  67. package/dist/esm/models/CreateProductRequestVariantsInnerRetailPrice.js +0 -46
  68. package/dist/esm/models/CreateProductVariant.d.ts +0 -59
  69. package/dist/esm/models/CreateProductVariant.js +0 -54
  70. package/dist/esm/models/CreateProductVariantApplicationsInner.d.ts +0 -54
  71. package/dist/esm/models/CreateProductVariantApplicationsInner.js +0 -58
  72. package/dist/esm/models/CreateProductVariantAttributesInner.d.ts +0 -37
  73. package/dist/esm/models/CreateProductVariantAttributesInner.js +0 -44
  74. package/dist/esm/models/CreateProductVariantRetailPrice.d.ts +0 -37
  75. package/dist/esm/models/CreateProductVariantRetailPrice.js +0 -44
  76. package/dist/esm/models/Image.d.ts +0 -67
  77. package/dist/esm/models/Image.js +0 -50
  78. package/dist/esm/models/ImportProducts200Response.d.ts +0 -31
  79. package/dist/esm/models/ImportProducts200Response.js +0 -38
  80. package/dist/esm/models/ModelFile.d.ts +0 -31
  81. package/dist/esm/models/ModelFile.js +0 -38
  82. package/dist/esm/models/Price.d.ts +0 -37
  83. package/dist/esm/models/Price.js +0 -40
  84. package/dist/esm/models/Product.d.ts +0 -113
  85. package/dist/esm/models/Product.js +0 -71
  86. package/dist/esm/models/ProductAdditionalFilesInner.d.ts +0 -37
  87. package/dist/esm/models/ProductAdditionalFilesInner.js +0 -40
  88. package/dist/esm/models/ProductsResponse.d.ts +0 -38
  89. package/dist/esm/models/ProductsResponse.js +0 -41
  90. package/dist/esm/models/SeoMetadata.d.ts +0 -31
  91. package/dist/esm/models/SeoMetadata.js +0 -38
  92. package/dist/esm/models/Stock.d.ts +0 -31
  93. package/dist/esm/models/Stock.js +0 -38
  94. package/dist/esm/models/UpdateProductRequest.d.ts +0 -87
  95. package/dist/esm/models/UpdateProductRequest.js +0 -58
  96. package/dist/esm/models/Variant.d.ts +0 -114
  97. package/dist/esm/models/Variant.js +0 -71
  98. package/dist/esm/models/VariantProduct.d.ts +0 -37
  99. package/dist/esm/models/VariantProduct.js +0 -40
  100. package/dist/esm/models/VariantsResponse.d.ts +0 -38
  101. package/dist/esm/models/VariantsResponse.js +0 -41
  102. package/dist/esm/models/index.d.ts +0 -23
  103. package/dist/esm/models/index.js +0 -25
  104. package/dist/esm/runtime.d.ts +0 -187
  105. package/dist/esm/runtime.js +0 -333
  106. package/dist/models/ApiError.d.ts +0 -37
  107. package/dist/models/ApiError.js +0 -49
  108. package/dist/models/Attribute.d.ts +0 -50
  109. package/dist/models/Attribute.js +0 -56
  110. package/dist/models/AttributeThumbnail.d.ts +0 -46
  111. package/dist/models/AttributeThumbnail.js +0 -55
  112. package/dist/models/CreateProductRequest.d.ts +0 -88
  113. package/dist/models/CreateProductRequest.js +0 -70
  114. package/dist/models/CreateProductRequestAdditionalFilesInner.d.ts +0 -31
  115. package/dist/models/CreateProductRequestAdditionalFilesInner.js +0 -50
  116. package/dist/models/CreateProductRequestImagesInner.d.ts +0 -31
  117. package/dist/models/CreateProductRequestImagesInner.js +0 -45
  118. package/dist/models/CreateProductRequestSeoMetadata.d.ts +0 -31
  119. package/dist/models/CreateProductRequestSeoMetadata.js +0 -45
  120. package/dist/models/CreateProductRequestVariantsInner.d.ts +0 -59
  121. package/dist/models/CreateProductRequestVariantsInner.js +0 -64
  122. package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.d.ts +0 -63
  123. package/dist/models/CreateProductRequestVariantsInnerApplicationsInner.js +0 -74
  124. package/dist/models/CreateProductRequestVariantsInnerAttributesInner.d.ts +0 -37
  125. package/dist/models/CreateProductRequestVariantsInnerAttributesInner.js +0 -53
  126. package/dist/models/CreateProductRequestVariantsInnerImagesInner.d.ts +0 -31
  127. package/dist/models/CreateProductRequestVariantsInnerImagesInner.js +0 -50
  128. package/dist/models/CreateProductRequestVariantsInnerRetailPrice.d.ts +0 -37
  129. package/dist/models/CreateProductRequestVariantsInnerRetailPrice.js +0 -53
  130. package/dist/models/CreateProductVariant.d.ts +0 -59
  131. package/dist/models/CreateProductVariant.js +0 -61
  132. package/dist/models/CreateProductVariantApplicationsInner.d.ts +0 -54
  133. package/dist/models/CreateProductVariantApplicationsInner.js +0 -65
  134. package/dist/models/CreateProductVariantAttributesInner.d.ts +0 -37
  135. package/dist/models/CreateProductVariantAttributesInner.js +0 -51
  136. package/dist/models/CreateProductVariantRetailPrice.d.ts +0 -37
  137. package/dist/models/CreateProductVariantRetailPrice.js +0 -51
  138. package/dist/models/Image.d.ts +0 -67
  139. package/dist/models/Image.js +0 -57
  140. package/dist/models/ImportProducts200Response.d.ts +0 -31
  141. package/dist/models/ImportProducts200Response.js +0 -45
  142. package/dist/models/ModelFile.d.ts +0 -31
  143. package/dist/models/ModelFile.js +0 -45
  144. package/dist/models/Price.d.ts +0 -37
  145. package/dist/models/Price.js +0 -47
  146. package/dist/models/Product.d.ts +0 -113
  147. package/dist/models/Product.js +0 -78
  148. package/dist/models/ProductAdditionalFilesInner.d.ts +0 -37
  149. package/dist/models/ProductAdditionalFilesInner.js +0 -47
  150. package/dist/models/ProductsResponse.d.ts +0 -38
  151. package/dist/models/ProductsResponse.js +0 -48
  152. package/dist/models/SeoMetadata.d.ts +0 -31
  153. package/dist/models/SeoMetadata.js +0 -45
  154. package/dist/models/Stock.d.ts +0 -31
  155. package/dist/models/Stock.js +0 -45
  156. package/dist/models/UpdateProductRequest.d.ts +0 -87
  157. package/dist/models/UpdateProductRequest.js +0 -65
  158. package/dist/models/Variant.d.ts +0 -114
  159. package/dist/models/Variant.js +0 -78
  160. package/dist/models/VariantProduct.d.ts +0 -37
  161. package/dist/models/VariantProduct.js +0 -47
  162. package/dist/models/VariantsResponse.d.ts +0 -38
  163. package/dist/models/VariantsResponse.js +0 -48
  164. package/dist/models/index.d.ts +0 -23
  165. package/dist/models/index.js +0 -41
  166. package/dist/runtime.d.ts +0 -187
  167. package/dist/runtime.js +0 -349
  168. package/src/apis/ProductsApi.ts +0 -453
  169. package/src/apis/VariantsApi.ts +0 -186
  170. package/src/apis/index.ts +0 -4
  171. package/src/index.ts +0 -5
  172. package/src/models/ApiError.ts +0 -69
  173. package/src/models/Attribute.ts +0 -93
  174. package/src/models/AttributeThumbnail.ts +0 -80
  175. package/src/models/CreateProductRequest.ts +0 -153
  176. package/src/models/CreateProductRequestAdditionalFilesInner.ts +0 -65
  177. package/src/models/CreateProductRequestImagesInner.ts +0 -60
  178. package/src/models/CreateProductRequestSeoMetadata.ts +0 -60
  179. package/src/models/CreateProductRequestVariantsInner.ts +0 -124
  180. package/src/models/CreateProductRequestVariantsInnerApplicationsInner.ts +0 -108
  181. package/src/models/CreateProductRequestVariantsInnerAttributesInner.ts +0 -75
  182. package/src/models/CreateProductRequestVariantsInnerImagesInner.ts +0 -65
  183. package/src/models/CreateProductRequestVariantsInnerRetailPrice.ts +0 -75
  184. package/src/models/CreateProductVariant.ts +0 -119
  185. package/src/models/CreateProductVariantApplicationsInner.ts +0 -93
  186. package/src/models/CreateProductVariantAttributesInner.ts +0 -70
  187. package/src/models/CreateProductVariantRetailPrice.ts +0 -70
  188. package/src/models/Image.ts +0 -108
  189. package/src/models/ImportProducts200Response.ts +0 -60
  190. package/src/models/ModelFile.ts +0 -60
  191. package/src/models/Price.ts +0 -68
  192. package/src/models/Product.ts +0 -190
  193. package/src/models/ProductAdditionalFilesInner.ts +0 -68
  194. package/src/models/ProductsResponse.ts +0 -75
  195. package/src/models/SeoMetadata.ts +0 -60
  196. package/src/models/Stock.ts +0 -60
  197. package/src/models/UpdateProductRequest.ts +0 -145
  198. package/src/models/Variant.ts +0 -195
  199. package/src/models/VariantProduct.ts +0 -68
  200. package/src/models/VariantsResponse.ts +0 -75
  201. package/src/models/index.ts +0 -25
  202. package/src/runtime.ts +0 -441
package/dist/api.js ADDED
@@ -0,0 +1,819 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Product Catalog API
6
+ * Manage Product Catalog A catalog product is an object that represents a product listing that can be purchased from the given project. It contains a combination of design applications and a warehouse product, plus listing information such as title, description and tags.
7
+ *
8
+ * The version of the OpenAPI document: 1.13.0
9
+ * Contact: hello@teemill.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.VariantsApi = exports.VariantsApiFactory = exports.VariantsApiFp = exports.VariantsApiAxiosParamCreator = exports.ProductsApi = exports.ProductsApiFactory = exports.ProductsApiFp = exports.ProductsApiAxiosParamCreator = exports.AttributeThumbnailTypeEnum = exports.ApplicationPlacementEnum = void 0;
26
+ const axios_1 = require("axios");
27
+ // Some imports not used depending on template conditions
28
+ // @ts-ignore
29
+ const common_1 = require("./common");
30
+ // @ts-ignore
31
+ const base_1 = require("./base");
32
+ exports.ApplicationPlacementEnum = {
33
+ Front: 'front',
34
+ Back: 'back',
35
+ Left: 'left',
36
+ Right: 'right',
37
+ Neck: 'neck'
38
+ };
39
+ exports.AttributeThumbnailTypeEnum = {
40
+ Text: 'text',
41
+ Color: 'color',
42
+ Image: 'image'
43
+ };
44
+ /**
45
+ * ProductsApi - axios parameter creator
46
+ * @export
47
+ */
48
+ const ProductsApiAxiosParamCreator = function (configuration) {
49
+ return {
50
+ /**
51
+ * Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
52
+ * @summary Create product
53
+ * @param {string} project What project it is
54
+ * @param {CreateProductRequest} [createProductRequest]
55
+ * @param {*} [options] Override http request option.
56
+ * @throws {RequiredError}
57
+ */
58
+ createProduct: (project_1, createProductRequest_1, ...args_1) => __awaiter(this, [project_1, createProductRequest_1, ...args_1], void 0, function* (project, createProductRequest, options = {}) {
59
+ // verify required parameter 'project' is not null or undefined
60
+ (0, common_1.assertParamExists)('createProduct', 'project', project);
61
+ const localVarPath = `/v1/catalog/products`;
62
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
63
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
64
+ let baseOptions;
65
+ if (configuration) {
66
+ baseOptions = configuration.baseOptions;
67
+ }
68
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
69
+ const localVarHeaderParameter = {};
70
+ const localVarQueryParameter = {};
71
+ // authentication session-oauth required
72
+ // oauth required
73
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
74
+ // authentication api-key required
75
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
76
+ if (project !== undefined) {
77
+ localVarQueryParameter['project'] = project;
78
+ }
79
+ localVarHeaderParameter['Content-Type'] = 'application/json';
80
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
81
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
82
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
83
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(createProductRequest, localVarRequestOptions, configuration);
84
+ return {
85
+ url: (0, common_1.toPathString)(localVarUrlObj),
86
+ options: localVarRequestOptions,
87
+ };
88
+ }),
89
+ /**
90
+ * Deletes a catalog product
91
+ * @summary Delete catalog product
92
+ * @param {string} project What project it is
93
+ * @param {string} productId Product\'s unique identifier
94
+ * @param {*} [options] Override http request option.
95
+ * @throws {RequiredError}
96
+ */
97
+ deleteProduct: (project_2, productId_1, ...args_2) => __awaiter(this, [project_2, productId_1, ...args_2], void 0, function* (project, productId, options = {}) {
98
+ // verify required parameter 'project' is not null or undefined
99
+ (0, common_1.assertParamExists)('deleteProduct', 'project', project);
100
+ // verify required parameter 'productId' is not null or undefined
101
+ (0, common_1.assertParamExists)('deleteProduct', 'productId', productId);
102
+ const localVarPath = `/v1/catalog/products/{productId}`
103
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
104
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
105
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
106
+ let baseOptions;
107
+ if (configuration) {
108
+ baseOptions = configuration.baseOptions;
109
+ }
110
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
111
+ const localVarHeaderParameter = {};
112
+ const localVarQueryParameter = {};
113
+ // authentication session-oauth required
114
+ // oauth required
115
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
116
+ // authentication api-key required
117
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
118
+ if (project !== undefined) {
119
+ localVarQueryParameter['project'] = project;
120
+ }
121
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
122
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
123
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
124
+ return {
125
+ url: (0, common_1.toPathString)(localVarUrlObj),
126
+ options: localVarRequestOptions,
127
+ };
128
+ }),
129
+ /**
130
+ * Gets a product by a given ID.
131
+ * @summary Get product
132
+ * @param {string} project What project it is
133
+ * @param {string} productId Product\'s unique identifier
134
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
135
+ * @param {*} [options] Override http request option.
136
+ * @throws {RequiredError}
137
+ */
138
+ getProduct: (project_3, productId_2, fields_1, ...args_3) => __awaiter(this, [project_3, productId_2, fields_1, ...args_3], void 0, function* (project, productId, fields, options = {}) {
139
+ // verify required parameter 'project' is not null or undefined
140
+ (0, common_1.assertParamExists)('getProduct', 'project', project);
141
+ // verify required parameter 'productId' is not null or undefined
142
+ (0, common_1.assertParamExists)('getProduct', 'productId', productId);
143
+ const localVarPath = `/v1/catalog/products/{productId}`
144
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
145
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
146
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
147
+ let baseOptions;
148
+ if (configuration) {
149
+ baseOptions = configuration.baseOptions;
150
+ }
151
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
152
+ const localVarHeaderParameter = {};
153
+ const localVarQueryParameter = {};
154
+ // authentication session-oauth required
155
+ // oauth required
156
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
157
+ // authentication api-key required
158
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
159
+ if (project !== undefined) {
160
+ localVarQueryParameter['project'] = project;
161
+ }
162
+ if (fields !== undefined) {
163
+ localVarQueryParameter['fields'] = fields;
164
+ }
165
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
166
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
167
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
168
+ return {
169
+ url: (0, common_1.toPathString)(localVarUrlObj),
170
+ options: localVarRequestOptions,
171
+ };
172
+ }),
173
+ /**
174
+ * Lists all enabled store listing products attached to the given project.
175
+ * @summary List products
176
+ * @param {string} project What project it is
177
+ * @param {number} [pageToken] Page reference token
178
+ * @param {string} [search] Search term to filter based on product tags.
179
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
180
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
181
+ * @param {*} [options] Override http request option.
182
+ * @throws {RequiredError}
183
+ */
184
+ getProducts: (project_4, pageToken_1, search_1, pageSize_1, fields_2, ...args_4) => __awaiter(this, [project_4, pageToken_1, search_1, pageSize_1, fields_2, ...args_4], void 0, function* (project, pageToken, search, pageSize, fields, options = {}) {
185
+ // verify required parameter 'project' is not null or undefined
186
+ (0, common_1.assertParamExists)('getProducts', 'project', project);
187
+ const localVarPath = `/v1/catalog/products`;
188
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
189
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
190
+ let baseOptions;
191
+ if (configuration) {
192
+ baseOptions = configuration.baseOptions;
193
+ }
194
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
195
+ const localVarHeaderParameter = {};
196
+ const localVarQueryParameter = {};
197
+ // authentication session-oauth required
198
+ // oauth required
199
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
200
+ // authentication api-key required
201
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
202
+ if (project !== undefined) {
203
+ localVarQueryParameter['project'] = project;
204
+ }
205
+ if (pageToken !== undefined) {
206
+ localVarQueryParameter['pageToken'] = pageToken;
207
+ }
208
+ if (search !== undefined) {
209
+ localVarQueryParameter['search'] = search;
210
+ }
211
+ if (pageSize !== undefined) {
212
+ localVarQueryParameter['pageSize'] = pageSize;
213
+ }
214
+ if (fields !== undefined) {
215
+ localVarQueryParameter['fields'] = fields;
216
+ }
217
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
218
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
219
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
220
+ return {
221
+ url: (0, common_1.toPathString)(localVarUrlObj),
222
+ options: localVarRequestOptions,
223
+ };
224
+ }),
225
+ /**
226
+ * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
227
+ * @summary Import products
228
+ * @param {string} project What project it is
229
+ * @param {string} [body] A data URL of a CSV file containing data for one or more products.
230
+ * @param {*} [options] Override http request option.
231
+ * @throws {RequiredError}
232
+ */
233
+ importProducts: (project_5, body_1, ...args_5) => __awaiter(this, [project_5, body_1, ...args_5], void 0, function* (project, body, options = {}) {
234
+ // verify required parameter 'project' is not null or undefined
235
+ (0, common_1.assertParamExists)('importProducts', 'project', project);
236
+ const localVarPath = `/v1/catalog/products/import`;
237
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
238
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
239
+ let baseOptions;
240
+ if (configuration) {
241
+ baseOptions = configuration.baseOptions;
242
+ }
243
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
244
+ const localVarHeaderParameter = {};
245
+ const localVarQueryParameter = {};
246
+ // authentication session-oauth required
247
+ // oauth required
248
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
249
+ // authentication api-key required
250
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
251
+ if (project !== undefined) {
252
+ localVarQueryParameter['project'] = project;
253
+ }
254
+ localVarHeaderParameter['Content-Type'] = 'text/csv';
255
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
256
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
257
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
258
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
259
+ return {
260
+ url: (0, common_1.toPathString)(localVarUrlObj),
261
+ options: localVarRequestOptions,
262
+ };
263
+ }),
264
+ /**
265
+ * Updates a product by a given ID.
266
+ * @summary Update product
267
+ * @param {string} project What project it is
268
+ * @param {string} productId Product\'s unique identifier
269
+ * @param {UpdateProductRequest} [updateProductRequest]
270
+ * @param {*} [options] Override http request option.
271
+ * @throws {RequiredError}
272
+ */
273
+ updateProduct: (project_6, productId_3, updateProductRequest_1, ...args_6) => __awaiter(this, [project_6, productId_3, updateProductRequest_1, ...args_6], void 0, function* (project, productId, updateProductRequest, options = {}) {
274
+ // verify required parameter 'project' is not null or undefined
275
+ (0, common_1.assertParamExists)('updateProduct', 'project', project);
276
+ // verify required parameter 'productId' is not null or undefined
277
+ (0, common_1.assertParamExists)('updateProduct', 'productId', productId);
278
+ const localVarPath = `/v1/catalog/products/{productId}`
279
+ .replace(`{${"productId"}}`, encodeURIComponent(String(productId)));
280
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
281
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
282
+ let baseOptions;
283
+ if (configuration) {
284
+ baseOptions = configuration.baseOptions;
285
+ }
286
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
287
+ const localVarHeaderParameter = {};
288
+ const localVarQueryParameter = {};
289
+ // authentication session-oauth required
290
+ // oauth required
291
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
292
+ // authentication api-key required
293
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
294
+ if (project !== undefined) {
295
+ localVarQueryParameter['project'] = project;
296
+ }
297
+ localVarHeaderParameter['Content-Type'] = 'application/json';
298
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
299
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
300
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
301
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(updateProductRequest, localVarRequestOptions, configuration);
302
+ return {
303
+ url: (0, common_1.toPathString)(localVarUrlObj),
304
+ options: localVarRequestOptions,
305
+ };
306
+ }),
307
+ };
308
+ };
309
+ exports.ProductsApiAxiosParamCreator = ProductsApiAxiosParamCreator;
310
+ /**
311
+ * ProductsApi - functional programming interface
312
+ * @export
313
+ */
314
+ const ProductsApiFp = function (configuration) {
315
+ const localVarAxiosParamCreator = (0, exports.ProductsApiAxiosParamCreator)(configuration);
316
+ return {
317
+ /**
318
+ * Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
319
+ * @summary Create product
320
+ * @param {string} project What project it is
321
+ * @param {CreateProductRequest} [createProductRequest]
322
+ * @param {*} [options] Override http request option.
323
+ * @throws {RequiredError}
324
+ */
325
+ createProduct(project, createProductRequest, options) {
326
+ return __awaiter(this, void 0, void 0, function* () {
327
+ var _a, _b, _c;
328
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.createProduct(project, createProductRequest, options);
329
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
330
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.createProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
331
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
332
+ });
333
+ },
334
+ /**
335
+ * Deletes a catalog product
336
+ * @summary Delete catalog product
337
+ * @param {string} project What project it is
338
+ * @param {string} productId Product\'s unique identifier
339
+ * @param {*} [options] Override http request option.
340
+ * @throws {RequiredError}
341
+ */
342
+ deleteProduct(project, productId, options) {
343
+ return __awaiter(this, void 0, void 0, function* () {
344
+ var _a, _b, _c;
345
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteProduct(project, productId, options);
346
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
347
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.deleteProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
348
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
349
+ });
350
+ },
351
+ /**
352
+ * Gets a product by a given ID.
353
+ * @summary Get product
354
+ * @param {string} project What project it is
355
+ * @param {string} productId Product\'s unique identifier
356
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
357
+ * @param {*} [options] Override http request option.
358
+ * @throws {RequiredError}
359
+ */
360
+ getProduct(project, productId, fields, options) {
361
+ return __awaiter(this, void 0, void 0, function* () {
362
+ var _a, _b, _c;
363
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getProduct(project, productId, fields, options);
364
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
365
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.getProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
366
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
367
+ });
368
+ },
369
+ /**
370
+ * Lists all enabled store listing products attached to the given project.
371
+ * @summary List products
372
+ * @param {string} project What project it is
373
+ * @param {number} [pageToken] Page reference token
374
+ * @param {string} [search] Search term to filter based on product tags.
375
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
376
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
377
+ * @param {*} [options] Override http request option.
378
+ * @throws {RequiredError}
379
+ */
380
+ getProducts(project, pageToken, search, pageSize, fields, options) {
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ var _a, _b, _c;
383
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getProducts(project, pageToken, search, pageSize, fields, options);
384
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
385
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.getProducts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
386
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
387
+ });
388
+ },
389
+ /**
390
+ * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
391
+ * @summary Import products
392
+ * @param {string} project What project it is
393
+ * @param {string} [body] A data URL of a CSV file containing data for one or more products.
394
+ * @param {*} [options] Override http request option.
395
+ * @throws {RequiredError}
396
+ */
397
+ importProducts(project, body, options) {
398
+ return __awaiter(this, void 0, void 0, function* () {
399
+ var _a, _b, _c;
400
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.importProducts(project, body, options);
401
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
402
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.importProducts']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
403
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
404
+ });
405
+ },
406
+ /**
407
+ * Updates a product by a given ID.
408
+ * @summary Update product
409
+ * @param {string} project What project it is
410
+ * @param {string} productId Product\'s unique identifier
411
+ * @param {UpdateProductRequest} [updateProductRequest]
412
+ * @param {*} [options] Override http request option.
413
+ * @throws {RequiredError}
414
+ */
415
+ updateProduct(project, productId, updateProductRequest, options) {
416
+ return __awaiter(this, void 0, void 0, function* () {
417
+ var _a, _b, _c;
418
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateProduct(project, productId, updateProductRequest, options);
419
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
420
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['ProductsApi.updateProduct']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
421
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
422
+ });
423
+ },
424
+ };
425
+ };
426
+ exports.ProductsApiFp = ProductsApiFp;
427
+ /**
428
+ * ProductsApi - factory interface
429
+ * @export
430
+ */
431
+ const ProductsApiFactory = function (configuration, basePath, axios) {
432
+ const localVarFp = (0, exports.ProductsApiFp)(configuration);
433
+ return {
434
+ /**
435
+ * Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
436
+ * @summary Create product
437
+ * @param {string} project What project it is
438
+ * @param {CreateProductRequest} [createProductRequest]
439
+ * @param {*} [options] Override http request option.
440
+ * @throws {RequiredError}
441
+ */
442
+ createProduct(project, createProductRequest, options) {
443
+ return localVarFp.createProduct(project, createProductRequest, options).then((request) => request(axios, basePath));
444
+ },
445
+ /**
446
+ * Deletes a catalog product
447
+ * @summary Delete catalog product
448
+ * @param {string} project What project it is
449
+ * @param {string} productId Product\'s unique identifier
450
+ * @param {*} [options] Override http request option.
451
+ * @throws {RequiredError}
452
+ */
453
+ deleteProduct(project, productId, options) {
454
+ return localVarFp.deleteProduct(project, productId, options).then((request) => request(axios, basePath));
455
+ },
456
+ /**
457
+ * Gets a product by a given ID.
458
+ * @summary Get product
459
+ * @param {string} project What project it is
460
+ * @param {string} productId Product\'s unique identifier
461
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
462
+ * @param {*} [options] Override http request option.
463
+ * @throws {RequiredError}
464
+ */
465
+ getProduct(project, productId, fields, options) {
466
+ return localVarFp.getProduct(project, productId, fields, options).then((request) => request(axios, basePath));
467
+ },
468
+ /**
469
+ * Lists all enabled store listing products attached to the given project.
470
+ * @summary List products
471
+ * @param {string} project What project it is
472
+ * @param {number} [pageToken] Page reference token
473
+ * @param {string} [search] Search term to filter based on product tags.
474
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
475
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
476
+ * @param {*} [options] Override http request option.
477
+ * @throws {RequiredError}
478
+ */
479
+ getProducts(project, pageToken, search, pageSize, fields, options) {
480
+ return localVarFp.getProducts(project, pageToken, search, pageSize, fields, options).then((request) => request(axios, basePath));
481
+ },
482
+ /**
483
+ * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
484
+ * @summary Import products
485
+ * @param {string} project What project it is
486
+ * @param {string} [body] A data URL of a CSV file containing data for one or more products.
487
+ * @param {*} [options] Override http request option.
488
+ * @throws {RequiredError}
489
+ */
490
+ importProducts(project, body, options) {
491
+ return localVarFp.importProducts(project, body, options).then((request) => request(axios, basePath));
492
+ },
493
+ /**
494
+ * Updates a product by a given ID.
495
+ * @summary Update product
496
+ * @param {string} project What project it is
497
+ * @param {string} productId Product\'s unique identifier
498
+ * @param {UpdateProductRequest} [updateProductRequest]
499
+ * @param {*} [options] Override http request option.
500
+ * @throws {RequiredError}
501
+ */
502
+ updateProduct(project, productId, updateProductRequest, options) {
503
+ return localVarFp.updateProduct(project, productId, updateProductRequest, options).then((request) => request(axios, basePath));
504
+ },
505
+ };
506
+ };
507
+ exports.ProductsApiFactory = ProductsApiFactory;
508
+ /**
509
+ * ProductsApi - object-oriented interface
510
+ * @export
511
+ * @class ProductsApi
512
+ * @extends {BaseAPI}
513
+ */
514
+ class ProductsApi extends base_1.BaseAPI {
515
+ /**
516
+ * Creates a new catalog product based on a given warehouse product with the variants and design applications provided. To select a warehouse product to base this product on, use the GFN Catalog API to list available options.
517
+ * @summary Create product
518
+ * @param {string} project What project it is
519
+ * @param {CreateProductRequest} [createProductRequest]
520
+ * @param {*} [options] Override http request option.
521
+ * @throws {RequiredError}
522
+ * @memberof ProductsApi
523
+ */
524
+ createProduct(project, createProductRequest, options) {
525
+ return (0, exports.ProductsApiFp)(this.configuration).createProduct(project, createProductRequest, options).then((request) => request(this.axios, this.basePath));
526
+ }
527
+ /**
528
+ * Deletes a catalog product
529
+ * @summary Delete catalog product
530
+ * @param {string} project What project it is
531
+ * @param {string} productId Product\'s unique identifier
532
+ * @param {*} [options] Override http request option.
533
+ * @throws {RequiredError}
534
+ * @memberof ProductsApi
535
+ */
536
+ deleteProduct(project, productId, options) {
537
+ return (0, exports.ProductsApiFp)(this.configuration).deleteProduct(project, productId, options).then((request) => request(this.axios, this.basePath));
538
+ }
539
+ /**
540
+ * Gets a product by a given ID.
541
+ * @summary Get product
542
+ * @param {string} project What project it is
543
+ * @param {string} productId Product\'s unique identifier
544
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
545
+ * @param {*} [options] Override http request option.
546
+ * @throws {RequiredError}
547
+ * @memberof ProductsApi
548
+ */
549
+ getProduct(project, productId, fields, options) {
550
+ return (0, exports.ProductsApiFp)(this.configuration).getProduct(project, productId, fields, options).then((request) => request(this.axios, this.basePath));
551
+ }
552
+ /**
553
+ * Lists all enabled store listing products attached to the given project.
554
+ * @summary List products
555
+ * @param {string} project What project it is
556
+ * @param {number} [pageToken] Page reference token
557
+ * @param {string} [search] Search term to filter based on product tags.
558
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
559
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
560
+ * @param {*} [options] Override http request option.
561
+ * @throws {RequiredError}
562
+ * @memberof ProductsApi
563
+ */
564
+ getProducts(project, pageToken, search, pageSize, fields, options) {
565
+ return (0, exports.ProductsApiFp)(this.configuration).getProducts(project, pageToken, search, pageSize, fields, options).then((request) => request(this.axios, this.basePath));
566
+ }
567
+ /**
568
+ * Initiates a product import from a CSV file. The result will be available as a notification within the dashboard.
569
+ * @summary Import products
570
+ * @param {string} project What project it is
571
+ * @param {string} [body] A data URL of a CSV file containing data for one or more products.
572
+ * @param {*} [options] Override http request option.
573
+ * @throws {RequiredError}
574
+ * @memberof ProductsApi
575
+ */
576
+ importProducts(project, body, options) {
577
+ return (0, exports.ProductsApiFp)(this.configuration).importProducts(project, body, options).then((request) => request(this.axios, this.basePath));
578
+ }
579
+ /**
580
+ * Updates a product by a given ID.
581
+ * @summary Update product
582
+ * @param {string} project What project it is
583
+ * @param {string} productId Product\'s unique identifier
584
+ * @param {UpdateProductRequest} [updateProductRequest]
585
+ * @param {*} [options] Override http request option.
586
+ * @throws {RequiredError}
587
+ * @memberof ProductsApi
588
+ */
589
+ updateProduct(project, productId, updateProductRequest, options) {
590
+ return (0, exports.ProductsApiFp)(this.configuration).updateProduct(project, productId, updateProductRequest, options).then((request) => request(this.axios, this.basePath));
591
+ }
592
+ }
593
+ exports.ProductsApi = ProductsApi;
594
+ /**
595
+ * VariantsApi - axios parameter creator
596
+ * @export
597
+ */
598
+ const VariantsApiAxiosParamCreator = function (configuration) {
599
+ return {
600
+ /**
601
+ * Gets a variant by a given ID.
602
+ * @summary Get variant
603
+ * @param {string} project What project it is
604
+ * @param {string} variantId Variants unique identifier
605
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
606
+ * @param {*} [options] Override http request option.
607
+ * @throws {RequiredError}
608
+ */
609
+ getVariant: (project_1, variantId_1, fields_1, ...args_1) => __awaiter(this, [project_1, variantId_1, fields_1, ...args_1], void 0, function* (project, variantId, fields, options = {}) {
610
+ // verify required parameter 'project' is not null or undefined
611
+ (0, common_1.assertParamExists)('getVariant', 'project', project);
612
+ // verify required parameter 'variantId' is not null or undefined
613
+ (0, common_1.assertParamExists)('getVariant', 'variantId', variantId);
614
+ const localVarPath = `/v1/catalog/variants/{variantId}`
615
+ .replace(`{${"variantId"}}`, encodeURIComponent(String(variantId)));
616
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
617
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
618
+ let baseOptions;
619
+ if (configuration) {
620
+ baseOptions = configuration.baseOptions;
621
+ }
622
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
623
+ const localVarHeaderParameter = {};
624
+ const localVarQueryParameter = {};
625
+ // authentication session-oauth required
626
+ // oauth required
627
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
628
+ // authentication api-key required
629
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
630
+ if (project !== undefined) {
631
+ localVarQueryParameter['project'] = project;
632
+ }
633
+ if (fields !== undefined) {
634
+ localVarQueryParameter['fields'] = fields;
635
+ }
636
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
637
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
638
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
639
+ return {
640
+ url: (0, common_1.toPathString)(localVarUrlObj),
641
+ options: localVarRequestOptions,
642
+ };
643
+ }),
644
+ /**
645
+ * Lists all variants that belong to enabled products attached to the given project.
646
+ * @summary List variants
647
+ * @param {string} project What project it is
648
+ * @param {string} [search] Search term to filter based on product tags.
649
+ * @param {number} [pageToken] Page reference token
650
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
651
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
652
+ * @param {*} [options] Override http request option.
653
+ * @throws {RequiredError}
654
+ */
655
+ listVariants: (project_2, search_1, pageToken_1, pageSize_1, fields_2, ...args_2) => __awaiter(this, [project_2, search_1, pageToken_1, pageSize_1, fields_2, ...args_2], void 0, function* (project, search, pageToken, pageSize, fields, options = {}) {
656
+ // verify required parameter 'project' is not null or undefined
657
+ (0, common_1.assertParamExists)('listVariants', 'project', project);
658
+ const localVarPath = `/v1/catalog/variants`;
659
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
660
+ const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
661
+ let baseOptions;
662
+ if (configuration) {
663
+ baseOptions = configuration.baseOptions;
664
+ }
665
+ const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
666
+ const localVarHeaderParameter = {};
667
+ const localVarQueryParameter = {};
668
+ // authentication session-oauth required
669
+ // oauth required
670
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "session-oauth", [], configuration);
671
+ // authentication api-key required
672
+ yield (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
673
+ if (project !== undefined) {
674
+ localVarQueryParameter['project'] = project;
675
+ }
676
+ if (search !== undefined) {
677
+ localVarQueryParameter['search'] = search;
678
+ }
679
+ if (pageToken !== undefined) {
680
+ localVarQueryParameter['pageToken'] = pageToken;
681
+ }
682
+ if (pageSize !== undefined) {
683
+ localVarQueryParameter['pageSize'] = pageSize;
684
+ }
685
+ if (fields !== undefined) {
686
+ localVarQueryParameter['fields'] = fields;
687
+ }
688
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
689
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
690
+ localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
691
+ return {
692
+ url: (0, common_1.toPathString)(localVarUrlObj),
693
+ options: localVarRequestOptions,
694
+ };
695
+ }),
696
+ };
697
+ };
698
+ exports.VariantsApiAxiosParamCreator = VariantsApiAxiosParamCreator;
699
+ /**
700
+ * VariantsApi - functional programming interface
701
+ * @export
702
+ */
703
+ const VariantsApiFp = function (configuration) {
704
+ const localVarAxiosParamCreator = (0, exports.VariantsApiAxiosParamCreator)(configuration);
705
+ return {
706
+ /**
707
+ * Gets a variant by a given ID.
708
+ * @summary Get variant
709
+ * @param {string} project What project it is
710
+ * @param {string} variantId Variants unique identifier
711
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
712
+ * @param {*} [options] Override http request option.
713
+ * @throws {RequiredError}
714
+ */
715
+ getVariant(project, variantId, fields, options) {
716
+ return __awaiter(this, void 0, void 0, function* () {
717
+ var _a, _b, _c;
718
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getVariant(project, variantId, fields, options);
719
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
720
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['VariantsApi.getVariant']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
721
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
722
+ });
723
+ },
724
+ /**
725
+ * Lists all variants that belong to enabled products attached to the given project.
726
+ * @summary List variants
727
+ * @param {string} project What project it is
728
+ * @param {string} [search] Search term to filter based on product tags.
729
+ * @param {number} [pageToken] Page reference token
730
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
731
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
732
+ * @param {*} [options] Override http request option.
733
+ * @throws {RequiredError}
734
+ */
735
+ listVariants(project, search, pageToken, pageSize, fields, options) {
736
+ return __awaiter(this, void 0, void 0, function* () {
737
+ var _a, _b, _c;
738
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.listVariants(project, search, pageToken, pageSize, fields, options);
739
+ const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
740
+ const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['VariantsApi.listVariants']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
741
+ return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
742
+ });
743
+ },
744
+ };
745
+ };
746
+ exports.VariantsApiFp = VariantsApiFp;
747
+ /**
748
+ * VariantsApi - factory interface
749
+ * @export
750
+ */
751
+ const VariantsApiFactory = function (configuration, basePath, axios) {
752
+ const localVarFp = (0, exports.VariantsApiFp)(configuration);
753
+ return {
754
+ /**
755
+ * Gets a variant by a given ID.
756
+ * @summary Get variant
757
+ * @param {string} project What project it is
758
+ * @param {string} variantId Variants unique identifier
759
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
760
+ * @param {*} [options] Override http request option.
761
+ * @throws {RequiredError}
762
+ */
763
+ getVariant(project, variantId, fields, options) {
764
+ return localVarFp.getVariant(project, variantId, fields, options).then((request) => request(axios, basePath));
765
+ },
766
+ /**
767
+ * Lists all variants that belong to enabled products attached to the given project.
768
+ * @summary List variants
769
+ * @param {string} project What project it is
770
+ * @param {string} [search] Search term to filter based on product tags.
771
+ * @param {number} [pageToken] Page reference token
772
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
773
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
774
+ * @param {*} [options] Override http request option.
775
+ * @throws {RequiredError}
776
+ */
777
+ listVariants(project, search, pageToken, pageSize, fields, options) {
778
+ return localVarFp.listVariants(project, search, pageToken, pageSize, fields, options).then((request) => request(axios, basePath));
779
+ },
780
+ };
781
+ };
782
+ exports.VariantsApiFactory = VariantsApiFactory;
783
+ /**
784
+ * VariantsApi - object-oriented interface
785
+ * @export
786
+ * @class VariantsApi
787
+ * @extends {BaseAPI}
788
+ */
789
+ class VariantsApi extends base_1.BaseAPI {
790
+ /**
791
+ * Gets a variant by a given ID.
792
+ * @summary Get variant
793
+ * @param {string} project What project it is
794
+ * @param {string} variantId Variants unique identifier
795
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
796
+ * @param {*} [options] Override http request option.
797
+ * @throws {RequiredError}
798
+ * @memberof VariantsApi
799
+ */
800
+ getVariant(project, variantId, fields, options) {
801
+ return (0, exports.VariantsApiFp)(this.configuration).getVariant(project, variantId, fields, options).then((request) => request(this.axios, this.basePath));
802
+ }
803
+ /**
804
+ * Lists all variants that belong to enabled products attached to the given project.
805
+ * @summary List variants
806
+ * @param {string} project What project it is
807
+ * @param {string} [search] Search term to filter based on product tags.
808
+ * @param {number} [pageToken] Page reference token
809
+ * @param {number} [pageSize] Max page size. This is the maximum page size that will be returned, but it might be smaller.
810
+ * @param {string} [fields] Filter response fields to only include a subset of the resource.
811
+ * @param {*} [options] Override http request option.
812
+ * @throws {RequiredError}
813
+ * @memberof VariantsApi
814
+ */
815
+ listVariants(project, search, pageToken, pageSize, fields, options) {
816
+ return (0, exports.VariantsApiFp)(this.configuration).listVariants(project, search, pageToken, pageSize, fields, options).then((request) => request(this.axios, this.basePath));
817
+ }
818
+ }
819
+ exports.VariantsApi = VariantsApi;