@aurigma/axios-design-atoms-api-client 2.63.1 → 2.65.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.
@@ -2017,7 +2017,7 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2017
2017
  this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2018
2018
  }
2019
2019
  /**
2020
- * Renders a web image preview with the specified parameters.
2020
+ * Renders a preview of an image with the specified parameters.
2021
2021
  * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
2022
2022
  (default value is 'false').
2023
2023
  * @param tenantId (optional) Tenant identifier
@@ -2089,13 +2089,2798 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2089
2089
  return Promise.resolve(null);
2090
2090
  }
2091
2091
  /**
2092
- * Renders a web image preview with the specified parameters and saves rendering result as resource.
2092
+ * Renders a preview of an uploaded image with the specified parameters.
2093
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
2094
+ (default value is 'false').
2095
+ * @param tenantId (optional) Tenant identifier
2096
+ * @param sourceFile (optional)
2097
+ * @param mockupOwnerId (optional)
2098
+ * @param mockupId (optional)
2099
+ * @param width (optional)
2100
+ * @param height (optional)
2101
+ * @param fileFormat (optional)
2102
+ * @param fitMode (optional)
2103
+ * @return Success
2104
+ */
2105
+ renderImagePreviewFromFile(attachment, tenantId, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
2106
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file?";
2107
+ if (attachment !== undefined && attachment !== null)
2108
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
2109
+ if (tenantId === null)
2110
+ throw new Error("The parameter 'tenantId' cannot be null.");
2111
+ else if (tenantId !== undefined)
2112
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2113
+ url_ = url_.replace(/[?&]$/, "");
2114
+ const content_ = new FormData();
2115
+ if (sourceFile !== null && sourceFile !== undefined)
2116
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
2117
+ if (mockupOwnerId !== null && mockupOwnerId !== undefined)
2118
+ content_.append("mockupOwnerId", mockupOwnerId.toString());
2119
+ if (mockupId !== null && mockupId !== undefined)
2120
+ content_.append("mockupId", mockupId.toString());
2121
+ if (width !== null && width !== undefined)
2122
+ content_.append("width", width.toString());
2123
+ if (height !== null && height !== undefined)
2124
+ content_.append("height", height.toString());
2125
+ if (fileFormat !== null && fileFormat !== undefined)
2126
+ content_.append("fileFormat", fileFormat.toString());
2127
+ if (fitMode !== null && fitMode !== undefined)
2128
+ content_.append("fitMode", fitMode.toString());
2129
+ let options_ = {
2130
+ data: content_,
2131
+ responseType: "blob",
2132
+ method: "POST",
2133
+ url: url_,
2134
+ headers: {
2135
+ "Accept": "application/octet-stream"
2136
+ },
2137
+ cancelToken
2138
+ };
2139
+ return this.transformOptions(options_).then(transformedOptions_ => {
2140
+ return this.instance.request(transformedOptions_);
2141
+ }).catch((_error) => {
2142
+ if (isAxiosError(_error) && _error.response) {
2143
+ return _error.response;
2144
+ }
2145
+ else {
2146
+ throw _error;
2147
+ }
2148
+ }).then((_response) => {
2149
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFile(_response));
2150
+ });
2151
+ }
2152
+ processRenderImagePreviewFromFile(response) {
2153
+ const status = response.status;
2154
+ let _headers = {};
2155
+ if (response.headers && typeof response.headers === "object") {
2156
+ for (let k in response.headers) {
2157
+ if (response.headers.hasOwnProperty(k)) {
2158
+ _headers[k] = response.headers[k];
2159
+ }
2160
+ }
2161
+ }
2162
+ if (status === 200 || status === 206) {
2163
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2164
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2165
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2166
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2167
+ }
2168
+ else if (status === 401) {
2169
+ const _responseText = response.data;
2170
+ return throwException("Unauthorized", status, _responseText, _headers);
2171
+ }
2172
+ else if (status === 403) {
2173
+ const _responseText = response.data;
2174
+ return throwException("Forbidden", status, _responseText, _headers);
2175
+ }
2176
+ else if (status !== 200 && status !== 204) {
2177
+ const _responseText = response.data;
2178
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2179
+ }
2180
+ return Promise.resolve(null);
2181
+ }
2182
+ /**
2183
+ * Renders a preview of an uploaded image with the specified parameters and saves rendering result as resource.
2184
+ * @param tenantId (optional) Tenant identifier
2185
+ * @param resourceOwnerId (optional)
2186
+ * @param resourceNamespace (optional)
2187
+ * @param resourceName (optional)
2188
+ * @param resourceSourceId (optional)
2189
+ * @param resourceType (optional)
2190
+ * @param anonymousAccess (optional)
2191
+ * @param overwriteExistingResource (optional)
2192
+ * @param sourceFile (optional)
2193
+ * @param mockupOwnerId (optional)
2194
+ * @param mockupId (optional)
2195
+ * @param width (optional)
2196
+ * @param height (optional)
2197
+ * @param fileFormat (optional)
2198
+ * @param fitMode (optional)
2199
+ * @return Success
2200
+ */
2201
+ renderImagePreviewFromFileToResource(tenantId, resourceOwnerId, resourceNamespace, resourceName, resourceSourceId, resourceType, anonymousAccess, overwriteExistingResource, sourceFile, mockupOwnerId, mockupId, width, height, fileFormat, fitMode, cancelToken) {
2202
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-file/to-resource?";
2203
+ if (tenantId === null)
2204
+ throw new Error("The parameter 'tenantId' cannot be null.");
2205
+ else if (tenantId !== undefined)
2206
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2207
+ url_ = url_.replace(/[?&]$/, "");
2208
+ const content_ = new FormData();
2209
+ if (resourceOwnerId !== null && resourceOwnerId !== undefined)
2210
+ content_.append("resourceOwnerId", resourceOwnerId.toString());
2211
+ if (resourceNamespace !== null && resourceNamespace !== undefined)
2212
+ content_.append("resourceNamespace", resourceNamespace.toString());
2213
+ if (resourceName !== null && resourceName !== undefined)
2214
+ content_.append("resourceName", resourceName.toString());
2215
+ if (resourceSourceId !== null && resourceSourceId !== undefined)
2216
+ content_.append("resourceSourceId", resourceSourceId.toString());
2217
+ if (resourceType !== null && resourceType !== undefined)
2218
+ content_.append("resourceType", resourceType.toString());
2219
+ if (anonymousAccess === null || anonymousAccess === undefined)
2220
+ throw new Error("The parameter 'anonymousAccess' cannot be null.");
2221
+ else
2222
+ content_.append("anonymousAccess", anonymousAccess.toString());
2223
+ if (overwriteExistingResource === null || overwriteExistingResource === undefined)
2224
+ throw new Error("The parameter 'overwriteExistingResource' cannot be null.");
2225
+ else
2226
+ content_.append("overwriteExistingResource", overwriteExistingResource.toString());
2227
+ if (sourceFile !== null && sourceFile !== undefined)
2228
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
2229
+ if (mockupOwnerId !== null && mockupOwnerId !== undefined)
2230
+ content_.append("mockupOwnerId", mockupOwnerId.toString());
2231
+ if (mockupId !== null && mockupId !== undefined)
2232
+ content_.append("mockupId", mockupId.toString());
2233
+ if (width !== null && width !== undefined)
2234
+ content_.append("width", width.toString());
2235
+ if (height !== null && height !== undefined)
2236
+ content_.append("height", height.toString());
2237
+ if (fileFormat !== null && fileFormat !== undefined)
2238
+ content_.append("fileFormat", fileFormat.toString());
2239
+ if (fitMode !== null && fitMode !== undefined)
2240
+ content_.append("fitMode", fitMode.toString());
2241
+ let options_ = {
2242
+ data: content_,
2243
+ method: "POST",
2244
+ url: url_,
2245
+ headers: {
2246
+ "Accept": "application/json"
2247
+ },
2248
+ cancelToken
2249
+ };
2250
+ return this.transformOptions(options_).then(transformedOptions_ => {
2251
+ return this.instance.request(transformedOptions_);
2252
+ }).catch((_error) => {
2253
+ if (isAxiosError(_error) && _error.response) {
2254
+ return _error.response;
2255
+ }
2256
+ else {
2257
+ throw _error;
2258
+ }
2259
+ }).then((_response) => {
2260
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromFileToResource(_response));
2261
+ });
2262
+ }
2263
+ processRenderImagePreviewFromFileToResource(response) {
2264
+ const status = response.status;
2265
+ let _headers = {};
2266
+ if (response.headers && typeof response.headers === "object") {
2267
+ for (let k in response.headers) {
2268
+ if (response.headers.hasOwnProperty(k)) {
2269
+ _headers[k] = response.headers[k];
2270
+ }
2271
+ }
2272
+ }
2273
+ if (status === 200) {
2274
+ const _responseText = response.data;
2275
+ let result200 = null;
2276
+ let resultData200 = _responseText;
2277
+ result200 = JSON.parse(resultData200);
2278
+ return Promise.resolve(result200);
2279
+ }
2280
+ else if (status === 409) {
2281
+ const _responseText = response.data;
2282
+ let result409 = null;
2283
+ let resultData409 = _responseText;
2284
+ result409 = JSON.parse(resultData409);
2285
+ return throwException("Conflict", status, _responseText, _headers, result409);
2286
+ }
2287
+ else if (status === 401) {
2288
+ const _responseText = response.data;
2289
+ return throwException("Unauthorized", status, _responseText, _headers);
2290
+ }
2291
+ else if (status === 403) {
2292
+ const _responseText = response.data;
2293
+ return throwException("Forbidden", status, _responseText, _headers);
2294
+ }
2295
+ else if (status !== 200 && status !== 204) {
2296
+ const _responseText = response.data;
2297
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2298
+ }
2299
+ return Promise.resolve(null);
2300
+ }
2301
+ /**
2302
+ * Renders a preview of a web image with the specified parameters.
2303
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
2304
+ (default value is 'false').
2305
+ * @param tenantId (optional) Tenant identifier
2306
+ * @param body (optional) Render model with preview parameters.
2307
+ * @return Success
2308
+ */
2309
+ renderImagePreviewFromUrl(attachment, tenantId, body, cancelToken) {
2310
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url?";
2311
+ if (attachment !== undefined && attachment !== null)
2312
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
2313
+ if (tenantId === null)
2314
+ throw new Error("The parameter 'tenantId' cannot be null.");
2315
+ else if (tenantId !== undefined)
2316
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2317
+ url_ = url_.replace(/[?&]$/, "");
2318
+ const content_ = JSON.stringify(body);
2319
+ let options_ = {
2320
+ data: content_,
2321
+ responseType: "blob",
2322
+ method: "POST",
2323
+ url: url_,
2324
+ headers: {
2325
+ "Content-Type": "application/json",
2326
+ "Accept": "application/octet-stream"
2327
+ },
2328
+ cancelToken
2329
+ };
2330
+ return this.transformOptions(options_).then(transformedOptions_ => {
2331
+ return this.instance.request(transformedOptions_);
2332
+ }).catch((_error) => {
2333
+ if (isAxiosError(_error) && _error.response) {
2334
+ return _error.response;
2335
+ }
2336
+ else {
2337
+ throw _error;
2338
+ }
2339
+ }).then((_response) => {
2340
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrl(_response));
2341
+ });
2342
+ }
2343
+ processRenderImagePreviewFromUrl(response) {
2344
+ const status = response.status;
2345
+ let _headers = {};
2346
+ if (response.headers && typeof response.headers === "object") {
2347
+ for (let k in response.headers) {
2348
+ if (response.headers.hasOwnProperty(k)) {
2349
+ _headers[k] = response.headers[k];
2350
+ }
2351
+ }
2352
+ }
2353
+ if (status === 200 || status === 206) {
2354
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2355
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2356
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2357
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2358
+ }
2359
+ else if (status === 401) {
2360
+ const _responseText = response.data;
2361
+ return throwException("Unauthorized", status, _responseText, _headers);
2362
+ }
2363
+ else if (status === 403) {
2364
+ const _responseText = response.data;
2365
+ return throwException("Forbidden", status, _responseText, _headers);
2366
+ }
2367
+ else if (status !== 200 && status !== 204) {
2368
+ const _responseText = response.data;
2369
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2370
+ }
2371
+ return Promise.resolve(null);
2372
+ }
2373
+ /**
2374
+ * Renders a preview of a web image with the specified parameters and saves rendering result as resource.
2375
+ * @param tenantId (optional) Tenant identifier
2376
+ * @param body (optional) Render model with preview parameters.
2377
+ * @return Success
2378
+ */
2379
+ renderImagePreviewFromUrlToResource(tenantId, body, cancelToken) {
2380
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/from-url/to-resource?";
2381
+ if (tenantId === null)
2382
+ throw new Error("The parameter 'tenantId' cannot be null.");
2383
+ else if (tenantId !== undefined)
2384
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2385
+ url_ = url_.replace(/[?&]$/, "");
2386
+ const content_ = JSON.stringify(body);
2387
+ let options_ = {
2388
+ data: content_,
2389
+ method: "POST",
2390
+ url: url_,
2391
+ headers: {
2392
+ "Content-Type": "application/json",
2393
+ "Accept": "application/json"
2394
+ },
2395
+ cancelToken
2396
+ };
2397
+ return this.transformOptions(options_).then(transformedOptions_ => {
2398
+ return this.instance.request(transformedOptions_);
2399
+ }).catch((_error) => {
2400
+ if (isAxiosError(_error) && _error.response) {
2401
+ return _error.response;
2402
+ }
2403
+ else {
2404
+ throw _error;
2405
+ }
2406
+ }).then((_response) => {
2407
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewFromUrlToResource(_response));
2408
+ });
2409
+ }
2410
+ processRenderImagePreviewFromUrlToResource(response) {
2411
+ const status = response.status;
2412
+ let _headers = {};
2413
+ if (response.headers && typeof response.headers === "object") {
2414
+ for (let k in response.headers) {
2415
+ if (response.headers.hasOwnProperty(k)) {
2416
+ _headers[k] = response.headers[k];
2417
+ }
2418
+ }
2419
+ }
2420
+ if (status === 200) {
2421
+ const _responseText = response.data;
2422
+ let result200 = null;
2423
+ let resultData200 = _responseText;
2424
+ result200 = JSON.parse(resultData200);
2425
+ return Promise.resolve(result200);
2426
+ }
2427
+ else if (status === 409) {
2428
+ const _responseText = response.data;
2429
+ let result409 = null;
2430
+ let resultData409 = _responseText;
2431
+ result409 = JSON.parse(resultData409);
2432
+ return throwException("Conflict", status, _responseText, _headers, result409);
2433
+ }
2434
+ else if (status === 401) {
2435
+ const _responseText = response.data;
2436
+ return throwException("Unauthorized", status, _responseText, _headers);
2437
+ }
2438
+ else if (status === 403) {
2439
+ const _responseText = response.data;
2440
+ return throwException("Forbidden", status, _responseText, _headers);
2441
+ }
2442
+ else if (status !== 200 && status !== 204) {
2443
+ const _responseText = response.data;
2444
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2445
+ }
2446
+ return Promise.resolve(null);
2447
+ }
2448
+ /**
2449
+ * Renders a preview of an image with the specified parameters and saves rendering result as resource.
2450
+ * @param tenantId (optional) Tenant identifier
2451
+ * @param body (optional) Render model with preview parameters.
2452
+ * @return Success
2453
+ */
2454
+ renderImagePreviewToResource(tenantId, body, cancelToken) {
2455
+ let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
2456
+ if (tenantId === null)
2457
+ throw new Error("The parameter 'tenantId' cannot be null.");
2458
+ else if (tenantId !== undefined)
2459
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2460
+ url_ = url_.replace(/[?&]$/, "");
2461
+ const content_ = JSON.stringify(body);
2462
+ let options_ = {
2463
+ data: content_,
2464
+ method: "POST",
2465
+ url: url_,
2466
+ headers: {
2467
+ "Content-Type": "application/json",
2468
+ "Accept": "application/json"
2469
+ },
2470
+ cancelToken
2471
+ };
2472
+ return this.transformOptions(options_).then(transformedOptions_ => {
2473
+ return this.instance.request(transformedOptions_);
2474
+ }).catch((_error) => {
2475
+ if (isAxiosError(_error) && _error.response) {
2476
+ return _error.response;
2477
+ }
2478
+ else {
2479
+ throw _error;
2480
+ }
2481
+ }).then((_response) => {
2482
+ return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
2483
+ });
2484
+ }
2485
+ processRenderImagePreviewToResource(response) {
2486
+ const status = response.status;
2487
+ let _headers = {};
2488
+ if (response.headers && typeof response.headers === "object") {
2489
+ for (let k in response.headers) {
2490
+ if (response.headers.hasOwnProperty(k)) {
2491
+ _headers[k] = response.headers[k];
2492
+ }
2493
+ }
2494
+ }
2495
+ if (status === 200) {
2496
+ const _responseText = response.data;
2497
+ let result200 = null;
2498
+ let resultData200 = _responseText;
2499
+ result200 = JSON.parse(resultData200);
2500
+ return Promise.resolve(result200);
2501
+ }
2502
+ else if (status === 409) {
2503
+ const _responseText = response.data;
2504
+ let result409 = null;
2505
+ let resultData409 = _responseText;
2506
+ result409 = JSON.parse(resultData409);
2507
+ return throwException("Conflict", status, _responseText, _headers, result409);
2508
+ }
2509
+ else if (status === 401) {
2510
+ const _responseText = response.data;
2511
+ return throwException("Unauthorized", status, _responseText, _headers);
2512
+ }
2513
+ else if (status === 403) {
2514
+ const _responseText = response.data;
2515
+ return throwException("Forbidden", status, _responseText, _headers);
2516
+ }
2517
+ else if (status !== 200 && status !== 204) {
2518
+ const _responseText = response.data;
2519
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2520
+ }
2521
+ return Promise.resolve(null);
2522
+ }
2523
+ }
2524
+ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2525
+ instance;
2526
+ baseUrl;
2527
+ jsonParseReviver = undefined;
2528
+ constructor(configuration, baseUrl, instance) {
2529
+ super(configuration);
2530
+ this.instance = instance ? instance : axios.create();
2531
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2532
+ }
2533
+ /**
2534
+ * Returns a 3D-Mockup attributes.
2535
+ * @param id 3D-Mockup identifier.
2536
+ * @param ownerId (optional) Private mockup owner identifier.
2537
+ * @param tenantId (optional) Tenant identifier
2538
+ * @return Success
2539
+ */
2540
+ getAttributes(id, ownerId, tenantId, cancelToken) {
2541
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
2542
+ if (id === undefined || id === null)
2543
+ throw new Error("The parameter 'id' must be defined.");
2544
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2545
+ if (ownerId !== undefined && ownerId !== null)
2546
+ url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
2547
+ if (tenantId === null)
2548
+ throw new Error("The parameter 'tenantId' cannot be null.");
2549
+ else if (tenantId !== undefined)
2550
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2551
+ url_ = url_.replace(/[?&]$/, "");
2552
+ let options_ = {
2553
+ method: "GET",
2554
+ url: url_,
2555
+ headers: {
2556
+ "Accept": "application/json"
2557
+ },
2558
+ cancelToken
2559
+ };
2560
+ return this.transformOptions(options_).then(transformedOptions_ => {
2561
+ return this.instance.request(transformedOptions_);
2562
+ }).catch((_error) => {
2563
+ if (isAxiosError(_error) && _error.response) {
2564
+ return _error.response;
2565
+ }
2566
+ else {
2567
+ throw _error;
2568
+ }
2569
+ }).then((_response) => {
2570
+ return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
2571
+ });
2572
+ }
2573
+ processGetAttributes(response) {
2574
+ const status = response.status;
2575
+ let _headers = {};
2576
+ if (response.headers && typeof response.headers === "object") {
2577
+ for (let k in response.headers) {
2578
+ if (response.headers.hasOwnProperty(k)) {
2579
+ _headers[k] = response.headers[k];
2580
+ }
2581
+ }
2582
+ }
2583
+ if (status === 200) {
2584
+ const _responseText = response.data;
2585
+ let result200 = null;
2586
+ let resultData200 = _responseText;
2587
+ result200 = JSON.parse(resultData200);
2588
+ return Promise.resolve(result200);
2589
+ }
2590
+ else if (status === 404) {
2591
+ const _responseText = response.data;
2592
+ let result404 = null;
2593
+ let resultData404 = _responseText;
2594
+ result404 = JSON.parse(resultData404);
2595
+ return throwException("Not Found", status, _responseText, _headers, result404);
2596
+ }
2597
+ else if (status === 409) {
2598
+ const _responseText = response.data;
2599
+ let result409 = null;
2600
+ let resultData409 = _responseText;
2601
+ result409 = JSON.parse(resultData409);
2602
+ return throwException("Conflict", status, _responseText, _headers, result409);
2603
+ }
2604
+ else if (status === 401) {
2605
+ const _responseText = response.data;
2606
+ return throwException("Unauthorized", status, _responseText, _headers);
2607
+ }
2608
+ else if (status === 403) {
2609
+ const _responseText = response.data;
2610
+ return throwException("Forbidden", status, _responseText, _headers);
2611
+ }
2612
+ else if (status !== 200 && status !== 204) {
2613
+ const _responseText = response.data;
2614
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2615
+ }
2616
+ return Promise.resolve(null);
2617
+ }
2618
+ /**
2619
+ * Returns a 3D-Mockup content as protobuf binary stream.
2620
+ * @param id 3D-Mockup identifier.
2621
+ * @param ownerId (optional) Private mockup owner identifier.
2622
+ * @param tenantId (optional) Tenant identifier
2623
+ * @return Success
2624
+ */
2625
+ getContentAsProtobuf(id, ownerId, tenantId, cancelToken) {
2626
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
2627
+ if (id === undefined || id === null)
2628
+ throw new Error("The parameter 'id' must be defined.");
2629
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2630
+ if (ownerId !== undefined && ownerId !== null)
2631
+ url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
2632
+ if (tenantId === null)
2633
+ throw new Error("The parameter 'tenantId' cannot be null.");
2634
+ else if (tenantId !== undefined)
2635
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2636
+ url_ = url_.replace(/[?&]$/, "");
2637
+ let options_ = {
2638
+ responseType: "blob",
2639
+ method: "GET",
2640
+ url: url_,
2641
+ headers: {
2642
+ "Accept": "application/json"
2643
+ },
2644
+ cancelToken
2645
+ };
2646
+ return this.transformOptions(options_).then(transformedOptions_ => {
2647
+ return this.instance.request(transformedOptions_);
2648
+ }).catch((_error) => {
2649
+ if (isAxiosError(_error) && _error.response) {
2650
+ return _error.response;
2651
+ }
2652
+ else {
2653
+ throw _error;
2654
+ }
2655
+ }).then((_response) => {
2656
+ return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
2657
+ });
2658
+ }
2659
+ processGetContentAsProtobuf(response) {
2660
+ const status = response.status;
2661
+ let _headers = {};
2662
+ if (response.headers && typeof response.headers === "object") {
2663
+ for (let k in response.headers) {
2664
+ if (response.headers.hasOwnProperty(k)) {
2665
+ _headers[k] = response.headers[k];
2666
+ }
2667
+ }
2668
+ }
2669
+ if (status === 200 || status === 206) {
2670
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2671
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2672
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2673
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2674
+ }
2675
+ else if (status === 404) {
2676
+ const _responseText = response.data;
2677
+ let result404 = null;
2678
+ let resultData404 = _responseText;
2679
+ result404 = JSON.parse(resultData404);
2680
+ return throwException("Not Found", status, _responseText, _headers, result404);
2681
+ }
2682
+ else if (status === 409) {
2683
+ const _responseText = response.data;
2684
+ let result409 = null;
2685
+ let resultData409 = _responseText;
2686
+ result409 = JSON.parse(resultData409);
2687
+ return throwException("Conflict", status, _responseText, _headers, result409);
2688
+ }
2689
+ else if (status === 401) {
2690
+ const _responseText = response.data;
2691
+ return throwException("Unauthorized", status, _responseText, _headers);
2692
+ }
2693
+ else if (status === 403) {
2694
+ const _responseText = response.data;
2695
+ return throwException("Forbidden", status, _responseText, _headers);
2696
+ }
2697
+ else if (status !== 200 && status !== 204) {
2698
+ const _responseText = response.data;
2699
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2700
+ }
2701
+ return Promise.resolve(null);
2702
+ }
2703
+ /**
2704
+ * Returns a 3D-Mockup geometry as binary stream.
2705
+ * @param id 3D-Mockup identifier.
2706
+ * @param ownerId (optional) Private mockup owner identifier.
2707
+ * @param tenantId (optional) Tenant identifier
2708
+ * @return Success
2709
+ */
2710
+ getGeometryFile(id, ownerId, tenantId, cancelToken) {
2711
+ let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
2712
+ if (id === undefined || id === null)
2713
+ throw new Error("The parameter 'id' must be defined.");
2714
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2715
+ if (ownerId !== undefined && ownerId !== null)
2716
+ url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
2717
+ if (tenantId === null)
2718
+ throw new Error("The parameter 'tenantId' cannot be null.");
2719
+ else if (tenantId !== undefined)
2720
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2721
+ url_ = url_.replace(/[?&]$/, "");
2722
+ let options_ = {
2723
+ responseType: "blob",
2724
+ method: "GET",
2725
+ url: url_,
2726
+ headers: {
2727
+ "Accept": "application/json"
2728
+ },
2729
+ cancelToken
2730
+ };
2731
+ return this.transformOptions(options_).then(transformedOptions_ => {
2732
+ return this.instance.request(transformedOptions_);
2733
+ }).catch((_error) => {
2734
+ if (isAxiosError(_error) && _error.response) {
2735
+ return _error.response;
2736
+ }
2737
+ else {
2738
+ throw _error;
2739
+ }
2740
+ }).then((_response) => {
2741
+ return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
2742
+ });
2743
+ }
2744
+ processGetGeometryFile(response) {
2745
+ const status = response.status;
2746
+ let _headers = {};
2747
+ if (response.headers && typeof response.headers === "object") {
2748
+ for (let k in response.headers) {
2749
+ if (response.headers.hasOwnProperty(k)) {
2750
+ _headers[k] = response.headers[k];
2751
+ }
2752
+ }
2753
+ }
2754
+ if (status === 200 || status === 206) {
2755
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2756
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2757
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2758
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2759
+ }
2760
+ else if (status === 404) {
2761
+ const _responseText = response.data;
2762
+ let result404 = null;
2763
+ let resultData404 = _responseText;
2764
+ result404 = JSON.parse(resultData404);
2765
+ return throwException("Not Found", status, _responseText, _headers, result404);
2766
+ }
2767
+ else if (status === 409) {
2768
+ const _responseText = response.data;
2769
+ let result409 = null;
2770
+ let resultData409 = _responseText;
2771
+ result409 = JSON.parse(resultData409);
2772
+ return throwException("Conflict", status, _responseText, _headers, result409);
2773
+ }
2774
+ else if (status === 401) {
2775
+ const _responseText = response.data;
2776
+ return throwException("Unauthorized", status, _responseText, _headers);
2777
+ }
2778
+ else if (status === 403) {
2779
+ const _responseText = response.data;
2780
+ return throwException("Forbidden", status, _responseText, _headers);
2781
+ }
2782
+ else if (status !== 200 && status !== 204) {
2783
+ const _responseText = response.data;
2784
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2785
+ }
2786
+ return Promise.resolve(null);
2787
+ }
2788
+ }
2789
+ export class DesignAtomsPrintProductApiClient extends ApiClientBase {
2790
+ instance;
2791
+ baseUrl;
2792
+ jsonParseReviver = undefined;
2793
+ constructor(configuration, baseUrl, instance) {
2794
+ super(configuration);
2795
+ this.instance = instance ? instance : axios.create();
2796
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2797
+ }
2798
+ /**
2799
+ * Patches a print-product of the specified design file.
2800
+ * @param id Design identifier.
2801
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2802
+ * @param tenantId (optional) Tenant identifier
2803
+ * @param patchType (optional)
2804
+ * @param replaceImageItemFileInfo_itemName (optional)
2805
+ * @param replaceImageItemFileInfo_sourceFile (optional)
2806
+ * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
2807
+ * @param replacePlaceholderItemContentInfo_newContentType (optional)
2808
+ * @param replacePlaceholderItemContentInfo_sourceFile (optional)
2809
+ * @return No Content
2810
+ */
2811
+ patchDesignProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
2812
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product?";
2813
+ if (id === undefined || id === null)
2814
+ throw new Error("The parameter 'id' must be defined.");
2815
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2816
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2817
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2818
+ if (tenantId === null)
2819
+ throw new Error("The parameter 'tenantId' cannot be null.");
2820
+ else if (tenantId !== undefined)
2821
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2822
+ url_ = url_.replace(/[?&]$/, "");
2823
+ const content_ = new FormData();
2824
+ if (patchType === null || patchType === undefined)
2825
+ throw new Error("The parameter 'patchType' cannot be null.");
2826
+ else
2827
+ content_.append("patchType", patchType.toString());
2828
+ if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
2829
+ content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
2830
+ if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
2831
+ content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
2832
+ if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
2833
+ content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
2834
+ if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
2835
+ throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
2836
+ else
2837
+ content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
2838
+ if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
2839
+ content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
2840
+ let options_ = {
2841
+ data: content_,
2842
+ method: "PATCH",
2843
+ url: url_,
2844
+ headers: {},
2845
+ cancelToken
2846
+ };
2847
+ return this.transformOptions(options_).then(transformedOptions_ => {
2848
+ return this.instance.request(transformedOptions_);
2849
+ }).catch((_error) => {
2850
+ if (isAxiosError(_error) && _error.response) {
2851
+ return _error.response;
2852
+ }
2853
+ else {
2854
+ throw _error;
2855
+ }
2856
+ }).then((_response) => {
2857
+ return this.transformResult(url_, _response, (_response) => this.processPatchDesignProduct(_response));
2858
+ });
2859
+ }
2860
+ processPatchDesignProduct(response) {
2861
+ const status = response.status;
2862
+ let _headers = {};
2863
+ if (response.headers && typeof response.headers === "object") {
2864
+ for (let k in response.headers) {
2865
+ if (response.headers.hasOwnProperty(k)) {
2866
+ _headers[k] = response.headers[k];
2867
+ }
2868
+ }
2869
+ }
2870
+ if (status === 204) {
2871
+ const _responseText = response.data;
2872
+ return Promise.resolve(null);
2873
+ }
2874
+ else if (status === 404) {
2875
+ const _responseText = response.data;
2876
+ let result404 = null;
2877
+ let resultData404 = _responseText;
2878
+ result404 = JSON.parse(resultData404);
2879
+ return throwException("Not Found", status, _responseText, _headers, result404);
2880
+ }
2881
+ else if (status === 401) {
2882
+ const _responseText = response.data;
2883
+ return throwException("Unauthorized", status, _responseText, _headers);
2884
+ }
2885
+ else if (status === 403) {
2886
+ const _responseText = response.data;
2887
+ return throwException("Forbidden", status, _responseText, _headers);
2888
+ }
2889
+ else if (status !== 200 && status !== 204) {
2890
+ const _responseText = response.data;
2891
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2892
+ }
2893
+ return Promise.resolve(null);
2894
+ }
2895
+ /**
2896
+ * Returns a print-product of the specified design file as a json-serialized model.
2897
+ * @param id Design identifier.
2898
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2899
+ * @param tenantId (optional) Tenant identifier
2900
+ * @return Success
2901
+ */
2902
+ getDesignProductModel(id, privateStorageOwner, tenantId, cancelToken) {
2903
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
2904
+ if (id === undefined || id === null)
2905
+ throw new Error("The parameter 'id' must be defined.");
2906
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2907
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2908
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2909
+ if (tenantId === null)
2910
+ throw new Error("The parameter 'tenantId' cannot be null.");
2911
+ else if (tenantId !== undefined)
2912
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2913
+ url_ = url_.replace(/[?&]$/, "");
2914
+ let options_ = {
2915
+ method: "GET",
2916
+ url: url_,
2917
+ headers: {
2918
+ "Accept": "application/json"
2919
+ },
2920
+ cancelToken
2921
+ };
2922
+ return this.transformOptions(options_).then(transformedOptions_ => {
2923
+ return this.instance.request(transformedOptions_);
2924
+ }).catch((_error) => {
2925
+ if (isAxiosError(_error) && _error.response) {
2926
+ return _error.response;
2927
+ }
2928
+ else {
2929
+ throw _error;
2930
+ }
2931
+ }).then((_response) => {
2932
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignProductModel(_response));
2933
+ });
2934
+ }
2935
+ processGetDesignProductModel(response) {
2936
+ const status = response.status;
2937
+ let _headers = {};
2938
+ if (response.headers && typeof response.headers === "object") {
2939
+ for (let k in response.headers) {
2940
+ if (response.headers.hasOwnProperty(k)) {
2941
+ _headers[k] = response.headers[k];
2942
+ }
2943
+ }
2944
+ }
2945
+ if (status === 200) {
2946
+ const _responseText = response.data;
2947
+ let result200 = null;
2948
+ let resultData200 = _responseText;
2949
+ result200 = JSON.parse(resultData200);
2950
+ return Promise.resolve(result200);
2951
+ }
2952
+ else if (status === 404) {
2953
+ const _responseText = response.data;
2954
+ let result404 = null;
2955
+ let resultData404 = _responseText;
2956
+ result404 = JSON.parse(resultData404);
2957
+ return throwException("Not Found", status, _responseText, _headers, result404);
2958
+ }
2959
+ else if (status === 401) {
2960
+ const _responseText = response.data;
2961
+ return throwException("Unauthorized", status, _responseText, _headers);
2962
+ }
2963
+ else if (status === 403) {
2964
+ const _responseText = response.data;
2965
+ return throwException("Forbidden", status, _responseText, _headers);
2966
+ }
2967
+ else if (status !== 200 && status !== 204) {
2968
+ const _responseText = response.data;
2969
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2970
+ }
2971
+ return Promise.resolve(null);
2972
+ }
2973
+ /**
2974
+ * Saves a print-product provided as a json-serialized model to the specified design file.
2975
+ * @param id Design identifier.
2976
+ * @param privateStorageOwner (optional) Private storage owner identifier.
2977
+ * @param tenantId (optional) Tenant identifier
2978
+ * @param body (optional) Serialized print-product description.
2979
+ * @return No Content
2980
+ */
2981
+ updateDesignProductModel(id, privateStorageOwner, tenantId, body, cancelToken) {
2982
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
2983
+ if (id === undefined || id === null)
2984
+ throw new Error("The parameter 'id' must be defined.");
2985
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2986
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
2987
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
2988
+ if (tenantId === null)
2989
+ throw new Error("The parameter 'tenantId' cannot be null.");
2990
+ else if (tenantId !== undefined)
2991
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2992
+ url_ = url_.replace(/[?&]$/, "");
2993
+ const content_ = JSON.stringify(body);
2994
+ let options_ = {
2995
+ data: content_,
2996
+ method: "PUT",
2997
+ url: url_,
2998
+ headers: {
2999
+ "Content-Type": "application/json",
3000
+ },
3001
+ cancelToken
3002
+ };
3003
+ return this.transformOptions(options_).then(transformedOptions_ => {
3004
+ return this.instance.request(transformedOptions_);
3005
+ }).catch((_error) => {
3006
+ if (isAxiosError(_error) && _error.response) {
3007
+ return _error.response;
3008
+ }
3009
+ else {
3010
+ throw _error;
3011
+ }
3012
+ }).then((_response) => {
3013
+ return this.transformResult(url_, _response, (_response) => this.processUpdateDesignProductModel(_response));
3014
+ });
3015
+ }
3016
+ processUpdateDesignProductModel(response) {
3017
+ const status = response.status;
3018
+ let _headers = {};
3019
+ if (response.headers && typeof response.headers === "object") {
3020
+ for (let k in response.headers) {
3021
+ if (response.headers.hasOwnProperty(k)) {
3022
+ _headers[k] = response.headers[k];
3023
+ }
3024
+ }
3025
+ }
3026
+ if (status === 204) {
3027
+ const _responseText = response.data;
3028
+ return Promise.resolve(null);
3029
+ }
3030
+ else if (status === 404) {
3031
+ const _responseText = response.data;
3032
+ let result404 = null;
3033
+ let resultData404 = _responseText;
3034
+ result404 = JSON.parse(resultData404);
3035
+ return throwException("Not Found", status, _responseText, _headers, result404);
3036
+ }
3037
+ else if (status === 401) {
3038
+ const _responseText = response.data;
3039
+ return throwException("Unauthorized", status, _responseText, _headers);
3040
+ }
3041
+ else if (status === 403) {
3042
+ const _responseText = response.data;
3043
+ return throwException("Forbidden", status, _responseText, _headers);
3044
+ }
3045
+ else if (status !== 200 && status !== 204) {
3046
+ const _responseText = response.data;
3047
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3048
+ }
3049
+ return Promise.resolve(null);
3050
+ }
3051
+ /**
3052
+ * Returns a list of print-area descriptions of the specified design file.
3053
+ * @param id Design identifier.
3054
+ * @param surfaceId (optional)
3055
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3056
+ * @param tenantId (optional) Tenant identifier
3057
+ * @return Success
3058
+ */
3059
+ getDesignPrintAreas(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
3060
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas?";
3061
+ if (id === undefined || id === null)
3062
+ throw new Error("The parameter 'id' must be defined.");
3063
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3064
+ if (surfaceId !== undefined && surfaceId !== null)
3065
+ url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
3066
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3067
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3068
+ if (tenantId === null)
3069
+ throw new Error("The parameter 'tenantId' cannot be null.");
3070
+ else if (tenantId !== undefined)
3071
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3072
+ url_ = url_.replace(/[?&]$/, "");
3073
+ let options_ = {
3074
+ method: "GET",
3075
+ url: url_,
3076
+ headers: {
3077
+ "Accept": "application/json"
3078
+ },
3079
+ cancelToken
3080
+ };
3081
+ return this.transformOptions(options_).then(transformedOptions_ => {
3082
+ return this.instance.request(transformedOptions_);
3083
+ }).catch((_error) => {
3084
+ if (isAxiosError(_error) && _error.response) {
3085
+ return _error.response;
3086
+ }
3087
+ else {
3088
+ throw _error;
3089
+ }
3090
+ }).then((_response) => {
3091
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignPrintAreas(_response));
3092
+ });
3093
+ }
3094
+ processGetDesignPrintAreas(response) {
3095
+ const status = response.status;
3096
+ let _headers = {};
3097
+ if (response.headers && typeof response.headers === "object") {
3098
+ for (let k in response.headers) {
3099
+ if (response.headers.hasOwnProperty(k)) {
3100
+ _headers[k] = response.headers[k];
3101
+ }
3102
+ }
3103
+ }
3104
+ if (status === 200) {
3105
+ const _responseText = response.data;
3106
+ let result200 = null;
3107
+ let resultData200 = _responseText;
3108
+ result200 = JSON.parse(resultData200);
3109
+ return Promise.resolve(result200);
3110
+ }
3111
+ else if (status === 404) {
3112
+ const _responseText = response.data;
3113
+ let result404 = null;
3114
+ let resultData404 = _responseText;
3115
+ result404 = JSON.parse(resultData404);
3116
+ return throwException("Not Found", status, _responseText, _headers, result404);
3117
+ }
3118
+ else if (status === 401) {
3119
+ const _responseText = response.data;
3120
+ return throwException("Unauthorized", status, _responseText, _headers);
3121
+ }
3122
+ else if (status === 403) {
3123
+ const _responseText = response.data;
3124
+ return throwException("Forbidden", status, _responseText, _headers);
3125
+ }
3126
+ else if (status !== 200 && status !== 204) {
3127
+ const _responseText = response.data;
3128
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3129
+ }
3130
+ return Promise.resolve(null);
3131
+ }
3132
+ /**
3133
+ * Deletes a specified print-area in an existing design file.
3134
+ * @param id Design identifier.
3135
+ * @param printAreaId Design print-area identifier.
3136
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3137
+ * @param tenantId (optional) Tenant identifier
3138
+ * @return No Content
3139
+ */
3140
+ deleteDesignPrintArea(id, printAreaId, privateStorageOwner, tenantId, cancelToken) {
3141
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}?";
3142
+ if (id === undefined || id === null)
3143
+ throw new Error("The parameter 'id' must be defined.");
3144
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3145
+ if (printAreaId === undefined || printAreaId === null)
3146
+ throw new Error("The parameter 'printAreaId' must be defined.");
3147
+ url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
3148
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3149
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3150
+ if (tenantId === null)
3151
+ throw new Error("The parameter 'tenantId' cannot be null.");
3152
+ else if (tenantId !== undefined)
3153
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3154
+ url_ = url_.replace(/[?&]$/, "");
3155
+ let options_ = {
3156
+ method: "DELETE",
3157
+ url: url_,
3158
+ headers: {},
3159
+ cancelToken
3160
+ };
3161
+ return this.transformOptions(options_).then(transformedOptions_ => {
3162
+ return this.instance.request(transformedOptions_);
3163
+ }).catch((_error) => {
3164
+ if (isAxiosError(_error) && _error.response) {
3165
+ return _error.response;
3166
+ }
3167
+ else {
3168
+ throw _error;
3169
+ }
3170
+ }).then((_response) => {
3171
+ return this.transformResult(url_, _response, (_response) => this.processDeleteDesignPrintArea(_response));
3172
+ });
3173
+ }
3174
+ processDeleteDesignPrintArea(response) {
3175
+ const status = response.status;
3176
+ let _headers = {};
3177
+ if (response.headers && typeof response.headers === "object") {
3178
+ for (let k in response.headers) {
3179
+ if (response.headers.hasOwnProperty(k)) {
3180
+ _headers[k] = response.headers[k];
3181
+ }
3182
+ }
3183
+ }
3184
+ if (status === 204) {
3185
+ const _responseText = response.data;
3186
+ return Promise.resolve(null);
3187
+ }
3188
+ else if (status === 404) {
3189
+ const _responseText = response.data;
3190
+ let result404 = null;
3191
+ let resultData404 = _responseText;
3192
+ result404 = JSON.parse(resultData404);
3193
+ return throwException("Not Found", status, _responseText, _headers, result404);
3194
+ }
3195
+ else if (status === 409) {
3196
+ const _responseText = response.data;
3197
+ let result409 = null;
3198
+ let resultData409 = _responseText;
3199
+ result409 = JSON.parse(resultData409);
3200
+ return throwException("Conflict", status, _responseText, _headers, result409);
3201
+ }
3202
+ else if (status === 401) {
3203
+ const _responseText = response.data;
3204
+ return throwException("Unauthorized", status, _responseText, _headers);
3205
+ }
3206
+ else if (status === 403) {
3207
+ const _responseText = response.data;
3208
+ return throwException("Forbidden", status, _responseText, _headers);
3209
+ }
3210
+ else if (status !== 200 && status !== 204) {
3211
+ const _responseText = response.data;
3212
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3213
+ }
3214
+ return Promise.resolve(null);
3215
+ }
3216
+ /**
3217
+ * Returns a print-area of the specified design file as a json-serialized model.
3218
+ * @param id Design identifier.
3219
+ * @param printAreaId Design print-area identifier.
3220
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3221
+ * @param tenantId (optional) Tenant identifier
3222
+ * @return Success
3223
+ */
3224
+ getDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId, cancelToken) {
3225
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
3226
+ if (id === undefined || id === null)
3227
+ throw new Error("The parameter 'id' must be defined.");
3228
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3229
+ if (printAreaId === undefined || printAreaId === null)
3230
+ throw new Error("The parameter 'printAreaId' must be defined.");
3231
+ url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
3232
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3233
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3234
+ if (tenantId === null)
3235
+ throw new Error("The parameter 'tenantId' cannot be null.");
3236
+ else if (tenantId !== undefined)
3237
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3238
+ url_ = url_.replace(/[?&]$/, "");
3239
+ let options_ = {
3240
+ method: "GET",
3241
+ url: url_,
3242
+ headers: {
3243
+ "Accept": "application/json"
3244
+ },
3245
+ cancelToken
3246
+ };
3247
+ return this.transformOptions(options_).then(transformedOptions_ => {
3248
+ return this.instance.request(transformedOptions_);
3249
+ }).catch((_error) => {
3250
+ if (isAxiosError(_error) && _error.response) {
3251
+ return _error.response;
3252
+ }
3253
+ else {
3254
+ throw _error;
3255
+ }
3256
+ }).then((_response) => {
3257
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignPrintAreaModel(_response));
3258
+ });
3259
+ }
3260
+ processGetDesignPrintAreaModel(response) {
3261
+ const status = response.status;
3262
+ let _headers = {};
3263
+ if (response.headers && typeof response.headers === "object") {
3264
+ for (let k in response.headers) {
3265
+ if (response.headers.hasOwnProperty(k)) {
3266
+ _headers[k] = response.headers[k];
3267
+ }
3268
+ }
3269
+ }
3270
+ if (status === 200) {
3271
+ const _responseText = response.data;
3272
+ let result200 = null;
3273
+ let resultData200 = _responseText;
3274
+ result200 = JSON.parse(resultData200);
3275
+ return Promise.resolve(result200);
3276
+ }
3277
+ else if (status === 404) {
3278
+ const _responseText = response.data;
3279
+ let result404 = null;
3280
+ let resultData404 = _responseText;
3281
+ result404 = JSON.parse(resultData404);
3282
+ return throwException("Not Found", status, _responseText, _headers, result404);
3283
+ }
3284
+ else if (status === 409) {
3285
+ const _responseText = response.data;
3286
+ let result409 = null;
3287
+ let resultData409 = _responseText;
3288
+ result409 = JSON.parse(resultData409);
3289
+ return throwException("Conflict", status, _responseText, _headers, result409);
3290
+ }
3291
+ else if (status === 401) {
3292
+ const _responseText = response.data;
3293
+ return throwException("Unauthorized", status, _responseText, _headers);
3294
+ }
3295
+ else if (status === 403) {
3296
+ const _responseText = response.data;
3297
+ return throwException("Forbidden", status, _responseText, _headers);
3298
+ }
3299
+ else if (status !== 200 && status !== 204) {
3300
+ const _responseText = response.data;
3301
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3302
+ }
3303
+ return Promise.resolve(null);
3304
+ }
3305
+ /**
3306
+ * Updates a specified print-area in an existing design file with the data provided as a json-serialized print-area model.
3307
+ * @param id Design identifier.
3308
+ * @param printAreaId Design print-area identifier.
3309
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3310
+ * @param tenantId (optional) Tenant identifier
3311
+ * @param body (optional) Updated print-area model.
3312
+ * @return Success
3313
+ */
3314
+ updateDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId, body, cancelToken) {
3315
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
3316
+ if (id === undefined || id === null)
3317
+ throw new Error("The parameter 'id' must be defined.");
3318
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3319
+ if (printAreaId === undefined || printAreaId === null)
3320
+ throw new Error("The parameter 'printAreaId' must be defined.");
3321
+ url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
3322
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3323
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3324
+ if (tenantId === null)
3325
+ throw new Error("The parameter 'tenantId' cannot be null.");
3326
+ else if (tenantId !== undefined)
3327
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3328
+ url_ = url_.replace(/[?&]$/, "");
3329
+ const content_ = JSON.stringify(body);
3330
+ let options_ = {
3331
+ data: content_,
3332
+ method: "PUT",
3333
+ url: url_,
3334
+ headers: {
3335
+ "Content-Type": "application/json",
3336
+ "Accept": "application/json"
3337
+ },
3338
+ cancelToken
3339
+ };
3340
+ return this.transformOptions(options_).then(transformedOptions_ => {
3341
+ return this.instance.request(transformedOptions_);
3342
+ }).catch((_error) => {
3343
+ if (isAxiosError(_error) && _error.response) {
3344
+ return _error.response;
3345
+ }
3346
+ else {
3347
+ throw _error;
3348
+ }
3349
+ }).then((_response) => {
3350
+ return this.transformResult(url_, _response, (_response) => this.processUpdateDesignPrintAreaModel(_response));
3351
+ });
3352
+ }
3353
+ processUpdateDesignPrintAreaModel(response) {
3354
+ const status = response.status;
3355
+ let _headers = {};
3356
+ if (response.headers && typeof response.headers === "object") {
3357
+ for (let k in response.headers) {
3358
+ if (response.headers.hasOwnProperty(k)) {
3359
+ _headers[k] = response.headers[k];
3360
+ }
3361
+ }
3362
+ }
3363
+ if (status === 200) {
3364
+ const _responseText = response.data;
3365
+ let result200 = null;
3366
+ let resultData200 = _responseText;
3367
+ result200 = JSON.parse(resultData200);
3368
+ return Promise.resolve(result200);
3369
+ }
3370
+ else if (status === 400) {
3371
+ const _responseText = response.data;
3372
+ let result400 = null;
3373
+ let resultData400 = _responseText;
3374
+ result400 = JSON.parse(resultData400);
3375
+ return throwException("Bad Request", status, _responseText, _headers, result400);
3376
+ }
3377
+ else if (status === 404) {
3378
+ const _responseText = response.data;
3379
+ let result404 = null;
3380
+ let resultData404 = _responseText;
3381
+ result404 = JSON.parse(resultData404);
3382
+ return throwException("Not Found", status, _responseText, _headers, result404);
3383
+ }
3384
+ else if (status === 409) {
3385
+ const _responseText = response.data;
3386
+ let result409 = null;
3387
+ let resultData409 = _responseText;
3388
+ result409 = JSON.parse(resultData409);
3389
+ return throwException("Conflict", status, _responseText, _headers, result409);
3390
+ }
3391
+ else if (status === 401) {
3392
+ const _responseText = response.data;
3393
+ return throwException("Unauthorized", status, _responseText, _headers);
3394
+ }
3395
+ else if (status === 403) {
3396
+ const _responseText = response.data;
3397
+ return throwException("Forbidden", status, _responseText, _headers);
3398
+ }
3399
+ else if (status !== 200 && status !== 204) {
3400
+ const _responseText = response.data;
3401
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3402
+ }
3403
+ return Promise.resolve(null);
3404
+ }
3405
+ /**
3406
+ * Inserts a new print-area provided as a json-serialized model at the specified position in an existing design file.
3407
+ Print-area identifier will be reset by auto-generated value to prevent identifiers collisions.
3408
+ * @param id Design identifier.
3409
+ * @param surfaceId (optional) Parent surface identifier.
3410
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3411
+ * @param tenantId (optional) Tenant identifier
3412
+ * @param body (optional) New print-area model.
3413
+ * @return Success
3414
+ */
3415
+ addDesignPrintAreaModel(id, surfaceId, privateStorageOwner, tenantId, body, cancelToken) {
3416
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/model?";
3417
+ if (id === undefined || id === null)
3418
+ throw new Error("The parameter 'id' must be defined.");
3419
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3420
+ if (surfaceId !== undefined && surfaceId !== null)
3421
+ url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
3422
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3423
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3424
+ if (tenantId === null)
3425
+ throw new Error("The parameter 'tenantId' cannot be null.");
3426
+ else if (tenantId !== undefined)
3427
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3428
+ url_ = url_.replace(/[?&]$/, "");
3429
+ const content_ = JSON.stringify(body);
3430
+ let options_ = {
3431
+ data: content_,
3432
+ method: "POST",
3433
+ url: url_,
3434
+ headers: {
3435
+ "Content-Type": "application/json",
3436
+ "Accept": "application/json"
3437
+ },
3438
+ cancelToken
3439
+ };
3440
+ return this.transformOptions(options_).then(transformedOptions_ => {
3441
+ return this.instance.request(transformedOptions_);
3442
+ }).catch((_error) => {
3443
+ if (isAxiosError(_error) && _error.response) {
3444
+ return _error.response;
3445
+ }
3446
+ else {
3447
+ throw _error;
3448
+ }
3449
+ }).then((_response) => {
3450
+ return this.transformResult(url_, _response, (_response) => this.processAddDesignPrintAreaModel(_response));
3451
+ });
3452
+ }
3453
+ processAddDesignPrintAreaModel(response) {
3454
+ const status = response.status;
3455
+ let _headers = {};
3456
+ if (response.headers && typeof response.headers === "object") {
3457
+ for (let k in response.headers) {
3458
+ if (response.headers.hasOwnProperty(k)) {
3459
+ _headers[k] = response.headers[k];
3460
+ }
3461
+ }
3462
+ }
3463
+ if (status === 200) {
3464
+ const _responseText = response.data;
3465
+ let result200 = null;
3466
+ let resultData200 = _responseText;
3467
+ result200 = JSON.parse(resultData200);
3468
+ return Promise.resolve(result200);
3469
+ }
3470
+ else if (status === 400) {
3471
+ const _responseText = response.data;
3472
+ let result400 = null;
3473
+ let resultData400 = _responseText;
3474
+ result400 = JSON.parse(resultData400);
3475
+ return throwException("Bad Request", status, _responseText, _headers, result400);
3476
+ }
3477
+ else if (status === 404) {
3478
+ const _responseText = response.data;
3479
+ let result404 = null;
3480
+ let resultData404 = _responseText;
3481
+ result404 = JSON.parse(resultData404);
3482
+ return throwException("Not Found", status, _responseText, _headers, result404);
3483
+ }
3484
+ else if (status === 401) {
3485
+ const _responseText = response.data;
3486
+ return throwException("Unauthorized", status, _responseText, _headers);
3487
+ }
3488
+ else if (status === 403) {
3489
+ const _responseText = response.data;
3490
+ return throwException("Forbidden", status, _responseText, _headers);
3491
+ }
3492
+ else if (status !== 200 && status !== 204) {
3493
+ const _responseText = response.data;
3494
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3495
+ }
3496
+ return Promise.resolve(null);
3497
+ }
3498
+ /**
3499
+ * Returns a list of print-product surfaces descriptions of the specified design file.
3500
+ * @param id Design identifier.
3501
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3502
+ * @param tenantId (optional) Tenant identifier
3503
+ * @return Success
3504
+ */
3505
+ getDesignSurfaces(id, privateStorageOwner, tenantId, cancelToken) {
3506
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces?";
3507
+ if (id === undefined || id === null)
3508
+ throw new Error("The parameter 'id' must be defined.");
3509
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3510
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3511
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3512
+ if (tenantId === null)
3513
+ throw new Error("The parameter 'tenantId' cannot be null.");
3514
+ else if (tenantId !== undefined)
3515
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3516
+ url_ = url_.replace(/[?&]$/, "");
3517
+ let options_ = {
3518
+ method: "GET",
3519
+ url: url_,
3520
+ headers: {
3521
+ "Accept": "application/json"
3522
+ },
3523
+ cancelToken
3524
+ };
3525
+ return this.transformOptions(options_).then(transformedOptions_ => {
3526
+ return this.instance.request(transformedOptions_);
3527
+ }).catch((_error) => {
3528
+ if (isAxiosError(_error) && _error.response) {
3529
+ return _error.response;
3530
+ }
3531
+ else {
3532
+ throw _error;
3533
+ }
3534
+ }).then((_response) => {
3535
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaces(_response));
3536
+ });
3537
+ }
3538
+ processGetDesignSurfaces(response) {
3539
+ const status = response.status;
3540
+ let _headers = {};
3541
+ if (response.headers && typeof response.headers === "object") {
3542
+ for (let k in response.headers) {
3543
+ if (response.headers.hasOwnProperty(k)) {
3544
+ _headers[k] = response.headers[k];
3545
+ }
3546
+ }
3547
+ }
3548
+ if (status === 200) {
3549
+ const _responseText = response.data;
3550
+ let result200 = null;
3551
+ let resultData200 = _responseText;
3552
+ result200 = JSON.parse(resultData200);
3553
+ return Promise.resolve(result200);
3554
+ }
3555
+ else if (status === 404) {
3556
+ const _responseText = response.data;
3557
+ let result404 = null;
3558
+ let resultData404 = _responseText;
3559
+ result404 = JSON.parse(resultData404);
3560
+ return throwException("Not Found", status, _responseText, _headers, result404);
3561
+ }
3562
+ else if (status === 401) {
3563
+ const _responseText = response.data;
3564
+ return throwException("Unauthorized", status, _responseText, _headers);
3565
+ }
3566
+ else if (status === 403) {
3567
+ const _responseText = response.data;
3568
+ return throwException("Forbidden", status, _responseText, _headers);
3569
+ }
3570
+ else if (status !== 200 && status !== 204) {
3571
+ const _responseText = response.data;
3572
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3573
+ }
3574
+ return Promise.resolve(null);
3575
+ }
3576
+ /**
3577
+ * Deletes a specified print-product surface in an existing design file.
3578
+ * @param id Design identifier.
3579
+ * @param surfaceId Surface identifier.
3580
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3581
+ * @param tenantId (optional) Tenant identifier
3582
+ * @return No Content
3583
+ */
3584
+ deleteDesignSurface(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
3585
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}?";
3586
+ if (id === undefined || id === null)
3587
+ throw new Error("The parameter 'id' must be defined.");
3588
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3589
+ if (surfaceId === undefined || surfaceId === null)
3590
+ throw new Error("The parameter 'surfaceId' must be defined.");
3591
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
3592
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3593
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3594
+ if (tenantId === null)
3595
+ throw new Error("The parameter 'tenantId' cannot be null.");
3596
+ else if (tenantId !== undefined)
3597
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3598
+ url_ = url_.replace(/[?&]$/, "");
3599
+ let options_ = {
3600
+ method: "DELETE",
3601
+ url: url_,
3602
+ headers: {},
3603
+ cancelToken
3604
+ };
3605
+ return this.transformOptions(options_).then(transformedOptions_ => {
3606
+ return this.instance.request(transformedOptions_);
3607
+ }).catch((_error) => {
3608
+ if (isAxiosError(_error) && _error.response) {
3609
+ return _error.response;
3610
+ }
3611
+ else {
3612
+ throw _error;
3613
+ }
3614
+ }).then((_response) => {
3615
+ return this.transformResult(url_, _response, (_response) => this.processDeleteDesignSurface(_response));
3616
+ });
3617
+ }
3618
+ processDeleteDesignSurface(response) {
3619
+ const status = response.status;
3620
+ let _headers = {};
3621
+ if (response.headers && typeof response.headers === "object") {
3622
+ for (let k in response.headers) {
3623
+ if (response.headers.hasOwnProperty(k)) {
3624
+ _headers[k] = response.headers[k];
3625
+ }
3626
+ }
3627
+ }
3628
+ if (status === 204) {
3629
+ const _responseText = response.data;
3630
+ return Promise.resolve(null);
3631
+ }
3632
+ else if (status === 404) {
3633
+ const _responseText = response.data;
3634
+ let result404 = null;
3635
+ let resultData404 = _responseText;
3636
+ result404 = JSON.parse(resultData404);
3637
+ return throwException("Not Found", status, _responseText, _headers, result404);
3638
+ }
3639
+ else if (status === 409) {
3640
+ const _responseText = response.data;
3641
+ let result409 = null;
3642
+ let resultData409 = _responseText;
3643
+ result409 = JSON.parse(resultData409);
3644
+ return throwException("Conflict", status, _responseText, _headers, result409);
3645
+ }
3646
+ else if (status === 401) {
3647
+ const _responseText = response.data;
3648
+ return throwException("Unauthorized", status, _responseText, _headers);
3649
+ }
3650
+ else if (status === 403) {
3651
+ const _responseText = response.data;
3652
+ return throwException("Forbidden", status, _responseText, _headers);
3653
+ }
3654
+ else if (status !== 200 && status !== 204) {
3655
+ const _responseText = response.data;
3656
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3657
+ }
3658
+ return Promise.resolve(null);
3659
+ }
3660
+ /**
3661
+ * Returns a down-mockup description of the specified surface in an existing design file.
3662
+ * @param id Design identifier.
3663
+ * @param surfaceId Design surface identifier.
3664
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3665
+ * @param tenantId (optional) Tenant identifier
3666
+ * @return Success
3667
+ */
3668
+ getDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
3669
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
3670
+ if (id === undefined || id === null)
3671
+ throw new Error("The parameter 'id' must be defined.");
3672
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3673
+ if (surfaceId === undefined || surfaceId === null)
3674
+ throw new Error("The parameter 'surfaceId' must be defined.");
3675
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
3676
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3677
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3678
+ if (tenantId === null)
3679
+ throw new Error("The parameter 'tenantId' cannot be null.");
3680
+ else if (tenantId !== undefined)
3681
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3682
+ url_ = url_.replace(/[?&]$/, "");
3683
+ let options_ = {
3684
+ method: "GET",
3685
+ url: url_,
3686
+ headers: {
3687
+ "Accept": "application/json"
3688
+ },
3689
+ cancelToken
3690
+ };
3691
+ return this.transformOptions(options_).then(transformedOptions_ => {
3692
+ return this.instance.request(transformedOptions_);
3693
+ }).catch((_error) => {
3694
+ if (isAxiosError(_error) && _error.response) {
3695
+ return _error.response;
3696
+ }
3697
+ else {
3698
+ throw _error;
3699
+ }
3700
+ }).then((_response) => {
3701
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceDownMockup(_response));
3702
+ });
3703
+ }
3704
+ processGetDesignSurfaceDownMockup(response) {
3705
+ const status = response.status;
3706
+ let _headers = {};
3707
+ if (response.headers && typeof response.headers === "object") {
3708
+ for (let k in response.headers) {
3709
+ if (response.headers.hasOwnProperty(k)) {
3710
+ _headers[k] = response.headers[k];
3711
+ }
3712
+ }
3713
+ }
3714
+ if (status === 200) {
3715
+ const _responseText = response.data;
3716
+ let result200 = null;
3717
+ let resultData200 = _responseText;
3718
+ result200 = JSON.parse(resultData200);
3719
+ return Promise.resolve(result200);
3720
+ }
3721
+ else if (status === 400) {
3722
+ const _responseText = response.data;
3723
+ let result400 = null;
3724
+ let resultData400 = _responseText;
3725
+ result400 = JSON.parse(resultData400);
3726
+ return throwException("Bad Request", status, _responseText, _headers, result400);
3727
+ }
3728
+ else if (status === 404) {
3729
+ const _responseText = response.data;
3730
+ let result404 = null;
3731
+ let resultData404 = _responseText;
3732
+ result404 = JSON.parse(resultData404);
3733
+ return throwException("Not Found", status, _responseText, _headers, result404);
3734
+ }
3735
+ else if (status === 409) {
3736
+ const _responseText = response.data;
3737
+ let result409 = null;
3738
+ let resultData409 = _responseText;
3739
+ result409 = JSON.parse(resultData409);
3740
+ return throwException("Conflict", status, _responseText, _headers, result409);
3741
+ }
3742
+ else if (status === 401) {
3743
+ const _responseText = response.data;
3744
+ return throwException("Unauthorized", status, _responseText, _headers);
3745
+ }
3746
+ else if (status === 403) {
3747
+ const _responseText = response.data;
3748
+ return throwException("Forbidden", status, _responseText, _headers);
3749
+ }
3750
+ else if (status !== 200 && status !== 204) {
3751
+ const _responseText = response.data;
3752
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3753
+ }
3754
+ return Promise.resolve(null);
3755
+ }
3756
+ /**
3757
+ * Updates a content file of down-mockup for the specified surface in an existing design file.
3758
+ * @param id Design identifier.
3759
+ * @param surfaceId Design surface identifier.
3760
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3761
+ * @param tenantId (optional) Tenant identifier
3762
+ * @param position_top (optional)
3763
+ * @param position_left (optional)
3764
+ * @param sourceFile (optional)
3765
+ * @return Success
3766
+ */
3767
+ updateDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile, cancelToken) {
3768
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
3769
+ if (id === undefined || id === null)
3770
+ throw new Error("The parameter 'id' must be defined.");
3771
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3772
+ if (surfaceId === undefined || surfaceId === null)
3773
+ throw new Error("The parameter 'surfaceId' must be defined.");
3774
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
3775
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3776
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3777
+ if (tenantId === null)
3778
+ throw new Error("The parameter 'tenantId' cannot be null.");
3779
+ else if (tenantId !== undefined)
3780
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3781
+ url_ = url_.replace(/[?&]$/, "");
3782
+ const content_ = new FormData();
3783
+ if (position_top === null || position_top === undefined)
3784
+ throw new Error("The parameter 'position_top' cannot be null.");
3785
+ else
3786
+ content_.append("position.top", position_top.toString());
3787
+ if (position_left === null || position_left === undefined)
3788
+ throw new Error("The parameter 'position_left' cannot be null.");
3789
+ else
3790
+ content_.append("position.left", position_left.toString());
3791
+ if (sourceFile !== null && sourceFile !== undefined)
3792
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
3793
+ let options_ = {
3794
+ data: content_,
3795
+ method: "PATCH",
3796
+ url: url_,
3797
+ headers: {
3798
+ "Accept": "application/json"
3799
+ },
3800
+ cancelToken
3801
+ };
3802
+ return this.transformOptions(options_).then(transformedOptions_ => {
3803
+ return this.instance.request(transformedOptions_);
3804
+ }).catch((_error) => {
3805
+ if (isAxiosError(_error) && _error.response) {
3806
+ return _error.response;
3807
+ }
3808
+ else {
3809
+ throw _error;
3810
+ }
3811
+ }).then((_response) => {
3812
+ return this.transformResult(url_, _response, (_response) => this.processUpdateDesignSurfaceDownMockup(_response));
3813
+ });
3814
+ }
3815
+ processUpdateDesignSurfaceDownMockup(response) {
3816
+ const status = response.status;
3817
+ let _headers = {};
3818
+ if (response.headers && typeof response.headers === "object") {
3819
+ for (let k in response.headers) {
3820
+ if (response.headers.hasOwnProperty(k)) {
3821
+ _headers[k] = response.headers[k];
3822
+ }
3823
+ }
3824
+ }
3825
+ if (status === 200) {
3826
+ const _responseText = response.data;
3827
+ let result200 = null;
3828
+ let resultData200 = _responseText;
3829
+ result200 = JSON.parse(resultData200);
3830
+ return Promise.resolve(result200);
3831
+ }
3832
+ else if (status === 400) {
3833
+ const _responseText = response.data;
3834
+ let result400 = null;
3835
+ let resultData400 = _responseText;
3836
+ result400 = JSON.parse(resultData400);
3837
+ return throwException("Bad Request", status, _responseText, _headers, result400);
3838
+ }
3839
+ else if (status === 404) {
3840
+ const _responseText = response.data;
3841
+ let result404 = null;
3842
+ let resultData404 = _responseText;
3843
+ result404 = JSON.parse(resultData404);
3844
+ return throwException("Not Found", status, _responseText, _headers, result404);
3845
+ }
3846
+ else if (status === 409) {
3847
+ const _responseText = response.data;
3848
+ let result409 = null;
3849
+ let resultData409 = _responseText;
3850
+ result409 = JSON.parse(resultData409);
3851
+ return throwException("Conflict", status, _responseText, _headers, result409);
3852
+ }
3853
+ else if (status === 401) {
3854
+ const _responseText = response.data;
3855
+ return throwException("Unauthorized", status, _responseText, _headers);
3856
+ }
3857
+ else if (status === 403) {
3858
+ const _responseText = response.data;
3859
+ return throwException("Forbidden", status, _responseText, _headers);
3860
+ }
3861
+ else if (status !== 200 && status !== 204) {
3862
+ const _responseText = response.data;
3863
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3864
+ }
3865
+ return Promise.resolve(null);
3866
+ }
3867
+ /**
3868
+ * Returns a content file for down-mockup of the specified surface in an existing design file.
3869
+ * @param id Design identifier.
3870
+ * @param surfaceId Design surface identifier.
3871
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3872
+ * @param tenantId (optional) Tenant identifier
3873
+ * @return Success
3874
+ */
3875
+ getDesignSurfaceDownMockupContent(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
3876
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down/file?";
3877
+ if (id === undefined || id === null)
3878
+ throw new Error("The parameter 'id' must be defined.");
3879
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3880
+ if (surfaceId === undefined || surfaceId === null)
3881
+ throw new Error("The parameter 'surfaceId' must be defined.");
3882
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
3883
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3884
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3885
+ if (tenantId === null)
3886
+ throw new Error("The parameter 'tenantId' cannot be null.");
3887
+ else if (tenantId !== undefined)
3888
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3889
+ url_ = url_.replace(/[?&]$/, "");
3890
+ let options_ = {
3891
+ responseType: "blob",
3892
+ method: "GET",
3893
+ url: url_,
3894
+ headers: {
3895
+ "Accept": "application/json"
3896
+ },
3897
+ cancelToken
3898
+ };
3899
+ return this.transformOptions(options_).then(transformedOptions_ => {
3900
+ return this.instance.request(transformedOptions_);
3901
+ }).catch((_error) => {
3902
+ if (isAxiosError(_error) && _error.response) {
3903
+ return _error.response;
3904
+ }
3905
+ else {
3906
+ throw _error;
3907
+ }
3908
+ }).then((_response) => {
3909
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceDownMockupContent(_response));
3910
+ });
3911
+ }
3912
+ processGetDesignSurfaceDownMockupContent(response) {
3913
+ const status = response.status;
3914
+ let _headers = {};
3915
+ if (response.headers && typeof response.headers === "object") {
3916
+ for (let k in response.headers) {
3917
+ if (response.headers.hasOwnProperty(k)) {
3918
+ _headers[k] = response.headers[k];
3919
+ }
3920
+ }
3921
+ }
3922
+ if (status === 200 || status === 206) {
3923
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3924
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3925
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3926
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3927
+ }
3928
+ else if (status === 400) {
3929
+ const _responseText = response.data;
3930
+ let result400 = null;
3931
+ let resultData400 = _responseText;
3932
+ result400 = JSON.parse(resultData400);
3933
+ return throwException("Bad Request", status, _responseText, _headers, result400);
3934
+ }
3935
+ else if (status === 404) {
3936
+ const _responseText = response.data;
3937
+ let result404 = null;
3938
+ let resultData404 = _responseText;
3939
+ result404 = JSON.parse(resultData404);
3940
+ return throwException("Not Found", status, _responseText, _headers, result404);
3941
+ }
3942
+ else if (status === 409) {
3943
+ const _responseText = response.data;
3944
+ let result409 = null;
3945
+ let resultData409 = _responseText;
3946
+ result409 = JSON.parse(resultData409);
3947
+ return throwException("Conflict", status, _responseText, _headers, result409);
3948
+ }
3949
+ else if (status === 401) {
3950
+ const _responseText = response.data;
3951
+ return throwException("Unauthorized", status, _responseText, _headers);
3952
+ }
3953
+ else if (status === 403) {
3954
+ const _responseText = response.data;
3955
+ return throwException("Forbidden", status, _responseText, _headers);
3956
+ }
3957
+ else if (status !== 200 && status !== 204) {
3958
+ const _responseText = response.data;
3959
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3960
+ }
3961
+ return Promise.resolve(null);
3962
+ }
3963
+ /**
3964
+ * Returns an up-mockup description of the specified surface in an existing design file.
3965
+ * @param id Design identifier.
3966
+ * @param surfaceId Design surface identifier.
3967
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3968
+ * @param tenantId (optional) Tenant identifier
3969
+ * @return Success
3970
+ */
3971
+ getDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
3972
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
3973
+ if (id === undefined || id === null)
3974
+ throw new Error("The parameter 'id' must be defined.");
3975
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3976
+ if (surfaceId === undefined || surfaceId === null)
3977
+ throw new Error("The parameter 'surfaceId' must be defined.");
3978
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
3979
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3980
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3981
+ if (tenantId === null)
3982
+ throw new Error("The parameter 'tenantId' cannot be null.");
3983
+ else if (tenantId !== undefined)
3984
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3985
+ url_ = url_.replace(/[?&]$/, "");
3986
+ let options_ = {
3987
+ method: "GET",
3988
+ url: url_,
3989
+ headers: {
3990
+ "Accept": "application/json"
3991
+ },
3992
+ cancelToken
3993
+ };
3994
+ return this.transformOptions(options_).then(transformedOptions_ => {
3995
+ return this.instance.request(transformedOptions_);
3996
+ }).catch((_error) => {
3997
+ if (isAxiosError(_error) && _error.response) {
3998
+ return _error.response;
3999
+ }
4000
+ else {
4001
+ throw _error;
4002
+ }
4003
+ }).then((_response) => {
4004
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceUpMockup(_response));
4005
+ });
4006
+ }
4007
+ processGetDesignSurfaceUpMockup(response) {
4008
+ const status = response.status;
4009
+ let _headers = {};
4010
+ if (response.headers && typeof response.headers === "object") {
4011
+ for (let k in response.headers) {
4012
+ if (response.headers.hasOwnProperty(k)) {
4013
+ _headers[k] = response.headers[k];
4014
+ }
4015
+ }
4016
+ }
4017
+ if (status === 200) {
4018
+ const _responseText = response.data;
4019
+ let result200 = null;
4020
+ let resultData200 = _responseText;
4021
+ result200 = JSON.parse(resultData200);
4022
+ return Promise.resolve(result200);
4023
+ }
4024
+ else if (status === 400) {
4025
+ const _responseText = response.data;
4026
+ let result400 = null;
4027
+ let resultData400 = _responseText;
4028
+ result400 = JSON.parse(resultData400);
4029
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4030
+ }
4031
+ else if (status === 404) {
4032
+ const _responseText = response.data;
4033
+ let result404 = null;
4034
+ let resultData404 = _responseText;
4035
+ result404 = JSON.parse(resultData404);
4036
+ return throwException("Not Found", status, _responseText, _headers, result404);
4037
+ }
4038
+ else if (status === 409) {
4039
+ const _responseText = response.data;
4040
+ let result409 = null;
4041
+ let resultData409 = _responseText;
4042
+ result409 = JSON.parse(resultData409);
4043
+ return throwException("Conflict", status, _responseText, _headers, result409);
4044
+ }
4045
+ else if (status === 401) {
4046
+ const _responseText = response.data;
4047
+ return throwException("Unauthorized", status, _responseText, _headers);
4048
+ }
4049
+ else if (status === 403) {
4050
+ const _responseText = response.data;
4051
+ return throwException("Forbidden", status, _responseText, _headers);
4052
+ }
4053
+ else if (status !== 200 && status !== 204) {
4054
+ const _responseText = response.data;
4055
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4056
+ }
4057
+ return Promise.resolve(null);
4058
+ }
4059
+ /**
4060
+ * Updates a content file of up-mockup for the specified surface in an existing design.
4061
+ * @param id Design identifier.
4062
+ * @param surfaceId Design surface identifier.
4063
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4064
+ * @param tenantId (optional) Tenant identifier
4065
+ * @param position_top (optional)
4066
+ * @param position_left (optional)
4067
+ * @param sourceFile (optional)
4068
+ * @return Success
4069
+ */
4070
+ updateDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile, cancelToken) {
4071
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
4072
+ if (id === undefined || id === null)
4073
+ throw new Error("The parameter 'id' must be defined.");
4074
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4075
+ if (surfaceId === undefined || surfaceId === null)
4076
+ throw new Error("The parameter 'surfaceId' must be defined.");
4077
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4078
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4079
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4080
+ if (tenantId === null)
4081
+ throw new Error("The parameter 'tenantId' cannot be null.");
4082
+ else if (tenantId !== undefined)
4083
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4084
+ url_ = url_.replace(/[?&]$/, "");
4085
+ const content_ = new FormData();
4086
+ if (position_top === null || position_top === undefined)
4087
+ throw new Error("The parameter 'position_top' cannot be null.");
4088
+ else
4089
+ content_.append("position.top", position_top.toString());
4090
+ if (position_left === null || position_left === undefined)
4091
+ throw new Error("The parameter 'position_left' cannot be null.");
4092
+ else
4093
+ content_.append("position.left", position_left.toString());
4094
+ if (sourceFile !== null && sourceFile !== undefined)
4095
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4096
+ let options_ = {
4097
+ data: content_,
4098
+ method: "PATCH",
4099
+ url: url_,
4100
+ headers: {
4101
+ "Accept": "application/json"
4102
+ },
4103
+ cancelToken
4104
+ };
4105
+ return this.transformOptions(options_).then(transformedOptions_ => {
4106
+ return this.instance.request(transformedOptions_);
4107
+ }).catch((_error) => {
4108
+ if (isAxiosError(_error) && _error.response) {
4109
+ return _error.response;
4110
+ }
4111
+ else {
4112
+ throw _error;
4113
+ }
4114
+ }).then((_response) => {
4115
+ return this.transformResult(url_, _response, (_response) => this.processUpdateDesignSurfaceUpMockup(_response));
4116
+ });
4117
+ }
4118
+ processUpdateDesignSurfaceUpMockup(response) {
4119
+ const status = response.status;
4120
+ let _headers = {};
4121
+ if (response.headers && typeof response.headers === "object") {
4122
+ for (let k in response.headers) {
4123
+ if (response.headers.hasOwnProperty(k)) {
4124
+ _headers[k] = response.headers[k];
4125
+ }
4126
+ }
4127
+ }
4128
+ if (status === 200) {
4129
+ const _responseText = response.data;
4130
+ let result200 = null;
4131
+ let resultData200 = _responseText;
4132
+ result200 = JSON.parse(resultData200);
4133
+ return Promise.resolve(result200);
4134
+ }
4135
+ else if (status === 400) {
4136
+ const _responseText = response.data;
4137
+ let result400 = null;
4138
+ let resultData400 = _responseText;
4139
+ result400 = JSON.parse(resultData400);
4140
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4141
+ }
4142
+ else if (status === 404) {
4143
+ const _responseText = response.data;
4144
+ let result404 = null;
4145
+ let resultData404 = _responseText;
4146
+ result404 = JSON.parse(resultData404);
4147
+ return throwException("Not Found", status, _responseText, _headers, result404);
4148
+ }
4149
+ else if (status === 409) {
4150
+ const _responseText = response.data;
4151
+ let result409 = null;
4152
+ let resultData409 = _responseText;
4153
+ result409 = JSON.parse(resultData409);
4154
+ return throwException("Conflict", status, _responseText, _headers, result409);
4155
+ }
4156
+ else if (status === 401) {
4157
+ const _responseText = response.data;
4158
+ return throwException("Unauthorized", status, _responseText, _headers);
4159
+ }
4160
+ else if (status === 403) {
4161
+ const _responseText = response.data;
4162
+ return throwException("Forbidden", status, _responseText, _headers);
4163
+ }
4164
+ else if (status !== 200 && status !== 204) {
4165
+ const _responseText = response.data;
4166
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4167
+ }
4168
+ return Promise.resolve(null);
4169
+ }
4170
+ /**
4171
+ * Returns a content file for up-mockup of the specified surface in an existing design file.
4172
+ * @param id Design identifier.
4173
+ * @param surfaceId Design surface identifier.
4174
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4175
+ * @param tenantId (optional) Tenant identifier
4176
+ * @return Success
4177
+ */
4178
+ getDesignSurfaceUpMockupContent(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
4179
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up/file?";
4180
+ if (id === undefined || id === null)
4181
+ throw new Error("The parameter 'id' must be defined.");
4182
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4183
+ if (surfaceId === undefined || surfaceId === null)
4184
+ throw new Error("The parameter 'surfaceId' must be defined.");
4185
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4186
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4187
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4188
+ if (tenantId === null)
4189
+ throw new Error("The parameter 'tenantId' cannot be null.");
4190
+ else if (tenantId !== undefined)
4191
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4192
+ url_ = url_.replace(/[?&]$/, "");
4193
+ let options_ = {
4194
+ responseType: "blob",
4195
+ method: "GET",
4196
+ url: url_,
4197
+ headers: {
4198
+ "Accept": "application/json"
4199
+ },
4200
+ cancelToken
4201
+ };
4202
+ return this.transformOptions(options_).then(transformedOptions_ => {
4203
+ return this.instance.request(transformedOptions_);
4204
+ }).catch((_error) => {
4205
+ if (isAxiosError(_error) && _error.response) {
4206
+ return _error.response;
4207
+ }
4208
+ else {
4209
+ throw _error;
4210
+ }
4211
+ }).then((_response) => {
4212
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceUpMockupContent(_response));
4213
+ });
4214
+ }
4215
+ processGetDesignSurfaceUpMockupContent(response) {
4216
+ const status = response.status;
4217
+ let _headers = {};
4218
+ if (response.headers && typeof response.headers === "object") {
4219
+ for (let k in response.headers) {
4220
+ if (response.headers.hasOwnProperty(k)) {
4221
+ _headers[k] = response.headers[k];
4222
+ }
4223
+ }
4224
+ }
4225
+ if (status === 200 || status === 206) {
4226
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
4227
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4228
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4229
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
4230
+ }
4231
+ else if (status === 204) {
4232
+ const _responseText = response.data;
4233
+ return throwException("No Content", status, _responseText, _headers);
4234
+ }
4235
+ else if (status === 400) {
4236
+ const _responseText = response.data;
4237
+ let result400 = null;
4238
+ let resultData400 = _responseText;
4239
+ result400 = JSON.parse(resultData400);
4240
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4241
+ }
4242
+ else if (status === 404) {
4243
+ const _responseText = response.data;
4244
+ let result404 = null;
4245
+ let resultData404 = _responseText;
4246
+ result404 = JSON.parse(resultData404);
4247
+ return throwException("Not Found", status, _responseText, _headers, result404);
4248
+ }
4249
+ else if (status === 409) {
4250
+ const _responseText = response.data;
4251
+ let result409 = null;
4252
+ let resultData409 = _responseText;
4253
+ result409 = JSON.parse(resultData409);
4254
+ return throwException("Conflict", status, _responseText, _headers, result409);
4255
+ }
4256
+ else if (status === 401) {
4257
+ const _responseText = response.data;
4258
+ return throwException("Unauthorized", status, _responseText, _headers);
4259
+ }
4260
+ else if (status === 403) {
4261
+ const _responseText = response.data;
4262
+ return throwException("Forbidden", status, _responseText, _headers);
4263
+ }
4264
+ else if (status !== 200 && status !== 204) {
4265
+ const _responseText = response.data;
4266
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4267
+ }
4268
+ return Promise.resolve(null);
4269
+ }
4270
+ /**
4271
+ * Returns a print-product surface of the specified design file as a json-serialized model.
4272
+ * @param id Design identifier.
4273
+ * @param surfaceId Surface identifier.
4274
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4275
+ * @param tenantId (optional) Tenant identifier
4276
+ * @return Success
4277
+ */
4278
+ getDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId, cancelToken) {
4279
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
4280
+ if (id === undefined || id === null)
4281
+ throw new Error("The parameter 'id' must be defined.");
4282
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4283
+ if (surfaceId === undefined || surfaceId === null)
4284
+ throw new Error("The parameter 'surfaceId' must be defined.");
4285
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4286
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4287
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4288
+ if (tenantId === null)
4289
+ throw new Error("The parameter 'tenantId' cannot be null.");
4290
+ else if (tenantId !== undefined)
4291
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4292
+ url_ = url_.replace(/[?&]$/, "");
4293
+ let options_ = {
4294
+ method: "GET",
4295
+ url: url_,
4296
+ headers: {
4297
+ "Accept": "application/json"
4298
+ },
4299
+ cancelToken
4300
+ };
4301
+ return this.transformOptions(options_).then(transformedOptions_ => {
4302
+ return this.instance.request(transformedOptions_);
4303
+ }).catch((_error) => {
4304
+ if (isAxiosError(_error) && _error.response) {
4305
+ return _error.response;
4306
+ }
4307
+ else {
4308
+ throw _error;
4309
+ }
4310
+ }).then((_response) => {
4311
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignSurfaceModel(_response));
4312
+ });
4313
+ }
4314
+ processGetDesignSurfaceModel(response) {
4315
+ const status = response.status;
4316
+ let _headers = {};
4317
+ if (response.headers && typeof response.headers === "object") {
4318
+ for (let k in response.headers) {
4319
+ if (response.headers.hasOwnProperty(k)) {
4320
+ _headers[k] = response.headers[k];
4321
+ }
4322
+ }
4323
+ }
4324
+ if (status === 200) {
4325
+ const _responseText = response.data;
4326
+ let result200 = null;
4327
+ let resultData200 = _responseText;
4328
+ result200 = JSON.parse(resultData200);
4329
+ return Promise.resolve(result200);
4330
+ }
4331
+ else if (status === 404) {
4332
+ const _responseText = response.data;
4333
+ let result404 = null;
4334
+ let resultData404 = _responseText;
4335
+ result404 = JSON.parse(resultData404);
4336
+ return throwException("Not Found", status, _responseText, _headers, result404);
4337
+ }
4338
+ else if (status === 409) {
4339
+ const _responseText = response.data;
4340
+ let result409 = null;
4341
+ let resultData409 = _responseText;
4342
+ result409 = JSON.parse(resultData409);
4343
+ return throwException("Conflict", status, _responseText, _headers, result409);
4344
+ }
4345
+ else if (status === 401) {
4346
+ const _responseText = response.data;
4347
+ return throwException("Unauthorized", status, _responseText, _headers);
4348
+ }
4349
+ else if (status === 403) {
4350
+ const _responseText = response.data;
4351
+ return throwException("Forbidden", status, _responseText, _headers);
4352
+ }
4353
+ else if (status !== 200 && status !== 204) {
4354
+ const _responseText = response.data;
4355
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4356
+ }
4357
+ return Promise.resolve(null);
4358
+ }
4359
+ /**
4360
+ * Replaces a specified print-product surface in an existing design file with the data provided as a json-serialized surface model.
4361
+ All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
4362
+ * @param id Design identifier.
4363
+ * @param surfaceId Design surface identifier.
4364
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4365
+ * @param tenantId (optional) Tenant identifier
4366
+ * @param body (optional) Updated surface model.
4367
+ * @return Success
4368
+ */
4369
+ replaceDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId, body, cancelToken) {
4370
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
4371
+ if (id === undefined || id === null)
4372
+ throw new Error("The parameter 'id' must be defined.");
4373
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4374
+ if (surfaceId === undefined || surfaceId === null)
4375
+ throw new Error("The parameter 'surfaceId' must be defined.");
4376
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4377
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4378
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4379
+ if (tenantId === null)
4380
+ throw new Error("The parameter 'tenantId' cannot be null.");
4381
+ else if (tenantId !== undefined)
4382
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4383
+ url_ = url_.replace(/[?&]$/, "");
4384
+ const content_ = JSON.stringify(body);
4385
+ let options_ = {
4386
+ data: content_,
4387
+ method: "PUT",
4388
+ url: url_,
4389
+ headers: {
4390
+ "Content-Type": "application/json",
4391
+ "Accept": "application/json"
4392
+ },
4393
+ cancelToken
4394
+ };
4395
+ return this.transformOptions(options_).then(transformedOptions_ => {
4396
+ return this.instance.request(transformedOptions_);
4397
+ }).catch((_error) => {
4398
+ if (isAxiosError(_error) && _error.response) {
4399
+ return _error.response;
4400
+ }
4401
+ else {
4402
+ throw _error;
4403
+ }
4404
+ }).then((_response) => {
4405
+ return this.transformResult(url_, _response, (_response) => this.processReplaceDesignSurfaceModel(_response));
4406
+ });
4407
+ }
4408
+ processReplaceDesignSurfaceModel(response) {
4409
+ const status = response.status;
4410
+ let _headers = {};
4411
+ if (response.headers && typeof response.headers === "object") {
4412
+ for (let k in response.headers) {
4413
+ if (response.headers.hasOwnProperty(k)) {
4414
+ _headers[k] = response.headers[k];
4415
+ }
4416
+ }
4417
+ }
4418
+ if (status === 200) {
4419
+ const _responseText = response.data;
4420
+ let result200 = null;
4421
+ let resultData200 = _responseText;
4422
+ result200 = JSON.parse(resultData200);
4423
+ return Promise.resolve(result200);
4424
+ }
4425
+ else if (status === 400) {
4426
+ const _responseText = response.data;
4427
+ let result400 = null;
4428
+ let resultData400 = _responseText;
4429
+ result400 = JSON.parse(resultData400);
4430
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4431
+ }
4432
+ else if (status === 404) {
4433
+ const _responseText = response.data;
4434
+ let result404 = null;
4435
+ let resultData404 = _responseText;
4436
+ result404 = JSON.parse(resultData404);
4437
+ return throwException("Not Found", status, _responseText, _headers, result404);
4438
+ }
4439
+ else if (status === 409) {
4440
+ const _responseText = response.data;
4441
+ let result409 = null;
4442
+ let resultData409 = _responseText;
4443
+ result409 = JSON.parse(resultData409);
4444
+ return throwException("Conflict", status, _responseText, _headers, result409);
4445
+ }
4446
+ else if (status === 401) {
4447
+ const _responseText = response.data;
4448
+ return throwException("Unauthorized", status, _responseText, _headers);
4449
+ }
4450
+ else if (status === 403) {
4451
+ const _responseText = response.data;
4452
+ return throwException("Forbidden", status, _responseText, _headers);
4453
+ }
4454
+ else if (status !== 200 && status !== 204) {
4455
+ const _responseText = response.data;
4456
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4457
+ }
4458
+ return Promise.resolve(null);
4459
+ }
4460
+ /**
4461
+ * Inserts a new surface provided as a json-serialized model at the specified position in an existing design file.
4462
+ All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
4463
+ * @param id Design identifier.
4464
+ * @param surfaceIndex (optional) New surface index.
4465
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4466
+ * @param tenantId (optional) Tenant identifier
4467
+ * @param body (optional) New surface model.
4468
+ * @return Success
4469
+ */
4470
+ addDesignSurfaceModel(id, surfaceIndex, privateStorageOwner, tenantId, body, cancelToken) {
4471
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/model?";
4472
+ if (id === undefined || id === null)
4473
+ throw new Error("The parameter 'id' must be defined.");
4474
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4475
+ if (surfaceIndex === null)
4476
+ throw new Error("The parameter 'surfaceIndex' cannot be null.");
4477
+ else if (surfaceIndex !== undefined)
4478
+ url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
4479
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4480
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4481
+ if (tenantId === null)
4482
+ throw new Error("The parameter 'tenantId' cannot be null.");
4483
+ else if (tenantId !== undefined)
4484
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4485
+ url_ = url_.replace(/[?&]$/, "");
4486
+ const content_ = JSON.stringify(body);
4487
+ let options_ = {
4488
+ data: content_,
4489
+ method: "POST",
4490
+ url: url_,
4491
+ headers: {
4492
+ "Content-Type": "application/json",
4493
+ "Accept": "application/json"
4494
+ },
4495
+ cancelToken
4496
+ };
4497
+ return this.transformOptions(options_).then(transformedOptions_ => {
4498
+ return this.instance.request(transformedOptions_);
4499
+ }).catch((_error) => {
4500
+ if (isAxiosError(_error) && _error.response) {
4501
+ return _error.response;
4502
+ }
4503
+ else {
4504
+ throw _error;
4505
+ }
4506
+ }).then((_response) => {
4507
+ return this.transformResult(url_, _response, (_response) => this.processAddDesignSurfaceModel(_response));
4508
+ });
4509
+ }
4510
+ processAddDesignSurfaceModel(response) {
4511
+ const status = response.status;
4512
+ let _headers = {};
4513
+ if (response.headers && typeof response.headers === "object") {
4514
+ for (let k in response.headers) {
4515
+ if (response.headers.hasOwnProperty(k)) {
4516
+ _headers[k] = response.headers[k];
4517
+ }
4518
+ }
4519
+ }
4520
+ if (status === 200) {
4521
+ const _responseText = response.data;
4522
+ let result200 = null;
4523
+ let resultData200 = _responseText;
4524
+ result200 = JSON.parse(resultData200);
4525
+ return Promise.resolve(result200);
4526
+ }
4527
+ else if (status === 400) {
4528
+ const _responseText = response.data;
4529
+ let result400 = null;
4530
+ let resultData400 = _responseText;
4531
+ result400 = JSON.parse(resultData400);
4532
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4533
+ }
4534
+ else if (status === 404) {
4535
+ const _responseText = response.data;
4536
+ let result404 = null;
4537
+ let resultData404 = _responseText;
4538
+ result404 = JSON.parse(resultData404);
4539
+ return throwException("Not Found", status, _responseText, _headers, result404);
4540
+ }
4541
+ else if (status === 401) {
4542
+ const _responseText = response.data;
4543
+ return throwException("Unauthorized", status, _responseText, _headers);
4544
+ }
4545
+ else if (status === 403) {
4546
+ const _responseText = response.data;
4547
+ return throwException("Forbidden", status, _responseText, _headers);
4548
+ }
4549
+ else if (status !== 200 && status !== 204) {
4550
+ const _responseText = response.data;
4551
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4552
+ }
4553
+ return Promise.resolve(null);
4554
+ }
4555
+ }
4556
+ export class DesignAtomsPrintProductItemsApiClient extends ApiClientBase {
4557
+ instance;
4558
+ baseUrl;
4559
+ jsonParseReviver = undefined;
4560
+ constructor(configuration, baseUrl, instance) {
4561
+ super(configuration);
4562
+ this.instance = instance ? instance : axios.create();
4563
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
4564
+ }
4565
+ /**
4566
+ * Extracts print-product item image.
4567
+ * @param tenantId (optional) Tenant identifier
4568
+ * @param body (optional) Extraction parameters.
4569
+ * @return Success
4570
+ */
4571
+ extractItemImage(tenantId, body, cancelToken) {
4572
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/extract-image?";
4573
+ if (tenantId === null)
4574
+ throw new Error("The parameter 'tenantId' cannot be null.");
4575
+ else if (tenantId !== undefined)
4576
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4577
+ url_ = url_.replace(/[?&]$/, "");
4578
+ const content_ = JSON.stringify(body);
4579
+ let options_ = {
4580
+ data: content_,
4581
+ responseType: "blob",
4582
+ method: "POST",
4583
+ url: url_,
4584
+ headers: {
4585
+ "Content-Type": "application/json",
4586
+ "Accept": "application/octet-stream"
4587
+ },
4588
+ cancelToken
4589
+ };
4590
+ return this.transformOptions(options_).then(transformedOptions_ => {
4591
+ return this.instance.request(transformedOptions_);
4592
+ }).catch((_error) => {
4593
+ if (isAxiosError(_error) && _error.response) {
4594
+ return _error.response;
4595
+ }
4596
+ else {
4597
+ throw _error;
4598
+ }
4599
+ }).then((_response) => {
4600
+ return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
4601
+ });
4602
+ }
4603
+ processExtractItemImage(response) {
4604
+ const status = response.status;
4605
+ let _headers = {};
4606
+ if (response.headers && typeof response.headers === "object") {
4607
+ for (let k in response.headers) {
4608
+ if (response.headers.hasOwnProperty(k)) {
4609
+ _headers[k] = response.headers[k];
4610
+ }
4611
+ }
4612
+ }
4613
+ if (status === 200 || status === 206) {
4614
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
4615
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4616
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4617
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
4618
+ }
4619
+ else if (status === 401) {
4620
+ const _responseText = response.data;
4621
+ return throwException("Unauthorized", status, _responseText, _headers);
4622
+ }
4623
+ else if (status === 403) {
4624
+ const _responseText = response.data;
4625
+ return throwException("Forbidden", status, _responseText, _headers);
4626
+ }
4627
+ else if (status !== 200 && status !== 204) {
4628
+ const _responseText = response.data;
4629
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4630
+ }
4631
+ return Promise.resolve(null);
4632
+ }
4633
+ /**
4634
+ * Flattens print-product items.
4635
+ * @param tenantId (optional) Tenant identifier
4636
+ * @param body (optional) List of print-product items to flatten.
4637
+ * @return Success
4638
+ */
4639
+ flattenItems(tenantId, body, cancelToken) {
4640
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/flatten?";
4641
+ if (tenantId === null)
4642
+ throw new Error("The parameter 'tenantId' cannot be null.");
4643
+ else if (tenantId !== undefined)
4644
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4645
+ url_ = url_.replace(/[?&]$/, "");
4646
+ const content_ = JSON.stringify(body);
4647
+ let options_ = {
4648
+ data: content_,
4649
+ method: "POST",
4650
+ url: url_,
4651
+ headers: {
4652
+ "Content-Type": "application/json",
4653
+ "Accept": "application/json"
4654
+ },
4655
+ cancelToken
4656
+ };
4657
+ return this.transformOptions(options_).then(transformedOptions_ => {
4658
+ return this.instance.request(transformedOptions_);
4659
+ }).catch((_error) => {
4660
+ if (isAxiosError(_error) && _error.response) {
4661
+ return _error.response;
4662
+ }
4663
+ else {
4664
+ throw _error;
4665
+ }
4666
+ }).then((_response) => {
4667
+ return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
4668
+ });
4669
+ }
4670
+ processFlattenItems(response) {
4671
+ const status = response.status;
4672
+ let _headers = {};
4673
+ if (response.headers && typeof response.headers === "object") {
4674
+ for (let k in response.headers) {
4675
+ if (response.headers.hasOwnProperty(k)) {
4676
+ _headers[k] = response.headers[k];
4677
+ }
4678
+ }
4679
+ }
4680
+ if (status === 200) {
4681
+ const _responseText = response.data;
4682
+ let result200 = null;
4683
+ let resultData200 = _responseText;
4684
+ result200 = JSON.parse(resultData200);
4685
+ return Promise.resolve(result200);
4686
+ }
4687
+ else if (status === 401) {
4688
+ const _responseText = response.data;
4689
+ return throwException("Unauthorized", status, _responseText, _headers);
4690
+ }
4691
+ else if (status === 403) {
4692
+ const _responseText = response.data;
4693
+ return throwException("Forbidden", status, _responseText, _headers);
4694
+ }
4695
+ else if (status !== 200 && status !== 204) {
4696
+ const _responseText = response.data;
4697
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4698
+ }
4699
+ return Promise.resolve(null);
4700
+ }
4701
+ /**
4702
+ * Creates print-product item from input image file.
4703
+ * @param itemType (optional) Desired item type.
2093
4704
  * @param tenantId (optional) Tenant identifier
2094
- * @param body (optional) Render model with preview parameters.
4705
+ * @param sourceFile (optional)
2095
4706
  * @return Success
2096
4707
  */
2097
- renderImagePreviewToResource(tenantId, body, cancelToken) {
2098
- let url_ = this.baseUrl + "/api/atoms/v1/images/render-preview/to-resource?";
4708
+ createItemFromFile(itemType, tenantId, sourceFile, cancelToken) {
4709
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file?";
4710
+ if (itemType !== undefined && itemType !== null)
4711
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4712
+ if (tenantId === null)
4713
+ throw new Error("The parameter 'tenantId' cannot be null.");
4714
+ else if (tenantId !== undefined)
4715
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4716
+ url_ = url_.replace(/[?&]$/, "");
4717
+ const content_ = new FormData();
4718
+ if (sourceFile !== null && sourceFile !== undefined)
4719
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4720
+ let options_ = {
4721
+ data: content_,
4722
+ method: "POST",
4723
+ url: url_,
4724
+ headers: {
4725
+ "Accept": "application/json"
4726
+ },
4727
+ cancelToken
4728
+ };
4729
+ return this.transformOptions(options_).then(transformedOptions_ => {
4730
+ return this.instance.request(transformedOptions_);
4731
+ }).catch((_error) => {
4732
+ if (isAxiosError(_error) && _error.response) {
4733
+ return _error.response;
4734
+ }
4735
+ else {
4736
+ throw _error;
4737
+ }
4738
+ }).then((_response) => {
4739
+ return this.transformResult(url_, _response, (_response) => this.processCreateItemFromFile(_response));
4740
+ });
4741
+ }
4742
+ processCreateItemFromFile(response) {
4743
+ const status = response.status;
4744
+ let _headers = {};
4745
+ if (response.headers && typeof response.headers === "object") {
4746
+ for (let k in response.headers) {
4747
+ if (response.headers.hasOwnProperty(k)) {
4748
+ _headers[k] = response.headers[k];
4749
+ }
4750
+ }
4751
+ }
4752
+ if (status === 200) {
4753
+ const _responseText = response.data;
4754
+ let result200 = null;
4755
+ let resultData200 = _responseText;
4756
+ result200 = JSON.parse(resultData200);
4757
+ return Promise.resolve(result200);
4758
+ }
4759
+ else if (status === 404) {
4760
+ const _responseText = response.data;
4761
+ let result404 = null;
4762
+ let resultData404 = _responseText;
4763
+ result404 = JSON.parse(resultData404);
4764
+ return throwException("Not Found", status, _responseText, _headers, result404);
4765
+ }
4766
+ else if (status === 409) {
4767
+ const _responseText = response.data;
4768
+ let result409 = null;
4769
+ let resultData409 = _responseText;
4770
+ result409 = JSON.parse(resultData409);
4771
+ return throwException("Conflict", status, _responseText, _headers, result409);
4772
+ }
4773
+ else if (status === 401) {
4774
+ const _responseText = response.data;
4775
+ return throwException("Unauthorized", status, _responseText, _headers);
4776
+ }
4777
+ else if (status === 403) {
4778
+ const _responseText = response.data;
4779
+ return throwException("Forbidden", status, _responseText, _headers);
4780
+ }
4781
+ else if (status !== 200 && status !== 204) {
4782
+ const _responseText = response.data;
4783
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4784
+ }
4785
+ return Promise.resolve(null);
4786
+ }
4787
+ /**
4788
+ * Creates multiple print-product items from input image files.
4789
+ * @param itemType (optional) Desired print-product items type.
4790
+ * @param tenantId (optional) Tenant identifier
4791
+ * @param sourceFiles (optional)
4792
+ * @return Success
4793
+ */
4794
+ batchCreateItemsFromFile(itemType, tenantId, sourceFiles, cancelToken) {
4795
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file/batch-create?";
4796
+ if (itemType !== undefined && itemType !== null)
4797
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4798
+ if (tenantId === null)
4799
+ throw new Error("The parameter 'tenantId' cannot be null.");
4800
+ else if (tenantId !== undefined)
4801
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4802
+ url_ = url_.replace(/[?&]$/, "");
4803
+ const content_ = new FormData();
4804
+ if (sourceFiles !== null && sourceFiles !== undefined)
4805
+ sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
4806
+ let options_ = {
4807
+ data: content_,
4808
+ method: "POST",
4809
+ url: url_,
4810
+ headers: {
4811
+ "Accept": "application/json"
4812
+ },
4813
+ cancelToken
4814
+ };
4815
+ return this.transformOptions(options_).then(transformedOptions_ => {
4816
+ return this.instance.request(transformedOptions_);
4817
+ }).catch((_error) => {
4818
+ if (isAxiosError(_error) && _error.response) {
4819
+ return _error.response;
4820
+ }
4821
+ else {
4822
+ throw _error;
4823
+ }
4824
+ }).then((_response) => {
4825
+ return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromFile(_response));
4826
+ });
4827
+ }
4828
+ processBatchCreateItemsFromFile(response) {
4829
+ const status = response.status;
4830
+ let _headers = {};
4831
+ if (response.headers && typeof response.headers === "object") {
4832
+ for (let k in response.headers) {
4833
+ if (response.headers.hasOwnProperty(k)) {
4834
+ _headers[k] = response.headers[k];
4835
+ }
4836
+ }
4837
+ }
4838
+ if (status === 200) {
4839
+ const _responseText = response.data;
4840
+ let result200 = null;
4841
+ let resultData200 = _responseText;
4842
+ result200 = JSON.parse(resultData200);
4843
+ return Promise.resolve(result200);
4844
+ }
4845
+ else if (status === 404) {
4846
+ const _responseText = response.data;
4847
+ let result404 = null;
4848
+ let resultData404 = _responseText;
4849
+ result404 = JSON.parse(resultData404);
4850
+ return throwException("Not Found", status, _responseText, _headers, result404);
4851
+ }
4852
+ else if (status === 409) {
4853
+ const _responseText = response.data;
4854
+ let result409 = null;
4855
+ let resultData409 = _responseText;
4856
+ result409 = JSON.parse(resultData409);
4857
+ return throwException("Conflict", status, _responseText, _headers, result409);
4858
+ }
4859
+ else if (status === 401) {
4860
+ const _responseText = response.data;
4861
+ return throwException("Unauthorized", status, _responseText, _headers);
4862
+ }
4863
+ else if (status === 403) {
4864
+ const _responseText = response.data;
4865
+ return throwException("Forbidden", status, _responseText, _headers);
4866
+ }
4867
+ else if (status !== 200 && status !== 204) {
4868
+ const _responseText = response.data;
4869
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
4870
+ }
4871
+ return Promise.resolve(null);
4872
+ }
4873
+ /**
4874
+ * Creates print-product item from image file taken from storage.
4875
+ * @param itemType (optional) Desired item type.
4876
+ * @param tenantId (optional) Tenant identifier
4877
+ * @param body (optional) Operation parameters.
4878
+ * @return Success
4879
+ */
4880
+ createItemFromStorage(itemType, tenantId, body, cancelToken) {
4881
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage?";
4882
+ if (itemType !== undefined && itemType !== null)
4883
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
2099
4884
  if (tenantId === null)
2100
4885
  throw new Error("The parameter 'tenantId' cannot be null.");
2101
4886
  else if (tenantId !== undefined)
@@ -2122,10 +4907,10 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2122
4907
  throw _error;
2123
4908
  }
2124
4909
  }).then((_response) => {
2125
- return this.transformResult(url_, _response, (_response) => this.processRenderImagePreviewToResource(_response));
4910
+ return this.transformResult(url_, _response, (_response) => this.processCreateItemFromStorage(_response));
2126
4911
  });
