@aurigma/ng-design-atoms-api-client 2.64.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.
@@ -2814,11 +2814,11 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
2814
2814
  return throwException("Not Found", status, _responseText, _headers, result404);
2815
2815
  }));
2816
2816
  }
2817
- else if (status === 422) {
2817
+ else if (status === 409) {
2818
2818
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2819
- let result422 = null;
2820
- result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2821
- return throwException("Client Error", status, _responseText, _headers, result422);
2819
+ let result409 = null;
2820
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2821
+ return throwException("Conflict", status, _responseText, _headers, result409);
2822
2822
  }));
2823
2823
  }
2824
2824
  else if (status === 401) {
@@ -2904,11 +2904,11 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
2904
2904
  return throwException("Not Found", status, _responseText, _headers, result404);
2905
2905
  }));
2906
2906
  }
2907
- else if (status === 422) {
2907
+ else if (status === 409) {
2908
2908
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2909
- let result422 = null;
2910
- result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2911
- return throwException("Client Error", status, _responseText, _headers, result422);
2909
+ let result409 = null;
2910
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2911
+ return throwException("Conflict", status, _responseText, _headers, result409);
2912
2912
  }));
2913
2913
  }
2914
2914
  else if (status === 401) {
@@ -2994,11 +2994,11 @@ class DesignAtomsMockups3dApiClient extends ApiClientBase {
2994
2994
  return throwException("Not Found", status, _responseText, _headers, result404);
2995
2995
  }));
2996
2996
  }
2997
- else if (status === 422) {
2997
+ else if (status === 409) {
2998
2998
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2999
- let result422 = null;
3000
- result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3001
- return throwException("Client Error", status, _responseText, _headers, result422);
2999
+ let result409 = null;
3000
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3001
+ return throwException("Conflict", status, _responseText, _headers, result409);
3002
3002
  }));
3003
3003
  }
3004
3004
  else if (status === 401) {
@@ -3030,7 +3030,7 @@ DesignAtomsMockups3dApiClient.ctorParameters = () => [
3030
3030
  { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
3031
3031
  { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
3032
3032
  ];
3033
- class DesignAtomsServiceApiClient extends ApiClientBase {
3033
+ class DesignAtomsPrintProductApiClient extends ApiClientBase {
3034
3034
  constructor(configuration, http, baseUrl) {
3035
3035
  super(configuration);
3036
3036
  this.jsonParseReviver = undefined;
@@ -3038,14 +3038,23 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3038
3038
  this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
3039
3039
  }
3040
3040
  /**
3041
- * Creates new design file with specified parameters and saves it in storage.
3041
+ * Patches a print-product of the specified design file.
3042
+ * @param id Design identifier.
3042
3043
  * @param privateStorageOwner (optional) Private storage owner identifier.
3043
3044
  * @param tenantId (optional) Tenant identifier
3044
- * @param body (optional) Design creation parameters.
3045
- * @return Created
3045
+ * @param patchType (optional)
3046
+ * @param replaceImageItemFileInfo_itemName (optional)
3047
+ * @param replaceImageItemFileInfo_sourceFile (optional)
3048
+ * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
3049
+ * @param replacePlaceholderItemContentInfo_newContentType (optional)
3050
+ * @param replacePlaceholderItemContentInfo_sourceFile (optional)
3051
+ * @return No Content
3046
3052
  */
3047
- createDesign(privateStorageOwner, tenantId, body) {
3048
- let url_ = this.baseUrl + "/api/atoms/v1/designs?";
3053
+ patchDesignProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile) {
3054
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product?";
3055
+ if (id === undefined || id === null)
3056
+ throw new Error("The parameter 'id' must be defined.");
3057
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3049
3058
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3050
3059
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3051
3060
  if (tenantId === null)
@@ -3053,24 +3062,37 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3053
3062
  else if (tenantId !== undefined)
3054
3063
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3055
3064
  url_ = url_.replace(/[?&]$/, "");
3056
- const content_ = JSON.stringify(body);
3065
+ const content_ = new FormData();
3066
+ if (patchType === null || patchType === undefined)
3067
+ throw new Error("The parameter 'patchType' cannot be null.");
3068
+ else
3069
+ content_.append("patchType", patchType.toString());
3070
+ if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
3071
+ content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
3072
+ if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
3073
+ content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
3074
+ if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
3075
+ content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
3076
+ if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
3077
+ throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
3078
+ else
3079
+ content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
3080
+ if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
3081
+ content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
3057
3082
  let options_ = {
3058
3083
  body: content_,
3059
3084
  observe: "response",
3060
3085
  responseType: "blob",
3061
- headers: new HttpHeaders({
3062
- "Content-Type": "application/json",
3063
- "Accept": "application/json"
3064
- })
3086
+ headers: new HttpHeaders({})
3065
3087
  };
3066
3088
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3067
- return this.http.request("post", url_, transformedOptions_);
3089
+ return this.http.request("patch", url_, transformedOptions_);
3068
3090
  })).pipe(mergeMap((response_) => {
3069
- return this.transformResult(url_, response_, (r) => this.processCreateDesign(r));
3091
+ return this.transformResult(url_, response_, (r) => this.processPatchDesignProduct(r));
3070
3092
  })).pipe(catchError((response_) => {
3071
3093
  if (response_ instanceof HttpResponseBase) {
3072
3094
  try {
3073
- return this.transformResult(url_, response_, (r) => this.processCreateDesign(r));
3095
+ return this.transformResult(url_, response_, (r) => this.processPatchDesignProduct(r));
3074
3096
  }
3075
3097
  catch (e) {
3076
3098
  return throwError(e);
@@ -3080,7 +3102,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3080
3102
  return throwError(response_);
3081
3103
  }));
3082
3104
  }
3083
- processCreateDesign(response) {
3105
+ processPatchDesignProduct(response) {
3084
3106
  const status = response.status;
3085
3107
  const responseBlob = response instanceof HttpResponse ? response.body :
3086
3108
  response.error instanceof Blob ? response.error : undefined;
@@ -3090,11 +3112,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3090
3112
  _headers[key] = response.headers.get(key);
3091
3113
  }
3092
3114
  }
3093
- if (status === 201) {
3115
+ if (status === 204) {
3094
3116
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3095
- let result201 = null;
3096
- result201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3097
- return of(result201);
3117
+ return of(null);
3118
+ }));
3119
+ }
3120
+ else if (status === 404) {
3121
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3122
+ let result404 = null;
3123
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3124
+ return throwException("Not Found", status, _responseText, _headers, result404);
3098
3125
  }));
3099
3126
  }
3100
3127
  else if (status === 401) {
@@ -3115,20 +3142,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3115
3142
  return of(null);
3116
3143
  }
3117
3144
  /**
3118
- * Returns content of the background.
3145
+ * Returns a print-product of the specified design file as a json-serialized model.
3119
3146
  * @param id Design identifier.
3120
- * @param surfaceIndex (optional) Surface index.
3121
3147
  * @param privateStorageOwner (optional) Private storage owner identifier.
3122
3148
  * @param tenantId (optional) Tenant identifier
3123
3149
  * @return Success
3124
3150
  */
3125
- extractBackground(id, surfaceIndex, privateStorageOwner, tenantId) {
3126
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
3151
+ getDesignProductModel(id, privateStorageOwner, tenantId) {
3152
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
3127
3153
  if (id === undefined || id === null)
3128
3154
  throw new Error("The parameter 'id' must be defined.");
3129
3155
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3130
- if (surfaceIndex !== undefined && surfaceIndex !== null)
3131
- url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
3132
3156
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3133
3157
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3134
3158
  if (tenantId === null)
@@ -3140,17 +3164,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3140
3164
  observe: "response",
3141
3165
  responseType: "blob",
3142
3166
  headers: new HttpHeaders({
3143
- "Accept": "application/octet-stream"
3167
+ "Accept": "application/json"
3144
3168
  })
3145
3169
  };
3146
3170
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3147
3171
  return this.http.request("get", url_, transformedOptions_);
3148
3172
  })).pipe(mergeMap((response_) => {
3149
- return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
3173
+ return this.transformResult(url_, response_, (r) => this.processGetDesignProductModel(r));
3150
3174
  })).pipe(catchError((response_) => {
3151
3175
  if (response_ instanceof HttpResponseBase) {
3152
3176
  try {
3153
- return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
3177
+ return this.transformResult(url_, response_, (r) => this.processGetDesignProductModel(r));
3154
3178
  }
3155
3179
  catch (e) {
3156
3180
  return throwError(e);
@@ -3160,7 +3184,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3160
3184
  return throwError(response_);
3161
3185
  }));
3162
3186
  }
3163
- processExtractBackground(response) {
3187
+ processGetDesignProductModel(response) {
3164
3188
  const status = response.status;
3165
3189
  const responseBlob = response instanceof HttpResponse ? response.body :
3166
3190
  response.error instanceof Blob ? response.error : undefined;
@@ -3170,11 +3194,12 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3170
3194
  _headers[key] = response.headers.get(key);
3171
3195
  }
3172
3196
  }
3173
- if (status === 200 || status === 206) {
3174
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
3175
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3176
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3177
- return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
3197
+ if (status === 200) {
3198
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3199
+ let result200 = null;
3200
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3201
+ return of(result200);
3202
+ }));
3178
3203
  }
3179
3204
  else if (status === 404) {
3180
3205
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
@@ -3183,13 +3208,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3183
3208
  return throwException("Not Found", status, _responseText, _headers, result404);
3184
3209
  }));
3185
3210
  }
3186
- else if (status === 422) {
3187
- return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3188
- let result422 = null;
3189
- result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3190
- return throwException("Client Error", status, _responseText, _headers, result422);
3191
- }));
3192
- }
3193
3211
  else if (status === 401) {
3194
3212
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3195
3213
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3208,14 +3226,15 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3208
3226
  return of(null);
3209
3227
  }
3210
3228
  /**
3211
- * Loads product (design model) from design file taken from storage.
3229
+ * Saves a print-product provided as a json-serialized model to the specified design file.
3212
3230
  * @param id Design identifier.
3213
3231
  * @param privateStorageOwner (optional) Private storage owner identifier.
3214
3232
  * @param tenantId (optional) Tenant identifier
3215
- * @return Success
3233
+ * @param body (optional) Serialized print-product description.
3234
+ * @return No Content
3216
3235
  */
3217
- loadProduct(id, privateStorageOwner, tenantId) {
3218
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
3236
+ updateDesignProductModel(id, privateStorageOwner, tenantId, body) {
3237
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/model?";
3219
3238
  if (id === undefined || id === null)
3220
3239
  throw new Error("The parameter 'id' must be defined.");
3221
3240
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -3226,21 +3245,23 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3226
3245
  else if (tenantId !== undefined)
3227
3246
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3228
3247
  url_ = url_.replace(/[?&]$/, "");
3248
+ const content_ = JSON.stringify(body);
3229
3249
  let options_ = {
3250
+ body: content_,
3230
3251
  observe: "response",
3231
3252
  responseType: "blob",
3232
3253
  headers: new HttpHeaders({
3233
- "Accept": "application/json"
3254
+ "Content-Type": "application/json",
3234
3255
  })
3235
3256
  };
3236
3257
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3237
- return this.http.request("get", url_, transformedOptions_);
3258
+ return this.http.request("put", url_, transformedOptions_);
3238
3259
  })).pipe(mergeMap((response_) => {
3239
- return this.transformResult(url_, response_, (r) => this.processLoadProduct(r));
3260
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignProductModel(r));
3240
3261
  })).pipe(catchError((response_) => {
3241
3262
  if (response_ instanceof HttpResponseBase) {
3242
3263
  try {
3243
- return this.transformResult(url_, response_, (r) => this.processLoadProduct(r));
3264
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignProductModel(r));
3244
3265
  }
3245
3266
  catch (e) {
3246
3267
  return throwError(e);
@@ -3250,7 +3271,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3250
3271
  return throwError(response_);
3251
3272
  }));
3252
3273
  }
3253
- processLoadProduct(response) {
3274
+ processUpdateDesignProductModel(response) {
3254
3275
  const status = response.status;
3255
3276
  const responseBlob = response instanceof HttpResponse ? response.body :
3256
3277
  response.error instanceof Blob ? response.error : undefined;
@@ -3260,11 +3281,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3260
3281
  _headers[key] = response.headers.get(key);
3261
3282
  }
3262
3283
  }
3263
- if (status === 200) {
3284
+ if (status === 204) {
3264
3285
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3265
- let result200 = null;
3266
- result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3267
- return of(result200);
3286
+ return of(null);
3268
3287
  }));
3269
3288
  }
3270
3289
  else if (status === 404) {
@@ -3292,18 +3311,20 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3292
3311
  return of(null);
3293
3312
  }
3294
3313
  /**
3295
- * Saves product (design model) to design file and updates design in storage.
3314
+ * Returns a list of print-area descriptions of the specified design file.
3296
3315
  * @param id Design identifier.
3316
+ * @param surfaceId (optional)
3297
3317
  * @param privateStorageOwner (optional) Private storage owner identifier.
3298
3318
  * @param tenantId (optional) Tenant identifier
3299
- * @param body (optional) Serialized product description.
3300
3319
  * @return Success
3301
3320
  */
3302
- saveProduct(id, privateStorageOwner, tenantId, body) {
3303
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
3321
+ getDesignPrintAreas(id, surfaceId, privateStorageOwner, tenantId) {
3322
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas?";
3304
3323
  if (id === undefined || id === null)
3305
3324
  throw new Error("The parameter 'id' must be defined.");
3306
3325
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3326
+ if (surfaceId !== undefined && surfaceId !== null)
3327
+ url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
3307
3328
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3308
3329
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3309
3330
  if (tenantId === null)
@@ -3311,23 +3332,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3311
3332
  else if (tenantId !== undefined)
3312
3333
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3313
3334
  url_ = url_.replace(/[?&]$/, "");
3314
- const content_ = JSON.stringify(body);
3315
3335
  let options_ = {
3316
- body: content_,
3317
3336
  observe: "response",
3318
3337
  responseType: "blob",
3319
3338
  headers: new HttpHeaders({
3320
- "Content-Type": "application/json",
3339
+ "Accept": "application/json"
3321
3340
  })
3322
3341
  };
3323
3342
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3324
- return this.http.request("put", url_, transformedOptions_);
3343
+ return this.http.request("get", url_, transformedOptions_);
3325
3344
  })).pipe(mergeMap((response_) => {
3326
- return this.transformResult(url_, response_, (r) => this.processSaveProduct(r));
3345
+ return this.transformResult(url_, response_, (r) => this.processGetDesignPrintAreas(r));
3327
3346
  })).pipe(catchError((response_) => {
3328
3347
  if (response_ instanceof HttpResponseBase) {
3329
3348
  try {
3330
- return this.transformResult(url_, response_, (r) => this.processSaveProduct(r));
3349
+ return this.transformResult(url_, response_, (r) => this.processGetDesignPrintAreas(r));
3331
3350
  }
3332
3351
  catch (e) {
3333
3352
  return throwError(e);
@@ -3337,7 +3356,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3337
3356
  return throwError(response_);
3338
3357
  }));
3339
3358
  }
3340
- processSaveProduct(response) {
3359
+ processGetDesignPrintAreas(response) {
3341
3360
  const status = response.status;
3342
3361
  const responseBlob = response instanceof HttpResponse ? response.body :
3343
3362
  response.error instanceof Blob ? response.error : undefined;
@@ -3349,7 +3368,9 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3349
3368
  }
3350
3369
  if (status === 200) {
3351
3370
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3352
- return of(null);
3371
+ let result200 = null;
3372
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3373
+ return of(result200);
3353
3374
  }));
3354
3375
  }
3355
3376
  else if (status === 404) {
@@ -3377,23 +3398,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3377
3398
  return of(null);
3378
3399
  }
3379
3400
  /**
3380
- * Patches product (design model) in design file.
3401
+ * Deletes a specified print-area in an existing design file.
3381
3402
  * @param id Design identifier.
3403
+ * @param printAreaId Design print-area identifier.
3382
3404
  * @param privateStorageOwner (optional) Private storage owner identifier.
3383
3405
  * @param tenantId (optional) Tenant identifier
3384
- * @param patchType (optional)
3385
- * @param replaceImageItemFileInfo_itemName (optional)
3386
- * @param replaceImageItemFileInfo_sourceFile (optional)
3387
- * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
3388
- * @param replacePlaceholderItemContentInfo_newContentType (optional)
3389
- * @param replacePlaceholderItemContentInfo_sourceFile (optional)
3390
- * @return Success
3406
+ * @return No Content
3391
3407
  */
3392
- patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile) {
3393
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
3408
+ deleteDesignPrintArea(id, printAreaId, privateStorageOwner, tenantId) {
3409
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}?";
3394
3410
  if (id === undefined || id === null)
3395
3411
  throw new Error("The parameter 'id' must be defined.");
3396
3412
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3413
+ if (printAreaId === undefined || printAreaId === null)
3414
+ throw new Error("The parameter 'printAreaId' must be defined.");
3415
+ url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
3397
3416
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3398
3417
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3399
3418
  if (tenantId === null)
@@ -3401,37 +3420,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3401
3420
  else if (tenantId !== undefined)
3402
3421
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3403
3422
  url_ = url_.replace(/[?&]$/, "");
3404
- const content_ = new FormData();
3405
- if (patchType === null || patchType === undefined)
3406
- throw new Error("The parameter 'patchType' cannot be null.");
3407
- else
3408
- content_.append("patchType", patchType.toString());
3409
- if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
3410
- content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
3411
- if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
3412
- content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
3413
- if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
3414
- content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
3415
- if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
3416
- throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
3417
- else
3418
- content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
3419
- if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
3420
- content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
3421
3423
  let options_ = {
3422
- body: content_,
3423
3424
  observe: "response",
3424
3425
  responseType: "blob",
3425
3426
  headers: new HttpHeaders({})
3426
3427
  };
3427
3428
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3428
- return this.http.request("patch", url_, transformedOptions_);
3429
+ return this.http.request("delete", url_, transformedOptions_);
3429
3430
  })).pipe(mergeMap((response_) => {
3430
- return this.transformResult(url_, response_, (r) => this.processPatchProduct(r));
3431
+ return this.transformResult(url_, response_, (r) => this.processDeleteDesignPrintArea(r));
3431
3432
  })).pipe(catchError((response_) => {
3432
3433
  if (response_ instanceof HttpResponseBase) {
3433
3434
  try {
3434
- return this.transformResult(url_, response_, (r) => this.processPatchProduct(r));
3435
+ return this.transformResult(url_, response_, (r) => this.processDeleteDesignPrintArea(r));
3435
3436
  }
3436
3437
  catch (e) {
3437
3438
  return throwError(e);
@@ -3441,7 +3442,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3441
3442
  return throwError(response_);
3442
3443
  }));
3443
3444
  }
3444
- processPatchProduct(response) {
3445
+ processDeleteDesignPrintArea(response) {
3445
3446
  const status = response.status;
3446
3447
  const responseBlob = response instanceof HttpResponse ? response.body :
3447
3448
  response.error instanceof Blob ? response.error : undefined;
@@ -3451,7 +3452,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3451
3452
  _headers[key] = response.headers.get(key);
3452
3453
  }
3453
3454
  }
3454
- if (status === 200) {
3455
+ if (status === 204) {
3455
3456
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3456
3457
  return of(null);
3457
3458
  }));
@@ -3463,6 +3464,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3463
3464
  return throwException("Not Found", status, _responseText, _headers, result404);
3464
3465
  }));
3465
3466
  }
3467
+ else if (status === 409) {
3468
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3469
+ let result409 = null;
3470
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3471
+ return throwException("Conflict", status, _responseText, _headers, result409);
3472
+ }));
3473
+ }
3466
3474
  else if (status === 401) {
3467
3475
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3468
3476
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3481,17 +3489,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3481
3489
  return of(null);
3482
3490
  }
3483
3491
  /**
3484
- * Returns design parameters stored in product model.
3492
+ * Returns a print-area of the specified design file as a json-serialized model.
3485
3493
  * @param id Design identifier.
3494
+ * @param printAreaId Design print-area identifier.
3486
3495
  * @param privateStorageOwner (optional) Private storage owner identifier.
3487
3496
  * @param tenantId (optional) Tenant identifier
3488
3497
  * @return Success
3489
3498
  */
3490
- getDesignParameters(id, privateStorageOwner, tenantId) {
3491
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
3499
+ getDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId) {
3500
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
3492
3501
  if (id === undefined || id === null)
3493
3502
  throw new Error("The parameter 'id' must be defined.");
3494
3503
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3504
+ if (printAreaId === undefined || printAreaId === null)
3505
+ throw new Error("The parameter 'printAreaId' must be defined.");
3506
+ url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
3495
3507
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3496
3508
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3497
3509
  if (tenantId === null)
@@ -3509,11 +3521,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3509
3521
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3510
3522
  return this.http.request("get", url_, transformedOptions_);
3511
3523
  })).pipe(mergeMap((response_) => {
3512
- return this.transformResult(url_, response_, (r) => this.processGetDesignParameters(r));
3524
+ return this.transformResult(url_, response_, (r) => this.processGetDesignPrintAreaModel(r));
3513
3525
  })).pipe(catchError((response_) => {
3514
3526
  if (response_ instanceof HttpResponseBase) {
3515
3527
  try {
3516
- return this.transformResult(url_, response_, (r) => this.processGetDesignParameters(r));
3528
+ return this.transformResult(url_, response_, (r) => this.processGetDesignPrintAreaModel(r));
3517
3529
  }
3518
3530
  catch (e) {
3519
3531
  return throwError(e);
@@ -3523,7 +3535,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3523
3535
  return throwError(response_);
3524
3536
  }));
3525
3537
  }
3526
- processGetDesignParameters(response) {
3538
+ processGetDesignPrintAreaModel(response) {
3527
3539
  const status = response.status;
3528
3540
  const responseBlob = response instanceof HttpResponse ? response.body :
3529
3541
  response.error instanceof Blob ? response.error : undefined;
@@ -3547,6 +3559,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3547
3559
  return throwException("Not Found", status, _responseText, _headers, result404);
3548
3560
  }));
3549
3561
  }
3562
+ else if (status === 409) {
3563
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3564
+ let result409 = null;
3565
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3566
+ return throwException("Conflict", status, _responseText, _headers, result409);
3567
+ }));
3568
+ }
3550
3569
  else if (status === 401) {
3551
3570
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3552
3571
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3565,17 +3584,22 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3565
3584
  return of(null);
3566
3585
  }
3567
3586
  /**
3568
- * Loads data schema from design file taken from storage.
3587
+ * Updates a specified print-area in an existing design file with the data provided as a json-serialized print-area model.
3569
3588
  * @param id Design identifier.
3589
+ * @param printAreaId Design print-area identifier.
3570
3590
  * @param privateStorageOwner (optional) Private storage owner identifier.
3571
3591
  * @param tenantId (optional) Tenant identifier
3592
+ * @param body (optional) Updated print-area model.
3572
3593
  * @return Success
3573
3594
  */
3574
- loadDataSchema(id, privateStorageOwner, tenantId) {
3575
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
3595
+ updateDesignPrintAreaModel(id, printAreaId, privateStorageOwner, tenantId, body) {
3596
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/{printAreaId}/model?";
3576
3597
  if (id === undefined || id === null)
3577
3598
  throw new Error("The parameter 'id' must be defined.");
3578
3599
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3600
+ if (printAreaId === undefined || printAreaId === null)
3601
+ throw new Error("The parameter 'printAreaId' must be defined.");
3602
+ url_ = url_.replace("{printAreaId}", encodeURIComponent("" + printAreaId));
3579
3603
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3580
3604
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3581
3605
  if (tenantId === null)
@@ -3583,21 +3607,24 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3583
3607
  else if (tenantId !== undefined)
3584
3608
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3585
3609
  url_ = url_.replace(/[?&]$/, "");
3610
+ const content_ = JSON.stringify(body);
3586
3611
  let options_ = {
3612
+ body: content_,
3587
3613
  observe: "response",
3588
3614
  responseType: "blob",
3589
3615
  headers: new HttpHeaders({
3590
- "Accept": "application/octet-stream"
3616
+ "Content-Type": "application/json",
3617
+ "Accept": "application/json"
3591
3618
  })
3592
3619
  };
3593
3620
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3594
- return this.http.request("get", url_, transformedOptions_);
3621
+ return this.http.request("put", url_, transformedOptions_);
3595
3622
  })).pipe(mergeMap((response_) => {
3596
- return this.transformResult(url_, response_, (r) => this.processLoadDataSchema(r));
3623
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignPrintAreaModel(r));
3597
3624
  })).pipe(catchError((response_) => {
3598
3625
  if (response_ instanceof HttpResponseBase) {
3599
3626
  try {
3600
- return this.transformResult(url_, response_, (r) => this.processLoadDataSchema(r));
3627
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignPrintAreaModel(r));
3601
3628
  }
3602
3629
  catch (e) {
3603
3630
  return throwError(e);
@@ -3607,7 +3634,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3607
3634
  return throwError(response_);
3608
3635
  }));
3609
3636
  }
3610
- processLoadDataSchema(response) {
3637
+ processUpdateDesignPrintAreaModel(response) {
3611
3638
  const status = response.status;
3612
3639
  const responseBlob = response instanceof HttpResponse ? response.body :
3613
3640
  response.error instanceof Blob ? response.error : undefined;
@@ -3617,11 +3644,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3617
3644
  _headers[key] = response.headers.get(key);
3618
3645
  }
3619
3646
  }
3620
- if (status === 200 || status === 206) {
3621
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
3622
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3623
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3624
- return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
3647
+ if (status === 200) {
3648
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3649
+ let result200 = null;
3650
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3651
+ return of(result200);
3652
+ }));
3653
+ }
3654
+ else if (status === 400) {
3655
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3656
+ let result400 = null;
3657
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3658
+ return throwException("Bad Request", status, _responseText, _headers, result400);
3659
+ }));
3625
3660
  }
3626
3661
  else if (status === 404) {
3627
3662
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
@@ -3655,17 +3690,22 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3655
3690
  return of(null);
3656
3691
  }
3657
3692
  /**
3658
- * Loads a toggle set from design file taken from storage.
3693
+ * Inserts a new print-area provided as a json-serialized model at the specified position in an existing design file.
3694
+ Print-area identifier will be reset by auto-generated value to prevent identifiers collisions.
3659
3695
  * @param id Design identifier.
3696
+ * @param surfaceId (optional) Parent surface identifier.
3660
3697
  * @param privateStorageOwner (optional) Private storage owner identifier.
3661
3698
  * @param tenantId (optional) Tenant identifier
3699
+ * @param body (optional) New print-area model.
3662
3700
  * @return Success
3663
3701
  */
3664
- loadToggleSet(id, privateStorageOwner, tenantId) {
3665
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
3702
+ addDesignPrintAreaModel(id, surfaceId, privateStorageOwner, tenantId, body) {
3703
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/print-areas/model?";
3666
3704
  if (id === undefined || id === null)
3667
3705
  throw new Error("The parameter 'id' must be defined.");
3668
3706
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3707
+ if (surfaceId !== undefined && surfaceId !== null)
3708
+ url_ += "surfaceId=" + encodeURIComponent("" + surfaceId) + "&";
3669
3709
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3670
3710
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3671
3711
  if (tenantId === null)
@@ -3673,21 +3713,24 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3673
3713
  else if (tenantId !== undefined)
3674
3714
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3675
3715
  url_ = url_.replace(/[?&]$/, "");
3716
+ const content_ = JSON.stringify(body);
3676
3717
  let options_ = {
3718
+ body: content_,
3677
3719
  observe: "response",
3678
3720
  responseType: "blob",
3679
3721
  headers: new HttpHeaders({
3680
- "Accept": "application/octet-stream"
3722
+ "Content-Type": "application/json",
3723
+ "Accept": "application/json"
3681
3724
  })
3682
3725
  };
3683
3726
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3684
- return this.http.request("get", url_, transformedOptions_);
3727
+ return this.http.request("post", url_, transformedOptions_);
3685
3728
  })).pipe(mergeMap((response_) => {
3686
- return this.transformResult(url_, response_, (r) => this.processLoadToggleSet(r));
3729
+ return this.transformResult(url_, response_, (r) => this.processAddDesignPrintAreaModel(r));
3687
3730
  })).pipe(catchError((response_) => {
3688
3731
  if (response_ instanceof HttpResponseBase) {
3689
3732
  try {
3690
- return this.transformResult(url_, response_, (r) => this.processLoadToggleSet(r));
3733
+ return this.transformResult(url_, response_, (r) => this.processAddDesignPrintAreaModel(r));
3691
3734
  }
3692
3735
  catch (e) {
3693
3736
  return throwError(e);
@@ -3697,7 +3740,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3697
3740
  return throwError(response_);
3698
3741
  }));
3699
3742
  }
3700
- processLoadToggleSet(response) {
3743
+ processAddDesignPrintAreaModel(response) {
3701
3744
  const status = response.status;
3702
3745
  const responseBlob = response instanceof HttpResponse ? response.body :
3703
3746
  response.error instanceof Blob ? response.error : undefined;
@@ -3707,11 +3750,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3707
3750
  _headers[key] = response.headers.get(key);
3708
3751
  }
3709
3752
  }
3710
- if (status === 200 || status === 206) {
3711
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
3712
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
3713
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
3714
- return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
3753
+ if (status === 200) {
3754
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3755
+ let result200 = null;
3756
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3757
+ return of(result200);
3758
+ }));
3759
+ }
3760
+ else if (status === 400) {
3761
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3762
+ let result400 = null;
3763
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3764
+ return throwException("Bad Request", status, _responseText, _headers, result400);
3765
+ }));
3715
3766
  }
3716
3767
  else if (status === 404) {
3717
3768
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
@@ -3720,13 +3771,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3720
3771
  return throwException("Not Found", status, _responseText, _headers, result404);
3721
3772
  }));
3722
3773
  }
3723
- else if (status === 409) {
3724
- return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3725
- let result409 = null;
3726
- result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3727
- return throwException("Conflict", status, _responseText, _headers, result409);
3728
- }));
3729
- }
3730
3774
  else if (status === 401) {
3731
3775
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3732
3776
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3745,14 +3789,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3745
3789
  return of(null);
3746
3790
  }
3747
3791
  /**
3748
- * Gets variable items information for design file taken from storage.
3792
+ * Returns a list of print-product surfaces descriptions of the specified design file.
3749
3793
  * @param id Design identifier.
3750
3794
  * @param privateStorageOwner (optional) Private storage owner identifier.
3751
3795
  * @param tenantId (optional) Tenant identifier
3752
3796
  * @return Success
3753
3797
  */
3754
- getVariables(id, privateStorageOwner, tenantId) {
3755
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
3798
+ getDesignSurfaces(id, privateStorageOwner, tenantId) {
3799
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces?";
3756
3800
  if (id === undefined || id === null)
3757
3801
  throw new Error("The parameter 'id' must be defined.");
3758
3802
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
@@ -3773,11 +3817,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3773
3817
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3774
3818
  return this.http.request("get", url_, transformedOptions_);
3775
3819
  })).pipe(mergeMap((response_) => {
3776
- return this.transformResult(url_, response_, (r) => this.processGetVariables(r));
3820
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaces(r));
3777
3821
  })).pipe(catchError((response_) => {
3778
3822
  if (response_ instanceof HttpResponseBase) {
3779
3823
  try {
3780
- return this.transformResult(url_, response_, (r) => this.processGetVariables(r));
3824
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaces(r));
3781
3825
  }
3782
3826
  catch (e) {
3783
3827
  return throwError(e);
@@ -3787,7 +3831,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3787
3831
  return throwError(response_);
3788
3832
  }));
3789
3833
  }
3790
- processGetVariables(response) {
3834
+ processGetDesignSurfaces(response) {
3791
3835
  const status = response.status;
3792
3836
  const responseBlob = response instanceof HttpResponse ? response.body :
3793
3837
  response.error instanceof Blob ? response.error : undefined;
@@ -3829,18 +3873,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3829
3873
  return of(null);
3830
3874
  }
3831
3875
  /**
3832
- * Sets variable items values for design file taken from storage.
3876
+ * Deletes a specified print-product surface in an existing design file.
3833
3877
  * @param id Design identifier.
3878
+ * @param surfaceId Surface identifier.
3834
3879
  * @param privateStorageOwner (optional) Private storage owner identifier.
3835
3880
  * @param tenantId (optional) Tenant identifier
3836
- * @param body (optional) Design variable values.
3837
- * @return Success
3881
+ * @return No Content
3838
3882
  */
3839
- setVariables(id, privateStorageOwner, tenantId, body) {
3840
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
3883
+ deleteDesignSurface(id, surfaceId, privateStorageOwner, tenantId) {
3884
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}?";
3841
3885
  if (id === undefined || id === null)
3842
3886
  throw new Error("The parameter 'id' must be defined.");
3843
3887
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3888
+ if (surfaceId === undefined || surfaceId === null)
3889
+ throw new Error("The parameter 'surfaceId' must be defined.");
3890
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
3844
3891
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3845
3892
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3846
3893
  if (tenantId === null)
@@ -3848,23 +3895,19 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3848
3895
  else if (tenantId !== undefined)
3849
3896
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3850
3897
  url_ = url_.replace(/[?&]$/, "");
3851
- const content_ = JSON.stringify(body);
3852
3898
  let options_ = {
3853
- body: content_,
3854
3899
  observe: "response",
3855
3900
  responseType: "blob",
3856
- headers: new HttpHeaders({
3857
- "Content-Type": "application/json",
3858
- })
3901
+ headers: new HttpHeaders({})
3859
3902
  };
3860
3903
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3861
- return this.http.request("put", url_, transformedOptions_);
3904
+ return this.http.request("delete", url_, transformedOptions_);
3862
3905
  })).pipe(mergeMap((response_) => {
3863
- return this.transformResult(url_, response_, (r) => this.processSetVariables(r));
3906
+ return this.transformResult(url_, response_, (r) => this.processDeleteDesignSurface(r));
3864
3907
  })).pipe(catchError((response_) => {
3865
3908
  if (response_ instanceof HttpResponseBase) {
3866
3909
  try {
3867
- return this.transformResult(url_, response_, (r) => this.processSetVariables(r));
3910
+ return this.transformResult(url_, response_, (r) => this.processDeleteDesignSurface(r));
3868
3911
  }
3869
3912
  catch (e) {
3870
3913
  return throwError(e);
@@ -3874,7 +3917,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3874
3917
  return throwError(response_);
3875
3918
  }));
3876
3919
  }
3877
- processSetVariables(response) {
3920
+ processDeleteDesignSurface(response) {
3878
3921
  const status = response.status;
3879
3922
  const responseBlob = response instanceof HttpResponse ? response.body :
3880
3923
  response.error instanceof Blob ? response.error : undefined;
@@ -3884,7 +3927,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3884
3927
  _headers[key] = response.headers.get(key);
3885
3928
  }
3886
3929
  }
3887
- if (status === 200) {
3930
+ if (status === 204) {
3888
3931
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3889
3932
  return of(null);
3890
3933
  }));
@@ -3921,17 +3964,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3921
3964
  return of(null);
3922
3965
  }
3923
3966
  /**
3924
- * Loads variable data printing information from design file taken from storage.
3967
+ * Returns a down-mockup description of the specified surface in an existing design file.
3925
3968
  * @param id Design identifier.
3969
+ * @param surfaceId Design surface identifier.
3926
3970
  * @param privateStorageOwner (optional) Private storage owner identifier.
3927
3971
  * @param tenantId (optional) Tenant identifier
3928
3972
  * @return Success
3929
3973
  */
3930
- loadVdpData(id, privateStorageOwner, tenantId) {
3931
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
3974
+ getDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId) {
3975
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
3932
3976
  if (id === undefined || id === null)
3933
3977
  throw new Error("The parameter 'id' must be defined.");
3934
3978
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
3979
+ if (surfaceId === undefined || surfaceId === null)
3980
+ throw new Error("The parameter 'surfaceId' must be defined.");
3981
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
3935
3982
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
3936
3983
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
3937
3984
  if (tenantId === null)
@@ -3949,11 +3996,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3949
3996
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3950
3997
  return this.http.request("get", url_, transformedOptions_);
3951
3998
  })).pipe(mergeMap((response_) => {
3952
- return this.transformResult(url_, response_, (r) => this.processLoadVdpData(r));
3999
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceDownMockup(r));
3953
4000
  })).pipe(catchError((response_) => {
3954
4001
  if (response_ instanceof HttpResponseBase) {
3955
4002
  try {
3956
- return this.transformResult(url_, response_, (r) => this.processLoadVdpData(r));
4003
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceDownMockup(r));
3957
4004
  }
3958
4005
  catch (e) {
3959
4006
  return throwError(e);
@@ -3963,7 +4010,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3963
4010
  return throwError(response_);
3964
4011
  }));
3965
4012
  }
3966
- processLoadVdpData(response) {
4013
+ processGetDesignSurfaceDownMockup(response) {
3967
4014
  const status = response.status;
3968
4015
  const responseBlob = response instanceof HttpResponse ? response.body :
3969
4016
  response.error instanceof Blob ? response.error : undefined;
@@ -3980,6 +4027,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
3980
4027
  return of(result200);
3981
4028
  }));
3982
4029
  }
4030
+ else if (status === 400) {
4031
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4032
+ let result400 = null;
4033
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4034
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4035
+ }));
4036
+ }
3983
4037
  else if (status === 404) {
3984
4038
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3985
4039
  let result404 = null;
@@ -4012,18 +4066,24 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4012
4066
  return of(null);
4013
4067
  }
4014
4068
  /**
4015
- * Saves variable data printing information to design file and updates design in storage.
4069
+ * Updates a content file of down-mockup for the specified surface in an existing design file.
4016
4070
  * @param id Design identifier.
4071
+ * @param surfaceId Design surface identifier.
4017
4072
  * @param privateStorageOwner (optional) Private storage owner identifier.
4018
4073
  * @param tenantId (optional) Tenant identifier
4019
- * @param body (optional) Serialized vdp data.
4074
+ * @param position_top (optional)
4075
+ * @param position_left (optional)
4076
+ * @param sourceFile (optional)
4020
4077
  * @return Success
4021
4078
  */
4022
- saveVdpData(id, privateStorageOwner, tenantId, body) {
4023
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
4079
+ updateDesignSurfaceDownMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile) {
4080
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down?";
4024
4081
  if (id === undefined || id === null)
4025
4082
  throw new Error("The parameter 'id' must be defined.");
4026
4083
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
4084
+ if (surfaceId === undefined || surfaceId === null)
4085
+ throw new Error("The parameter 'surfaceId' must be defined.");
4086
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4027
4087
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4028
4088
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4029
4089
  if (tenantId === null)
@@ -4031,23 +4091,33 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4031
4091
  else if (tenantId !== undefined)
4032
4092
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4033
4093
  url_ = url_.replace(/[?&]$/, "");
4034
- const content_ = JSON.stringify(body);
4094
+ const content_ = new FormData();
4095
+ if (position_top === null || position_top === undefined)
4096
+ throw new Error("The parameter 'position_top' cannot be null.");
4097
+ else
4098
+ content_.append("position.top", position_top.toString());
4099
+ if (position_left === null || position_left === undefined)
4100
+ throw new Error("The parameter 'position_left' cannot be null.");
4101
+ else
4102
+ content_.append("position.left", position_left.toString());
4103
+ if (sourceFile !== null && sourceFile !== undefined)
4104
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4035
4105
  let options_ = {
4036
4106
  body: content_,
4037
4107
  observe: "response",
4038
4108
  responseType: "blob",
4039
4109
  headers: new HttpHeaders({
4040
- "Content-Type": "application/json",
4110
+ "Accept": "application/json"
4041
4111
  })
4042
4112
  };
4043
4113
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4044
- return this.http.request("put", url_, transformedOptions_);
4114
+ return this.http.request("patch", url_, transformedOptions_);
4045
4115
  })).pipe(mergeMap((response_) => {
4046
- return this.transformResult(url_, response_, (r) => this.processSaveVdpData(r));
4116
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignSurfaceDownMockup(r));
4047
4117
  })).pipe(catchError((response_) => {
4048
4118
  if (response_ instanceof HttpResponseBase) {
4049
4119
  try {
4050
- return this.transformResult(url_, response_, (r) => this.processSaveVdpData(r));
4120
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignSurfaceDownMockup(r));
4051
4121
  }
4052
4122
  catch (e) {
4053
4123
  return throwError(e);
@@ -4057,7 +4127,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4057
4127
  return throwError(response_);
4058
4128
  }));
4059
4129
  }
4060
- processSaveVdpData(response) {
4130
+ processUpdateDesignSurfaceDownMockup(response) {
4061
4131
  const status = response.status;
4062
4132
  const responseBlob = response instanceof HttpResponse ? response.body :
4063
4133
  response.error instanceof Blob ? response.error : undefined;
@@ -4069,7 +4139,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4069
4139
  }
4070
4140
  if (status === 200) {
4071
4141
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4072
- return of(null);
4142
+ let result200 = null;
4143
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4144
+ return of(result200);
4145
+ }));
4146
+ }
4147
+ else if (status === 400) {
4148
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4149
+ let result400 = null;
4150
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4151
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4073
4152
  }));