2127
4912
  }
2128
- processRenderImagePreviewToResource(response) {
4913
+ processCreateItemFromStorage(response) {
2129
4914
  const status = response.status;
2130
4915
  let _headers = {};
2131
4916
  if (response.headers && typeof response.headers === "object") {
@@ -2142,6 +4927,20 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2142
4927
  result200 = JSON.parse(resultData200);
2143
4928
  return Promise.resolve(result200);
2144
4929
  }
4930
+ else if (status === 404) {
4931
+ const _responseText = response.data;
4932
+ let result404 = null;
4933
+ let resultData404 = _responseText;
4934
+ result404 = JSON.parse(resultData404);
4935
+ return throwException("Not Found", status, _responseText, _headers, result404);
4936
+ }
4937
+ else if (status === 409) {
4938
+ const _responseText = response.data;
4939
+ let result409 = null;
4940
+ let resultData409 = _responseText;
4941
+ result409 = JSON.parse(resultData409);
4942
+ return throwException("Conflict", status, _responseText, _headers, result409);
4943
+ }
2145
4944
  else if (status === 401) {
2146
4945
  const _responseText = response.data;
2147
4946
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2156,39 +4955,29 @@ export class DesignAtomsImagesApiClient extends ApiClientBase {
2156
4955
  }
2157
4956
  return Promise.resolve(null);
2158
4957
  }
2159
- }
2160
- export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2161
- instance;
2162
- baseUrl;
2163
- jsonParseReviver = undefined;
2164
- constructor(configuration, baseUrl, instance) {
2165
- super(configuration);
2166
- this.instance = instance ? instance : axios.create();
2167
- this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2168
- }
2169
4958
  /**
2170
- * Returns a 3D-Mockup attributes.
2171
- * @param id 3D-Mockup identifier.
2172
- * @param ownerId (optional) Private mockup owner identifier.
4959
+ * Creates multiple print-product items from the specified image files in storage.
4960
+ * @param itemType (optional) Desired items type.
2173
4961
  * @param tenantId (optional) Tenant identifier
4962
+ * @param body (optional) Operation parameters.
2174
4963
  * @return Success
2175
4964
  */
2176
- getAttributes(id, ownerId, tenantId, cancelToken) {
2177
- let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/attributes?";
2178
- if (id === undefined || id === null)
2179
- throw new Error("The parameter 'id' must be defined.");
2180
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
2181
- if (ownerId !== undefined && ownerId !== null)
2182
- url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
4965
+ batchCreateItemsFromStorage(itemType, tenantId, body, cancelToken) {
4966
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage/batch-create?";
4967
+ if (itemType !== undefined && itemType !== null)
4968
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
2183
4969
  if (tenantId === null)
2184
4970
  throw new Error("The parameter 'tenantId' cannot be null.");
2185
4971
  else if (tenantId !== undefined)
2186
4972
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2187
4973
  url_ = url_.replace(/[?&]$/, "");
4974
+ const content_ = JSON.stringify(body);
2188
4975
  let options_ = {
2189
- method: "GET",
4976
+ data: content_,
4977
+ method: "POST",
2190
4978
  url: url_,
2191
4979
  headers: {
4980
+ "Content-Type": "application/json",
2192
4981
  "Accept": "application/json"
2193
4982
  },
2194
4983
  cancelToken
@@ -2203,10 +4992,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2203
4992
  throw _error;
2204
4993
  }
2205
4994
  }).then((_response) => {
2206
- return this.transformResult(url_, _response, (_response) => this.processGetAttributes(_response));
4995
+ return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromStorage(_response));
2207
4996
  });