4074
4153
  }
4075
4154
  else if (status === 404) {
@@ -4079,6 +4158,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4079
4158
  return throwException("Not Found", status, _responseText, _headers, result404);
4080
4159
  }));
4081
4160
  }
4161
+ else if (status === 409) {
4162
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4163
+ let result409 = null;
4164
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4165
+ return throwException("Conflict", status, _responseText, _headers, result409);
4166
+ }));
4167
+ }
4082
4168
  else if (status === 401) {
4083
4169
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4084
4170
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4097,17 +4183,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4097
4183
  return of(null);
4098
4184
  }
4099
4185
  /**
4100
- * Deletes variable data printing information from design file and updates design in storage.
4186
+ * Returns a content file for down-mockup of the specified surface in an existing design file.
4101
4187
  * @param id Design identifier.
4188
+ * @param surfaceId Design surface identifier.
4102
4189
  * @param privateStorageOwner (optional) Private storage owner identifier.
4103
4190
  * @param tenantId (optional) Tenant identifier
4104
4191
  * @return Success
4105
4192
  */
4106
- deleteVdpData(id, privateStorageOwner, tenantId) {
4107
- let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
4193
+ getDesignSurfaceDownMockupContent(id, surfaceId, privateStorageOwner, tenantId) {
4194
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-down/file?";
4108
4195
  if (id === undefined || id === null)
4109
4196
  throw new Error("The parameter 'id' must be defined.");
4110
4197
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
4198
+ if (surfaceId === undefined || surfaceId === null)
4199
+ throw new Error("The parameter 'surfaceId' must be defined.");
4200
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4111
4201
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4112
4202
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4113
4203
  if (tenantId === null)
@@ -4118,16 +4208,18 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4118
4208
  let options_ = {
4119
4209
  observe: "response",
4120
4210
  responseType: "blob",
4121
- headers: new HttpHeaders({})
4211
+ headers: new HttpHeaders({
4212
+ "Accept": "application/json"
4213
+ })
4122
4214
  };
4123
4215
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4124
- return this.http.request("delete", url_, transformedOptions_);
4216
+ return this.http.request("get", url_, transformedOptions_);
4125
4217
  })).pipe(mergeMap((response_) => {
4126
- return this.transformResult(url_, response_, (r) => this.processDeleteVdpData(r));
4218
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceDownMockupContent(r));
4127
4219
  })).pipe(catchError((response_) => {
4128
4220
  if (response_ instanceof HttpResponseBase) {
4129
4221
  try {
4130
- return this.transformResult(url_, response_, (r) => this.processDeleteVdpData(r));
4222
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceDownMockupContent(r));
4131
4223
  }
4132
4224
  catch (e) {
4133
4225
  return throwError(e);
@@ -4137,7 +4229,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4137
4229
  return throwError(response_);
4138
4230
  }));
4139
4231
  }
4140
- processDeleteVdpData(response) {
4232
+ processGetDesignSurfaceDownMockupContent(response) {
4141
4233
  const status = response.status;
4142
4234
  const responseBlob = response instanceof HttpResponse ? response.body :
4143
4235
  response.error instanceof Blob ? response.error : undefined;
@@ -4147,9 +4239,24 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4147
4239
  _headers[key] = response.headers.get(key);
4148
4240
  }
4149
4241
  }
4150
- if (status === 200) {
4242
+ if (status === 200 || status === 206) {
4243
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
4244
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4245
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4246
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
4247
+ }
4248
+ else if (status === 400) {
4151
4249
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4152
- return of(null);
4250
+ let result400 = null;
4251
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4252
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4253
+ }));
4254
+ }
4255
+ else if (status === 404) {
4256
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4257
+ let result404 = null;
4258
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4259
+ return throwException("Not Found", status, _responseText, _headers, result404);
4153
4260
  }));
4154
4261
  }
4155
4262
  else if (status === 409) {
@@ -4177,17 +4284,21 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4177
4284
  return of(null);
4178
4285
  }
4179
4286
  /**
4180
- * Loads product (design model) from resource file taken from storage.
4181
- * @param id Resource identifier.
4287
+ * Returns an up-mockup description of the specified surface in an existing design file.
4288
+ * @param id Design identifier.
4289
+ * @param surfaceId Design surface identifier.
4182
4290
  * @param privateStorageOwner (optional) Private storage owner identifier.
4183
4291
  * @param tenantId (optional) Tenant identifier
4184
4292
  * @return Success
4185
4293
  */
4186
- loadProductFromResource(id, privateStorageOwner, tenantId) {
4187
- let url_ = this.baseUrl + "/api/atoms/v1/designs/from-resource/{id}/model?";
4294
+ getDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId) {
4295
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
4188
4296
  if (id === undefined || id === null)
4189
4297
  throw new Error("The parameter 'id' must be defined.");
4190
4298
  url_ = url_.replace("{id}", encodeURIComponent("" + id));
4299
+ if (surfaceId === undefined || surfaceId === null)
4300
+ throw new Error("The parameter 'surfaceId' must be defined.");
4301
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4191
4302
  if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4192
4303
  url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4193
4304
  if (tenantId === null)
@@ -4205,11 +4316,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4205
4316
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4206
4317
  return this.http.request("get", url_, transformedOptions_);
4207
4318
  })).pipe(mergeMap((response_) => {
4208
- return this.transformResult(url_, response_, (r) => this.processLoadProductFromResource(r));
4319
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceUpMockup(r));
4209
4320
  })).pipe(catchError((response_) => {
4210
4321
  if (response_ instanceof HttpResponseBase) {
4211
4322
  try {
4212
- return this.transformResult(url_, response_, (r) => this.processLoadProductFromResource(r));
4323
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceUpMockup(r));
4213
4324
  }
4214
4325
  catch (e) {
4215
4326
  return throwError(e);
@@ -4219,7 +4330,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4219
4330
  return throwError(response_);
4220
4331
  }));
4221
4332
  }
4222
- processLoadProductFromResource(response) {
4333
+ processGetDesignSurfaceUpMockup(response) {
4223
4334
  const status = response.status;
4224
4335
  const responseBlob = response instanceof HttpResponse ? response.body :
4225
4336
  response.error instanceof Blob ? response.error : undefined;
@@ -4236,6 +4347,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4236
4347
  return of(result200);
4237
4348
  }));
4238
4349
  }
4350
+ else if (status === 400) {
4351
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4352
+ let result400 = null;
4353
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4354
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4355
+ }));
4356
+ }
4239
4357
  else if (status === 404) {
4240
4358
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4241
4359
  let result404 = null;
@@ -4243,11 +4361,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4243
4361
  return throwException("Not Found", status, _responseText, _headers, result404);
4244
4362
  }));
4245
4363
  }
4246
- else if (status === 422) {
4364
+ else if (status === 409) {
4247
4365
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4248
- let result422 = null;
4249
- result422 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4250
- return throwException("Client Error", status, _responseText, _headers, result422);
4366
+ let result409 = null;
4367
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4368
+ return throwException("Conflict", status, _responseText, _headers, result409);
4251
4369
  }));
4252
4370
  }
4253
4371
  else if (status === 401) {
@@ -4268,36 +4386,58 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4268
4386
  return of(null);
4269
4387
  }
4270
4388
  /**
4271
- * Converts colors.
4389
+ * Updates a content file of up-mockup for the specified surface in an existing design.
4390
+ * @param id Design identifier.
4391
+ * @param surfaceId Design surface identifier.
4392
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4272
4393
  * @param tenantId (optional) Tenant identifier
4273
- * @param body (optional) Convert colors operation parameters.
4394
+ * @param position_top (optional)
4395
+ * @param position_left (optional)
4396
+ * @param sourceFile (optional)
4274
4397
  * @return Success
4275
4398
  */
4276
- convertColors(tenantId, body) {
4277
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/convert-colors?";
4399
+ updateDesignSurfaceUpMockup(id, surfaceId, privateStorageOwner, tenantId, position_top, position_left, sourceFile) {
4400
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up?";
4401
+ if (id === undefined || id === null)
4402
+ throw new Error("The parameter 'id' must be defined.");
4403
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4404
+ if (surfaceId === undefined || surfaceId === null)
4405
+ throw new Error("The parameter 'surfaceId' must be defined.");
4406
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4407
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4408
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4278
4409
  if (tenantId === null)
4279
4410
  throw new Error("The parameter 'tenantId' cannot be null.");
4280
4411
  else if (tenantId !== undefined)
4281
4412
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4282
4413
  url_ = url_.replace(/[?&]$/, "");
4283
- const content_ = JSON.stringify(body);
4414
+ const content_ = new FormData();
4415
+ if (position_top === null || position_top === undefined)
4416
+ throw new Error("The parameter 'position_top' cannot be null.");
4417
+ else
4418
+ content_.append("position.top", position_top.toString());
4419
+ if (position_left === null || position_left === undefined)
4420
+ throw new Error("The parameter 'position_left' cannot be null.");
4421
+ else
4422
+ content_.append("position.left", position_left.toString());
4423
+ if (sourceFile !== null && sourceFile !== undefined)
4424
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4284
4425
  let options_ = {
4285
4426
  body: content_,
4286
4427
  observe: "response",
4287
4428
  responseType: "blob",
4288
4429
  headers: new HttpHeaders({
4289
- "Content-Type": "application/json",
4290
4430
  "Accept": "application/json"
4291
4431
  })
4292
4432
  };
4293
4433
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4294
- return this.http.request("post", url_, transformedOptions_);
4434
+ return this.http.request("patch", url_, transformedOptions_);
4295
4435
  })).pipe(mergeMap((response_) => {
4296
- return this.transformResult(url_, response_, (r) => this.processConvertColors(r));
4436
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignSurfaceUpMockup(r));
4297
4437
  })).pipe(catchError((response_) => {
4298
4438
  if (response_ instanceof HttpResponseBase) {
4299
4439
  try {
4300
- return this.transformResult(url_, response_, (r) => this.processConvertColors(r));
4440
+ return this.transformResult(url_, response_, (r) => this.processUpdateDesignSurfaceUpMockup(r));
4301
4441
  }
4302
4442
  catch (e) {
4303
4443
  return throwError(e);
@@ -4307,7 +4447,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4307
4447
  return throwError(response_);
4308
4448
  }));
4309
4449
  }
4310
- processConvertColors(response) {
4450
+ processUpdateDesignSurfaceUpMockup(response) {
4311
4451
  const status = response.status;
4312
4452
  const responseBlob = response instanceof HttpResponse ? response.body :
4313
4453
  response.error instanceof Blob ? response.error : undefined;
@@ -4324,6 +4464,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4324
4464
  return of(result200);
4325
4465
  }));
4326
4466
  }
4467
+ else if (status === 400) {
4468
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4469
+ let result400 = null;
4470
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4471
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4472
+ }));
4473
+ }
4327
4474
  else if (status === 404) {
4328
4475
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4329
4476
  let result404 = null;
@@ -4331,6 +4478,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4331
4478
  return throwException("Not Found", status, _responseText, _headers, result404);
4332
4479
  }));
4333
4480
  }
4481
+ else if (status === 409) {
4482
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4483
+ let result409 = null;
4484
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4485
+ return throwException("Conflict", status, _responseText, _headers, result409);
4486
+ }));
4487
+ }
4334
4488
  else if (status === 401) {
4335
4489
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4336
4490
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4349,36 +4503,43 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4349
4503
  return of(null);
4350
4504
  }
4351
4505
  /**
4352
- * Extracts product item image.
4506
+ * Returns a content file for up-mockup of the specified surface in an existing design file.
4507
+ * @param id Design identifier.
4508
+ * @param surfaceId Design surface identifier.
4509
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4353
4510
  * @param tenantId (optional) Tenant identifier
4354
- * @param body (optional) Extraction parameters.
4355
4511
  * @return Success
4356
4512
  */
4357
- extractItemImage(tenantId, body) {
4358
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
4513
+ getDesignSurfaceUpMockupContent(id, surfaceId, privateStorageOwner, tenantId) {
4514
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/mockup-up/file?";
4515
+ if (id === undefined || id === null)
4516
+ throw new Error("The parameter 'id' must be defined.");
4517
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4518
+ if (surfaceId === undefined || surfaceId === null)
4519
+ throw new Error("The parameter 'surfaceId' must be defined.");
4520
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4521
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4522
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4359
4523
  if (tenantId === null)
4360
4524
  throw new Error("The parameter 'tenantId' cannot be null.");
4361
4525
  else if (tenantId !== undefined)
4362
4526
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4363
4527
  url_ = url_.replace(/[?&]$/, "");
4364
- const content_ = JSON.stringify(body);
4365
4528
  let options_ = {
4366
- body: content_,
4367
4529
  observe: "response",
4368
4530
  responseType: "blob",
4369
4531
  headers: new HttpHeaders({
4370
- "Content-Type": "application/json",
4371
- "Accept": "application/octet-stream"
4532
+ "Accept": "application/json"
4372
4533
  })
4373
4534
  };
4374
4535
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4375
- return this.http.request("post", url_, transformedOptions_);
4536
+ return this.http.request("get", url_, transformedOptions_);
4376
4537
  })).pipe(mergeMap((response_) => {
4377
- return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
4538
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceUpMockupContent(r));
4378
4539
  })).pipe(catchError((response_) => {
4379
4540
  if (response_ instanceof HttpResponseBase) {
4380
4541
  try {
4381
- return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
4542
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceUpMockupContent(r));
4382
4543
  }
4383
4544
  catch (e) {
4384
4545
  return throwError(e);
@@ -4388,7 +4549,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4388
4549
  return throwError(response_);
4389
4550
  }));
4390
4551
  }
4391
- processExtractItemImage(response) {
4552
+ processGetDesignSurfaceUpMockupContent(response) {
4392
4553
  const status = response.status;
4393
4554
  const responseBlob = response instanceof HttpResponse ? response.body :
4394
4555
  response.error instanceof Blob ? response.error : undefined;
@@ -4404,6 +4565,32 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4404
4565
  const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4405
4566
  return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
4406
4567
  }
4568
+ else if (status === 204) {
4569
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4570
+ return throwException("No Content", status, _responseText, _headers);
4571
+ }));
4572
+ }
4573
+ else if (status === 400) {
4574
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4575
+ let result400 = null;
4576
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4577
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4578
+ }));
4579
+ }
4580
+ else if (status === 404) {
4581
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4582
+ let result404 = null;
4583
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4584
+ return throwException("Not Found", status, _responseText, _headers, result404);
4585
+ }));
4586
+ }
4587
+ else if (status === 409) {
4588
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4589
+ let result409 = null;
4590
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4591
+ return throwException("Conflict", status, _responseText, _headers, result409);
4592
+ }));
4593
+ }
4407
4594
  else if (status === 401) {
4408
4595
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4409
4596
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4422,36 +4609,43 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4422
4609
  return of(null);
4423
4610
  }
4424
4611
  /**
4425
- * Flatten items.
4612
+ * Returns a print-product surface of the specified design file as a json-serialized model.
4613
+ * @param id Design identifier.
4614
+ * @param surfaceId Surface identifier.
4615
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4426
4616
  * @param tenantId (optional) Tenant identifier
4427
- * @param body (optional) Items to flatten.
4428
4617
  * @return Success
4429
4618
  */
4430
- flattenItems(tenantId, body) {
4431
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
4619
+ getDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId) {
4620
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
4621
+ if (id === undefined || id === null)
4622
+ throw new Error("The parameter 'id' must be defined.");
4623
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4624
+ if (surfaceId === undefined || surfaceId === null)
4625
+ throw new Error("The parameter 'surfaceId' must be defined.");
4626
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4627
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4628
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4432
4629
  if (tenantId === null)
4433
4630
  throw new Error("The parameter 'tenantId' cannot be null.");
4434
4631
  else if (tenantId !== undefined)
4435
4632
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4436
4633
  url_ = url_.replace(/[?&]$/, "");
4437
- const content_ = JSON.stringify(body);
4438
4634
  let options_ = {
4439
- body: content_,
4440
4635
  observe: "response",
4441
4636
  responseType: "blob",
4442
4637
  headers: new HttpHeaders({
4443
- "Content-Type": "application/json",
4444
4638
  "Accept": "application/json"
4445
4639
  })
4446
4640
  };
4447
4641
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4448
- return this.http.request("post", url_, transformedOptions_);
4642
+ return this.http.request("get", url_, transformedOptions_);
4449
4643
  })).pipe(mergeMap((response_) => {
4450
- return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
4644
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceModel(r));
4451
4645
  })).pipe(catchError((response_) => {
4452
4646
  if (response_ instanceof HttpResponseBase) {
4453
4647
  try {
4454
- return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
4648
+ return this.transformResult(url_, response_, (r) => this.processGetDesignSurfaceModel(r));
4455
4649
  }
4456
4650
  catch (e) {
4457
4651
  return throwError(e);
@@ -4461,7 +4655,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4461
4655
  return throwError(response_);
4462
4656
  }));
4463
4657
  }
4464
- processFlattenItems(response) {
4658
+ processGetDesignSurfaceModel(response) {
4465
4659
  const status = response.status;
4466
4660
  const responseBlob = response instanceof HttpResponse ? response.body :
4467
4661
  response.error instanceof Blob ? response.error : undefined;
@@ -4478,6 +4672,20 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4478
4672
  return of(result200);
4479
4673
  }));
4480
4674
  }
4675
+ else if (status === 404) {
4676
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4677
+ let result404 = null;
4678
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4679
+ return throwException("Not Found", status, _responseText, _headers, result404);
4680
+ }));
4681
+ }
4682
+ else if (status === 409) {
4683
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4684
+ let result409 = null;
4685
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4686
+ return throwException("Conflict", status, _responseText, _headers, result409);
4687
+ }));
4688
+ }
4481
4689
  else if (status === 401) {
4482
4690
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4483
4691
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4496,40 +4704,48 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4496
4704
  return of(null);
4497
4705
  }
4498
4706
  /**
4499
- * Creates product item from input image file.
4500
- * @param itemType (optional) Desired item type.
4707
+ * Replaces a specified print-product surface in an existing design file with the data provided as a json-serialized surface model.
4708
+ All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
4709
+ * @param id Design identifier.
4710
+ * @param surfaceId Design surface identifier.
4711
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4501
4712
  * @param tenantId (optional) Tenant identifier
4502
- * @param sourceFile (optional)
4713
+ * @param body (optional) Updated surface model.
4503
4714
  * @return Success
4504
4715
  */
4505
- createItemFromFile(itemType, tenantId, sourceFile) {
4506
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file?";
4507
- if (itemType !== undefined && itemType !== null)
4508
- url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4716
+ replaceDesignSurfaceModel(id, surfaceId, privateStorageOwner, tenantId, body) {
4717
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/{surfaceId}/model?";
4718
+ if (id === undefined || id === null)
4719
+ throw new Error("The parameter 'id' must be defined.");
4720
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4721
+ if (surfaceId === undefined || surfaceId === null)
4722
+ throw new Error("The parameter 'surfaceId' must be defined.");
4723
+ url_ = url_.replace("{surfaceId}", encodeURIComponent("" + surfaceId));
4724
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4725
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4509
4726
  if (tenantId === null)
4510
4727
  throw new Error("The parameter 'tenantId' cannot be null.");
4511
4728
  else if (tenantId !== undefined)
4512
4729
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4513
4730
  url_ = url_.replace(/[?&]$/, "");
4514
- const content_ = new FormData();
4515
- if (sourceFile !== null && sourceFile !== undefined)
4516
- content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4731
+ const content_ = JSON.stringify(body);
4517
4732
  let options_ = {
4518
4733
  body: content_,
4519
4734
  observe: "response",
4520
4735
  responseType: "blob",
4521
4736
  headers: new HttpHeaders({
4737
+ "Content-Type": "application/json",
4522
4738
  "Accept": "application/json"
4523
4739
  })
4524
4740
  };
4525
4741
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4526
- return this.http.request("post", url_, transformedOptions_);
4742
+ return this.http.request("put", url_, transformedOptions_);
4527
4743
  })).pipe(mergeMap((response_) => {
4528
- return this.transformResult(url_, response_, (r) => this.processCreateItemFromFile(r));
4744
+ return this.transformResult(url_, response_, (r) => this.processReplaceDesignSurfaceModel(r));
4529
4745
  })).pipe(catchError((response_) => {
4530
4746
  if (response_ instanceof HttpResponseBase) {
4531
4747
  try {
4532
- return this.transformResult(url_, response_, (r) => this.processCreateItemFromFile(r));
4748
+ return this.transformResult(url_, response_, (r) => this.processReplaceDesignSurfaceModel(r));
4533
4749
  }
4534
4750
  catch (e) {
4535
4751
  return throwError(e);
@@ -4539,7 +4755,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4539
4755
  return throwError(response_);
4540
4756
  }));
4541
4757
  }
4542
- processCreateItemFromFile(response) {
4758
+ processReplaceDesignSurfaceModel(response) {
4543
4759
  const status = response.status;
4544
4760
  const responseBlob = response instanceof HttpResponse ? response.body :
4545
4761
  response.error instanceof Blob ? response.error : undefined;
@@ -4556,6 +4772,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4556
4772
  return of(result200);
4557
4773
  }));
4558
4774
  }
4775
+ else if (status === 400) {
4776
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4777
+ let result400 = null;
4778
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4779
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4780
+ }));
4781
+ }
4559
4782
  else if (status === 404) {
4560
4783
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4561
4784
  let result404 = null;
@@ -4563,6 +4786,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4563
4786
  return throwException("Not Found", status, _responseText, _headers, result404);
4564
4787
  }));
4565
4788
  }
4789
+ else if (status === 409) {
4790
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4791
+ let result409 = null;
4792
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4793
+ return throwException("Conflict", status, _responseText, _headers, result409);
4794
+ }));
4795
+ }
4566
4796
  else if (status === 401) {
4567
4797
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4568
4798
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4581,40 +4811,49 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4581
4811
  return of(null);
4582
4812
  }
4583
4813
  /**
4584
- * Creates multiple product items from input image files.
4585
- * @param itemType (optional) Desired items type.
4814
+ * Inserts a new surface provided as a json-serialized model at the specified position in an existing design file.
4815
+ All identifiers of a replaced surface (including surface identifier) will be reset by auto-generated values to prevent identifiers collisions.
4816
+ * @param id Design identifier.
4817
+ * @param surfaceIndex (optional) New surface index.
4818
+ * @param privateStorageOwner (optional) Private storage owner identifier.
4586
4819
  * @param tenantId (optional) Tenant identifier
4587
- * @param sourceFiles (optional)
4820
+ * @param body (optional) New surface model.
4588
4821
  * @return Success
4589
4822
  */
4590
- batchCreateItemsFromFile(itemType, tenantId, sourceFiles) {
4591
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-file/batch-create?";
4592
- if (itemType !== undefined && itemType !== null)
4593
- url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4823
+ addDesignSurfaceModel(id, surfaceIndex, privateStorageOwner, tenantId, body) {
4824
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/print-product/surfaces/model?";
4825
+ if (id === undefined || id === null)
4826
+ throw new Error("The parameter 'id' must be defined.");
4827
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
4828
+ if (surfaceIndex === null)
4829
+ throw new Error("The parameter 'surfaceIndex' cannot be null.");
4830
+ else if (surfaceIndex !== undefined)
4831
+ url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
4832
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
4833
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
4594
4834
  if (tenantId === null)
4595
4835
  throw new Error("The parameter 'tenantId' cannot be null.");
4596
4836
  else if (tenantId !== undefined)
4597
4837
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4598
4838
  url_ = url_.replace(/[?&]$/, "");
4599
- const content_ = new FormData();
4600
- if (sourceFiles !== null && sourceFiles !== undefined)
4601
- sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
4839
+ const content_ = JSON.stringify(body);
4602
4840
  let options_ = {
4603
4841
  body: content_,
4604
4842
  observe: "response",
4605
4843
  responseType: "blob",
4606
4844
  headers: new HttpHeaders({
4845
+ "Content-Type": "application/json",
4607
4846
  "Accept": "application/json"
4608
4847
  })
4609
4848
  };
4610
4849
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4611
4850
  return this.http.request("post", url_, transformedOptions_);
4612
4851
  })).pipe(mergeMap((response_) => {
4613
- return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromFile(r));
4852
+ return this.transformResult(url_, response_, (r) => this.processAddDesignSurfaceModel(r));
4614
4853
  })).pipe(catchError((response_) => {
4615
4854
  if (response_ instanceof HttpResponseBase) {
4616
4855
  try {
4617
- return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromFile(r));
4856
+ return this.transformResult(url_, response_, (r) => this.processAddDesignSurfaceModel(r));
4618
4857
  }
4619
4858
  catch (e) {
4620
4859
  return throwError(e);
@@ -4624,7 +4863,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4624
4863
  return throwError(response_);
4625
4864
  }));
4626
4865
  }
4627
- processBatchCreateItemsFromFile(response) {
4866
+ processAddDesignSurfaceModel(response) {
4628
4867
  const status = response.status;
4629
4868
  const responseBlob = response instanceof HttpResponse ? response.body :
4630
4869
  response.error instanceof Blob ? response.error : undefined;
@@ -4641,6 +4880,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4641
4880
  return of(result200);
4642
4881
  }));
4643
4882
  }
4883
+ else if (status === 400) {
4884
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4885
+ let result400 = null;
4886
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4887
+ return throwException("Bad Request", status, _responseText, _headers, result400);
4888
+ }));
4889
+ }
4644
4890
  else if (status === 404) {
4645
4891
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4646
4892
  let result404 = null;
@@ -4665,22 +4911,38 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4665
4911
  }
4666
4912
  return of(null);
4667
4913
  }
4668
- /**
4669
- * Creates product item from image in storage.
4670
- * @param itemType (optional) Desired item type.
4671
- * @param tenantId (optional) Tenant identifier
4672
- * @param body (optional) Operation parameters.
4673
- * @return Success
4674
- */
4675
- createItemFromStorage(itemType, tenantId, body) {
4676
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage?";
4677
- if (itemType !== undefined && itemType !== null)
4678
- url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4679
- if (tenantId === null)
4680
- throw new Error("The parameter 'tenantId' cannot be null.");
4681
- else if (tenantId !== undefined)
4682
- url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4683
- url_ = url_.replace(/[?&]$/, "");
4914
+ }
4915
+ DesignAtomsPrintProductApiClient.ɵprov = ɵɵdefineInjectable({ factory: function DesignAtomsPrintProductApiClient_Factory() { return new DesignAtomsPrintProductApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: DesignAtomsPrintProductApiClient, providedIn: "root" });
4916
+ DesignAtomsPrintProductApiClient.decorators = [
4917
+ { type: Injectable, args: [{
4918
+ providedIn: 'root'
4919
+ },] }
4920
+ ];
4921
+ DesignAtomsPrintProductApiClient.ctorParameters = () => [
4922
+ { type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
4923
+ { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
4924
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
4925
+ ];
4926
+ class DesignAtomsPrintProductItemsApiClient extends ApiClientBase {
4927
+ constructor(configuration, http, baseUrl) {
4928
+ super(configuration);
4929
+ this.jsonParseReviver = undefined;
4930
+ this.http = http;
4931
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
4932
+ }
4933
+ /**
4934
+ * Extracts print-product item image.
4935
+ * @param tenantId (optional) Tenant identifier
4936
+ * @param body (optional) Extraction parameters.
4937
+ * @return Success
4938
+ */
4939
+ extractItemImage(tenantId, body) {
4940
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/extract-image?";
4941
+ if (tenantId === null)
4942
+ throw new Error("The parameter 'tenantId' cannot be null.");
4943
+ else if (tenantId !== undefined)
4944
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4945
+ url_ = url_.replace(/[?&]$/, "");
4684
4946
  const content_ = JSON.stringify(body);
4685
4947
  let options_ = {
4686
4948
  body: content_,
@@ -4688,17 +4950,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4688
4950
  responseType: "blob",
4689
4951
  headers: new HttpHeaders({
4690
4952
  "Content-Type": "application/json",
4691
- "Accept": "application/json"
4953
+ "Accept": "application/octet-stream"
4692
4954
  })
4693
4955
  };
4694
4956
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4695
4957
  return this.http.request("post", url_, transformedOptions_);
4696
4958
  })).pipe(mergeMap((response_) => {
4697
- return this.transformResult(url_, response_, (r) => this.processCreateItemFromStorage(r));
4959
+ return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
4698
4960
  })).pipe(catchError((response_) => {
4699
4961
  if (response_ instanceof HttpResponseBase) {
4700
4962
  try {
4701
- return this.transformResult(url_, response_, (r) => this.processCreateItemFromStorage(r));
4963
+ return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
4702
4964
  }
4703
4965
  catch (e) {
4704
4966
  return throwError(e);
@@ -4708,7 +4970,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4708
4970
  return throwError(response_);
4709
4971
  }));
4710
4972
  }
4711
- processCreateItemFromStorage(response) {
4973
+ processExtractItemImage(response) {
4712
4974
  const status = response.status;
4713
4975
  const responseBlob = response instanceof HttpResponse ? response.body :
4714
4976
  response.error instanceof Blob ? response.error : undefined;
@@ -4718,19 +4980,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4718
4980
  _headers[key] = response.headers.get(key);
4719
4981
  }
4720
4982
  }
4721
- if (status === 200) {
4722
- return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4723
- let result200 = null;
4724
- result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4725
- return of(result200);
4726
- }));
4727
- }
4728
- else if (status === 404) {
4729
- return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4730
- let result404 = null;
4731
- result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4732
- return throwException("Not Found", status, _responseText, _headers, result404);
4733
- }));
4983
+ if (status === 200 || status === 206) {
4984
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
4985
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
4986
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
4987
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
4734
4988
  }
4735
4989
  else if (status === 401) {
4736
4990
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
@@ -4750,16 +5004,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4750
5004
  return of(null);
4751
5005
  }
4752
5006
  /**
4753
- * Creates multiple product items from images in storage.
4754
- * @param itemType (optional) Desired items type.
5007
+ * Flattens print-product items.
4755
5008
  * @param tenantId (optional) Tenant identifier
4756
- * @param body (optional) Create items operation parameters.
5009
+ * @param body (optional) List of print-product items to flatten.
4757
5010
  * @return Success
4758
5011
  */
4759
- batchCreateItemsFromStorage(itemType, tenantId, body) {
4760
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-storage/batch-create?";
4761
- if (itemType !== undefined && itemType !== null)
4762
- url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
5012
+ flattenItems(tenantId, body) {
5013
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/flatten?";
4763
5014
  if (tenantId === null)
4764
5015
  throw new Error("The parameter 'tenantId' cannot be null.");
4765
5016
  else if (tenantId !== undefined)
@@ -4778,11 +5029,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4778
5029
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4779
5030
  return this.http.request("post", url_, transformedOptions_);
4780
5031
  })).pipe(mergeMap((response_) => {
4781
- return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromStorage(r));
5032
+ return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
4782
5033
  })).pipe(catchError((response_) => {
4783
5034
  if (response_ instanceof HttpResponseBase) {
4784
5035
  try {
4785
- return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromStorage(r));
5036
+ return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
4786
5037
  }
4787
5038
  catch (e) {
4788
5039
  return throwError(e);
@@ -4792,7 +5043,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4792
5043
  return throwError(response_);
4793
5044
  }));
4794
5045
  }
4795
- processBatchCreateItemsFromStorage(response) {
5046
+ processFlattenItems(response) {
4796
5047
  const status = response.status;
4797
5048
  const responseBlob = response instanceof HttpResponse ? response.body :
4798
5049
  response.error instanceof Blob ? response.error : undefined;
@@ -4809,13 +5060,6 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4809
5060
  return of(result200);
4810
5061
  }));
4811
5062
  }
4812
- else if (status === 404) {
4813
- return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4814
- let result404 = null;
4815
- result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4816
- return throwException("Not Found", status, _responseText, _headers, result404);
4817
- }));
4818
- }
4819
5063
  else if (status === 401) {
4820
5064
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4821
5065
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4834,14 +5078,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4834
5078
  return of(null);
4835
5079
  }
4836
5080
  /**
4837
- * Creates product item from remote web image provided by URL.
5081
+ * Creates print-product item from input image file.
4838
5082
  * @param itemType (optional) Desired item type.
4839
5083
  * @param tenantId (optional) Tenant identifier
4840
- * @param body (optional) Operation parameters.
5084
+ * @param sourceFile (optional)
4841
5085
  * @return Success
4842
5086
  */
4843
- createItemFromUrl(itemType, tenantId, body) {
4844
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url?";
5087
+ createItemFromFile(itemType, tenantId, sourceFile) {
5088
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file?";
4845
5089
  if (itemType !== undefined && itemType !== null)
4846
5090
  url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4847
5091
  if (tenantId === null)
@@ -4849,24 +5093,25 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4849
5093
  else if (tenantId !== undefined)
4850
5094
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4851
5095
  url_ = url_.replace(/[?&]$/, "");
4852
- const content_ = JSON.stringify(body);
5096
+ const content_ = new FormData();
5097
+ if (sourceFile !== null && sourceFile !== undefined)
5098
+ content_.append("sourceFile", sourceFile.data, sourceFile.fileName ? sourceFile.fileName : "sourceFile");
4853
5099
  let options_ = {
4854
5100
  body: content_,
4855
5101
  observe: "response",
4856
5102
  responseType: "blob",
4857
5103
  headers: new HttpHeaders({
4858
- "Content-Type": "application/json",
4859
5104
  "Accept": "application/json"
4860
5105
  })
4861
5106
  };
4862
5107
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4863
5108
  return this.http.request("post", url_, transformedOptions_);
4864
5109
  })).pipe(mergeMap((response_) => {
4865
- return this.transformResult(url_, response_, (r) => this.processCreateItemFromUrl(r));
5110
+ return this.transformResult(url_, response_, (r) => this.processCreateItemFromFile(r));
4866
5111
  })).pipe(catchError((response_) => {
4867
5112
  if (response_ instanceof HttpResponseBase) {
4868
5113
  try {
4869
- return this.transformResult(url_, response_, (r) => this.processCreateItemFromUrl(r));
5114
+ return this.transformResult(url_, response_, (r) => this.processCreateItemFromFile(r));
4870
5115
  }
4871
5116
  catch (e) {
4872
5117
  return throwError(e);
@@ -4876,7 +5121,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4876
5121
  return throwError(response_);
4877
5122
  }));
4878
5123
  }
4879
- processCreateItemFromUrl(response) {
5124
+ processCreateItemFromFile(response) {
4880
5125
  const status = response.status;
4881
5126
  const responseBlob = response instanceof HttpResponse ? response.body :
4882
5127
  response.error instanceof Blob ? response.error : undefined;
@@ -4900,6 +5145,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4900
5145
  return throwException("Not Found", status, _responseText, _headers, result404);
4901
5146
  }));
4902
5147
  }
5148
+ else if (status === 409) {
5149
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5150
+ let result409 = null;
5151
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5152
+ return throwException("Conflict", status, _responseText, _headers, result409);
5153
+ }));
5154
+ }
4903
5155
  else if (status === 401) {
4904
5156
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4905
5157
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -4918,14 +5170,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4918
5170
  return of(null);
4919
5171
  }
4920
5172
  /**
4921
- * Creates multiple product items from remote web images provided by URLs list.
4922
- * @param itemType (optional) Desired items type.
5173
+ * Creates multiple print-product items from input image files.
5174
+ * @param itemType (optional) Desired print-product items type.
4923
5175
  * @param tenantId (optional) Tenant identifier
4924
- * @param body (optional) Operation parameters.
5176
+ * @param sourceFiles (optional)
4925
5177
  * @return Success
4926
5178
  */
4927
- batchCreateItemsFromUrl(itemType, tenantId, body) {
4928
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/from-url/batch-create?";
5179
+ batchCreateItemsFromFile(itemType, tenantId, sourceFiles) {
5180
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-file/batch-create?";
4929
5181
  if (itemType !== undefined && itemType !== null)
4930
5182
  url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
4931
5183
  if (tenantId === null)
@@ -4933,24 +5185,25 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4933
5185
  else if (tenantId !== undefined)
4934
5186
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
4935
5187
  url_ = url_.replace(/[?&]$/, "");
4936
- const content_ = JSON.stringify(body);
5188
+ const content_ = new FormData();
5189
+ if (sourceFiles !== null && sourceFiles !== undefined)
5190
+ sourceFiles.forEach(item_ => content_.append("sourceFiles", item_.data, item_.fileName ? item_.fileName : "sourceFiles"));
4937
5191
  let options_ = {
4938
5192
  body: content_,
4939
5193
  observe: "response",
4940
5194
  responseType: "blob",
4941
5195
  headers: new HttpHeaders({
4942
- "Content-Type": "application/json",
4943
5196
  "Accept": "application/json"
4944
5197
  })
4945
5198
  };
4946
5199
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
4947
5200
  return this.http.request("post", url_, transformedOptions_);
4948
5201
  })).pipe(mergeMap((response_) => {
4949
- return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromUrl(r));
5202
+ return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromFile(r));
4950
5203
  })).pipe(catchError((response_) => {
4951
5204
  if (response_ instanceof HttpResponseBase) {
4952
5205
  try {
4953
- return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromUrl(r));
5206
+ return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromFile(r));
4954
5207
  }
4955
5208
  catch (e) {
4956
5209
  return throwError(e);
@@ -4960,7 +5213,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4960
5213
  return throwError(response_);
4961
5214
  }));
4962
5215
  }
4963
- processBatchCreateItemsFromUrl(response) {
5216
+ processBatchCreateItemsFromFile(response) {
4964
5217
  const status = response.status;
4965
5218
  const responseBlob = response instanceof HttpResponse ? response.body :
4966
5219
  response.error instanceof Blob ? response.error : undefined;
@@ -4984,6 +5237,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
4984
5237
  return throwException("Not Found", status, _responseText, _headers, result404);
4985
5238
  }));
4986
5239
  }
5240
+ else if (status === 409) {
5241
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5242
+ let result409 = null;
5243
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5244
+ return throwException("Conflict", status, _responseText, _headers, result409);
5245
+ }));
5246
+ }
4987
5247
  else if (status === 401) {
4988
5248
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4989
5249
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -5002,17 +5262,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5002
5262
  return of(null);
5003
5263
  }
5004
5264
  /**
5005
- * Render product proof image with specified parameters.
5006
- * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
5007
- (default value is 'false').
5265
+ * Creates print-product item from image file taken from storage.
5266
+ * @param itemType (optional) Desired item type.
5008
5267
  * @param tenantId (optional) Tenant identifier
5009
- * @param body (optional) Preview parameters.
5268
+ * @param body (optional) Operation parameters.
5010
5269
  * @return Success
5011
5270
  */
5012
- renderProduct(attachment, tenantId, body) {
5013
- let url_ = this.baseUrl + "/api/atoms/v1/designs/model/render-proof?";
5014
- if (attachment !== undefined && attachment !== null)
5015
- url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
5271
+ createItemFromStorage(itemType, tenantId, body) {
5272
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage?";
5273
+ if (itemType !== undefined && itemType !== null)
5274
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
5016
5275
  if (tenantId === null)
5017
5276
  throw new Error("The parameter 'tenantId' cannot be null.");
5018
5277
  else if (tenantId !== undefined)
@@ -5025,17 +5284,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5025
5284
  responseType: "blob",
5026
5285
  headers: new HttpHeaders({
5027
5286
  "Content-Type": "application/json",
5028
- "Accept": "application/octet-stream"
5287
+ "Accept": "application/json"
5029
5288
  })
5030
5289
  };
5031
5290
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5032
5291
  return this.http.request("post", url_, transformedOptions_);
5033
5292
  })).pipe(mergeMap((response_) => {
5034
- return this.transformResult(url_, response_, (r) => this.processRenderProduct(r));
5293
+ return this.transformResult(url_, response_, (r) => this.processCreateItemFromStorage(r));
5035
5294
  })).pipe(catchError((response_) => {
5036
5295
  if (response_ instanceof HttpResponseBase) {
5037
5296
  try {
5038
- return this.transformResult(url_, response_, (r) => this.processRenderProduct(r));
5297
+ return this.transformResult(url_, response_, (r) => this.processCreateItemFromStorage(r));
5039
5298
  }
5040
5299
  catch (e) {
5041
5300
  return throwError(e);
@@ -5045,7 +5304,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5045
5304
  return throwError(response_);
5046
5305
  }));
5047
5306
  }
5048
- processRenderProduct(response) {
5307
+ processCreateItemFromStorage(response) {
5049
5308
  const status = response.status;
5050
5309
  const responseBlob = response instanceof HttpResponse ? response.body :
5051
5310
  response.error instanceof Blob ? response.error : undefined;
@@ -5055,11 +5314,26 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5055
5314
  _headers[key] = response.headers.get(key);
5056
5315
  }
5057
5316
  }
5058
- if (status === 200 || status === 206) {
5059
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5060
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5061
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5062
- return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
5317
+ if (status === 200) {
5318
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5319
+ let result200 = null;
5320
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5321
+ return of(result200);
5322
+ }));
5323
+ }
5324
+ else if (status === 404) {
5325
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5326
+ let result404 = null;
5327
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5328
+ return throwException("Not Found", status, _responseText, _headers, result404);
5329
+ }));
5330
+ }
5331
+ else if (status === 409) {
5332
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5333
+ let result409 = null;
5334
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5335
+ return throwException("Conflict", status, _responseText, _headers, result409);
5336
+ }));
5063
5337
  }