2208
4997
  }
2209
- processGetAttributes(response) {
4998
+ processBatchCreateItemsFromStorage(response) {
2210
4999
  const status = response.status;
2211
5000
  let _headers = {};
2212
5001
  if (response.headers && typeof response.headers === "object") {
@@ -2230,12 +5019,12 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2230
5019
  result404 = JSON.parse(resultData404);
2231
5020
  return throwException("Not Found", status, _responseText, _headers, result404);
2232
5021
  }
2233
- else if (status === 422) {
5022
+ else if (status === 409) {
2234
5023
  const _responseText = response.data;
2235
- let result422 = null;
2236
- let resultData422 = _responseText;
2237
- result422 = JSON.parse(resultData422);
2238
- return throwException("Client Error", status, _responseText, _headers, result422);
5024
+ let result409 = null;
5025
+ let resultData409 = _responseText;
5026
+ result409 = JSON.parse(resultData409);
5027
+ return throwException("Conflict", status, _responseText, _headers, result409);
2239
5028
  }
2240
5029
  else if (status === 401) {
2241
5030
  const _responseText = response.data;
@@ -2252,29 +5041,28 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2252
5041
  return Promise.resolve(null);
2253
5042
  }
2254
5043
  /**
2255
- * Returns a 3D-Mockup content as protobuf binary stream.
2256
- * @param id 3D-Mockup identifier.
2257
- * @param ownerId (optional) Private mockup owner identifier.
5044
+ * Creates print-product item from remote web image provided by URL.
5045
+ * @param itemType (optional) Desired item type.
2258
5046
  * @param tenantId (optional) Tenant identifier
5047
+ * @param body (optional) Operation parameters.
2259
5048
  * @return Success
2260
5049
  */
2261
- getContentAsProtobuf(id, ownerId, tenantId, cancelToken) {
2262
- let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/content/as-protobuf?";
2263
- if (id === undefined || id === null)
2264
- throw new Error("The parameter 'id' must be defined.");
2265
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
2266
- if (ownerId !== undefined && ownerId !== null)
2267
- url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
5050
+ createItemFromUrl(itemType, tenantId, body, cancelToken) {
5051
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url?";
5052
+ if (itemType !== undefined && itemType !== null)
5053
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
2268
5054
  if (tenantId === null)
2269
5055
  throw new Error("The parameter 'tenantId' cannot be null.");
2270
5056
  else if (tenantId !== undefined)
2271
5057
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2272
5058
  url_ = url_.replace(/[?&]$/, "");
5059
+ const content_ = JSON.stringify(body);
2273
5060
  let options_ = {
2274
- responseType: "blob",
2275
- method: "GET",
5061
+ data: content_,
5062
+ method: "POST",
2276
5063
  url: url_,
2277
5064
  headers: {
5065
+ "Content-Type": "application/json",
2278
5066
  "Accept": "application/json"
2279
5067
  },
2280
5068
  cancelToken
@@ -2289,10 +5077,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2289
5077
  throw _error;
2290
5078
  }
2291
5079
  }).then((_response) => {
2292
- return this.transformResult(url_, _response, (_response) => this.processGetContentAsProtobuf(_response));
5080
+ return this.transformResult(url_, _response, (_response) => this.processCreateItemFromUrl(_response));
2293
5081
  });
2294
5082
  }
2295
- processGetContentAsProtobuf(response) {
5083
+ processCreateItemFromUrl(response) {
2296
5084
  const status = response.status;
2297
5085
  let _headers = {};
2298
5086
  if (response.headers && typeof response.headers === "object") {
@@ -2302,11 +5090,12 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2302
5090
  }
2303
5091
  }
2304
5092
  }
2305
- if (status === 200 || status === 206) {
2306
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2307
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2308
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2309
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
5093
+ if (status === 200) {
5094
+ const _responseText = response.data;
5095
+ let result200 = null;
5096
+ let resultData200 = _responseText;
5097
+ result200 = JSON.parse(resultData200);
5098
+ return Promise.resolve(result200);
2310
5099
  }
2311
5100
  else if (status === 404) {
2312
5101
  const _responseText = response.data;
@@ -2315,12 +5104,12 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2315
5104
  result404 = JSON.parse(resultData404);
2316
5105
  return throwException("Not Found", status, _responseText, _headers, result404);
2317
5106
  }
2318
- else if (status === 422) {
5107
+ else if (status === 409) {
2319
5108
  const _responseText = response.data;
2320
- let result422 = null;
2321
- let resultData422 = _responseText;
2322
- result422 = JSON.parse(resultData422);
2323
- return throwException("Client Error", status, _responseText, _headers, result422);
5109
+ let result409 = null;
5110
+ let resultData409 = _responseText;
5111
+ result409 = JSON.parse(resultData409);
5112
+ return throwException("Conflict", status, _responseText, _headers, result409);
2324
5113
  }
2325
5114
  else if (status === 401) {
2326
5115
  const _responseText = response.data;
@@ -2337,29 +5126,28 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2337
5126
  return Promise.resolve(null);
2338
5127
  }
2339
5128
  /**
2340
- * Returns a 3D-Mockup geometry as binary stream.
2341
- * @param id 3D-Mockup identifier.
2342
- * @param ownerId (optional) Private mockup owner identifier.
5129
+ * Creates multiple print-product items from remote web images provided by URLs list.
5130
+ * @param itemType (optional) Desired items type.
2343
5131
  * @param tenantId (optional) Tenant identifier
5132
+ * @param body (optional) Operation parameters.
2344
5133
  * @return Success
2345
5134
  */
2346
- getGeometryFile(id, ownerId, tenantId, cancelToken) {
2347
- let url_ = this.baseUrl + "/api/atoms/v1/mockups-3d/{id}/geometry/file?";
2348
- if (id === undefined || id === null)
2349
- throw new Error("The parameter 'id' must be defined.");
2350
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
2351
- if (ownerId !== undefined && ownerId !== null)
2352
- url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
5135
+ batchCreateItemsFromUrl(itemType, tenantId, body, cancelToken) {
5136
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url/batch-create?";
5137
+ if (itemType !== undefined && itemType !== null)
5138
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
2353
5139
  if (tenantId === null)
2354
5140
  throw new Error("The parameter 'tenantId' cannot be null.");
2355
5141
  else if (tenantId !== undefined)
2356
5142
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2357
5143
  url_ = url_.replace(/[?&]$/, "");
5144
+ const content_ = JSON.stringify(body);
2358
5145
  let options_ = {
2359
- responseType: "blob",
2360
- method: "GET",
5146
+ data: content_,
5147
+ method: "POST",
2361
5148
  url: url_,
2362
5149
  headers: {
5150
+ "Content-Type": "application/json",
2363
5151
  "Accept": "application/json"
2364
5152
  },
2365
5153
  cancelToken
@@ -2374,10 +5162,10 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2374
5162
  throw _error;
2375
5163
  }
2376
5164
  }).then((_response) => {
2377
- return this.transformResult(url_, _response, (_response) => this.processGetGeometryFile(_response));
5165
+ return this.transformResult(url_, _response, (_response) => this.processBatchCreateItemsFromUrl(_response));
2378
5166
  });
2379
5167
  }
2380
- processGetGeometryFile(response) {
5168
+ processBatchCreateItemsFromUrl(response) {
2381
5169
  const status = response.status;
2382
5170
  let _headers = {};
2383
5171
  if (response.headers && typeof response.headers === "object") {
@@ -2387,11 +5175,12 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2387
5175
  }
2388
5176
  }
2389
5177
  }
2390
- if (status === 200 || status === 206) {
2391
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2392
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2393
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2394
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
5178
+ if (status === 200) {
5179
+ const _responseText = response.data;
5180
+ let result200 = null;
5181
+ let resultData200 = _responseText;
5182
+ result200 = JSON.parse(resultData200);
5183
+ return Promise.resolve(result200);
2395
5184
  }
2396
5185
  else if (status === 404) {
2397
5186
  const _responseText = response.data;
@@ -2400,12 +5189,12 @@ export class DesignAtomsMockups3dApiClient extends ApiClientBase {
2400
5189
  result404 = JSON.parse(resultData404);
2401
5190
  return throwException("Not Found", status, _responseText, _headers, result404);
2402
5191
  }
2403
- else if (status === 422) {
5192
+ else if (status === 409) {
2404
5193
  const _responseText = response.data;
2405
- let result422 = null;
2406
- let resultData422 = _responseText;
2407
- result422 = JSON.parse(resultData422);
2408
- return throwException("Client Error", status, _responseText, _headers, result422);
5194
+ let result409 = null;
5195
+ let resultData409 = _responseText;
5196
+ result409 = JSON.parse(resultData409);
5197
+ return throwException("Conflict", status, _responseText, _headers, result409);
2409
5198
  }
2410
5199
  else if (status === 401) {
2411
5200
  const _responseText = response.data;
@@ -2503,7 +5292,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2503
5292
  return Promise.resolve(null);
2504
5293
  }
2505
5294
  /**
2506
- * Returns content of the background.
5295
+ * Returns image content of the background.
2507
5296
  * @param id Design identifier.
2508
5297
  * @param surfaceIndex (optional) Surface index.
2509
5298
  * @param privateStorageOwner (optional) Private storage owner identifier.
@@ -2569,12 +5358,97 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2569
5358
  result404 = JSON.parse(resultData404);
2570
5359
  return throwException("Not Found", status, _responseText, _headers, result404);
2571
5360
  }
2572
- else if (status === 422) {
5361
+ else if (status === 409) {
5362
+ const _responseText = response.data;
5363
+ let result409 = null;
5364
+ let resultData409 = _responseText;
5365
+ result409 = JSON.parse(resultData409);
5366
+ return throwException("Conflict", status, _responseText, _headers, result409);
5367
+ }
5368
+ else if (status === 401) {
5369
+ const _responseText = response.data;
5370
+ return throwException("Unauthorized", status, _responseText, _headers);
5371
+ }
5372
+ else if (status === 403) {
5373
+ const _responseText = response.data;
5374
+ return throwException("Forbidden", status, _responseText, _headers);
5375
+ }
5376
+ else if (status !== 200 && status !== 204) {
5377
+ const _responseText = response.data;
5378
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5379
+ }
5380
+ return Promise.resolve(null);
5381
+ }
5382
+ /**
5383
+ * Sets specified editor-mockups for selected design surfaces.
5384
+ * @param id Design identifier.
5385
+ * @param privateStorageOwner (optional) Private storage owner identifier.
5386
+ * @param tenantId (optional) Tenant identifier
5387
+ * @param body (optional) Operation parameters.
5388
+ * @return No Content
5389
+ */
5390
+ setEditorMockups(id, privateStorageOwner, tenantId, body, cancelToken) {
5391
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/editor-mockups?";
5392
+ if (id === undefined || id === null)
5393
+ throw new Error("The parameter 'id' must be defined.");
5394
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5395
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
5396
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
5397
+ if (tenantId === null)
5398
+ throw new Error("The parameter 'tenantId' cannot be null.");
5399
+ else if (tenantId !== undefined)
5400
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5401
+ url_ = url_.replace(/[?&]$/, "");
5402
+ const content_ = JSON.stringify(body);
5403
+ let options_ = {
5404
+ data: content_,
5405
+ method: "PUT",
5406
+ url: url_,
5407
+ headers: {
5408
+ "Content-Type": "application/json",
5409
+ },
5410
+ cancelToken
5411
+ };
5412
+ return this.transformOptions(options_).then(transformedOptions_ => {
5413
+ return this.instance.request(transformedOptions_);
5414
+ }).catch((_error) => {
5415
+ if (isAxiosError(_error) && _error.response) {
5416
+ return _error.response;
5417
+ }
5418
+ else {
5419
+ throw _error;
5420
+ }
5421
+ }).then((_response) => {
5422
+ return this.transformResult(url_, _response, (_response) => this.processSetEditorMockups(_response));
5423
+ });
5424
+ }
5425
+ processSetEditorMockups(response) {
5426
+ const status = response.status;
5427
+ let _headers = {};
5428
+ if (response.headers && typeof response.headers === "object") {
5429
+ for (let k in response.headers) {
5430
+ if (response.headers.hasOwnProperty(k)) {
5431
+ _headers[k] = response.headers[k];
5432
+ }
5433
+ }
5434
+ }
5435
+ if (status === 204) {
5436
+ const _responseText = response.data;
5437
+ return Promise.resolve(null);
5438
+ }
5439
+ else if (status === 400) {
5440
+ const _responseText = response.data;
5441
+ let result400 = null;
5442
+ let resultData400 = _responseText;
5443
+ result400 = JSON.parse(resultData400);
5444
+ return throwException("Bad Request", status, _responseText, _headers, result400);
5445
+ }
5446
+ else if (status === 404) {
2573
5447
  const _responseText = response.data;
2574
- let result422 = null;
2575
- let resultData422 = _responseText;
2576
- result422 = JSON.parse(resultData422);
2577
- return throwException("Client Error", status, _responseText, _headers, result422);
5448
+ let result404 = null;
5449
+ let resultData404 = _responseText;
5450
+ result404 = JSON.parse(resultData404);
5451
+ return throwException("Not Found", status, _responseText, _headers, result404);
2578
5452
  }
2579
5453
  else if (status === 401) {
2580
5454
  const _responseText = response.data;
@@ -2591,14 +5465,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2591
5465
  return Promise.resolve(null);
2592
5466
  }
2593
5467
  /**
2594
- * Loads product (design model) from design file taken from storage.
5468
+ * Returns design parameters stored in product model.
2595
5469
  * @param id Design identifier.
2596
5470
  * @param privateStorageOwner (optional) Private storage owner identifier.
2597
5471
  * @param tenantId (optional) Tenant identifier
2598
5472
  * @return Success
2599
5473
  */
2600
- loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
2601
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
5474
+ getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
5475
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
2602
5476
  if (id === undefined || id === null)
2603
5477
  throw new Error("The parameter 'id' must be defined.");
2604
5478
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -2627,10 +5501,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2627
5501
  throw _error;
2628
5502
  }
2629
5503
  }).then((_response) => {
2630
- return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
5504
+ return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
2631
5505
  });
2632
5506
  }
2633
- processLoadProduct(response) {
5507
+ processGetDesignParameters(response) {
2634
5508
  const status = response.status;
2635
5509
  let _headers = {};
2636
5510
  if (response.headers && typeof response.headers === "object") {
@@ -2669,15 +5543,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2669
5543
  return Promise.resolve(null);
2670
5544
  }
2671
5545
  /**
2672
- * Saves product (design model) to design file and updates design in storage.
5546
+ * Loads a data schema from design file taken from storage.
2673
5547
  * @param id Design identifier.
2674
5548
  * @param privateStorageOwner (optional) Private storage owner identifier.
2675
5549
  * @param tenantId (optional) Tenant identifier
2676
- * @param body (optional) Serialized product description.
2677
5550
  * @return Success
2678
5551
  */
2679
- saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
2680
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
5552
+ loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
5553
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
2681
5554
  if (id === undefined || id === null)
2682
5555
  throw new Error("The parameter 'id' must be defined.");
2683
5556
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -2688,13 +5561,12 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2688
5561
  else if (tenantId !== undefined)
2689
5562
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2690
5563
  url_ = url_.replace(/[?&]$/, "");
2691
- const content_ = JSON.stringify(body);
2692
5564
  let options_ = {
2693
- data: content_,
2694
- method: "PUT",
5565
+ responseType: "blob",
5566
+ method: "GET",
2695
5567
  url: url_,
2696
5568
  headers: {
2697
- "Content-Type": "application/json",
5569
+ "Accept": "application/octet-stream"
2698
5570
  },
2699
5571
  cancelToken
2700
5572
  };
@@ -2708,10 +5580,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2708
5580
  throw _error;
2709
5581
  }
2710
5582
  }).then((_response) => {
2711
- return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
5583
+ return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
2712
5584
  });
2713
5585
  }
2714
- processSaveProduct(response) {
5586
+ processLoadDataSchema(response) {
2715
5587
  const status = response.status;
2716
5588
  let _headers = {};
2717
5589
  if (response.headers && typeof response.headers === "object") {
@@ -2721,9 +5593,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2721
5593
  }
2722
5594
  }
2723
5595
  }
2724
- if (status === 200) {
2725
- const _responseText = response.data;
2726
- return Promise.resolve(null);
5596
+ if (status === 200 || status === 206) {
5597
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
5598
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5599
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5600
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2727
5601
  }
2728
5602
  else if (status === 404) {
2729
5603
  const _responseText = response.data;
@@ -2732,6 +5606,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2732
5606
  result404 = JSON.parse(resultData404);
2733
5607
  return throwException("Not Found", status, _responseText, _headers, result404);
2734
5608
  }
5609
+ else if (status === 409) {
5610
+ const _responseText = response.data;
5611
+ let result409 = null;
5612
+ let resultData409 = _responseText;
5613
+ result409 = JSON.parse(resultData409);
5614
+ return throwException("Conflict", status, _responseText, _headers, result409);
5615
+ }
2735
5616
  else if (status === 401) {
2736
5617
  const _responseText = response.data;
2737
5618
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2747,20 +5628,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2747
5628
  return Promise.resolve(null);
2748
5629
  }
2749
5630
  /**
2750
- * Patches product (design model) in design file.
5631
+ * Loads a toggle set from design file taken from storage.
2751
5632
  * @param id Design identifier.
2752
5633
  * @param privateStorageOwner (optional) Private storage owner identifier.
2753
5634
  * @param tenantId (optional) Tenant identifier
2754
- * @param patchType (optional)
2755
- * @param replaceImageItemFileInfo_itemName (optional)
2756
- * @param replaceImageItemFileInfo_sourceFile (optional)
2757
- * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
2758
- * @param replacePlaceholderItemContentInfo_newContentType (optional)
2759
- * @param replacePlaceholderItemContentInfo_sourceFile (optional)
2760
5635
  * @return Success
2761
5636
  */
2762
- patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
2763
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
5637
+ loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
5638
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
2764
5639
  if (id === undefined || id === null)
2765
5640
  throw new Error("The parameter 'id' must be defined.");
2766
5641
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -2771,28 +5646,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2771
5646
  else if (tenantId !== undefined)
2772
5647
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2773
5648
  url_ = url_.replace(/[?&]$/, "");
2774
- const content_ = new FormData();
2775
- if (patchType === null || patchType === undefined)
2776
- throw new Error("The parameter 'patchType' cannot be null.");
2777
- else
2778
- content_.append("patchType", patchType.toString());
2779
- if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
2780
- content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
2781
- if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
2782
- content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
2783
- if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
2784
- content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
2785
- if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
2786
- throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
2787
- else
2788
- content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
2789
- if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
2790
- content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
2791
5649
  let options_ = {
2792
- data: content_,
2793
- method: "PATCH",
5650
+ responseType: "blob",
5651
+ method: "GET",
2794
5652
  url: url_,
2795
- headers: {},
5653
+ headers: {
5654
+ "Accept": "application/octet-stream"
5655
+ },
2796
5656
  cancelToken
2797
5657
  };
2798
5658
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -2805,10 +5665,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2805
5665
  throw _error;
2806
5666
  }
2807
5667
  }).then((_response) => {
2808
- return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
5668
+ return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
2809
5669
  });
2810
5670
  }
2811
- processPatchProduct(response) {
5671
+ processLoadToggleSet(response) {
2812
5672
  const status = response.status;
2813
5673
  let _headers = {};
2814
5674
  if (response.headers && typeof response.headers === "object") {
@@ -2818,9 +5678,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2818
5678
  }
2819
5679
  }
2820
5680
  }
2821
- if (status === 200) {
2822
- const _responseText = response.data;
2823
- return Promise.resolve(null);
5681
+ if (status === 200 || status === 206) {
5682
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
5683
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5684
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5685
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
2824
5686
  }
2825
5687
  else if (status === 404) {
2826
5688
  const _responseText = response.data;
@@ -2829,6 +5691,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2829
5691
  result404 = JSON.parse(resultData404);
2830
5692
  return throwException("Not Found", status, _responseText, _headers, result404);
2831
5693
  }
5694
+ else if (status === 409) {
5695
+ const _responseText = response.data;
5696
+ let result409 = null;
5697
+ let resultData409 = _responseText;
5698
+ result409 = JSON.parse(resultData409);
5699
+ return throwException("Conflict", status, _responseText, _headers, result409);
5700
+ }
2832
5701
  else if (status === 401) {
2833
5702
  const _responseText = response.data;
2834
5703
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2844,14 +5713,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2844
5713
  return Promise.resolve(null);
2845
5714
  }
2846
5715
  /**
2847
- * Returns design parameters stored in product model.
5716
+ * Returns variable items information for design file taken from storage.
2848
5717
  * @param id Design identifier.
2849
5718
  * @param privateStorageOwner (optional) Private storage owner identifier.
2850
5719
  * @param tenantId (optional) Tenant identifier
2851
5720
  * @return Success
2852
5721
  */
2853
- getDesignParameters(id, privateStorageOwner, tenantId, cancelToken) {
2854
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
5722
+ getVariables(id, privateStorageOwner, tenantId, cancelToken) {
5723
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
2855
5724
  if (id === undefined || id === null)
2856
5725
  throw new Error("The parameter 'id' must be defined.");
2857
5726
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -2880,10 +5749,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2880
5749
  throw _error;
2881
5750
  }
2882
5751
  }).then((_response) => {
2883
- return this.transformResult(url_, _response, (_response) => this.processGetDesignParameters(_response));
5752
+ return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
2884
5753
  });