5064
5338
  else if (status === 401) {
5065
5339
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
@@ -5079,17 +5353,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5079
5353
  return of(null);
5080
5354
  }
5081
5355
  /**
5082
- * Renders a design preview with the specified parameters.
5083
- * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
5084
- (default value is 'false').
5356
+ * Creates multiple print-product items from the specified image files in storage.
5357
+ * @param itemType (optional) Desired items type.
5085
5358
  * @param tenantId (optional) Tenant identifier
5086
- * @param body (optional) Render model with preview parameters.
5359
+ * @param body (optional) Operation parameters.
5087
5360
  * @return Success
5088
5361
  */
5089
- renderDesignPreview(attachment, tenantId, body) {
5090
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
5091
- if (attachment !== undefined && attachment !== null)
5092
- url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
5362
+ batchCreateItemsFromStorage(itemType, tenantId, body) {
5363
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-storage/batch-create?";
5364
+ if (itemType !== undefined && itemType !== null)
5365
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
5093
5366
  if (tenantId === null)
5094
5367
  throw new Error("The parameter 'tenantId' cannot be null.");
5095
5368
  else if (tenantId !== undefined)
@@ -5102,17 +5375,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5102
5375
  responseType: "blob",
5103
5376
  headers: new HttpHeaders({
5104
5377
  "Content-Type": "application/json",
5105
- "Accept": "application/octet-stream"
5378
+ "Accept": "application/json"
5106
5379
  })
5107
5380
  };
5108
5381
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5109
5382
  return this.http.request("post", url_, transformedOptions_);
5110
5383
  })).pipe(mergeMap((response_) => {
5111
- return this.transformResult(url_, response_, (r) => this.processRenderDesignPreview(r));
5384
+ return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromStorage(r));
5112
5385
  })).pipe(catchError((response_) => {
5113
5386
  if (response_ instanceof HttpResponseBase) {
5114
5387
  try {
5115
- return this.transformResult(url_, response_, (r) => this.processRenderDesignPreview(r));
5388
+ return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromStorage(r));
5116
5389
  }
5117
5390
  catch (e) {
5118
5391
  return throwError(e);
@@ -5122,7 +5395,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5122
5395
  return throwError(response_);
5123
5396
  }));
5124
5397
  }
5125
- processRenderDesignPreview(response) {
5398
+ processBatchCreateItemsFromStorage(response) {
5126
5399
  const status = response.status;
5127
5400
  const responseBlob = response instanceof HttpResponse ? response.body :
5128
5401
  response.error instanceof Blob ? response.error : undefined;
@@ -5132,11 +5405,26 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5132
5405
  _headers[key] = response.headers.get(key);
5133
5406
  }
5134
5407
  }
5135
- if (status === 200 || status === 206) {
5136
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5137
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5138
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5139
- return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
5408
+ if (status === 200) {
5409
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5410
+ let result200 = null;
5411
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5412
+ return of(result200);
5413
+ }));
5414
+ }
5415
+ else if (status === 404) {
5416
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5417
+ let result404 = null;
5418
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5419
+ return throwException("Not Found", status, _responseText, _headers, result404);
5420
+ }));
5421
+ }
5422
+ else if (status === 409) {
5423
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5424
+ let result409 = null;
5425
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5426
+ return throwException("Conflict", status, _responseText, _headers, result409);
5427
+ }));
5140
5428
  }
5141
5429
  else if (status === 401) {
5142
5430
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
@@ -5156,13 +5444,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5156
5444
  return of(null);
5157
5445
  }
5158
5446
  /**
5159
- * Renders a design preview with the specified parameters and saves rendering result as resource.
5447
+ * Creates print-product item from remote web image provided by URL.
5448
+ * @param itemType (optional) Desired item type.
5160
5449
  * @param tenantId (optional) Tenant identifier
5161
- * @param body (optional) Render model with preview parameters.
5450
+ * @param body (optional) Operation parameters.
5162
5451
  * @return Success
5163
5452
  */
5164
- renderDesignPreviewToResource(tenantId, body) {
5165
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview/to-resource?";
5453
+ createItemFromUrl(itemType, tenantId, body) {
5454
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url?";
5455
+ if (itemType !== undefined && itemType !== null)
5456
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
5166
5457
  if (tenantId === null)
5167
5458
  throw new Error("The parameter 'tenantId' cannot be null.");
5168
5459
  else if (tenantId !== undefined)
@@ -5181,11 +5472,11 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5181
5472
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5182
5473
  return this.http.request("post", url_, transformedOptions_);
5183
5474
  })).pipe(mergeMap((response_) => {
5184
- return this.transformResult(url_, response_, (r) => this.processRenderDesignPreviewToResource(r));
5475
+ return this.transformResult(url_, response_, (r) => this.processCreateItemFromUrl(r));
5185
5476
  })).pipe(catchError((response_) => {
5186
5477
  if (response_ instanceof HttpResponseBase) {
5187
5478
  try {
5188
- return this.transformResult(url_, response_, (r) => this.processRenderDesignPreviewToResource(r));
5479
+ return this.transformResult(url_, response_, (r) => this.processCreateItemFromUrl(r));
5189
5480
  }
5190
5481
  catch (e) {
5191
5482
  return throwError(e);
@@ -5195,7 +5486,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5195
5486
  return throwError(response_);
5196
5487
  }));
5197
5488
  }
5198
- processRenderDesignPreviewToResource(response) {
5489
+ processCreateItemFromUrl(response) {
5199
5490
  const status = response.status;
5200
5491
  const responseBlob = response instanceof HttpResponse ? response.body :
5201
5492
  response.error instanceof Blob ? response.error : undefined;
@@ -5212,6 +5503,13 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5212
5503
  return of(result200);
5213
5504
  }));
5214
5505
  }
5506
+ else if (status === 404) {
5507
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5508
+ let result404 = null;
5509
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5510
+ return throwException("Not Found", status, _responseText, _headers, result404);
5511
+ }));
5512
+ }
5215
5513
  else if (status === 409) {
5216
5514
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5217
5515
  let result409 = null;
@@ -5237,17 +5535,16 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5237
5535
  return of(null);
5238
5536
  }
5239
5537
  /**
5240
- * Renders a design proof with the specified parameters.
5241
- * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
5242
- (default value is 'false').
5538
+ * Creates multiple print-product items from remote web images provided by URLs list.
5539
+ * @param itemType (optional) Desired items type.
5243
5540
  * @param tenantId (optional) Tenant identifier
5244
- * @param body (optional) Render model with proof parameters.
5541
+ * @param body (optional) Operation parameters.
5245
5542
  * @return Success
5246
5543
  */