2885
5754
  }
2886
- processGetDesignParameters(response) {
5755
+ processGetVariables(response) {
2887
5756
  const status = response.status;
2888
5757
  let _headers = {};
2889
5758
  if (response.headers && typeof response.headers === "object") {
@@ -2922,14 +5791,15 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2922
5791
  return Promise.resolve(null);
2923
5792
  }
2924
5793
  /**
2925
- * Loads data schema from design file taken from storage.
5794
+ * Saves variable items values for design file taken from storage.
2926
5795
  * @param id Design identifier.
2927
5796
  * @param privateStorageOwner (optional) Private storage owner identifier.
2928
5797
  * @param tenantId (optional) Tenant identifier
5798
+ * @param body (optional) Design variable values.
2929
5799
  * @return Success
2930
5800
  */
2931
- loadDataSchema(id, privateStorageOwner, tenantId, cancelToken) {
2932
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
5801
+ setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
5802
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
2933
5803
  if (id === undefined || id === null)
2934
5804
  throw new Error("The parameter 'id' must be defined.");
2935
5805
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -2940,12 +5810,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2940
5810
  else if (tenantId !== undefined)
2941
5811
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2942
5812
  url_ = url_.replace(/[?&]$/, "");
5813
+ const content_ = JSON.stringify(body);
2943
5814
  let options_ = {
2944
- responseType: "blob",
2945
- method: "GET",
5815
+ data: content_,
5816
+ method: "PUT",
2946
5817
  url: url_,
2947
5818
  headers: {
2948
- "Accept": "application/octet-stream"
5819
+ "Content-Type": "application/json",
2949
5820
  },
2950
5821
  cancelToken
2951
5822
  };
@@ -2959,10 +5830,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2959
5830
  throw _error;
2960
5831
  }
2961
5832
  }).then((_response) => {
2962
- return this.transformResult(url_, _response, (_response) => this.processLoadDataSchema(_response));
5833
+ return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
2963
5834
  });
2964
5835
  }
2965
- processLoadDataSchema(response) {
5836
+ processSetVariables(response) {
2966
5837
  const status = response.status;
2967
5838
  let _headers = {};
2968
5839
  if (response.headers && typeof response.headers === "object") {
@@ -2972,11 +5843,9 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
2972
5843
  }
2973
5844
  }
2974
5845
  }
2975
- if (status === 200 || status === 206) {
2976
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
2977
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
2978
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
2979
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
5846
+ if (status === 200) {
5847
+ const _responseText = response.data;
5848
+ return Promise.resolve(null);
2980
5849
  }
2981
5850
  else if (status === 404) {
2982
5851
  const _responseText = response.data;
@@ -3007,14 +5876,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3007
5876
  return Promise.resolve(null);
3008
5877
  }
3009
5878
  /**
3010
- * Loads a toggle set from design file taken from storage.
5879
+ * Loads variable data printing information from design file taken from storage.
3011
5880
  * @param id Design identifier.
3012
5881
  * @param privateStorageOwner (optional) Private storage owner identifier.
3013
5882
  * @param tenantId (optional) Tenant identifier
3014
5883
  * @return Success
3015
5884
  */
3016
- loadToggleSet(id, privateStorageOwner, tenantId, cancelToken) {
3017
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
5885
+ loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
5886
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3018
5887
  if (id === undefined || id === null)
3019
5888
  throw new Error("The parameter 'id' must be defined.");
3020
5889
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -3026,11 +5895,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3026
5895
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3027
5896
  url_ = url_.replace(/[?&]$/, "");
3028
5897
  let options_ = {
3029
- responseType: "blob",
3030
5898
  method: "GET",
3031
5899
  url: url_,
3032
5900
  headers: {
3033
- "Accept": "application/octet-stream"
5901
+ "Accept": "application/json"
3034
5902
  },
3035
5903
  cancelToken
3036
5904
  };
@@ -3044,10 +5912,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3044
5912
  throw _error;
3045
5913
  }
3046
5914
  }).then((_response) => {
3047
- return this.transformResult(url_, _response, (_response) => this.processLoadToggleSet(_response));
5915
+ return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
3048
5916
  });