5247
- renderDesignProof(attachment, tenantId, body) {
5248
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
5249
- if (attachment !== undefined && attachment !== null)
5250
- url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
5544
+ batchCreateItemsFromUrl(itemType, tenantId, body) {
5545
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/items/from-url/batch-create?";
5546
+ if (itemType !== undefined && itemType !== null)
5547
+ url_ += "itemType=" + encodeURIComponent("" + itemType) + "&";
5251
5548
  if (tenantId === null)
5252
5549
  throw new Error("The parameter 'tenantId' cannot be null.");
5253
5550
  else if (tenantId !== undefined)
@@ -5260,17 +5557,17 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5260
5557
  responseType: "blob",
5261
5558
  headers: new HttpHeaders({
5262
5559
  "Content-Type": "application/json",
5263
- "Accept": "application/octet-stream"
5560
+ "Accept": "application/json"
5264
5561
  })
5265
5562
  };
5266
5563
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5267
5564
  return this.http.request("post", url_, transformedOptions_);
5268
5565
  })).pipe(mergeMap((response_) => {
5269
- return this.transformResult(url_, response_, (r) => this.processRenderDesignProof(r));
5566
+ return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromUrl(r));
5270
5567
  })).pipe(catchError((response_) => {
5271
5568
  if (response_ instanceof HttpResponseBase) {
5272
5569
  try {
5273
- return this.transformResult(url_, response_, (r) => this.processRenderDesignProof(r));
5570
+ return this.transformResult(url_, response_, (r) => this.processBatchCreateItemsFromUrl(r));
5274
5571
  }
5275
5572
  catch (e) {
5276
5573
  return throwError(e);
@@ -5280,7 +5577,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5280
5577
  return throwError(response_);
5281
5578
  }));
5282
5579
  }
5283
- processRenderDesignProof(response) {
5580
+ processBatchCreateItemsFromUrl(response) {
5284
5581
  const status = response.status;
5285
5582
  const responseBlob = response instanceof HttpResponse ? response.body :
5286
5583
  response.error instanceof Blob ? response.error : undefined;
@@ -5290,13 +5587,1740 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5290
5587
  _headers[key] = response.headers.get(key);
5291
5588
  }
5292
5589
  }
5293
- if (status === 200 || status === 206) {
5294
- const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5295
- const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5296
- const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5297
- return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
5298
- }
5299
- else if (status === 401) {
5590
+ if (status === 200) {
5591
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5592
+ let result200 = null;
5593
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5594
+ return of(result200);
5595
+ }));
5596
+ }
5597
+ else if (status === 404) {
5598
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5599
+ let result404 = null;
5600
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5601
+ return throwException("Not Found", status, _responseText, _headers, result404);
5602
+ }));
5603
+ }
5604
+ else if (status === 409) {
5605
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5606
+ let result409 = null;
5607
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5608
+ return throwException("Conflict", status, _responseText, _headers, result409);
5609
+ }));
5610
+ }
5611
+ else if (status === 401) {
5612
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5613
+ return throwException("Unauthorized", status, _responseText, _headers);
5614
+ }));
5615
+ }
5616
+ else if (status === 403) {
5617
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5618
+ return throwException("Forbidden", status, _responseText, _headers);
5619
+ }));
5620
+ }
5621
+ else if (status !== 200 && status !== 204) {
5622
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5623
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5624
+ }));
5625
+ }
5626
+ return of(null);
5627
+ }
5628
+ }
5629
+ DesignAtomsPrintProductItemsApiClient.ɵprov = ɵɵdefineInjectable({ factory: function DesignAtomsPrintProductItemsApiClient_Factory() { return new DesignAtomsPrintProductItemsApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: DesignAtomsPrintProductItemsApiClient, providedIn: "root" });
5630
+ DesignAtomsPrintProductItemsApiClient.decorators = [
5631
+ { type: Injectable, args: [{
5632
+ providedIn: 'root'
5633
+ },] }
5634
+ ];
5635
+ DesignAtomsPrintProductItemsApiClient.ctorParameters = () => [
5636
+ { type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
5637
+ { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
5638
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
5639
+ ];
5640
+ class DesignAtomsServiceApiClient extends ApiClientBase {
5641
+ constructor(configuration, http, baseUrl) {
5642
+ super(configuration);
5643
+ this.jsonParseReviver = undefined;
5644
+ this.http = http;
5645
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
5646
+ }
5647
+ /**
5648
+ * Creates new design file with specified parameters and saves it in storage.
5649
+ * @param privateStorageOwner (optional) Private storage owner identifier.
5650
+ * @param tenantId (optional) Tenant identifier
5651
+ * @param body (optional) Design creation parameters.
5652
+ * @return Created
5653
+ */
5654
+ createDesign(privateStorageOwner, tenantId, body) {
5655
+ let url_ = this.baseUrl + "/api/atoms/v1/designs?";
5656
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
5657
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
5658
+ if (tenantId === null)
5659
+ throw new Error("The parameter 'tenantId' cannot be null.");
5660
+ else if (tenantId !== undefined)
5661
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5662
+ url_ = url_.replace(/[?&]$/, "");
5663
+ const content_ = JSON.stringify(body);
5664
+ let options_ = {
5665
+ body: content_,
5666
+ observe: "response",
5667
+ responseType: "blob",
5668
+ headers: new HttpHeaders({
5669
+ "Content-Type": "application/json",
5670
+ "Accept": "application/json"
5671
+ })
5672
+ };
5673
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5674
+ return this.http.request("post", url_, transformedOptions_);
5675
+ })).pipe(mergeMap((response_) => {
5676
+ return this.transformResult(url_, response_, (r) => this.processCreateDesign(r));
5677
+ })).pipe(catchError((response_) => {
5678
+ if (response_ instanceof HttpResponseBase) {
5679
+ try {
5680
+ return this.transformResult(url_, response_, (r) => this.processCreateDesign(r));
5681
+ }
5682
+ catch (e) {
5683
+ return throwError(e);
5684
+ }
5685
+ }
5686
+ else
5687
+ return throwError(response_);
5688
+ }));
5689
+ }
5690
+ processCreateDesign(response) {
5691
+ const status = response.status;
5692
+ const responseBlob = response instanceof HttpResponse ? response.body :
5693
+ response.error instanceof Blob ? response.error : undefined;
5694
+ let _headers = {};
5695
+ if (response.headers) {
5696
+ for (let key of response.headers.keys()) {
5697
+ _headers[key] = response.headers.get(key);
5698
+ }
5699
+ }
5700
+ if (status === 201) {
5701
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5702
+ let result201 = null;
5703
+ result201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5704
+ return of(result201);
5705
+ }));
5706
+ }
5707
+ else if (status === 401) {
5708
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5709
+ return throwException("Unauthorized", status, _responseText, _headers);
5710
+ }));
5711
+ }
5712
+ else if (status === 403) {
5713
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5714
+ return throwException("Forbidden", status, _responseText, _headers);
5715
+ }));
5716
+ }
5717
+ else if (status !== 200 && status !== 204) {
5718
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5719
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5720
+ }));
5721
+ }
5722
+ return of(null);
5723
+ }
5724
+ /**
5725
+ * Returns image content of the background.
5726
+ * @param id Design identifier.
5727
+ * @param surfaceIndex (optional) Surface index.
5728
+ * @param privateStorageOwner (optional) Private storage owner identifier.
5729
+ * @param tenantId (optional) Tenant identifier
5730
+ * @return Success
5731
+ */
5732
+ extractBackground(id, surfaceIndex, privateStorageOwner, tenantId) {
5733
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/background?";
5734
+ if (id === undefined || id === null)
5735
+ throw new Error("The parameter 'id' must be defined.");
5736
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5737
+ if (surfaceIndex !== undefined && surfaceIndex !== null)
5738
+ url_ += "surfaceIndex=" + encodeURIComponent("" + surfaceIndex) + "&";
5739
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
5740
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
5741
+ if (tenantId === null)
5742
+ throw new Error("The parameter 'tenantId' cannot be null.");
5743
+ else if (tenantId !== undefined)
5744
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5745
+ url_ = url_.replace(/[?&]$/, "");
5746
+ let options_ = {
5747
+ observe: "response",
5748
+ responseType: "blob",
5749
+ headers: new HttpHeaders({
5750
+ "Accept": "application/octet-stream"
5751
+ })
5752
+ };
5753
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5754
+ return this.http.request("get", url_, transformedOptions_);
5755
+ })).pipe(mergeMap((response_) => {
5756
+ return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
5757
+ })).pipe(catchError((response_) => {
5758
+ if (response_ instanceof HttpResponseBase) {
5759
+ try {
5760
+ return this.transformResult(url_, response_, (r) => this.processExtractBackground(r));
5761
+ }
5762
+ catch (e) {
5763
+ return throwError(e);
5764
+ }
5765
+ }
5766
+ else
5767
+ return throwError(response_);
5768
+ }));
5769
+ }
5770
+ processExtractBackground(response) {
5771
+ const status = response.status;
5772
+ const responseBlob = response instanceof HttpResponse ? response.body :
5773
+ response.error instanceof Blob ? response.error : undefined;
5774
+ let _headers = {};
5775
+ if (response.headers) {
5776
+ for (let key of response.headers.keys()) {
5777
+ _headers[key] = response.headers.get(key);
5778
+ }
5779
+ }
5780
+ if (status === 200 || status === 206) {
5781
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
5782
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
5783
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
5784
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
5785
+ }
5786
+ else if (status === 404) {
5787
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5788
+ let result404 = null;
5789
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5790
+ return throwException("Not Found", status, _responseText, _headers, result404);
5791
+ }));
5792
+ }
5793
+ else if (status === 409) {
5794
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5795
+ let result409 = null;
5796
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5797
+ return throwException("Conflict", status, _responseText, _headers, result409);
5798
+ }));
5799
+ }
5800
+ else if (status === 401) {
5801
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5802
+ return throwException("Unauthorized", status, _responseText, _headers);
5803
+ }));
5804
+ }
5805
+ else if (status === 403) {
5806
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5807
+ return throwException("Forbidden", status, _responseText, _headers);
5808
+ }));
5809
+ }
5810
+ else if (status !== 200 && status !== 204) {
5811
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5812
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5813
+ }));
5814
+ }
5815
+ return of(null);
5816
+ }
5817
+ /**
5818
+ * Sets specified editor-mockups for selected design surfaces.
5819
+ * @param id Design identifier.
5820
+ * @param privateStorageOwner (optional) Private storage owner identifier.
5821
+ * @param tenantId (optional) Tenant identifier
5822
+ * @param body (optional) Operation parameters.
5823
+ * @return No Content
5824
+ */
5825
+ setEditorMockups(id, privateStorageOwner, tenantId, body) {
5826
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/editor-mockups?";
5827
+ if (id === undefined || id === null)
5828
+ throw new Error("The parameter 'id' must be defined.");
5829
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5830
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
5831
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
5832
+ if (tenantId === null)
5833
+ throw new Error("The parameter 'tenantId' cannot be null.");
5834
+ else if (tenantId !== undefined)
5835
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5836
+ url_ = url_.replace(/[?&]$/, "");
5837
+ const content_ = JSON.stringify(body);
5838
+ let options_ = {
5839
+ body: content_,
5840
+ observe: "response",
5841
+ responseType: "blob",
5842
+ headers: new HttpHeaders({
5843
+ "Content-Type": "application/json",
5844
+ })
5845
+ };
5846
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5847
+ return this.http.request("put", url_, transformedOptions_);
5848
+ })).pipe(mergeMap((response_) => {
5849
+ return this.transformResult(url_, response_, (r) => this.processSetEditorMockups(r));
5850
+ })).pipe(catchError((response_) => {
5851
+ if (response_ instanceof HttpResponseBase) {
5852
+ try {
5853
+ return this.transformResult(url_, response_, (r) => this.processSetEditorMockups(r));
5854
+ }
5855
+ catch (e) {
5856
+ return throwError(e);
5857
+ }
5858
+ }
5859
+ else
5860
+ return throwError(response_);
5861
+ }));
5862
+ }
5863
+ processSetEditorMockups(response) {
5864
+ const status = response.status;
5865
+ const responseBlob = response instanceof HttpResponse ? response.body :
5866
+ response.error instanceof Blob ? response.error : undefined;
5867
+ let _headers = {};
5868
+ if (response.headers) {
5869
+ for (let key of response.headers.keys()) {
5870
+ _headers[key] = response.headers.get(key);
5871
+ }
5872
+ }
5873
+ if (status === 204) {
5874
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5875
+ return of(null);
5876
+ }));
5877
+ }
5878
+ else if (status === 400) {
5879
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5880
+ let result400 = null;
5881
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5882
+ return throwException("Bad Request", status, _responseText, _headers, result400);
5883
+ }));
5884
+ }
5885
+ else if (status === 404) {
5886
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5887
+ let result404 = null;
5888
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5889
+ return throwException("Not Found", status, _responseText, _headers, result404);
5890
+ }));
5891
+ }
5892
+ else if (status === 401) {
5893
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5894
+ return throwException("Unauthorized", status, _responseText, _headers);
5895
+ }));
5896
+ }
5897
+ else if (status === 403) {
5898
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5899
+ return throwException("Forbidden", status, _responseText, _headers);
5900
+ }));
5901
+ }
5902
+ else if (status !== 200 && status !== 204) {
5903
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5904
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5905
+ }));
5906
+ }
5907
+ return of(null);
5908
+ }
5909
+ /**
5910
+ * Returns design parameters stored in product model.
5911
+ * @param id Design identifier.
5912
+ * @param privateStorageOwner (optional) Private storage owner identifier.
5913
+ * @param tenantId (optional) Tenant identifier
5914
+ * @return Success
5915
+ */
5916
+ getDesignParameters(id, privateStorageOwner, tenantId) {
5917
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/parameters?";
5918
+ if (id === undefined || id === null)
5919
+ throw new Error("The parameter 'id' must be defined.");
5920
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
5921
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
5922
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
5923
+ if (tenantId === null)
5924
+ throw new Error("The parameter 'tenantId' cannot be null.");
5925
+ else if (tenantId !== undefined)
5926
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5927
+ url_ = url_.replace(/[?&]$/, "");
5928
+ let options_ = {
5929
+ observe: "response",
5930
+ responseType: "blob",
5931
+ headers: new HttpHeaders({
5932
+ "Accept": "application/json"
5933
+ })
5934
+ };
5935
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5936
+ return this.http.request("get", url_, transformedOptions_);
5937
+ })).pipe(mergeMap((response_) => {
5938
+ return this.transformResult(url_, response_, (r) => this.processGetDesignParameters(r));
5939
+ })).pipe(catchError((response_) => {
5940
+ if (response_ instanceof HttpResponseBase) {
5941
+ try {
5942
+ return this.transformResult(url_, response_, (r) => this.processGetDesignParameters(r));
5943
+ }
5944
+ catch (e) {
5945
+ return throwError(e);
5946
+ }
5947
+ }
5948
+ else
5949
+ return throwError(response_);
5950
+ }));
5951
+ }
5952
+ processGetDesignParameters(response) {
5953
+ const status = response.status;
5954
+ const responseBlob = response instanceof HttpResponse ? response.body :
5955
+ response.error instanceof Blob ? response.error : undefined;
5956
+ let _headers = {};
5957
+ if (response.headers) {
5958
+ for (let key of response.headers.keys()) {
5959
+ _headers[key] = response.headers.get(key);
5960
+ }
5961
+ }
5962
+ if (status === 200) {
5963
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5964
+ let result200 = null;
5965
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5966
+ return of(result200);
5967
+ }));
5968
+ }
5969
+ else if (status === 404) {
5970
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5971
+ let result404 = null;
5972
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5973
+ return throwException("Not Found", status, _responseText, _headers, result404);
5974
+ }));
5975
+ }
5976
+ else if (status === 401) {
5977
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5978
+ return throwException("Unauthorized", status, _responseText, _headers);
5979
+ }));
5980
+ }
5981
+ else if (status === 403) {
5982
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5983
+ return throwException("Forbidden", status, _responseText, _headers);
5984
+ }));
5985
+ }
5986
+ else if (status !== 200 && status !== 204) {
5987
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5988
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5989
+ }));
5990
+ }
5991
+ return of(null);
5992
+ }
5993
+ /**
5994
+ * Loads a data schema from design file taken from storage.
5995
+ * @param id Design identifier.
5996
+ * @param privateStorageOwner (optional) Private storage owner identifier.
5997
+ * @param tenantId (optional) Tenant identifier
5998
+ * @return Success
5999
+ */
6000
+ loadDataSchema(id, privateStorageOwner, tenantId) {
6001
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/schema?";
6002
+ if (id === undefined || id === null)
6003
+ throw new Error("The parameter 'id' must be defined.");
6004
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6005
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6006
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6007
+ if (tenantId === null)
6008
+ throw new Error("The parameter 'tenantId' cannot be null.");
6009
+ else if (tenantId !== undefined)
6010
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6011
+ url_ = url_.replace(/[?&]$/, "");
6012
+ let options_ = {
6013
+ observe: "response",
6014
+ responseType: "blob",
6015
+ headers: new HttpHeaders({
6016
+ "Accept": "application/octet-stream"
6017
+ })
6018
+ };
6019
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6020
+ return this.http.request("get", url_, transformedOptions_);
6021
+ })).pipe(mergeMap((response_) => {
6022
+ return this.transformResult(url_, response_, (r) => this.processLoadDataSchema(r));
6023
+ })).pipe(catchError((response_) => {
6024
+ if (response_ instanceof HttpResponseBase) {
6025
+ try {
6026
+ return this.transformResult(url_, response_, (r) => this.processLoadDataSchema(r));
6027
+ }
6028
+ catch (e) {
6029
+ return throwError(e);
6030
+ }
6031
+ }
6032
+ else
6033
+ return throwError(response_);
6034
+ }));
6035
+ }
6036
+ processLoadDataSchema(response) {
6037
+ const status = response.status;
6038
+ const responseBlob = response instanceof HttpResponse ? response.body :
6039
+ response.error instanceof Blob ? response.error : undefined;
6040
+ let _headers = {};
6041
+ if (response.headers) {
6042
+ for (let key of response.headers.keys()) {
6043
+ _headers[key] = response.headers.get(key);
6044
+ }
6045
+ }
6046
+ if (status === 200 || status === 206) {
6047
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
6048
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
6049
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
6050
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
6051
+ }
6052
+ else if (status === 404) {
6053
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6054
+ let result404 = null;
6055
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6056
+ return throwException("Not Found", status, _responseText, _headers, result404);
6057
+ }));
6058
+ }
6059
+ else if (status === 409) {
6060
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6061
+ let result409 = null;
6062
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6063
+ return throwException("Conflict", status, _responseText, _headers, result409);
6064
+ }));
6065
+ }
6066
+ else if (status === 401) {
6067
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6068
+ return throwException("Unauthorized", status, _responseText, _headers);
6069
+ }));
6070
+ }
6071
+ else if (status === 403) {
6072
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6073
+ return throwException("Forbidden", status, _responseText, _headers);
6074
+ }));
6075
+ }
6076
+ else if (status !== 200 && status !== 204) {
6077
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6078
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6079
+ }));
6080
+ }
6081
+ return of(null);
6082
+ }
6083
+ /**
6084
+ * Loads a toggle set from design file taken from storage.
6085
+ * @param id Design identifier.
6086
+ * @param privateStorageOwner (optional) Private storage owner identifier.
6087
+ * @param tenantId (optional) Tenant identifier
6088
+ * @return Success
6089
+ */
6090
+ loadToggleSet(id, privateStorageOwner, tenantId) {
6091
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/toggle-set?";
6092
+ if (id === undefined || id === null)
6093
+ throw new Error("The parameter 'id' must be defined.");
6094
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6095
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6096
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6097
+ if (tenantId === null)
6098
+ throw new Error("The parameter 'tenantId' cannot be null.");
6099
+ else if (tenantId !== undefined)
6100
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6101
+ url_ = url_.replace(/[?&]$/, "");
6102
+ let options_ = {
6103
+ observe: "response",
6104
+ responseType: "blob",
6105
+ headers: new HttpHeaders({
6106
+ "Accept": "application/octet-stream"
6107
+ })
6108
+ };
6109
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6110
+ return this.http.request("get", url_, transformedOptions_);
6111
+ })).pipe(mergeMap((response_) => {
6112
+ return this.transformResult(url_, response_, (r) => this.processLoadToggleSet(r));
6113
+ })).pipe(catchError((response_) => {
6114
+ if (response_ instanceof HttpResponseBase) {
6115
+ try {
6116
+ return this.transformResult(url_, response_, (r) => this.processLoadToggleSet(r));
6117
+ }
6118
+ catch (e) {
6119
+ return throwError(e);
6120
+ }
6121
+ }
6122
+ else
6123
+ return throwError(response_);
6124
+ }));
6125
+ }
6126
+ processLoadToggleSet(response) {
6127
+ const status = response.status;
6128
+ const responseBlob = response instanceof HttpResponse ? response.body :
6129
+ response.error instanceof Blob ? response.error : undefined;
6130
+ let _headers = {};
6131
+ if (response.headers) {
6132
+ for (let key of response.headers.keys()) {
6133
+ _headers[key] = response.headers.get(key);
6134
+ }
6135
+ }
6136
+ if (status === 200 || status === 206) {
6137
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
6138
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
6139
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
6140
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
6141
+ }
6142
+ else if (status === 404) {
6143
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6144
+ let result404 = null;
6145
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6146
+ return throwException("Not Found", status, _responseText, _headers, result404);
6147
+ }));
6148
+ }
6149
+ else if (status === 409) {
6150
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6151
+ let result409 = null;
6152
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6153
+ return throwException("Conflict", status, _responseText, _headers, result409);
6154
+ }));
6155
+ }
6156
+ else if (status === 401) {
6157
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6158
+ return throwException("Unauthorized", status, _responseText, _headers);
6159
+ }));
6160
+ }
6161
+ else if (status === 403) {
6162
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6163
+ return throwException("Forbidden", status, _responseText, _headers);
6164
+ }));
6165
+ }
6166
+ else if (status !== 200 && status !== 204) {
6167
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6168
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6169
+ }));
6170
+ }
6171
+ return of(null);
6172
+ }
6173
+ /**
6174
+ * Returns variable items information for design file taken from storage.
6175
+ * @param id Design identifier.
6176
+ * @param privateStorageOwner (optional) Private storage owner identifier.
6177
+ * @param tenantId (optional) Tenant identifier
6178
+ * @return Success
6179
+ */
6180
+ getVariables(id, privateStorageOwner, tenantId) {
6181
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
6182
+ if (id === undefined || id === null)
6183
+ throw new Error("The parameter 'id' must be defined.");
6184
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6185
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6186
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6187
+ if (tenantId === null)
6188
+ throw new Error("The parameter 'tenantId' cannot be null.");
6189
+ else if (tenantId !== undefined)
6190
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6191
+ url_ = url_.replace(/[?&]$/, "");
6192
+ let options_ = {
6193
+ observe: "response",
6194
+ responseType: "blob",
6195
+ headers: new HttpHeaders({
6196
+ "Accept": "application/json"
6197
+ })
6198
+ };
6199
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6200
+ return this.http.request("get", url_, transformedOptions_);
6201
+ })).pipe(mergeMap((response_) => {
6202
+ return this.transformResult(url_, response_, (r) => this.processGetVariables(r));
6203
+ })).pipe(catchError((response_) => {
6204
+ if (response_ instanceof HttpResponseBase) {
6205
+ try {
6206
+ return this.transformResult(url_, response_, (r) => this.processGetVariables(r));
6207
+ }
6208
+ catch (e) {
6209
+ return throwError(e);
6210
+ }
6211
+ }
6212
+ else
6213
+ return throwError(response_);
6214
+ }));
6215
+ }
6216
+ processGetVariables(response) {
6217
+ const status = response.status;
6218
+ const responseBlob = response instanceof HttpResponse ? response.body :
6219
+ response.error instanceof Blob ? response.error : undefined;
6220
+ let _headers = {};
6221
+ if (response.headers) {
6222
+ for (let key of response.headers.keys()) {
6223
+ _headers[key] = response.headers.get(key);
6224
+ }
6225
+ }
6226
+ if (status === 200) {
6227
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6228
+ let result200 = null;
6229
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6230
+ return of(result200);
6231
+ }));
6232
+ }
6233
+ else if (status === 404) {
6234
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6235
+ let result404 = null;
6236
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6237
+ return throwException("Not Found", status, _responseText, _headers, result404);
6238
+ }));
6239
+ }
6240
+ else if (status === 401) {
6241
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6242
+ return throwException("Unauthorized", status, _responseText, _headers);
6243
+ }));
6244
+ }
6245
+ else if (status === 403) {
6246
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6247
+ return throwException("Forbidden", status, _responseText, _headers);
6248
+ }));
6249
+ }
6250
+ else if (status !== 200 && status !== 204) {
6251
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6252
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6253
+ }));
6254
+ }
6255
+ return of(null);
6256
+ }
6257
+ /**
6258
+ * Saves variable items values for design file taken from storage.
6259
+ * @param id Design identifier.
6260
+ * @param privateStorageOwner (optional) Private storage owner identifier.
6261
+ * @param tenantId (optional) Tenant identifier
6262
+ * @param body (optional) Design variable values.
6263
+ * @return Success
6264
+ */
6265
+ setVariables(id, privateStorageOwner, tenantId, body) {
6266
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/variables?";
6267
+ if (id === undefined || id === null)
6268
+ throw new Error("The parameter 'id' must be defined.");
6269
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6270
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6271
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6272
+ if (tenantId === null)
6273
+ throw new Error("The parameter 'tenantId' cannot be null.");
6274
+ else if (tenantId !== undefined)
6275
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6276
+ url_ = url_.replace(/[?&]$/, "");
6277
+ const content_ = JSON.stringify(body);
6278
+ let options_ = {
6279
+ body: content_,
6280
+ observe: "response",
6281
+ responseType: "blob",
6282
+ headers: new HttpHeaders({
6283
+ "Content-Type": "application/json",
6284
+ })
6285
+ };
6286
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6287
+ return this.http.request("put", url_, transformedOptions_);
6288
+ })).pipe(mergeMap((response_) => {
6289
+ return this.transformResult(url_, response_, (r) => this.processSetVariables(r));
6290
+ })).pipe(catchError((response_) => {
6291
+ if (response_ instanceof HttpResponseBase) {
6292
+ try {
6293
+ return this.transformResult(url_, response_, (r) => this.processSetVariables(r));
6294
+ }
6295
+ catch (e) {
6296
+ return throwError(e);
6297
+ }
6298
+ }
6299
+ else
6300
+ return throwError(response_);
6301
+ }));
6302
+ }
6303
+ processSetVariables(response) {
6304
+ const status = response.status;
6305
+ const responseBlob = response instanceof HttpResponse ? response.body :
6306
+ response.error instanceof Blob ? response.error : undefined;
6307
+ let _headers = {};
6308
+ if (response.headers) {
6309
+ for (let key of response.headers.keys()) {
6310
+ _headers[key] = response.headers.get(key);
6311
+ }
6312
+ }
6313
+ if (status === 200) {
6314
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6315
+ return of(null);
6316
+ }));
6317
+ }
6318
+ else if (status === 404) {
6319
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6320
+ let result404 = null;
6321
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6322
+ return throwException("Not Found", status, _responseText, _headers, result404);
6323
+ }));
6324
+ }
6325
+ else if (status === 409) {
6326
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6327
+ let result409 = null;
6328
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6329
+ return throwException("Conflict", status, _responseText, _headers, result409);
6330
+ }));
6331
+ }
6332
+ else if (status === 401) {
6333
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6334
+ return throwException("Unauthorized", status, _responseText, _headers);
6335
+ }));
6336
+ }
6337
+ else if (status === 403) {
6338
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6339
+ return throwException("Forbidden", status, _responseText, _headers);
6340
+ }));
6341
+ }
6342
+ else if (status !== 200 && status !== 204) {
6343
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6344
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6345
+ }));
6346
+ }
6347
+ return of(null);
6348
+ }
6349
+ /**
6350
+ * Loads variable data printing information from design file taken from storage.
6351
+ * @param id Design identifier.
6352
+ * @param privateStorageOwner (optional) Private storage owner identifier.
6353
+ * @param tenantId (optional) Tenant identifier
6354
+ * @return Success
6355
+ */
6356
+ loadVdpData(id, privateStorageOwner, tenantId) {
6357
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
6358
+ if (id === undefined || id === null)
6359
+ throw new Error("The parameter 'id' must be defined.");
6360
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6361
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6362
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6363
+ if (tenantId === null)
6364
+ throw new Error("The parameter 'tenantId' cannot be null.");
6365
+ else if (tenantId !== undefined)
6366
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6367
+ url_ = url_.replace(/[?&]$/, "");
6368
+ let options_ = {
6369
+ observe: "response",
6370
+ responseType: "blob",
6371
+ headers: new HttpHeaders({
6372
+ "Accept": "application/json"
6373
+ })
6374
+ };
6375
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6376
+ return this.http.request("get", url_, transformedOptions_);
6377
+ })).pipe(mergeMap((response_) => {
6378
+ return this.transformResult(url_, response_, (r) => this.processLoadVdpData(r));
6379
+ })).pipe(catchError((response_) => {
6380
+ if (response_ instanceof HttpResponseBase) {
6381
+ try {
6382
+ return this.transformResult(url_, response_, (r) => this.processLoadVdpData(r));
6383
+ }
6384
+ catch (e) {
6385
+ return throwError(e);
6386
+ }
6387
+ }
6388
+ else
6389
+ return throwError(response_);
6390
+ }));
6391
+ }
6392
+ processLoadVdpData(response) {
6393
+ const status = response.status;
6394
+ const responseBlob = response instanceof HttpResponse ? response.body :
6395
+ response.error instanceof Blob ? response.error : undefined;
6396
+ let _headers = {};
6397
+ if (response.headers) {
6398
+ for (let key of response.headers.keys()) {
6399
+ _headers[key] = response.headers.get(key);
6400
+ }
6401
+ }
6402
+ if (status === 200) {
6403
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6404
+ let result200 = null;
6405
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6406
+ return of(result200);
6407
+ }));
6408
+ }
6409
+ else if (status === 404) {
6410
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6411
+ let result404 = null;
6412
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6413
+ return throwException("Not Found", status, _responseText, _headers, result404);
6414
+ }));
6415
+ }
6416
+ else if (status === 409) {
6417
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6418
+ let result409 = null;
6419
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6420
+ return throwException("Conflict", status, _responseText, _headers, result409);
6421
+ }));
6422
+ }
6423
+ else if (status === 401) {
6424
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6425
+ return throwException("Unauthorized", status, _responseText, _headers);
6426
+ }));
6427
+ }
6428
+ else if (status === 403) {
6429
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6430
+ return throwException("Forbidden", status, _responseText, _headers);
6431
+ }));
6432
+ }
6433
+ else if (status !== 200 && status !== 204) {
6434
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6435
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6436
+ }));
6437
+ }
6438
+ return of(null);
6439
+ }
6440
+ /**
6441
+ * Saves variable data printing information to design file and updates design in storage.
6442
+ * @param id Design identifier.
6443
+ * @param privateStorageOwner (optional) Private storage owner identifier.
6444
+ * @param tenantId (optional) Tenant identifier
6445
+ * @param body (optional) Serialized vdp data.
6446
+ * @return Success
6447
+ */
6448
+ saveVdpData(id, privateStorageOwner, tenantId, body) {
6449
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
6450
+ if (id === undefined || id === null)
6451
+ throw new Error("The parameter 'id' must be defined.");
6452
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6453
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6454
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6455
+ if (tenantId === null)
6456
+ throw new Error("The parameter 'tenantId' cannot be null.");
6457
+ else if (tenantId !== undefined)
6458
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6459
+ url_ = url_.replace(/[?&]$/, "");
6460
+ const content_ = JSON.stringify(body);
6461
+ let options_ = {
6462
+ body: content_,
6463
+ observe: "response",
6464
+ responseType: "blob",
6465
+ headers: new HttpHeaders({
6466
+ "Content-Type": "application/json",
6467
+ })
6468
+ };
6469
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6470
+ return this.http.request("put", url_, transformedOptions_);
6471
+ })).pipe(mergeMap((response_) => {
6472
+ return this.transformResult(url_, response_, (r) => this.processSaveVdpData(r));
6473
+ })).pipe(catchError((response_) => {
6474
+ if (response_ instanceof HttpResponseBase) {
6475
+ try {
6476
+ return this.transformResult(url_, response_, (r) => this.processSaveVdpData(r));
6477
+ }
6478
+ catch (e) {
6479
+ return throwError(e);
6480
+ }
6481
+ }
6482
+ else
6483
+ return throwError(response_);
6484
+ }));
6485
+ }
6486
+ processSaveVdpData(response) {
6487
+ const status = response.status;
6488
+ const responseBlob = response instanceof HttpResponse ? response.body :
6489
+ response.error instanceof Blob ? response.error : undefined;
6490
+ let _headers = {};
6491
+ if (response.headers) {
6492
+ for (let key of response.headers.keys()) {
6493
+ _headers[key] = response.headers.get(key);
6494
+ }
6495
+ }
6496
+ if (status === 200) {
6497
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6498
+ return of(null);
6499
+ }));
6500
+ }
6501
+ else if (status === 404) {
6502
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6503
+ let result404 = null;
6504
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6505
+ return throwException("Not Found", status, _responseText, _headers, result404);
6506
+ }));
6507
+ }
6508
+ else if (status === 401) {
6509
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6510
+ return throwException("Unauthorized", status, _responseText, _headers);
6511
+ }));
6512
+ }
6513
+ else if (status === 403) {
6514
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6515
+ return throwException("Forbidden", status, _responseText, _headers);
6516
+ }));
6517
+ }
6518
+ else if (status !== 200 && status !== 204) {
6519
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6520
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6521
+ }));
6522
+ }
6523
+ return of(null);
6524
+ }
6525
+ /**
6526
+ * Deletes variable data printing information from design file and updates design file in storage.
6527
+ * @param id Design identifier.
6528
+ * @param privateStorageOwner (optional) Private storage owner identifier.
6529
+ * @param tenantId (optional) Tenant identifier
6530
+ * @return Success
6531
+ */
6532
+ deleteVdpData(id, privateStorageOwner, tenantId) {
6533
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/vdp-data?";
6534
+ if (id === undefined || id === null)
6535
+ throw new Error("The parameter 'id' must be defined.");
6536
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
6537
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6538
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6539
+ if (tenantId === null)
6540
+ throw new Error("The parameter 'tenantId' cannot be null.");
6541
+ else if (tenantId !== undefined)
6542
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6543
+ url_ = url_.replace(/[?&]$/, "");
6544
+ let options_ = {
6545
+ observe: "response",
6546
+ responseType: "blob",
6547
+ headers: new HttpHeaders({})
6548
+ };
6549
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6550
+ return this.http.request("delete", url_, transformedOptions_);
6551
+ })).pipe(mergeMap((response_) => {
6552
+ return this.transformResult(url_, response_, (r) => this.processDeleteVdpData(r));
6553
+ })).pipe(catchError((response_) => {
6554
+ if (response_ instanceof HttpResponseBase) {
6555
+ try {
6556
+ return this.transformResult(url_, response_, (r) => this.processDeleteVdpData(r));
6557
+ }
6558
+ catch (e) {
6559
+ return throwError(e);
6560
+ }
6561
+ }
6562
+ else
6563
+ return throwError(response_);
6564
+ }));
6565
+ }
6566
+ processDeleteVdpData(response) {
6567
+ const status = response.status;
6568
+ const responseBlob = response instanceof HttpResponse ? response.body :
6569
+ response.error instanceof Blob ? response.error : undefined;
6570
+ let _headers = {};
6571
+ if (response.headers) {
6572
+ for (let key of response.headers.keys()) {
6573
+ _headers[key] = response.headers.get(key);
6574
+ }
6575
+ }
6576
+ if (status === 200) {
6577
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6578
+ return of(null);
6579
+ }));
6580
+ }
6581
+ else if (status === 409) {
6582
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6583
+ let result409 = null;
6584
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6585
+ return throwException("Conflict", status, _responseText, _headers, result409);
6586
+ }));
6587
+ }
6588
+ else if (status === 401) {
6589
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6590
+ return throwException("Unauthorized", status, _responseText, _headers);
6591
+ }));
6592
+ }
6593
+ else if (status === 403) {
6594
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6595
+ return throwException("Forbidden", status, _responseText, _headers);
6596
+ }));
6597
+ }
6598
+ else if (status !== 200 && status !== 204) {
6599
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6600
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6601
+ }));
6602
+ }
6603
+ return of(null);
6604
+ }
6605
+ /**
6606
+ * Converts colors for print-product item manipulations.
6607
+ * @param tenantId (optional) Tenant identifier
6608
+ * @param body (optional) Convert colors operation parameters.
6609
+ * @return Success
6610
+ */
6611
+ convertColors(tenantId, body) {
6612
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/convert-colors?";
6613
+ if (tenantId === null)
6614
+ throw new Error("The parameter 'tenantId' cannot be null.");
6615
+ else if (tenantId !== undefined)
6616
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6617
+ url_ = url_.replace(/[?&]$/, "");
6618
+ const content_ = JSON.stringify(body);
6619
+ let options_ = {
6620
+ body: content_,
6621
+ observe: "response",
6622
+ responseType: "blob",
6623
+ headers: new HttpHeaders({
6624
+ "Content-Type": "application/json",
6625
+ "Accept": "application/json"
6626
+ })
6627
+ };
6628
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6629
+ return this.http.request("post", url_, transformedOptions_);
6630
+ })).pipe(mergeMap((response_) => {
6631
+ return this.transformResult(url_, response_, (r) => this.processConvertColors(r));
6632
+ })).pipe(catchError((response_) => {
6633
+ if (response_ instanceof HttpResponseBase) {
6634
+ try {
6635
+ return this.transformResult(url_, response_, (r) => this.processConvertColors(r));
6636
+ }
6637
+ catch (e) {
6638
+ return throwError(e);
6639
+ }
6640
+ }
6641
+ else
6642
+ return throwError(response_);
6643
+ }));
6644
+ }
6645
+ processConvertColors(response) {
6646
+ const status = response.status;
6647
+ const responseBlob = response instanceof HttpResponse ? response.body :
6648
+ response.error instanceof Blob ? response.error : undefined;
6649
+ let _headers = {};
6650
+ if (response.headers) {
6651
+ for (let key of response.headers.keys()) {
6652
+ _headers[key] = response.headers.get(key);
6653
+ }
6654
+ }
6655
+ if (status === 200) {
6656
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6657
+ let result200 = null;
6658
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6659
+ return of(result200);
6660
+ }));
6661
+ }
6662
+ else if (status === 404) {
6663
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6664
+ let result404 = null;
6665
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6666
+ return throwException("Not Found", status, _responseText, _headers, result404);
6667
+ }));
6668
+ }
6669
+ else if (status === 401) {
6670
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6671
+ return throwException("Unauthorized", status, _responseText, _headers);
6672
+ }));
6673
+ }
6674
+ else if (status === 403) {
6675
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6676
+ return throwException("Forbidden", status, _responseText, _headers);
6677
+ }));
6678
+ }
6679
+ else if (status !== 200 && status !== 204) {
6680
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6681
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6682
+ }));
6683
+ }
6684
+ return of(null);
6685
+ }
6686
+ /**
6687
+ * Loads print-product from resource file taken from storage.
6688
+ * @param id (optional) Resource identifier.
6689
+ * @param privateStorageOwner (optional) Private storage owner identifier.
6690
+ * @param tenantId (optional) Tenant identifier
6691
+ * @return Success
6692
+ */
6693
+ loadProductFromResource(id, privateStorageOwner, tenantId) {
6694
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/from-resource/model?";
6695
+ if (id !== undefined && id !== null)
6696
+ url_ += "id=" + encodeURIComponent("" + id) + "&";
6697
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
6698
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
6699
+ if (tenantId === null)
6700
+ throw new Error("The parameter 'tenantId' cannot be null.");
6701
+ else if (tenantId !== undefined)
6702
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6703
+ url_ = url_.replace(/[?&]$/, "");
6704
+ let options_ = {
6705
+ observe: "response",
6706
+ responseType: "blob",
6707
+ headers: new HttpHeaders({
6708
+ "Accept": "application/json"
6709
+ })
6710
+ };
6711
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6712
+ return this.http.request("get", url_, transformedOptions_);
6713
+ })).pipe(mergeMap((response_) => {
6714
+ return this.transformResult(url_, response_, (r) => this.processLoadProductFromResource(r));
6715
+ })).pipe(catchError((response_) => {
6716
+ if (response_ instanceof HttpResponseBase) {
6717
+ try {
6718
+ return this.transformResult(url_, response_, (r) => this.processLoadProductFromResource(r));
6719
+ }
6720
+ catch (e) {
6721
+ return throwError(e);
6722
+ }
6723
+ }
6724
+ else
6725
+ return throwError(response_);
6726
+ }));
6727
+ }
6728
+ processLoadProductFromResource(response) {
6729
+ const status = response.status;
6730
+ const responseBlob = response instanceof HttpResponse ? response.body :
6731
+ response.error instanceof Blob ? response.error : undefined;
6732
+ let _headers = {};
6733
+ if (response.headers) {
6734
+ for (let key of response.headers.keys()) {
6735
+ _headers[key] = response.headers.get(key);
6736
+ }
6737
+ }
6738
+ if (status === 200) {
6739
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6740
+ let result200 = null;
6741
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6742
+ return of(result200);
6743
+ }));
6744
+ }
6745
+ else if (status === 404) {
6746
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6747
+ let result404 = null;
6748
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6749
+ return throwException("Not Found", status, _responseText, _headers, result404);
6750
+ }));
6751
+ }
6752
+ else if (status === 409) {
6753
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6754
+ let result409 = null;
6755
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6756
+ return throwException("Conflict", status, _responseText, _headers, result409);
6757
+ }));
6758
+ }
6759
+ else if (status === 401) {
6760
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6761
+ return throwException("Unauthorized", status, _responseText, _headers);
6762
+ }));
6763
+ }
6764
+ else if (status === 403) {
6765
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6766
+ return throwException("Forbidden", status, _responseText, _headers);
6767
+ }));
6768
+ }
6769
+ else if (status !== 200 && status !== 204) {
6770
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6771
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6772
+ }));
6773
+ }
6774
+ return of(null);
6775
+ }
6776
+ /**
6777
+ * Renders a product proof image with specified parameters.
6778
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
6779
+ (default value is 'false').
6780
+ * @param tenantId (optional) Tenant identifier
6781
+ * @param body (optional) Preview parameters.
6782
+ * @return Success
6783
+ */
6784
+ renderProduct(attachment, tenantId, body) {
6785
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/print-product/render-proof?";
6786
+ if (attachment !== undefined && attachment !== null)
6787
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
6788
+ if (tenantId === null)
6789
+ throw new Error("The parameter 'tenantId' cannot be null.");
6790
+ else if (tenantId !== undefined)
6791
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6792
+ url_ = url_.replace(/[?&]$/, "");
6793
+ const content_ = JSON.stringify(body);
6794
+ let options_ = {
6795
+ body: content_,
6796
+ observe: "response",
6797
+ responseType: "blob",
6798
+ headers: new HttpHeaders({
6799
+ "Content-Type": "application/json",
6800
+ "Accept": "application/octet-stream"
6801
+ })
6802
+ };
6803
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6804
+ return this.http.request("post", url_, transformedOptions_);
6805
+ })).pipe(mergeMap((response_) => {
6806
+ return this.transformResult(url_, response_, (r) => this.processRenderProduct(r));
6807
+ })).pipe(catchError((response_) => {
6808
+ if (response_ instanceof HttpResponseBase) {
6809
+ try {
6810
+ return this.transformResult(url_, response_, (r) => this.processRenderProduct(r));
6811
+ }
6812
+ catch (e) {
6813
+ return throwError(e);
6814
+ }
6815
+ }
6816
+ else
6817
+ return throwError(response_);
6818
+ }));
6819
+ }
6820
+ processRenderProduct(response) {
6821
+ const status = response.status;
6822
+ const responseBlob = response instanceof HttpResponse ? response.body :
6823
+ response.error instanceof Blob ? response.error : undefined;
6824
+ let _headers = {};
6825
+ if (response.headers) {
6826
+ for (let key of response.headers.keys()) {
6827
+ _headers[key] = response.headers.get(key);
6828
+ }
6829
+ }
6830
+ if (status === 200 || status === 206) {
6831
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
6832
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
6833
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
6834
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
6835
+ }
6836
+ else if (status === 401) {
6837
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6838
+ return throwException("Unauthorized", status, _responseText, _headers);
6839
+ }));
6840
+ }
6841
+ else if (status === 403) {
6842
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6843
+ return throwException("Forbidden", status, _responseText, _headers);
6844
+ }));
6845
+ }
6846
+ else if (status !== 200 && status !== 204) {
6847
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6848
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6849
+ }));
6850
+ }
6851
+ return of(null);
6852
+ }
6853
+ /**
6854
+ * Renders a design preview with the specified parameters.
6855
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
6856
+ (default value is 'false').
6857
+ * @param tenantId (optional) Tenant identifier
6858
+ * @param body (optional) Render model with preview parameters.
6859
+ * @return Success
6860
+ */
6861
+ renderDesignPreview(attachment, tenantId, body) {
6862
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview?";
6863
+ if (attachment !== undefined && attachment !== null)
6864
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
6865
+ if (tenantId === null)
6866
+ throw new Error("The parameter 'tenantId' cannot be null.");
6867
+ else if (tenantId !== undefined)
6868
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6869
+ url_ = url_.replace(/[?&]$/, "");
6870
+ const content_ = JSON.stringify(body);
6871
+ let options_ = {
6872
+ body: content_,
6873
+ observe: "response",
6874
+ responseType: "blob",
6875
+ headers: new HttpHeaders({
6876
+ "Content-Type": "application/json",
6877
+ "Accept": "application/octet-stream"
6878
+ })
6879
+ };
6880
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6881
+ return this.http.request("post", url_, transformedOptions_);
6882
+ })).pipe(mergeMap((response_) => {
6883
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignPreview(r));
6884
+ })).pipe(catchError((response_) => {
6885
+ if (response_ instanceof HttpResponseBase) {
6886
+ try {
6887
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignPreview(r));
6888
+ }
6889
+ catch (e) {
6890
+ return throwError(e);
6891
+ }
6892
+ }
6893
+ else
6894
+ return throwError(response_);
6895
+ }));
6896
+ }
6897
+ processRenderDesignPreview(response) {
6898
+ const status = response.status;
6899
+ const responseBlob = response instanceof HttpResponse ? response.body :
6900
+ response.error instanceof Blob ? response.error : undefined;
6901
+ let _headers = {};
6902
+ if (response.headers) {
6903
+ for (let key of response.headers.keys()) {
6904
+ _headers[key] = response.headers.get(key);
6905
+ }
6906
+ }
6907
+ if (status === 200 || status === 206) {
6908
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
6909
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
6910
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
6911
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
6912
+ }
6913
+ else if (status === 401) {
6914
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6915
+ return throwException("Unauthorized", status, _responseText, _headers);
6916
+ }));
6917
+ }
6918
+ else if (status === 403) {
6919
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6920
+ return throwException("Forbidden", status, _responseText, _headers);
6921
+ }));
6922
+ }
6923
+ else if (status !== 200 && status !== 204) {
6924
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6925
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
6926
+ }));
6927
+ }
6928
+ return of(null);
6929
+ }
6930
+ /**
6931
+ * Renders a design preview with the specified parameters and saves rendering result as resource.
6932
+ * @param tenantId (optional) Tenant identifier
6933
+ * @param body (optional) Render model with preview parameters.
6934
+ * @return Success
6935
+ */
6936
+ renderDesignPreviewToResource(tenantId, body) {
6937
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-preview/to-resource?";
6938
+ if (tenantId === null)
6939
+ throw new Error("The parameter 'tenantId' cannot be null.");
6940
+ else if (tenantId !== undefined)
6941
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
6942
+ url_ = url_.replace(/[?&]$/, "");
6943
+ const content_ = JSON.stringify(body);
6944
+ let options_ = {
6945
+ body: content_,
6946
+ observe: "response",
6947
+ responseType: "blob",
6948
+ headers: new HttpHeaders({
6949
+ "Content-Type": "application/json",
6950
+ "Accept": "application/json"
6951
+ })
6952
+ };
6953
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
6954
+ return this.http.request("post", url_, transformedOptions_);
6955
+ })).pipe(mergeMap((response_) => {
6956
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignPreviewToResource(r));
6957
+ })).pipe(catchError((response_) => {
6958
+ if (response_ instanceof HttpResponseBase) {
6959
+ try {
6960
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignPreviewToResource(r));
6961
+ }
6962
+ catch (e) {
6963
+ return throwError(e);
6964
+ }
6965
+ }
6966
+ else
6967
+ return throwError(response_);
6968
+ }));
6969
+ }
6970
+ processRenderDesignPreviewToResource(response) {
6971
+ const status = response.status;
6972
+ const responseBlob = response instanceof HttpResponse ? response.body :
6973
+ response.error instanceof Blob ? response.error : undefined;
6974
+ let _headers = {};
6975
+ if (response.headers) {
6976
+ for (let key of response.headers.keys()) {
6977
+ _headers[key] = response.headers.get(key);
6978
+ }
6979
+ }
6980
+ if (status === 200) {
6981
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6982
+ let result200 = null;
6983
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6984
+ return of(result200);
6985
+ }));
6986
+ }
6987
+ else if (status === 409) {
6988
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6989
+ let result409 = null;
6990
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6991
+ return throwException("Conflict", status, _responseText, _headers, result409);
6992
+ }));
6993
+ }
6994
+ else if (status === 401) {
6995
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6996
+ return throwException("Unauthorized", status, _responseText, _headers);
6997
+ }));
6998
+ }
6999
+ else if (status === 403) {
7000
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7001
+ return throwException("Forbidden", status, _responseText, _headers);
7002
+ }));
7003
+ }
7004
+ else if (status !== 200 && status !== 204) {
7005
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7006
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
7007
+ }));
7008
+ }
7009
+ return of(null);
7010
+ }
7011
+ /**
7012
+ * Renders a design proof with the specified parameters.
7013
+ * @param attachment (optional) If set to 'true', file will be provided as an attachment with unique filename supplied
7014
+ (default value is 'false').
7015
+ * @param tenantId (optional) Tenant identifier
7016
+ * @param body (optional) Render model with proof parameters.
7017
+ * @return Success
7018
+ */
7019
+ renderDesignProof(attachment, tenantId, body) {
7020
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof?";
7021
+ if (attachment !== undefined && attachment !== null)
7022
+ url_ += "attachment=" + encodeURIComponent("" + attachment) + "&";
7023
+ if (tenantId === null)
7024
+ throw new Error("The parameter 'tenantId' cannot be null.");
7025
+ else if (tenantId !== undefined)
7026
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
7027
+ url_ = url_.replace(/[?&]$/, "");
7028
+ const content_ = JSON.stringify(body);
7029
+ let options_ = {
7030
+ body: content_,
7031
+ observe: "response",
7032
+ responseType: "blob",
7033
+ headers: new HttpHeaders({
7034
+ "Content-Type": "application/json",
7035
+ "Accept": "application/octet-stream"
7036
+ })
7037
+ };
7038
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
7039
+ return this.http.request("post", url_, transformedOptions_);
7040
+ })).pipe(mergeMap((response_) => {
7041
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignProof(r));
7042
+ })).pipe(catchError((response_) => {
7043
+ if (response_ instanceof HttpResponseBase) {
7044
+ try {
7045
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignProof(r));
7046
+ }
7047
+ catch (e) {
7048
+ return throwError(e);
7049
+ }
7050
+ }
7051
+ else
7052
+ return throwError(response_);
7053
+ }));
7054
+ }
7055
+ processRenderDesignProof(response) {
7056
+ const status = response.status;
7057
+ const responseBlob = response instanceof HttpResponse ? response.body :
7058
+ response.error instanceof Blob ? response.error : undefined;
7059
+ let _headers = {};
7060
+ if (response.headers) {
7061
+ for (let key of response.headers.keys()) {
7062
+ _headers[key] = response.headers.get(key);
7063
+ }
7064
+ }
7065
+ if (status === 200 || status === 206) {
7066
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
7067
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
7068
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
7069
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
7070
+ }
7071
+ else if (status === 401) {
7072
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7073
+ return throwException("Unauthorized", status, _responseText, _headers);
7074
+ }));
7075
+ }
7076
+ else if (status === 403) {
7077
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7078
+ return throwException("Forbidden", status, _responseText, _headers);
7079
+ }));
7080
+ }
7081
+ else if (status !== 200 && status !== 204) {
7082
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7083
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
7084
+ }));
7085
+ }
7086
+ return of(null);
7087
+ }
7088
+ /**
7089
+ * Renders a design proof with the specified parameters and saves rendering result as resource.
7090
+ * @param tenantId (optional) Tenant identifier
7091
+ * @param body (optional) Render model with preview parameters.
7092
+ * @return Success
7093
+ */
7094
+ renderDesignProofToResource(tenantId, body) {
7095
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof/to-resource?";
7096
+ if (tenantId === null)
7097
+ throw new Error("The parameter 'tenantId' cannot be null.");
7098
+ else if (tenantId !== undefined)
7099
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
7100
+ url_ = url_.replace(/[?&]$/, "");
7101
+ const content_ = JSON.stringify(body);
7102
+ let options_ = {
7103
+ body: content_,
7104
+ observe: "response",
7105
+ responseType: "blob",
7106
+ headers: new HttpHeaders({
7107
+ "Content-Type": "application/json",
7108
+ "Accept": "application/json"
7109
+ })
7110
+ };
7111
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
7112
+ return this.http.request("post", url_, transformedOptions_);
7113
+ })).pipe(mergeMap((response_) => {
7114
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignProofToResource(r));
7115
+ })).pipe(catchError((response_) => {
7116
+ if (response_ instanceof HttpResponseBase) {
7117
+ try {
7118
+ return this.transformResult(url_, response_, (r) => this.processRenderDesignProofToResource(r));
7119
+ }
7120
+ catch (e) {
7121
+ return throwError(e);
7122
+ }
7123
+ }
7124
+ else
7125
+ return throwError(response_);
7126
+ }));
7127
+ }
7128
+ processRenderDesignProofToResource(response) {
7129
+ const status = response.status;
7130
+ const responseBlob = response instanceof HttpResponse ? response.body :
7131
+ response.error instanceof Blob ? response.error : undefined;
7132
+ let _headers = {};
7133
+ if (response.headers) {
7134
+ for (let key of response.headers.keys()) {
7135
+ _headers[key] = response.headers.get(key);
7136
+ }
7137
+ }
7138
+ if (status === 200) {
7139
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7140
+ let result200 = null;
7141
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7142
+ return of(result200);
7143
+ }));
7144
+ }
7145
+ else if (status === 409) {
7146
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7147
+ let result409 = null;
7148
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7149
+ return throwException("Conflict", status, _responseText, _headers, result409);
7150
+ }));
7151
+ }
7152
+ else if (status === 401) {
7153
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7154
+ return throwException("Unauthorized", status, _responseText, _headers);
7155
+ }));
7156
+ }
7157
+ else if (status === 403) {
7158
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7159
+ return throwException("Forbidden", status, _responseText, _headers);
7160
+ }));
7161
+ }
7162
+ else if (status !== 200 && status !== 204) {
7163
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7164
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
7165
+ }));
7166
+ }
7167
+ return of(null);
7168
+ }
7169
+ /**
7170
+ * Loads print-product from design file taken from storage.
7171
+ * @param id Design identifier.
7172
+ * @param privateStorageOwner (optional) Private storage owner identifier.
7173
+ * @param tenantId (optional) Tenant identifier
7174
+ * @return Success
7175
+ * @deprecated
7176
+ */
7177
+ loadProduct(id, privateStorageOwner, tenantId) {
7178
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
7179
+ if (id === undefined || id === null)
7180
+ throw new Error("The parameter 'id' must be defined.");
7181
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
7182
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
7183
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
7184
+ if (tenantId === null)
7185
+ throw new Error("The parameter 'tenantId' cannot be null.");
7186
+ else if (tenantId !== undefined)
7187
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
7188
+ url_ = url_.replace(/[?&]$/, "");
7189
+ let options_ = {
7190
+ observe: "response",
7191
+ responseType: "blob",
7192
+ headers: new HttpHeaders({
7193
+ "Accept": "application/json"
7194
+ })
7195
+ };
7196
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
7197
+ return this.http.request("get", url_, transformedOptions_);
7198
+ })).pipe(mergeMap((response_) => {
7199
+ return this.transformResult(url_, response_, (r) => this.processLoadProduct(r));
7200
+ })).pipe(catchError((response_) => {
7201
+ if (response_ instanceof HttpResponseBase) {
7202
+ try {
7203
+ return this.transformResult(url_, response_, (r) => this.processLoadProduct(r));
7204
+ }
7205
+ catch (e) {
7206
+ return throwError(e);
7207
+ }
7208
+ }
7209
+ else
7210
+ return throwError(response_);
7211
+ }));
7212
+ }
7213
+ processLoadProduct(response) {
7214
+ const status = response.status;
7215
+ const responseBlob = response instanceof HttpResponse ? response.body :
7216
+ response.error instanceof Blob ? response.error : undefined;
7217
+ let _headers = {};
7218
+ if (response.headers) {
7219
+ for (let key of response.headers.keys()) {
7220
+ _headers[key] = response.headers.get(key);
7221
+ }
7222
+ }
7223
+ if (status === 200) {
7224
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7225
+ let result200 = null;
7226
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7227
+ return of(result200);
7228
+ }));
7229
+ }
7230
+ else if (status === 404) {
7231
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7232
+ let result404 = null;
7233
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7234
+ return throwException("Not Found", status, _responseText, _headers, result404);
7235
+ }));
7236
+ }
7237
+ else if (status === 401) {
7238
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7239
+ return throwException("Unauthorized", status, _responseText, _headers);
7240
+ }));
7241
+ }
7242
+ else if (status === 403) {
7243
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7244
+ return throwException("Forbidden", status, _responseText, _headers);
7245
+ }));
7246
+ }
7247
+ else if (status !== 200 && status !== 204) {
7248
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7249
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
7250
+ }));
7251
+ }
7252
+ return of(null);
7253
+ }
7254
+ /**
7255
+ * Saves print-product to design file and updates design file in storage.
7256
+ * @param id Design identifier.
7257
+ * @param privateStorageOwner (optional) Private storage owner identifier.
7258
+ * @param tenantId (optional) Tenant identifier
7259
+ * @param body (optional) Serialized product description.
7260
+ * @return Success
7261
+ * @deprecated
7262
+ */
7263
+ saveProduct(id, privateStorageOwner, tenantId, body) {
7264
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
7265
+ if (id === undefined || id === null)
7266
+ throw new Error("The parameter 'id' must be defined.");
7267
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
7268
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
7269
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
7270
+ if (tenantId === null)
7271
+ throw new Error("The parameter 'tenantId' cannot be null.");
7272
+ else if (tenantId !== undefined)
7273
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
7274
+ url_ = url_.replace(/[?&]$/, "");
7275
+ const content_ = JSON.stringify(body);
7276
+ let options_ = {
7277
+ body: content_,
7278
+ observe: "response",
7279
+ responseType: "blob",
7280
+ headers: new HttpHeaders({
7281
+ "Content-Type": "application/json",
7282
+ })
7283
+ };
7284
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
7285
+ return this.http.request("put", url_, transformedOptions_);
7286
+ })).pipe(mergeMap((response_) => {
7287
+ return this.transformResult(url_, response_, (r) => this.processSaveProduct(r));
7288
+ })).pipe(catchError((response_) => {
7289
+ if (response_ instanceof HttpResponseBase) {
7290
+ try {
7291
+ return this.transformResult(url_, response_, (r) => this.processSaveProduct(r));
7292
+ }
7293
+ catch (e) {
7294
+ return throwError(e);
7295
+ }
7296
+ }
7297
+ else
7298
+ return throwError(response_);
7299
+ }));
7300
+ }
7301
+ processSaveProduct(response) {
7302
+ const status = response.status;
7303
+ const responseBlob = response instanceof HttpResponse ? response.body :
7304
+ response.error instanceof Blob ? response.error : undefined;
7305
+ let _headers = {};
7306
+ if (response.headers) {
7307
+ for (let key of response.headers.keys()) {
7308
+ _headers[key] = response.headers.get(key);
7309
+ }
7310
+ }
7311
+ if (status === 200) {
7312
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7313
+ return of(null);
7314
+ }));
7315
+ }
7316
+ else if (status === 404) {
7317
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7318
+ let result404 = null;
7319
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7320
+ return throwException("Not Found", status, _responseText, _headers, result404);
7321
+ }));
7322
+ }
7323
+ else if (status === 401) {
5300
7324
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5301
7325
  return throwException("Unauthorized", status, _responseText, _headers);
5302
7326
  }));