3049
5917
  }
3050
- processLoadToggleSet(response) {
5918
+ processLoadVdpData(response) {
3051
5919
  const status = response.status;
3052
5920
  let _headers = {};
3053
5921
  if (response.headers && typeof response.headers === "object") {
@@ -3057,11 +5925,12 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3057
5925
  }
3058
5926
  }
3059
5927
  }
3060
- if (status === 200 || status === 206) {
3061
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3062
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3063
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3064
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
5928
+ if (status === 200) {
5929
+ const _responseText = response.data;
5930
+ let result200 = null;
5931
+ let resultData200 = _responseText;
5932
+ result200 = JSON.parse(resultData200);
5933
+ return Promise.resolve(result200);
3065
5934
  }
3066
5935
  else if (status === 404) {
3067
5936
  const _responseText = response.data;
@@ -3092,14 +5961,15 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3092
5961
  return Promise.resolve(null);
3093
5962
  }
3094
5963
  /**
3095
- * Gets variable items information for design file taken from storage.
5964
+ * Saves variable data printing information to design file and updates design in storage.
3096
5965
  * @param id Design identifier.
3097
5966
  * @param privateStorageOwner (optional) Private storage owner identifier.
3098
5967
  * @param tenantId (optional) Tenant identifier
5968
+ * @param body (optional) Serialized vdp data.
3099
5969
  * @return Success
3100
5970
  */
3101
- getVariables(id, privateStorageOwner, tenantId, cancelToken) {
3102
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
5971
+ saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
5972
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3103
5973
  if (id === undefined || id === null)
3104
5974
  throw new Error("The parameter 'id' must be defined.");
3105
5975
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -3110,11 +5980,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3110
5980
  else if (tenantId !== undefined)
3111
5981
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3112
5982
  url_ = url_.replace(/[?&]$/, "");
5983
+ const content_ = JSON.stringify(body);
3113
5984
  let options_ = {
3114
- method: "GET",
5985
+ data: content_,
5986
+ method: "PUT",
3115
5987
  url: url_,
3116
5988
  headers: {
3117
- "Accept": "application/json"
5989
+ "Content-Type": "application/json",
3118
5990
  },
3119
5991
  cancelToken
3120
5992
  };
@@ -3128,10 +6000,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3128
6000
  throw _error;
3129
6001
  }
3130
6002
  }).then((_response) => {
3131
- return this.transformResult(url_, _response, (_response) => this.processGetVariables(_response));
6003
+ return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
3132
6004
  });
3133
6005
  }
3134
- processGetVariables(response) {
6006
+ processSaveVdpData(response) {
3135
6007
  const status = response.status;
3136
6008
  let _headers = {};
3137
6009
  if (response.headers && typeof response.headers === "object") {
@@ -3143,10 +6015,7 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3143
6015
  }
3144
6016
  if (status === 200) {
3145
6017
  const _responseText = response.data;
3146
- let result200 = null;
3147
- let resultData200 = _responseText;
3148
- result200 = JSON.parse(resultData200);
3149
- return Promise.resolve(result200);
6018
+ return Promise.resolve(null);
3150
6019
  }
3151
6020
  else if (status === 404) {
3152
6021
  const _responseText = response.data;
@@ -3170,15 +6039,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3170
6039
  return Promise.resolve(null);
3171
6040
  }
3172
6041
  /**
3173
- * Sets variable items values for design file taken from storage.
6042
+ * Deletes variable data printing information from design file and updates design file in storage.
3174
6043
  * @param id Design identifier.
3175
6044
  * @param privateStorageOwner (optional) Private storage owner identifier.
3176
6045
  * @param tenantId (optional) Tenant identifier
3177
- * @param body (optional) Design variable values.
3178
6046
  * @return Success
3179
6047
  */
3180
- setVariables(id, privateStorageOwner, tenantId, body, cancelToken) {
3181
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
6048
+ deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
6049
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3182
6050
  if (id === undefined || id === null)
3183
6051
  throw new Error("The parameter 'id' must be defined.");
3184
6052
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -3189,14 +6057,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3189
6057
  else if (tenantId !== undefined)
3190
6058
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3191
6059
  url_ = url_.replace(/[?&]$/, "");
3192
- const content_ = JSON.stringify(body);
3193
6060
  let options_ = {
3194
- data: content_,
3195
- method: "PUT",
6061
+ method: "DELETE",
3196
6062
  url: url_,
3197
- headers: {
3198
- "Content-Type": "application/json",
3199
- },
6063
+ headers: {},
3200
6064
  cancelToken
3201
6065
  };
3202
6066
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -3209,10 +6073,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3209
6073
  throw _error;
3210
6074
  }
3211
6075
  }).then((_response) => {
3212
- return this.transformResult(url_, _response, (_response) => this.processSetVariables(_response));
6076
+ return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
3213
6077
  });
3214
6078
  }
3215
- processSetVariables(response) {
6079
+ processDeleteVdpData(response) {
3216
6080
  const status = response.status;
3217
6081
  let _headers = {};
3218
6082
  if (response.headers && typeof response.headers === "object") {
@@ -3226,13 +6090,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3226
6090
  const _responseText = response.data;
3227
6091
  return Promise.resolve(null);
3228
6092
  }
3229
- else if (status === 404) {
3230
- const _responseText = response.data;
3231
- let result404 = null;
3232
- let resultData404 = _responseText;
3233
- result404 = JSON.parse(resultData404);
3234
- return throwException("Not Found", status, _responseText, _headers, result404);
3235
- }
3236
6093
  else if (status === 409) {
3237
6094
  const _responseText = response.data;
3238
6095
  let result409 = null;
@@ -3255,28 +6112,25 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3255
6112
  return Promise.resolve(null);
3256
6113
  }
3257
6114
  /**
3258
- * Loads variable data printing information from design file taken from storage.
3259
- * @param id Design identifier.
3260
- * @param privateStorageOwner (optional) Private storage owner identifier.
6115
+ * Converts colors for print-product item manipulations.
3261
6116
  * @param tenantId (optional) Tenant identifier
6117
+ * @param body (optional) Convert colors operation parameters.
3262
6118
  * @return Success
3263
6119
  */
3264
- loadVdpData(id, privateStorageOwner, tenantId, cancelToken) {
3265
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3266
- if (id === undefined || id === null)
3267
- throw new Error("The parameter 'id' must be defined.");
3268
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3269
- if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3270
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6120
+ convertColors(tenantId, body, cancelToken) {
6121
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/convert-colors?";
3271
6122
  if (tenantId === null)
3272
6123
  throw new Error("The parameter 'tenantId' cannot be null.");
3273
6124
  else if (tenantId !== undefined)
3274
6125
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3275
6126
  url_ = url_.replace(/[?&]$/, "");
6127
+ const content_ = JSON.stringify(body);
3276
6128
  let options_ = {
3277
- method: "GET",
6129
+ data: content_,
6130
+ method: "POST",
3278
6131
  url: url_,
3279
6132
  headers: {
6133
+ "Content-Type": "application/json",
3280
6134
  "Accept": "application/json"
3281
6135
  },
3282
6136
  cancelToken
@@ -3291,10 +6145,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3291
6145
  throw _error;
3292
6146
  }
3293
6147
  }).then((_response) => {
3294
- return this.transformResult(url_, _response, (_response) => this.processLoadVdpData(_response));
6148
+ return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
3295
6149
  });
3296
6150
  }
3297
- processLoadVdpData(response) {
6151
+ processConvertColors(response) {
3298
6152
  const status = response.status;
3299
6153
  let _headers = {};
3300
6154
  if (response.headers && typeof response.headers === "object") {
@@ -3318,13 +6172,6 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3318
6172
  result404 = JSON.parse(resultData404);
3319
6173
  return throwException("Not Found", status, _responseText, _headers, result404);
3320
6174
  }
3321
- else if (status === 409) {
3322
- const _responseText = response.data;
3323
- let result409 = null;
3324
- let resultData409 = _responseText;
3325
- result409 = JSON.parse(resultData409);
3326
- return throwException("Conflict", status, _responseText, _headers, result409);
3327
- }
3328
6175
  else if (status === 401) {
3329
6176
  const _responseText = response.data;
3330
6177
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3340,18 +6187,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3340
6187
  return Promise.resolve(null);
3341
6188
  }
3342
6189
  /**
3343
- * Saves variable data printing information to design file and updates design in storage.
3344
- * @param id Design identifier.
6190
+ * Loads print-product from resource file taken from storage.
6191
+ * @param id (optional) Resource identifier.
3345
6192
  * @param privateStorageOwner (optional) Private storage owner identifier.
3346
6193
  * @param tenantId (optional) Tenant identifier
3347
- * @param body (optional) Serialized vdp data.
3348
6194
  * @return Success
3349
6195
  */
3350
- saveVdpData(id, privateStorageOwner, tenantId, body, cancelToken) {
3351
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3352
- if (id === undefined || id === null)
3353
- throw new Error("The parameter 'id' must be defined.");
3354
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
6196
+ loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
6197
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/from-resource/model?";
6198
+ if (id !== undefined && id !== null)
6199
+ url_ += "id=" + encodeURIComponent("" + id) + "&";
3355
6200
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3356
6201
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3357
6202
  if (tenantId === null)
@@ -3359,13 +6204,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3359
6204
  else if (tenantId !== undefined)
3360
6205
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3361
6206
  url_ = url_.replace(/[?&]$/, "");
3362
- const content_ = JSON.stringify(body);
3363
6207
  let options_ = {
3364
- data: content_,
3365
- method: "PUT",
6208
+ method: "GET",
3366
6209
  url: url_,
3367
6210
  headers: {
3368
- "Content-Type": "application/json",
6211
+ "Accept": "application/json"
3369
6212
  },
3370
6213
  cancelToken
3371
6214
  };
@@ -3379,10 +6222,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3379
6222
  throw _error;
3380
6223
  }
3381
6224
  }).then((_response) => {
3382
- return this.transformResult(url_, _response, (_response) => this.processSaveVdpData(_response));
6225
+ return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
3383
6226
  });
3384
6227
  }
3385
- processSaveVdpData(response) {
6228
+ processLoadProductFromResource(response) {
3386
6229
  const status = response.status;
3387
6230
  let _headers = {};
3388
6231
  if (response.headers && typeof response.headers === "object") {
@@ -3394,7 +6237,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3394
6237
  }
3395
6238
  if (status === 200) {
3396
6239
  const _responseText = response.data;
3397
- return Promise.resolve(null);
6240
+ let result200 = null;
6241
+ let resultData200 = _responseText;
6242
+ result200 = JSON.parse(resultData200);
6243
+ return Promise.resolve(result200);
3398
6244
  }
3399
6245
  else if (status === 404) {
3400
6246
  const _responseText = response.data;
@@ -3403,6 +6249,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3403
6249
  result404 = JSON.parse(resultData404);
3404
6250
  return throwException("Not Found", status, _responseText, _headers, result404);
3405
6251
  }
6252
+ else if (status === 409) {
6253
+ const _responseText = response.data;
6254
+ let result409 = null;
6255
+ let resultData409 = _responseText;
6256
+ result409 = JSON.parse(resultData409);
6257
+ return throwException("Conflict", status, _responseText, _headers, result409);
6258
+ }
3406
6259
  else if (status === 401) {
3407
6260
  const _responseText = response.data;
3408
6261
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3418,28 +6271,32 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3418
6271
  return Promise.resolve(null);
3419
6272
  }
3420
6273
  /**
3421
- * Deletes variable data printing information from design file and updates design in storage.
3422
- * @param id Design identifier.
3423
- * @param privateStorageOwner (optional) Private storage owner identifier.
6274
+ * Renders a product proof image with specified parameters.
6275
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
6276
+ (default value is 'false').
3424
6277
  * @param tenantId (optional) Tenant identifier
6278
+ * @param body (optional) Preview parameters.
3425
6279
  * @return Success
3426
6280
  */
3427
- deleteVdpData(id, privateStorageOwner, tenantId, cancelToken) {
3428
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3429
- if (id === undefined || id === null)
3430
- throw new Error("The parameter 'id' must be defined.");
3431
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3432
- if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3433
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6281
+ renderProduct(attachment, tenantId, body, cancelToken) {
6282
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/render-proof?";
6283
+ if (attachment !== undefined && attachment !== null)
6284
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
3434
6285
  if (tenantId === null)
3435
6286
  throw new Error("The parameter 'tenantId' cannot be null.");
3436
6287
  else if (tenantId !== undefined)
3437
6288
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3438
6289
  url_ = url_.replace(/[?&]$/, "");
6290
+ const content_ = JSON.stringify(body);
3439
6291
  let options_ = {
3440
- method: "DELETE",
6292
+ data: content_,
6293
+ responseType: "blob",
6294
+ method: "POST",
3441
6295
  url: url_,
3442
- headers: {},
6296
+ headers: {
6297
+ "Content-Type": "application/json",
6298
+ "Accept": "application/octet-stream"
6299
+ },
3443
6300
  cancelToken
3444
6301
  };
3445
6302
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -3452,10 +6309,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3452
6309
  throw _error;
3453
6310
  }
3454
6311
  }).then((_response) => {
3455
- return this.transformResult(url_, _response, (_response) => this.processDeleteVdpData(_response));
6312
+ return this.transformResult(url_, _response, (_response) => this.processRenderProduct(_response));
3456
6313
  });
3457
6314
  }
3458
- processDeleteVdpData(response) {
6315
+ processRenderProduct(response) {
3459
6316
  const status = response.status;
3460
6317
  let _headers = {};
3461
6318
  if (response.headers && typeof response.headers === "object") {
@@ -3465,16 +6322,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3465
6322
  }
3466
6323
  }
3467
6324
  }
3468
- if (status === 200) {
3469
- const _responseText = response.data;
3470
- return Promise.resolve(null);
3471
- }
3472
- else if (status === 409) {
3473
- const _responseText = response.data;
3474
- let result409 = null;
3475
- let resultData409 = _responseText;
3476
- result409 = JSON.parse(resultData409);
3477
- return throwException("Conflict", status, _responseText, _headers, result409);
6325
+ if (status === 200 || status === 206) {
6326
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
6327
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
6328
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
6329
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3478
6330
  }
3479
6331
  else if (status === 401) {
3480
6332
  const _responseText = response.data;
@@ -3491,29 +6343,31 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3491
6343
  return Promise.resolve(null);
3492
6344
  }
3493
6345
  /**
3494
- * Loads product (design model) from resource file taken from storage.
3495
- * @param id Resource identifier.
3496
- * @param privateStorageOwner (optional) Private storage owner identifier.
6346
+ * Renders a design preview with the specified parameters.
6347
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
6348
+ (default value is 'false').
3497
6349
  * @param tenantId (optional) Tenant identifier
6350
+ * @param body (optional) Render model with preview parameters.
3498
6351
  * @return Success
3499
6352
  */
3500
- loadProductFromResource(id, privateStorageOwner, tenantId, cancelToken) {
3501
- let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
3502
- if (id === undefined || id === null)
3503
- throw new Error("The parameter 'id' must be defined.");
3504
- url_ = url_.replace("{id}", encodeURIComponent("" + id));
3505
- if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3506
- url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6353
+ renderDesignPreview(attachment, tenantId, body, cancelToken) {
6354
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
6355
+ if (attachment !== undefined && attachment !== null)
6356
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
3507
6357
  if (tenantId === null)
3508
6358
  throw new Error("The parameter 'tenantId' cannot be null.");
3509
6359
  else if (tenantId !== undefined)
3510
6360
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3511
6361
  url_ = url_.replace(/[?&]$/, "");
6362
+ const content_ = JSON.stringify(body);
3512
6363
  let options_ = {
3513
- method: "GET",
6364
+ data: content_,
6365
+ responseType: "blob",
6366
+ method: "POST",
3514
6367
  url: url_,
3515
6368
  headers: {
3516
- "Accept": "application/json"
6369
+ "Content-Type": "application/json",
6370
+ "Accept": "application/octet-stream"
3517
6371
  },
3518
6372
  cancelToken
3519
6373
  };
@@ -3527,10 +6381,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3527
6381
  throw _error;
3528
6382
  }
3529
6383
  }).then((_response) => {
3530
- return this.transformResult(url_, _response, (_response) => this.processLoadProductFromResource(_response));
6384
+ return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreview(_response));
3531
6385
  });
3532
6386
  }
3533
- processLoadProductFromResource(response) {
6387
+ processRenderDesignPreview(response) {
3534
6388
  const status = response.status;
3535
6389
  let _headers = {};
3536
6390
  if (response.headers && typeof response.headers === "object") {
@@ -3540,26 +6394,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3540
6394
  }
3541
6395
  }
3542
6396
  }
3543
- if (status === 200) {
3544
- const _responseText = response.data;
3545
- let result200 = null;
3546
- let resultData200 = _responseText;
3547
- result200 = JSON.parse(resultData200);
3548
- return Promise.resolve(result200);
3549
- }
3550
- else if (status === 404) {
3551
- const _responseText = response.data;
3552
- let result404 = null;
3553
- let resultData404 = _responseText;
3554
- result404 = JSON.parse(resultData404);
3555
- return throwException("Not Found", status, _responseText, _headers, result404);
3556
- }
3557
- else if (status === 422) {
3558
- const _responseText = response.data;
3559
- let result422 = null;
3560
- let resultData422 = _responseText;
3561
- result422 = JSON.parse(resultData422);
3562
- return throwException("Client Error", status, _responseText, _headers, result422);
6397
+ if (status === 200 || status === 206) {
6398
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
6399
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
6400
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
6401
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3563
6402
  }
3564
6403
  else if (status === 401) {
3565
6404
  const _responseText = response.data;
@@ -3576,13 +6415,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3576
6415
  return Promise.resolve(null);
3577
6416
  }
3578
6417
  /**
3579
- * Converts colors.
6418
+ * Renders a design preview with the specified parameters and saves rendering result as resource.
3580
6419
  * @param tenantId (optional) Tenant identifier
3581
- * @param body (optional) Convert colors operation parameters.
6420
+ * @param body (optional) Render model with preview parameters.
3582
6421
  * @return Success
3583
6422
  */
3584
- convertColors(tenantId, body, cancelToken) {
3585
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
6423
+ renderDesignPreviewToResource(tenantId, body, cancelToken) {
6424
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview/to-resource?";
3586
6425
  if (tenantId === null)
3587
6426
  throw new Error("The parameter 'tenantId' cannot be null.");
3588
6427
  else if (tenantId !== undefined)
@@ -3609,10 +6448,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3609
6448
  throw _error;
3610
6449
  }
3611
6450
  }).then((_response) => {
3612
- return this.transformResult(url_, _response, (_response) => this.processConvertColors(_response));
6451
+ return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreviewToResource(_response));
3613
6452
  });
3614
6453
  }