@@ -5314,36 +7338,62 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5314
7338
  return of(null);
5315
7339
  }
5316
7340
  /**
5317
- * Renders a design proof with the specified parameters and saves rendering result as resource.
7341
+ * Patches print-product in design file.
7342
+ * @param id Design identifier.
7343
+ * @param privateStorageOwner (optional) Private storage owner identifier.
5318
7344
  * @param tenantId (optional) Tenant identifier
5319
- * @param body (optional) Render model with preview parameters.
7345
+ * @param patchType (optional)
7346
+ * @param replaceImageItemFileInfo_itemName (optional)
7347
+ * @param replaceImageItemFileInfo_sourceFile (optional)
7348
+ * @param replacePlaceholderItemContentInfo_placeholderItemName (optional)
7349
+ * @param replacePlaceholderItemContentInfo_newContentType (optional)
7350
+ * @param replacePlaceholderItemContentInfo_sourceFile (optional)
5320
7351
  * @return Success
7352
+ * @deprecated
5321
7353
  */
5322
- renderDesignProofToResource(tenantId, body) {
5323
- let url_ = this.baseUrl + "/api/atoms/v1/designs/render-proof/to-resource?";
7354
+ patchProduct(id, privateStorageOwner, tenantId, patchType, replaceImageItemFileInfo_itemName, replaceImageItemFileInfo_sourceFile, replacePlaceholderItemContentInfo_placeholderItemName, replacePlaceholderItemContentInfo_newContentType, replacePlaceholderItemContentInfo_sourceFile) {
7355
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/{id}/model?";
7356
+ if (id === undefined || id === null)
7357
+ throw new Error("The parameter 'id' must be defined.");
7358
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
7359
+ if (privateStorageOwner !== undefined && privateStorageOwner !== null)
7360
+ url_ += "privateStorageOwner=" + encodeURIComponent("" + privateStorageOwner) + "&";
5324
7361
  if (tenantId === null)
5325
7362
  throw new Error("The parameter 'tenantId' cannot be null.");
5326
7363
  else if (tenantId !== undefined)
5327
7364
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5328
7365
  url_ = url_.replace(/[?&]$/, "");
5329
- const content_ = JSON.stringify(body);
7366
+ const content_ = new FormData();
7367
+ if (patchType === null || patchType === undefined)
7368
+ throw new Error("The parameter 'patchType' cannot be null.");
7369
+ else
7370
+ content_.append("patchType", patchType.toString());
7371
+ if (replaceImageItemFileInfo_itemName !== null && replaceImageItemFileInfo_itemName !== undefined)
7372
+ content_.append("replaceImageItemFileInfo.itemName", replaceImageItemFileInfo_itemName.toString());
7373
+ if (replaceImageItemFileInfo_sourceFile !== null && replaceImageItemFileInfo_sourceFile !== undefined)
7374
+ content_.append("replaceImageItemFileInfo.sourceFile", replaceImageItemFileInfo_sourceFile.data, replaceImageItemFileInfo_sourceFile.fileName ? replaceImageItemFileInfo_sourceFile.fileName : "replaceImageItemFileInfo.sourceFile");
7375
+ if (replacePlaceholderItemContentInfo_placeholderItemName !== null && replacePlaceholderItemContentInfo_placeholderItemName !== undefined)
7376
+ content_.append("replacePlaceholderItemContentInfo.placeholderItemName", replacePlaceholderItemContentInfo_placeholderItemName.toString());
7377
+ if (replacePlaceholderItemContentInfo_newContentType === null || replacePlaceholderItemContentInfo_newContentType === undefined)
7378
+ throw new Error("The parameter 'replacePlaceholderItemContentInfo_newContentType' cannot be null.");
7379
+ else
7380
+ content_.append("replacePlaceholderItemContentInfo.newContentType", replacePlaceholderItemContentInfo_newContentType.toString());
7381
+ if (replacePlaceholderItemContentInfo_sourceFile !== null && replacePlaceholderItemContentInfo_sourceFile !== undefined)
7382
+ content_.append("replacePlaceholderItemContentInfo.sourceFile", replacePlaceholderItemContentInfo_sourceFile.data, replacePlaceholderItemContentInfo_sourceFile.fileName ? replacePlaceholderItemContentInfo_sourceFile.fileName : "replacePlaceholderItemContentInfo.sourceFile");
5330
7383
  let options_ = {
5331
7384
  body: content_,
5332
7385
  observe: "response",
5333
7386
  responseType: "blob",
5334
- headers: new HttpHeaders({
5335
- "Content-Type": "application/json",
5336
- "Accept": "application/json"
5337
- })
7387
+ headers: new HttpHeaders({})
5338
7388
  };
5339
7389
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5340
- return this.http.request("post", url_, transformedOptions_);
7390
+ return this.http.request("patch", url_, transformedOptions_);
5341
7391
  })).pipe(mergeMap((response_) => {
5342
- return this.transformResult(url_, response_, (r) => this.processRenderDesignProofToResource(r));
7392
+ return this.transformResult(url_, response_, (r) => this.processPatchProduct(r));
5343
7393
  })).pipe(catchError((response_) => {
5344
7394
  if (response_ instanceof HttpResponseBase) {
5345
7395
  try {
5346
- return this.transformResult(url_, response_, (r) => this.processRenderDesignProofToResource(r));
7396
+ return this.transformResult(url_, response_, (r) => this.processPatchProduct(r));
5347
7397
  }
5348
7398
  catch (e) {
5349
7399
  return throwError(e);
@@ -5353,7 +7403,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5353
7403
  return throwError(response_);
5354
7404
  }));
5355
7405
  }
5356
- processRenderDesignProofToResource(response) {
7406
+ processPatchProduct(response) {
5357
7407
  const status = response.status;
5358
7408
  const responseBlob = response instanceof HttpResponse ? response.body :
5359
7409
  response.error instanceof Blob ? response.error : undefined;
@@ -5365,16 +7415,14 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5365
7415
  }
5366
7416
  if (status === 200) {
5367
7417
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5368
- let result200 = null;
5369
- result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5370
- return of(result200);
7418
+ return of(null);
5371
7419
  }));