3615
- processConvertColors(response) {
6454
+ processRenderDesignPreviewToResource(response) {
3616
6455
  const status = response.status;
3617
6456
  let _headers = {};
3618
6457
  if (response.headers && typeof response.headers === "object") {
@@ -3629,12 +6468,12 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3629
6468
  result200 = JSON.parse(resultData200);
3630
6469
  return Promise.resolve(result200);
3631
6470
  }
3632
- else if (status === 404) {
6471
+ else if (status === 409) {
3633
6472
  const _responseText = response.data;
3634
- let result404 = null;
3635
- let resultData404 = _responseText;
3636
- result404 = JSON.parse(resultData404);
3637
- return throwException("Not Found", status, _responseText, _headers, result404);
6473
+ let result409 = null;
6474
+ let resultData409 = _responseText;
6475
+ result409 = JSON.parse(resultData409);
6476
+ return throwException("Conflict", status, _responseText, _headers, result409);
3638
6477
  }
3639
6478
  else if (status === 401) {
3640
6479
  const _responseText = response.data;
@@ -3651,39 +6490,31 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3651
6490
  return Promise.resolve(null);
3652
6491
  }
3653
6492
  /**
3654
- * Creates product item.
3655
- * @param itemType (optional) Desired item type.
6493
+ * Renders a design proof with the specified parameters.
6494
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
6495
+ (default value is 'false').
3656
6496
  * @param tenantId (optional) Tenant identifier
3657
- * @param sourceType (optional)
3658
- * @param sourceId (optional)
3659
- * @param sourceOwnerId (optional)
3660
- * @param sourceFile (optional)
6497
+ * @param body (optional) Render model with proof parameters.
3661
6498
  * @return Success
3662
6499
  */
3663
- createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, sourceFile, cancelToken) {
3664
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
3665
- if (itemType !== undefined && itemType !== null)
3666
- url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
6500
+ renderDesignProof(attachment, tenantId, body, cancelToken) {
6501
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
6502
+ if (attachment !== undefined && attachment !== null)
6503
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
3667
6504
  if (tenantId === null)
3668
6505
  throw new Error("The parameter 'tenantId' cannot be null.");
3669
6506
  else if (tenantId !== undefined)
3670
6507
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3671
6508
  url_ = url_.replace(/[?&]$/, "");
3672
- const content_ = new FormData();
3673
- if (sourceType !== null && sourceType !== undefined)
3674
- content_.append("sourceType", sourceType.toString());
3675
- if (sourceId !== null && sourceId !== undefined)
3676
- content_.append("sourceId", sourceId.toString());
3677
- if (sourceOwnerId !== null && sourceOwnerId !== undefined)
3678
- content_.append("sourceOwnerId", sourceOwnerId.toString());
3679
- if (sourceFile !== null && sourceFile !== undefined)
3680
- content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
6509
+ const content_ = JSON.stringify(body);
3681
6510
  let options_ = {
3682
6511
  data: content_,
6512
+ responseType: "blob",
3683
6513
  method: "POST",
3684
6514
  url: url_,
3685
6515
  headers: {
3686
- "Accept": "application/json"
6516
+ "Content-Type": "application/json",
6517
+ "Accept": "application/octet-stream"
3687
6518
  },
3688
6519
  cancelToken
3689
6520
  };
@@ -3697,10 +6528,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3697
6528
  throw _error;
3698
6529
  }
3699
6530
  }).then((_response) => {
3700
- return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
6531
+ return this.transformResult(url_, _response, (_response) => this.processRenderDesignProof(_response));
3701
6532
  });
3702
6533
  }
3703
- processCreateItem(response) {
6534
+ processRenderDesignProof(response) {
3704
6535
  const status = response.status;
3705
6536
  let _headers = {};
3706
6537
  if (response.headers && typeof response.headers === "object") {
@@ -3710,19 +6541,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3710
6541
  }
3711
6542
  }
3712
6543
  }
3713
- if (status === 200) {
3714
- const _responseText = response.data;
3715
- let result200 = null;
3716
- let resultData200 = _responseText;
3717
- result200 = JSON.parse(resultData200);
3718
- return Promise.resolve(result200);
3719
- }
3720
- else if (status === 404) {
3721
- const _responseText = response.data;
3722
- let result404 = null;
3723
- let resultData404 = _responseText;
3724
- result404 = JSON.parse(resultData404);
3725
- return throwException("Not Found", status, _responseText, _headers, result404);
6544
+ if (status === 200 || status === 206) {
6545
+ const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
6546
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
6547
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
6548
+ return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
3726
6549
  }
3727
6550
  else if (status === 401) {
3728
6551
  const _responseText = response.data;
@@ -3739,13 +6562,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3739
6562
  return Promise.resolve(null);
3740
6563
  }
3741
6564
  /**
3742
- * Extracts product item image.
6565
+ * Renders a design proof with the specified parameters and saves rendering result as resource.
3743
6566
  * @param tenantId (optional) Tenant identifier
3744
- * @param body (optional) Extraction parameters.
6567
+ * @param body (optional) Render model with preview parameters.
3745
6568
  * @return Success
3746
6569
  */
3747
- extractItemImage(tenantId, body, cancelToken) {
3748
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
6570
+ renderDesignProofToResource(tenantId, body, cancelToken) {
6571
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof/to-resource?";
3749
6572
  if (tenantId === null)
3750
6573
  throw new Error("The parameter 'tenantId' cannot be null.");
3751
6574
  else if (tenantId !== undefined)
@@ -3754,12 +6577,11 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3754
6577
  const content_ = JSON.stringify(body);
3755
6578
  let options_ = {
3756
6579
  data: content_,
3757
- responseType: "blob",
3758
6580
  method: "POST",
3759
6581
  url: url_,
3760
6582
  headers: {
3761
6583
  "Content-Type": "application/json",
3762
- "Accept": "application/octet-stream"
6584
+ "Accept": "application/json"
3763
6585
  },
3764
6586
  cancelToken
3765
6587
  };
@@ -3773,10 +6595,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3773
6595
  throw _error;
3774
6596
  }
3775
6597
  }).then((_response) => {
3776
- return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
6598
+ return this.transformResult(url_, _response, (_response) => this.processRenderDesignProofToResource(_response));
3777
6599
  });
3778
6600
  }
3779
- processExtractItemImage(response) {
6601
+ processRenderDesignProofToResource(response) {
3780
6602
  const status = response.status;
3781
6603
  let _headers = {};
3782
6604
  if (response.headers && typeof response.headers === "object") {
@@ -3786,11 +6608,19 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3786
6608
  }
3787
6609
  }
3788
6610
  }
3789
- if (status === 200 || status === 206) {
3790
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3791
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3792
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3793
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
6611
+ if (status === 200) {
6612
+ const _responseText = response.data;
6613
+ let result200 = null;
6614
+ let resultData200 = _responseText;
6615
+ result200 = JSON.parse(resultData200);
6616
+ return Promise.resolve(result200);
6617
+ }
6618
+ else if (status === 409) {
6619
+ const _responseText = response.data;
6620
+ let result409 = null;
6621
+ let resultData409 = _responseText;
6622
+ result409 = JSON.parse(resultData409);
6623
+ return throwException("Conflict", status, _responseText, _headers, result409);
3794
6624
  }
3795
6625
  else if (status === 401) {
3796
6626
  const _responseText = response.data;
@@ -3807,25 +6637,29 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3807
6637
  return Promise.resolve(null);
3808
6638
  }
3809
6639
  /**
3810
- * Flatten items.
6640
+ * Loads print-product from design file taken from storage.
6641
+ * @param id Design identifier.
6642
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3811
6643
  * @param tenantId (optional) Tenant identifier
3812
- * @param body (optional) Items to flatten.
3813
6644
  * @return Success
6645
+ * @deprecated
3814
6646
  */
3815
- flattenItems(tenantId, body, cancelToken) {
3816
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
6647
+ loadProduct(id, privateStorageOwner, tenantId, cancelToken) {
6648
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
6649
+ if (id === undefined || id === null)
6650
+ throw new Error("The parameter 'id' must be defined.");
6651
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6652
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6653
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3817
6654
  if (tenantId === null)
3818
6655
  throw new Error("The parameter 'tenantId' cannot be null.");
3819
6656
  else if (tenantId !== undefined)
3820
6657
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3821
6658
  url_ = url_.replace(/[?&]$/, "");
3822
- const content_ = JSON.stringify(body);
3823
6659
  let options_ = {
3824
- data: content_,
3825
- method: "POST",
6660
+ method: "GET",
3826
6661
  url: url_,
3827
6662
  headers: {
3828
- "Content-Type": "application/json",
3829
6663
  "Accept": "application/json"
3830
6664
  },
3831
6665
  cancelToken
@@ -3840,10 +6674,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3840
6674
  throw _error;
3841
6675
  }
3842
6676
  }).then((_response) => {
3843
- return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
6677
+ return this.transformResult(url_, _response, (_response) => this.processLoadProduct(_response));
3844
6678
  });
3845
6679
  }
3846
- processFlattenItems(response) {
6680
+ processLoadProduct(response) {
3847
6681
  const status = response.status;
3848
6682
  let _headers = {};
3849
6683
  if (response.headers && typeof response.headers === "object") {
@@ -3860,6 +6694,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3860
6694
  result200 = JSON.parse(resultData200);
3861
6695
  return Promise.resolve(result200);
3862
6696
  }
6697
+ else if (status === 404) {
6698
+ const _responseText = response.data;
6699
+ let result404 = null;
6700
+ let resultData404 = _responseText;
6701
+ result404 = JSON.parse(resultData404);
6702
+ return throwException("Not Found", status, _responseText, _headers, result404);
6703
+ }
3863
6704
  else if (status === 401) {
3864
6705
  const _responseText = response.data;
3865
6706
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3875,17 +6716,21 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3875
6716
  return Promise.resolve(null);
3876
6717
  }
3877
6718
  /**
3878
- * Render product proof image with specified parameters.
3879
- * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
3880
- (default value is 'false').
6719
+ * Saves print-product to design file and updates design file in storage.
6720
+ * @param id Design identifier.
6721
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3881
6722
  * @param tenantId (optional) Tenant identifier
3882
- * @param body (optional) Preview parameters.
6723
+ * @param body (optional) Serialized product description.
3883
6724
  * @return Success
6725
+ * @deprecated
3884
6726
  */
3885
- renderProduct(attachment, tenantId, body, cancelToken) {
3886
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/render-proof?";
3887
- if (attachment !== undefined && attachment !== null)
3888
- url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
6727
+ saveProduct(id, privateStorageOwner, tenantId, body, cancelToken) {
6728
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
6729
+ if (id === undefined || id === null)
6730
+ throw new Error("The parameter 'id' must be defined.");
6731
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6732
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6733
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3889
6734
  if (tenantId === null)
3890
6735
  throw new Error("The parameter 'tenantId' cannot be null.");
3891
6736
  else if (tenantId !== undefined)
@@ -3894,12 +6739,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3894
6739
  const content_ = JSON.stringify(body);
3895
6740
  let options_ = {
3896
6741
  data: content_,
3897
- responseType: "blob",
3898
- method: "POST",
6742
+ method: "PUT",
3899
6743
  url: url_,
3900
6744
  headers: {
3901
6745
  "Content-Type": "application/json",
3902
- "Accept": "application/octet-stream"
3903
6746
  },
3904
6747
  cancelToken
3905
6748
  };
@@ -3913,10 +6756,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3913
6756
  throw _error;
3914
6757
  }
3915
6758
  }).then((_response) => {
3916
- return this.transformResult(url_, _response, (_response) => this.processRenderProduct(_response));
6759
+ return this.transformResult(url_, _response, (_response) => this.processSaveProduct(_response));
3917
6760
  });
3918
6761
  }
3919
- processRenderProduct(response) {
6762
+ processSaveProduct(response) {
3920
6763
  const status = response.status;
3921
6764
  let _headers = {};
3922
6765
  if (response.headers && typeof response.headers === "object") {
@@ -3926,11 +6769,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3926
6769
  }
3927
6770
  }
3928
6771
  }
3929
- if (status === 200 || status === 206) {
3930
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
3931
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3932
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3933
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
6772
+ if (status === 200) {
6773
+ const _responseText = response.data;
6774
+ return Promise.resolve(null);
6775
+ }
6776
+ else if (status === 404) {
6777
+ const _responseText = response.data;
6778
+ let result404 = null;
6779
+ let resultData404 = _responseText;
6780
+ result404 = JSON.parse(resultData404);
6781
+ return throwException("Not Found", status, _responseText, _headers, result404);
3934
6782
  }
3935
6783
  else if (status === 401) {
3936
6784
  const _responseText = response.data;
@@ -3947,32 +6795,53 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3947
6795
  return Promise.resolve(null);
3948
6796
  }
3949
6797
  /**
3950
- * Renders a design preview with the specified parameters.
3951
- * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
3952
- (default value is 'false').
6798
+ * Patches print-product in design file.
6799
+ * @param id Design identifier.
6800
+ * @param privateStorageOwner (optional) Private storage owner identifier.
3953
6801
  * @param tenantId (optional) Tenant identifier
3954
- * @param body (optional) Render model with preview parameters.
6802
+ * @param patchType (optional)
6803
+ * @param replaceImageItemFileInfo_itemName (optional)
6804
+ * @param replaceImageItemFileInfo_sourceFile (optional)
6805
+ * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
6806
+ * @param replacePlaceholderItemContentInfo_newContentType (optional)
6807
+ * @param replacePlaceholderItemContentInfo_sourceFile (optional)
3955
6808
  * @return Success
6809
+ * @deprecated
3956
6810
  */
3957
- renderDesignPreview(attachment, tenantId, body, cancelToken) {
3958
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
3959
- if (attachment !== undefined && attachment !== null)
3960
- url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
6811
+ patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile, cancelToken) {
6812
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
6813
+ if (id === undefined || id === null)
6814
+ throw new Error("The parameter 'id' must be defined.");
6815
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6816
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6817
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3961
6818
  if (tenantId === null)
3962
6819
  throw new Error("The parameter 'tenantId' cannot be null.");
3963
6820
  else if (tenantId !== undefined)
3964
6821
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3965
6822
  url_ = url_.replace(/[?&]$/, "");
3966
- const content_ = JSON.stringify(body);
6823
+ const content_ = new FormData();
6824
+ if (patchType === null || patchType === undefined)
6825
+ throw new Error("The parameter 'patchType' cannot be null.");
6826
+ else
6827
+ content_.append("patchType", patchType.toString());
6828
+ if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
6829
+ content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
6830
+ if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
6831
+ content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
6832
+ if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
6833
+ content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
6834
+ if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
6835
+ throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
6836
+ else
6837
+ content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
6838
+ if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
6839
+ content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
3967
6840
  let options_ = {
3968
6841
  data: content_,
3969
- responseType: "blob",
3970
- method: "POST",
6842
+ method: "PATCH",
3971
6843
  url: url_,
3972
- headers: {
3973
- "Content-Type": "application/json",
3974
- "Accept": "application/octet-stream"
3975
- },
6844
+ headers: {},
3976
6845
  cancelToken
3977
6846
  };
3978
6847
  return this.transformOptions(options_).then(transformedOptions_ => {
@@ -3985,10 +6854,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3985
6854
  throw _error;
3986
6855
  }
3987
6856
  }).then((_response) => {
3988
- return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreview(_response));
6857
+ return this.transformResult(url_, _response, (_response) => this.processPatchProduct(_response));
3989
6858
  });
3990
6859
  }
3991
- processRenderDesignPreview(response) {
6860
+ processPatchProduct(response) {
3992
6861
  const status = response.status;
3993
6862
  let _headers = {};
3994
6863
  if (response.headers && typeof response.headers === "object") {
@@ -3998,11 +6867,16 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
3998
6867
  }
3999
6868
  }
4000
6869
  }
4001
- if (status === 200 || status === 206) {
4002
- const contentDisposition = response.headers ? response.headers["content-disposition"] : undefined;
4003
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4004
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4005
- return Promise.resolve({ fileName: fileName, status: status, data: new Blob([response.data]), headers: _headers });
6870
+ if (status === 200) {
6871
+ const _responseText = response.data;
6872
+ return Promise.resolve(null);
6873
+ }
6874
+ else if (status === 404) {
6875
+ const _responseText = response.data;
6876
+ let result404 = null;
6877
+ let resultData404 = _responseText;
6878
+ result404 = JSON.parse(resultData404);
6879
+ return throwException("Not Found", status, _responseText, _headers, result404);
4006
6880
  }
4007
6881
  else if (status === 401) {
4008
6882
  const _responseText = response.data;
@@ -4019,25 +6893,42 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4019
6893
  return Promise.resolve(null);
4020
6894
  }
4021
6895
  /**
4022
- * Renders a design preview with the specified parameters and saves rendering result as resource.
6896
+ * Creates print-product item.
6897
+ * @param itemType (optional) Desired item type.
4023
6898
  * @param tenantId (optional) Tenant identifier
4024
- * @param body (optional) Render model with preview parameters.
6899
+ * @param sourceType (optional)
6900
+ * @param sourceId (optional)
6901
+ * @param sourceOwnerId (optional)
6902
+ * @param url (optional)
6903
+ * @param sourceFile (optional)
4025
6904
  * @return Success
6905
+ * @deprecated
4026
6906
  */
4027
- renderDesignPreviewToResource(tenantId, body, cancelToken) {
4028
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview/to-resource?";
6907
+ createItem(itemType, tenantId, sourceType, sourceId, sourceOwnerId, url, sourceFile, cancelToken) {
6908
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items?";
6909
+ if (itemType !== undefined && itemType !== null)
6910
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4029
6911
  if (tenantId === null)
4030
6912
  throw new Error("The parameter 'tenantId' cannot be null.");
4031
6913
  else if (tenantId !== undefined)
4032
6914
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4033
6915
  url_ = url_.replace(/[?&]$/, "");
4034
- const content_ = JSON.stringify(body);
6916
+ const content_ = new FormData();
6917
+ if (sourceType !== null && sourceType !== undefined)
6918
+ content_.append("sourceType", sourceType.toString());
6919
+ if (sourceId !== null && sourceId !== undefined)
6920
+ content_.append("sourceId", sourceId.toString());
6921
+ if (sourceOwnerId !== null && sourceOwnerId !== undefined)
6922
+ content_.append("sourceOwnerId", sourceOwnerId.toString());
6923
+ if (url !== null && url !== undefined)
6924
+ content_.append("url", url.toString());
6925
+ if (sourceFile !== null && sourceFile !== undefined)
6926
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4035
6927
  let options_ = {
4036
6928
  data: content_,
4037
6929
  method: "POST",
4038
6930
  url: url_,
4039
6931
  headers: {
4040
- "Content-Type": "application/json",
4041
6932
  "Accept": "application/json"
4042
6933
  },
4043
6934
  cancelToken
@@ -4052,10 +6943,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4052
6943
  throw _error;
4053
6944
  }
4054
6945
  }).then((_response) => {
4055
- return this.transformResult(url_, _response, (_response) => this.processRenderDesignPreviewToResource(_response));
6946
+ return this.transformResult(url_, _response, (_response) => this.processCreateItem(_response));
4056
6947
  });
4057
6948
  }
4058
- processRenderDesignPreviewToResource(response) {
6949
+ processCreateItem(response) {
4059
6950
  const status = response.status;
4060
6951
  let _headers = {};
4061
6952
  if (response.headers && typeof response.headers === "object") {
@@ -4072,6 +6963,13 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4072
6963
  result200 = JSON.parse(resultData200);
4073
6964
  return Promise.resolve(result200);
4074
6965
  }
6966
+ else if (status === 404) {
6967
+ const _responseText = response.data;
6968
+ let result404 = null;
6969
+ let resultData404 = _responseText;
6970
+ result404 = JSON.parse(resultData404);
6971
+ return throwException("Not Found", status, _responseText, _headers, result404);
6972
+ }
4075
6973
  else if (status === 401) {
4076
6974
  const _responseText = response.data;
4077
6975
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4087,17 +6985,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4087
6985
  return Promise.resolve(null);
4088
6986
  }
4089
6987
  /**
4090
- * Renders a design proof with the specified parameters.
4091
- * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
4092
- (default value is 'false').
6988
+ * Extracts print-product item image.
4093
6989
  * @param tenantId (optional) Tenant identifier
4094
- * @param body (optional) Render model with proof parameters.
6990
+ * @param body (optional) Extraction parameters.
4095
6991
  * @return Success
6992
+ * @deprecated
4096
6993
  */
4097
- renderDesignProof(attachment, tenantId, body, cancelToken) {
4098
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
4099
- if (attachment !== undefined && attachment !== null)
4100
- url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
6994
+ extractItemImage(tenantId, body, cancelToken) {
6995
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
4101
6996
  if (tenantId === null)
4102
6997
  throw new Error("The parameter 'tenantId' cannot be null.");
4103
6998
  else if (tenantId !== undefined)
@@ -4125,10 +7020,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4125
7020
  throw _error;
4126
7021
  }
4127
7022
  }).then((_response) => {
4128
- return this.transformResult(url_, _response, (_response) => this.processRenderDesignProof(_response));
7023
+ return this.transformResult(url_, _response, (_response) => this.processExtractItemImage(_response));
4129
7024
  });
4130
7025
  }
4131
- processRenderDesignProof(response) {
7026
+ processExtractItemImage(response) {
4132
7027
  const status = response.status;
4133
7028
  let _headers = {};
4134
7029
  if (response.headers && typeof response.headers === "object") {
@@ -4159,13 +7054,14 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4159
7054
  return Promise.resolve(null);
4160
7055
  }
4161
7056
  /**
4162
- * Renders a design proof with the specified parameters and saves rendering result as resource.
7057
+ * Flattens print-product items.
4163
7058
  * @param tenantId (optional) Tenant identifier
4164
- * @param body (optional) Render model with preview parameters.
7059
+ * @param body (optional) Items to flatten.
4165
7060
  * @return Success
7061
+ * @deprecated
4166
7062
  */
4167
- renderDesignProofToResource(tenantId, body, cancelToken) {
4168
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof/to-resource?";
7063
+ flattenItems(tenantId, body, cancelToken) {
7064
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
4169
7065
  if (tenantId === null)
4170
7066
  throw new Error("The parameter 'tenantId' cannot be null.");
4171
7067
  else if (tenantId !== undefined)
@@ -4192,10 +7088,10 @@ export class DesignAtomsServiceApiClient extends ApiClientBase {
4192
7088
  throw _error;
4193
7089
  }
4194
7090
  }).then((_response) => {
4195
- return this.transformResult(url_, _response, (_response) => this.processRenderDesignProofToResource(_response));
7091
+ return this.transformResult(url_, _response, (_response) => this.processFlattenItems(_response));
4196
7092
  });
4197
7093
  }
4198
- processRenderDesignProofToResource(response) {
7094
+ processFlattenItems(response) {
4199
7095
  const status = response.status;
4200
7096
  let _headers = {};
4201
7097
  if (response.headers && typeof response.headers === "object") {
@@ -6298,6 +9194,7 @@ export var ItemSourceType;
6298
9194
  ItemSourceType["File"] = "File";
6299
9195
  ItemSourceType["ImageStorage"] = "ImageStorage";
6300
9196
  ItemSourceType["PrivateImageStorage"] = "PrivateImageStorage";
9197
+ ItemSourceType["Url"] = "Url";
6301
9198
  })(ItemSourceType || (ItemSourceType = {}));
6302
9199
  export var ItemType;
6303
9200
  (function (ItemType) {