5372
7420
  }
5373
- else if (status === 409) {
7421
+ else if (status === 404) {
5374
7422
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5375
- let result409 = null;
5376
- result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5377
- return throwException("Conflict", status, _responseText, _headers, result409);
7423
+ let result404 = null;
7424
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7425
+ return throwException("Not Found", status, _responseText, _headers, result404);
5378
7426
  }));
5379
7427
  }
5380
7428
  else if (status === 401) {
@@ -5395,7 +7443,7 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5395
7443
  return of(null);
5396
7444
  }
5397
7445
  /**
5398
- * Creates product item.
7446
+ * Creates print-product item.
5399
7447
  * @param itemType (optional) Desired item type.
5400
7448
  * @param tenantId (optional) Tenant identifier
5401
7449
  * @param sourceType (optional)
@@ -5492,6 +7540,155 @@ class DesignAtomsServiceApiClient extends ApiClientBase {
5492
7540
  }
5493
7541
  return of(null);
5494
7542
  }
7543
+ /**
7544
+ * Extracts print-product item image.
7545
+ * @param tenantId (optional) Tenant identifier
7546
+ * @param body (optional) Extraction parameters.
7547
+ * @return Success
7548
+ * @deprecated
7549
+ */
7550
+ extractItemImage(tenantId, body) {
7551
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/extract-image?";
7552
+ if (tenantId === null)
7553
+ throw new Error("The parameter 'tenantId' cannot be null.");
7554
+ else if (tenantId !== undefined)
7555
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
7556
+ url_ = url_.replace(/[?&]$/, "");
7557
+ const content_ = JSON.stringify(body);
7558
+ let options_ = {
7559
+ body: content_,
7560
+ observe: "response",
7561
+ responseType: "blob",
7562
+ headers: new HttpHeaders({
7563
+ "Content-Type": "application/json",
7564
+ "Accept": "application/octet-stream"
7565
+ })
7566
+ };
7567
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
7568
+ return this.http.request("post", url_, transformedOptions_);
7569
+ })).pipe(mergeMap((response_) => {
7570
+ return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
7571
+ })).pipe(catchError((response_) => {
7572
+ if (response_ instanceof HttpResponseBase) {
7573
+ try {
7574
+ return this.transformResult(url_, response_, (r) => this.processExtractItemImage(r));
7575
+ }
7576
+ catch (e) {
7577
+ return throwError(e);
7578
+ }
7579
+ }
7580
+ else
7581
+ return throwError(response_);
7582
+ }));
7583
+ }
7584
+ processExtractItemImage(response) {
7585
+ const status = response.status;
7586
+ const responseBlob = response instanceof HttpResponse ? response.body :
7587
+ response.error instanceof Blob ? response.error : undefined;
7588
+ let _headers = {};
7589
+ if (response.headers) {
7590
+ for (let key of response.headers.keys()) {
7591
+ _headers[key] = response.headers.get(key);
7592
+ }
7593
+ }
7594
+ if (status === 200 || status === 206) {
7595
+ const contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
7596
+ const fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
7597
+ const fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
7598
+ return of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
7599
+ }
7600
+ else if (status === 401) {
7601
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7602
+ return throwException("Unauthorized", status, _responseText, _headers);
7603
+ }));
7604
+ }
7605
+ else if (status === 403) {
7606
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7607
+ return throwException("Forbidden", status, _responseText, _headers);
7608
+ }));
7609
+ }
7610
+ else if (status !== 200 && status !== 204) {
7611
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7612
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
7613
+ }));
7614
+ }
7615
+ return of(null);
7616
+ }
7617
+ /**
7618
+ * Flattens print-product items.
7619
+ * @param tenantId (optional) Tenant identifier
7620
+ * @param body (optional) Items to flatten.
7621
+ * @return Success
7622
+ * @deprecated
7623
+ */
7624
+ flattenItems(tenantId, body) {
7625
+ let url_ = this.baseUrl + "/api/atoms/v1/designs/model/items/flatten?";
7626
+ if (tenantId === null)
7627
+ throw new Error("The parameter 'tenantId' cannot be null.");
7628
+ else if (tenantId !== undefined)
7629
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
7630
+ url_ = url_.replace(/[?&]$/, "");
7631
+ const content_ = JSON.stringify(body);
7632
+ let options_ = {
7633
+ body: content_,
7634
+ observe: "response",
7635
+ responseType: "blob",
7636
+ headers: new HttpHeaders({
7637
+ "Content-Type": "application/json",
7638
+ "Accept": "application/json"
7639
+ })
7640
+ };
7641
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
7642
+ return this.http.request("post", url_, transformedOptions_);
7643
+ })).pipe(mergeMap((response_) => {
7644
+ return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
7645
+ })).pipe(catchError((response_) => {
7646
+ if (response_ instanceof HttpResponseBase) {
7647
+ try {
7648
+ return this.transformResult(url_, response_, (r) => this.processFlattenItems(r));
7649
+ }
7650
+ catch (e) {
7651
+ return throwError(e);
7652
+ }
7653
+ }
7654
+ else
7655
+ return throwError(response_);
7656
+ }));
7657
+ }
7658
+ processFlattenItems(response) {
7659
+ const status = response.status;
7660
+ const responseBlob = response instanceof HttpResponse ? response.body :
7661
+ response.error instanceof Blob ? response.error : undefined;
7662
+ let _headers = {};
7663
+ if (response.headers) {
7664
+ for (let key of response.headers.keys()) {
7665
+ _headers[key] = response.headers.get(key);
7666
+ }
7667
+ }
7668
+ if (status === 200) {
7669
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7670
+ let result200 = null;
7671
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
7672
+ return of(result200);
7673
+ }));
7674
+ }
7675
+ else if (status === 401) {
7676
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7677
+ return throwException("Unauthorized", status, _responseText, _headers);
7678
+ }));
7679
+ }
7680
+ else if (status === 403) {
7681
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7682
+ return throwException("Forbidden", status, _responseText, _headers);
7683
+ }));
7684
+ }
7685
+ else if (status !== 200 && status !== 204) {
7686
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
7687
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
7688
+ }));
7689
+ }
7690
+ return of(null);
7691
+ }
5495
7692
  /**
5496
7693
  * Creates a private design from a public design.
5497
7694
  * @param designId (optional) Public design identifier.
@@ -7877,5 +10074,5 @@ DesignAtomsApiModule.decorators = [
7877
10074
  * Generated bundle index. Do not edit.
7878
10075
  */
7879
10076
 
7880
- export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, BuildInfoApiClient, CreateApiClientConfiguration, DesignAtomsApiModule, DesignAtomsCompatibilityApiClient, DesignAtomsImagesApiClient, DesignAtomsMockups3dApiClient, DesignAtomsServiceApiClient, DesignAtomsViewerApiClient, DesignElementType, ImagePreviewFitMode, ImagePreviewFormat, ItemSourceType, ItemType, PlaceholderItemContentType, ProductPatchType, ProductPreviewFormat, ProductProofFormat, ProductProofInterpolationMode };
10077
+ export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, BuildInfoApiClient, CreateApiClientConfiguration, DesignAtomsApiModule, DesignAtomsCompatibilityApiClient, DesignAtomsImagesApiClient, DesignAtomsMockups3dApiClient, DesignAtomsPrintProductApiClient, DesignAtomsPrintProductItemsApiClient, DesignAtomsServiceApiClient, DesignAtomsViewerApiClient, DesignElementType, ImagePreviewFitMode, ImagePreviewFormat, ItemSourceType, ItemType, PlaceholderItemContentType, ProductPatchType, ProductPreviewFormat, ProductProofFormat, ProductProofInterpolationMode };
7881
10078
  //# sourceMappingURL=aurigma-ng-design-atoms-api-client.js.map