@aurigma/ng-storefront-api-client 2.51.1 → 2.53.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.
@@ -113,7 +113,7 @@ class BuildInfoApiClient extends ApiClientBase {
113
113
  observe: "response",
114
114
  responseType: "blob",
115
115
  headers: new HttpHeaders({
116
- "Accept": "text/plain"
116
+ "Accept": "application/json"
117
117
  })
118
118
  };
119
119
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -199,7 +199,7 @@ class ProcessingPipelinesApiClient extends ApiClientBase {
199
199
  observe: "response",
200
200
  responseType: "blob",
201
201
  headers: new HttpHeaders({
202
- "Accept": "text/plain"
202
+ "Accept": "application/json"
203
203
  })
204
204
  };
205
205
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -271,7 +271,7 @@ class ProcessingPipelinesApiClient extends ApiClientBase {
271
271
  observe: "response",
272
272
  responseType: "blob",
273
273
  headers: new HttpHeaders({
274
- "Accept": "text/plain"
274
+ "Accept": "application/json"
275
275
  })
276
276
  };
277
277
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -344,7 +344,7 @@ ProcessingPipelinesApiClient.ctorParameters = () => [
344
344
  { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
345
345
  { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
346
346
  ];
347
- class ProductReferencesApiClient extends ApiClientBase {
347
+ class ProductLinksApiClient extends ApiClientBase {
348
348
  constructor(configuration, http, baseUrl) {
349
349
  super(configuration);
350
350
  this.jsonParseReviver = undefined;
@@ -352,10 +352,7 @@ class ProductReferencesApiClient extends ApiClientBase {
352
352
  this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
353
353
  }
354
354
  /**
355
- * Returns all storefront product references relevant to the specified query parameters.
356
- * @param storefrontId Storefront identifier.
357
- * @param productReference (optional) Product reference filter. Product reference is an external reference to Customer's Canvas product specification, e.g online store product identifier.
358
- * @param productSpecificationId (optional) Cusomer's Canvas product specification filter.
355
+ * Returns all product links, relevant to the specified query parameters.
359
356
  * @param skip (optional) Defines page start offset from beginning of sorted result list.
360
357
  * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
361
358
  * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
@@ -363,16 +360,8 @@ class ProductReferencesApiClient extends ApiClientBase {
363
360
  * @param tenantId (optional) Tenant identifier.
364
361
  * @return Success
365
362
  */
366
- getAll(storefrontId, productReference, productSpecificationId, skip, take, sorting, search, tenantId) {
367
- let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
368
- if (storefrontId === undefined || storefrontId === null)
369
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
370
- else
371
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
372
- if (productReference !== undefined && productReference !== null)
373
- url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
374
- if (productSpecificationId !== undefined && productSpecificationId !== null)
375
- url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
363
+ getAllProductLinks(skip, take, sorting, search, tenantId) {
364
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links?";
376
365
  if (skip !== undefined && skip !== null)
377
366
  url_ += "skip=" + encodeURIComponent("" + skip) + "&";
378
367
  if (take !== undefined && take !== null)
@@ -388,17 +377,17 @@ class ProductReferencesApiClient extends ApiClientBase {
388
377
  observe: "response",
389
378
  responseType: "blob",
390
379
  headers: new HttpHeaders({
391
- "Accept": "text/plain"
380
+ "Accept": "application/json"
392
381
  })
393
382
  };
394
383
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
395
384
  return this.http.request("get", url_, transformedOptions_);
396
385
  })).pipe(mergeMap((response_) => {
397
- return this.transformResult(url_, response_, (r) => this.processGetAll(r));
386
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductLinks(r));
398
387
  })).pipe(catchError((response_) => {
399
388
  if (response_ instanceof HttpResponseBase) {
400
389
  try {
401
- return this.transformResult(url_, response_, (r) => this.processGetAll(r));
390
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductLinks(r));
402
391
  }
403
392
  catch (e) {
404
393
  return throwError(e);
@@ -408,7 +397,7 @@ class ProductReferencesApiClient extends ApiClientBase {
408
397
  return throwError(response_);
409
398
  }));
410
399
  }
411
- processGetAll(response) {
400
+ processGetAllProductLinks(response) {
412
401
  const status = response.status;
413
402
  const responseBlob = response instanceof HttpResponse ? response.body :
414
403
  response.error instanceof Blob ? response.error : undefined;
@@ -443,39 +432,40 @@ class ProductReferencesApiClient extends ApiClientBase {
443
432
  return of(null);
444
433
  }
445
434
  /**
446
- * Creates a new storefront product reference.
447
- * @param storefrontId Storefront identifier.
435
+ * Returns a product link by its identifier.
436
+ * @param id Product identifier.
437
+ * @param productLinkVersionId (optional) Product link version identifier. Optional
438
+ * @param productVersionId (optional) Product version identifier which represents linked product version. Optional
448
439
  * @param tenantId (optional) Tenant identifier.
449
- * @param body (optional) Create operation parameters.
450
440
  * @return Success
451
441
  */
452
- create(storefrontId, tenantId, body) {
453
- let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
454
- if (storefrontId === undefined || storefrontId === null)
455
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
456
- else
457
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
442
+ getProductLink(id, productLinkVersionId, productVersionId, tenantId) {
443
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}?";
444
+ if (id === undefined || id === null)
445
+ throw new Error("The parameter 'id' must be defined.");
446
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
447
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
448
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
449
+ if (productVersionId !== undefined && productVersionId !== null)
450
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
458
451
  if (tenantId !== undefined && tenantId !== null)
459
452
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
460
453
  url_ = url_.replace(/[?&]$/, "");
461
- const content_ = JSON.stringify(body);
462
454
  let options_ = {
463
- body: content_,
464
455
  observe: "response",
465
456
  responseType: "blob",
466
457
  headers: new HttpHeaders({
467
- "Content-Type": "application/json-patch+json",
468
- "Accept": "text/plain"
458
+ "Accept": "application/json"
469
459
  })
470
460
  };
471
461
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
472
- return this.http.request("post", url_, transformedOptions_);
462
+ return this.http.request("get", url_, transformedOptions_);
473
463
  })).pipe(mergeMap((response_) => {
474
- return this.transformResult(url_, response_, (r) => this.processCreate(r));
464
+ return this.transformResult(url_, response_, (r) => this.processGetProductLink(r));
475
465
  })).pipe(catchError((response_) => {
476
466
  if (response_ instanceof HttpResponseBase) {
477
467
  try {
478
- return this.transformResult(url_, response_, (r) => this.processCreate(r));
468
+ return this.transformResult(url_, response_, (r) => this.processGetProductLink(r));
479
469
  }
480
470
  catch (e) {
481
471
  return throwError(e);
@@ -485,7 +475,7 @@ class ProductReferencesApiClient extends ApiClientBase {
485
475
  return throwError(response_);
486
476
  }));
487
477
  }
488
- processCreate(response) {
478
+ processGetProductLink(response) {
489
479
  const status = response.status;
490
480
  const responseBlob = response instanceof HttpResponse ? response.body :
491
481
  response.error instanceof Blob ? response.error : undefined;
@@ -495,11 +485,11 @@ class ProductReferencesApiClient extends ApiClientBase {
495
485
  _headers[key] = response.headers.get(key);
496
486
  }
497
487
  }
498
- if (status === 201) {
488
+ if (status === 200) {
499
489
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
500
- let result201 = null;
501
- result201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
502
- return of(result201);
490
+ let result200 = null;
491
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
492
+ return of(result200);
503
493
  }));
504
494
  }
505
495
  else if (status === 404) {
@@ -509,6 +499,13 @@ class ProductReferencesApiClient extends ApiClientBase {
509
499
  return throwException("Not Found", status, _responseText, _headers, result404);
510
500
  }));
511
501
  }
502
+ else if (status === 409) {
503
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
504
+ let result409 = null;
505
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
506
+ return throwException("Conflict", status, _responseText, _headers, result409);
507
+ }));
508
+ }
512
509
  else if (status === 401) {
513
510
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
514
511
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -527,21 +524,28 @@ class ProductReferencesApiClient extends ApiClientBase {
527
524
  return of(null);
528
525
  }
529
526
  /**
530
- * Returns a storefront product reference.
531
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
532
- * @param storefrontId Storefront identifier.
527
+ * Returns a product link summary by product link identifier.
528
+ * @param id Product link identifier.
529
+ * @param productLinkVersionId (optional) Product link version identifier.
530
+ * @param productVersionId (optional) Product link identifier.
531
+ * @param productVariantId (optional) Product variant identifier.
532
+ * @param sku (optional) Product variant SKU.
533
533
  * @param tenantId (optional) Tenant identifier.
534
534
  * @return Success
535
535
  */
536
- get(reference, storefrontId, tenantId) {
537
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
538
- if (reference === undefined || reference === null)
539
- throw new Error("The parameter 'reference' must be defined.");
540
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
541
- if (storefrontId === undefined || storefrontId === null)
542
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
543
- else
544
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
536
+ getProductSummary(id, productLinkVersionId, productVersionId, productVariantId, sku, tenantId) {
537
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/summary?";
538
+ if (id === undefined || id === null)
539
+ throw new Error("The parameter 'id' must be defined.");
540
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
541
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
542
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
543
+ if (productVersionId !== undefined && productVersionId !== null)
544
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
545
+ if (productVariantId !== undefined && productVariantId !== null)
546
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
547
+ if (sku !== undefined && sku !== null)
548
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
545
549
  if (tenantId !== undefined && tenantId !== null)
546
550
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
547
551
  url_ = url_.replace(/[?&]$/, "");
@@ -549,17 +553,17 @@ class ProductReferencesApiClient extends ApiClientBase {
549
553
  observe: "response",
550
554
  responseType: "blob",
551
555
  headers: new HttpHeaders({
552
- "Accept": "text/plain"
556
+ "Accept": "application/json"
553
557
  })
554
558
  };
555
559
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
556
560
  return this.http.request("get", url_, transformedOptions_);
557
561
  })).pipe(mergeMap((response_) => {
558
- return this.transformResult(url_, response_, (r) => this.processGet(r));
562
+ return this.transformResult(url_, response_, (r) => this.processGetProductSummary(r));
559
563
  })).pipe(catchError((response_) => {
560
564
  if (response_ instanceof HttpResponseBase) {
561
565
  try {
562
- return this.transformResult(url_, response_, (r) => this.processGet(r));
566
+ return this.transformResult(url_, response_, (r) => this.processGetProductSummary(r));
563
567
  }
564
568
  catch (e) {
565
569
  return throwError(e);
@@ -569,7 +573,7 @@ class ProductReferencesApiClient extends ApiClientBase {
569
573
  return throwError(response_);
570
574
  }));
571
575
  }
572
- processGet(response) {
576
+ processGetProductSummary(response) {
573
577
  const status = response.status;
574
578
  const responseBlob = response instanceof HttpResponse ? response.body :
575
579
  response.error instanceof Blob ? response.error : undefined;
@@ -593,6 +597,13 @@ class ProductReferencesApiClient extends ApiClientBase {
593
597
  return throwException("Not Found", status, _responseText, _headers, result404);
594
598
  }));
595
599
  }
600
+ else if (status === 409) {
601
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
602
+ let result409 = null;
603
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
604
+ return throwException("Conflict", status, _responseText, _headers, result409);
605
+ }));
606
+ }
596
607
  else if (status === 401) {
597
608
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
598
609
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -611,21 +622,25 @@ class ProductReferencesApiClient extends ApiClientBase {
611
622
  return of(null);
612
623
  }
613
624
  /**
614
- * Deletes the storefront product reference.
615
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
616
- * @param storefrontId Storefront identifier.
625
+ * Returns a product link personalization workflow description by product link identifier.
626
+ * @param id Product link identifier.
627
+ * @param productLinkVersionId (optional) Product link version identifier.
628
+ * @param productVersionId (optional) Product version identifier.
629
+ * @param productFilterId (optional) Product filter identifier.
617
630
  * @param tenantId (optional) Tenant identifier.
618
631
  * @return Success
619
632
  */
620
- delete(reference, storefrontId, tenantId) {
621
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
622
- if (reference === undefined || reference === null)
623
- throw new Error("The parameter 'reference' must be defined.");
624
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
625
- if (storefrontId === undefined || storefrontId === null)
626
- throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
627
- else
628
- url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
633
+ getPersonalizationWorkflow(id, productLinkVersionId, productVersionId, productFilterId, tenantId) {
634
+ let url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/personalization-workflow?";
635
+ if (id === undefined || id === null)
636
+ throw new Error("The parameter 'id' must be defined.");
637
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
638
+ if (productLinkVersionId !== undefined && productLinkVersionId !== null)
639
+ url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
640
+ if (productVersionId !== undefined && productVersionId !== null)
641
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
642
+ if (productFilterId !== undefined && productFilterId !== null)
643
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
629
644
  if (tenantId !== undefined && tenantId !== null)
630
645
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
631
646
  url_ = url_.replace(/[?&]$/, "");
@@ -633,17 +648,17 @@ class ProductReferencesApiClient extends ApiClientBase {
633
648
  observe: "response",
634
649
  responseType: "blob",
635
650
  headers: new HttpHeaders({
636
- "Accept": "text/plain"
651
+ "Accept": "application/json"
637
652
  })
638
653
  };
639
654
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
640
- return this.http.request("delete", url_, transformedOptions_);
655
+ return this.http.request("get", url_, transformedOptions_);
641
656
  })).pipe(mergeMap((response_) => {
642
- return this.transformResult(url_, response_, (r) => this.processDelete(r));
657
+ return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
643
658
  })).pipe(catchError((response_) => {
644
659
  if (response_ instanceof HttpResponseBase) {
645
660
  try {
646
- return this.transformResult(url_, response_, (r) => this.processDelete(r));
661
+ return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
647
662
  }
648
663
  catch (e) {
649
664
  return throwError(e);
@@ -653,7 +668,7 @@ class ProductReferencesApiClient extends ApiClientBase {
653
668
  return throwError(response_);
654
669
  }));
655
670
  }
656
- processDelete(response) {
671
+ processGetPersonalizationWorkflow(response) {
657
672
  const status = response.status;
658
673
  const responseBlob = response instanceof HttpResponse ? response.body :
659
674
  response.error instanceof Blob ? response.error : undefined;
@@ -677,6 +692,13 @@ class ProductReferencesApiClient extends ApiClientBase {
677
692
  return throwException("Not Found", status, _responseText, _headers, result404);
678
693
  }));
679
694
  }
695
+ else if (status === 409) {
696
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
697
+ let result409 = null;
698
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
699
+ return throwException("Conflict", status, _responseText, _headers, result409);
700
+ }));
701
+ }
680
702
  else if (status === 401) {
681
703
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
682
704
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -694,22 +716,71 @@ class ProductReferencesApiClient extends ApiClientBase {
694
716
  }
695
717
  return of(null);
696
718
  }
719
+ }
720
+ ProductLinksApiClient.ɵprov = ɵɵdefineInjectable({ factory: function ProductLinksApiClient_Factory() { return new ProductLinksApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: ProductLinksApiClient, providedIn: "root" });
721
+ ProductLinksApiClient.decorators = [
722
+ { type: Injectable, args: [{
723
+ providedIn: 'root'
724
+ },] }
725
+ ];
726
+ ProductLinksApiClient.ctorParameters = () => [
727
+ { type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
728
+ { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
729
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
730
+ ];
731
+ class ProductReferencesApiClient extends ApiClientBase {
732
+ constructor(configuration, http, baseUrl) {
733
+ super(configuration);
734
+ this.jsonParseReviver = undefined;
735
+ this.http = http;
736
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
737
+ }
697
738
  /**
698
- * Returns a product specification by the storefront product reference.
699
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
739
+ * Returns all storefront product references relevant to the specified query parameters.
700
740
  * @param storefrontId Storefront identifier.
741
+ * @param productReference (optional) Product reference filter.
742
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
743
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
744
+ * @param productId (optional) Customer's Canvas product filter.
745
+ * @param productLinkId (optional) Customer's Canvas product link filter.
746
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
747
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
748
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
749
+ * @param search (optional) Search string for partial match.
750
+ * @param sku (optional) SKU filter.
751
+ * @param tags (optional) List of tags that product should have.
752
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
701
753
  * @param tenantId (optional) Tenant identifier.
702
754
  * @return Success
703
755
  */
704
- getProductSpecification(reference, storefrontId, tenantId) {
705
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
706
- if (reference === undefined || reference === null)
707
- throw new Error("The parameter 'reference' must be defined.");
708
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
756
+ getAll(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
757
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
709
758
  if (storefrontId === undefined || storefrontId === null)
710
759
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
711
760
  else
712
761
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
762
+ if (productReference !== undefined && productReference !== null)
763
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
764
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
765
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
766
+ if (productId !== undefined && productId !== null)
767
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
768
+ if (productLinkId !== undefined && productLinkId !== null)
769
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
770
+ if (skip !== undefined && skip !== null)
771
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
772
+ if (take !== undefined && take !== null)
773
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
774
+ if (sorting !== undefined && sorting !== null)
775
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
776
+ if (search !== undefined && search !== null)
777
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
778
+ if (sku !== undefined && sku !== null)
779
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
780
+ if (tags !== undefined && tags !== null)
781
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
782
+ if (customFields !== undefined && customFields !== null)
783
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
713
784
  if (tenantId !== undefined && tenantId !== null)
714
785
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
715
786
  url_ = url_.replace(/[?&]$/, "");
@@ -717,17 +788,17 @@ class ProductReferencesApiClient extends ApiClientBase {
717
788
  observe: "response",
718
789
  responseType: "blob",
719
790
  headers: new HttpHeaders({
720
- "Accept": "text/plain"
791
+ "Accept": "application/json"
721
792
  })
722
793
  };
723
794
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
724
795
  return this.http.request("get", url_, transformedOptions_);
725
796
  })).pipe(mergeMap((response_) => {
726
- return this.transformResult(url_, response_, (r) => this.processGetProductSpecification(r));
797
+ return this.transformResult(url_, response_, (r) => this.processGetAll(r));
727
798
  })).pipe(catchError((response_) => {
728
799
  if (response_ instanceof HttpResponseBase) {
729
800
  try {
730
- return this.transformResult(url_, response_, (r) => this.processGetProductSpecification(r));
801
+ return this.transformResult(url_, response_, (r) => this.processGetAll(r));
731
802
  }
732
803
  catch (e) {
733
804
  return throwError(e);
@@ -737,7 +808,7 @@ class ProductReferencesApiClient extends ApiClientBase {
737
808
  return throwError(response_);
738
809
  }));
739
810
  }
740
- processGetProductSpecification(response) {
811
+ processGetAll(response) {
741
812
  const status = response.status;
742
813
  const responseBlob = response instanceof HttpResponse ? response.body :
743
814
  response.error instanceof Blob ? response.error : undefined;
@@ -754,11 +825,11 @@ class ProductReferencesApiClient extends ApiClientBase {
754
825
  return of(result200);
755
826
  }));
756
827
  }
757
- else if (status === 404) {
828
+ else if (status === 409) {
758
829
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
759
- let result404 = null;
760
- result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
761
- return throwException("Not Found", status, _responseText, _headers, result404);
830
+ let result409 = null;
831
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
832
+ return throwException("Conflict", status, _responseText, _headers, result409);
762
833
  }));
763
834
  }
764
835
  else if (status === 401) {
@@ -779,55 +850,39 @@ class ProductReferencesApiClient extends ApiClientBase {
779
850
  return of(null);
780
851
  }
781
852
  /**
782
- * Returns a product cost details from ecommerce system.
783
- * @param reference Product reference - external reference to Customer's Canvas product product specification, e.g online store product identifier.
784
- * @param sku Product SKU.
853
+ * Creates a new storefront product reference.
785
854
  * @param storefrontId Storefront identifier.
786
- * @param storefrontUserId (optional) Storefront user identifier.
787
- * @param currencyCode (optional) Product cost currency code.
788
- * @param quantity (optional) Product quantity.
789
855
  * @param tenantId (optional) Tenant identifier.
856
+ * @param body (optional) Create operation parameters.
790
857
  * @return Success
791
858
  */
792
- getProductCostDetails(reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId) {
793
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
794
- if (reference === undefined || reference === null)
795
- throw new Error("The parameter 'reference' must be defined.");
796
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
797
- if (sku === undefined || sku === null)
798
- throw new Error("The parameter 'sku' must be defined and cannot be null.");
799
- else
800
- url_ += "sku=" + encodeURIComponent("" + sku) + "&";
859
+ create(storefrontId, tenantId, body) {
860
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references?";
801
861
  if (storefrontId === undefined || storefrontId === null)
802
862
  throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
803
863
  else
804
864
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
805
- if (storefrontUserId !== undefined && storefrontUserId !== null)
806
- url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
807
- if (currencyCode !== undefined && currencyCode !== null)
808
- url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
809
- if (quantity === null)
810
- throw new Error("The parameter 'quantity' cannot be null.");
811
- else if (quantity !== undefined)
812
- url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
813
865
  if (tenantId !== undefined && tenantId !== null)
814
866
  url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
815
867
  url_ = url_.replace(/[?&]$/, "");
868
+ const content_ = JSON.stringify(body);
816
869
  let options_ = {
870
+ body: content_,
817
871
  observe: "response",
818
872
  responseType: "blob",
819
873
  headers: new HttpHeaders({
820
- "Accept": "text/plain"
874
+ "Content-Type": "application/json",
875
+ "Accept": "application/json"
821
876
  })
822
877
  };
823
878
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
824
- return this.http.request("get", url_, transformedOptions_);
879
+ return this.http.request("post", url_, transformedOptions_);
825
880
  })).pipe(mergeMap((response_) => {
826
- return this.transformResult(url_, response_, (r) => this.processGetProductCostDetails(r));
881
+ return this.transformResult(url_, response_, (r) => this.processCreate(r));
827
882
  })).pipe(catchError((response_) => {
828
883
  if (response_ instanceof HttpResponseBase) {
829
884
  try {
830
- return this.transformResult(url_, response_, (r) => this.processGetProductCostDetails(r));
885
+ return this.transformResult(url_, response_, (r) => this.processCreate(r));
831
886
  }
832
887
  catch (e) {
833
888
  return throwError(e);
@@ -837,7 +892,7 @@ class ProductReferencesApiClient extends ApiClientBase {
837
892
  return throwError(response_);
838
893
  }));
839
894
  }
840
- processGetProductCostDetails(response) {
895
+ processCreate(response) {
841
896
  const status = response.status;
842
897
  const responseBlob = response instanceof HttpResponse ? response.body :
843
898
  response.error instanceof Blob ? response.error : undefined;
@@ -847,11 +902,11 @@ class ProductReferencesApiClient extends ApiClientBase {
847
902
  _headers[key] = response.headers.get(key);
848
903
  }
849
904
  }
850
- if (status === 200) {
905
+ if (status === 201) {
851
906
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
852
- let result200 = null;
853
- result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
854
- return of(result200);
907
+ let result201 = null;
908
+ result201 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
909
+ return of(result201);
855
910
  }));
856
911
  }
857
912
  else if (status === 404) {
@@ -861,6 +916,13 @@ class ProductReferencesApiClient extends ApiClientBase {
861
916
  return throwException("Not Found", status, _responseText, _headers, result404);
862
917
  }));
863
918
  }
919
+ else if (status === 409) {
920
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
921
+ let result409 = null;
922
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
923
+ return throwException("Conflict", status, _responseText, _headers, result409);
924
+ }));
925
+ }
864
926
  else if (status === 401) {
865
927
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
866
928
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -879,39 +941,69 @@ class ProductReferencesApiClient extends ApiClientBase {
879
941
  return of(null);
880
942
  }
881
943
  /**
882
- * Returns a product personalization workflow description by product specification identifier.
883
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
884
- * @param storefrontId (optional) Storefront identifier.
944
+ * Returns a list of product specifications associated with storefront product references relevant to the specified query parameters.
945
+ * @param storefrontId Storefront identifier.
946
+ * @param productReference (optional) Product reference filter.
947
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
948
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
949
+ * @param productId (optional) Customer's Canvas product filter.
950
+ * @param productLinkId (optional) Customer's Canvas product link filter.
951
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
952
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
953
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
954
+ * @param search (optional) Search string for partial match.
955
+ * @param sku (optional) SKU filter.
956
+ * @param tags (optional) List of tags that product should have.
957
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
885
958
  * @param tenantId (optional) Tenant identifier.
886
959
  * @return Success
887
960
  */
888
- getPersonalizationWorkflow(reference, storefrontId, tenantId) {
889
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/personalization-workflow?";
890
- if (reference === undefined || reference === null)
891
- throw new Error("The parameter 'reference' must be defined.");
892
- url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
893
- if (storefrontId === null)
894
- throw new Error("The parameter 'storefrontId' cannot be null.");
895
- else if (storefrontId !== undefined)
961
+ getAllProductSpecifications(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
962
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/product-specifications?";
963
+ if (storefrontId === undefined || storefrontId === null)
964
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
965
+ else
896
966
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
897
- if (tenantId !== undefined && tenantId !== null)
898
- url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
899
- url_ = url_.replace(/[?&]$/, "");
900
- let options_ = {
901
- observe: "response",
967
+ if (productReference !== undefined && productReference !== null)
968
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
969
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
970
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
971
+ if (productId !== undefined && productId !== null)
972
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
973
+ if (productLinkId !== undefined && productLinkId !== null)
974
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
975
+ if (skip !== undefined && skip !== null)
976
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
977
+ if (take !== undefined && take !== null)
978
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
979
+ if (sorting !== undefined && sorting !== null)
980
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
981
+ if (search !== undefined && search !== null)
982
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
983
+ if (sku !== undefined && sku !== null)
984
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
985
+ if (tags !== undefined && tags !== null)
986
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
987
+ if (customFields !== undefined && customFields !== null)
988
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
989
+ if (tenantId !== undefined && tenantId !== null)
990
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
991
+ url_ = url_.replace(/[?&]$/, "");
992
+ let options_ = {
993
+ observe: "response",
902
994
  responseType: "blob",
903
995
  headers: new HttpHeaders({
904
- "Accept": "text/plain"
996
+ "Accept": "application/json"
905
997
  })
906
998
  };
907
999
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
908
1000
  return this.http.request("get", url_, transformedOptions_);
909
1001
  })).pipe(mergeMap((response_) => {
910
- return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
1002
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductSpecifications(r));
911
1003
  })).pipe(catchError((response_) => {
912
1004
  if (response_ instanceof HttpResponseBase) {
913
1005
  try {
914
- return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
1006
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductSpecifications(r));
915
1007
  }
916
1008
  catch (e) {
917
1009
  return throwError(e);
@@ -921,7 +1013,7 @@ class ProductReferencesApiClient extends ApiClientBase {
921
1013
  return throwError(response_);
922
1014
  }));
923
1015
  }
924
- processGetPersonalizationWorkflow(response) {
1016
+ processGetAllProductSpecifications(response) {
925
1017
  const status = response.status;
926
1018
  const responseBlob = response instanceof HttpResponse ? response.body :
927
1019
  response.error instanceof Blob ? response.error : undefined;
@@ -938,11 +1030,11 @@ class ProductReferencesApiClient extends ApiClientBase {
938
1030
  return of(result200);
939
1031
  }));
940
1032
  }
941
- else if (status === 404) {
1033
+ else if (status === 409) {
942
1034
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
943
- let result404 = null;
944
- result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
945
- return throwException("Not Found", status, _responseText, _headers, result404);
1035
+ let result409 = null;
1036
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1037
+ return throwException("Conflict", status, _responseText, _headers, result409);
946
1038
  }));
947
1039
  }
948
1040
  else if (status === 401) {
@@ -963,15 +1055,242 @@ class ProductReferencesApiClient extends ApiClientBase {
963
1055
  return of(null);
964
1056
  }
965
1057
  /**
966
- * Returns a product personalization workflow configuration by storefront product reference.
967
- * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
1058
+ * Returns a list of products associated with storefront product references relevant to the specified query parameters.
968
1059
  * @param storefrontId Storefront identifier.
1060
+ * @param productReference (optional) Product reference filter.
1061
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
1062
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
1063
+ * @param productId (optional) Customer's Canvas product filter.
1064
+ * @param productLinkId (optional) Customer's Canvas product link filter.
1065
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
1066
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
1067
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
1068
+ * @param search (optional) Search string for partial match.
1069
+ * @param sku (optional) SKU filter.
1070
+ * @param tags (optional) List of tags that product should have.
1071
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
969
1072
  * @param tenantId (optional) Tenant identifier.
970
1073
  * @return Success
971
- * @deprecated
972
1074
  */
973
- getProductConfig(reference, storefrontId, tenantId) {
974
- let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
1075
+ getAllProducts(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
1076
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/products?";
1077
+ if (storefrontId === undefined || storefrontId === null)
1078
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1079
+ else
1080
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1081
+ if (productReference !== undefined && productReference !== null)
1082
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
1083
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
1084
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
1085
+ if (productId !== undefined && productId !== null)
1086
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
1087
+ if (productLinkId !== undefined && productLinkId !== null)
1088
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
1089
+ if (skip !== undefined && skip !== null)
1090
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1091
+ if (take !== undefined && take !== null)
1092
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1093
+ if (sorting !== undefined && sorting !== null)
1094
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1095
+ if (search !== undefined && search !== null)
1096
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1097
+ if (sku !== undefined && sku !== null)
1098
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1099
+ if (tags !== undefined && tags !== null)
1100
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
1101
+ if (customFields !== undefined && customFields !== null)
1102
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
1103
+ if (tenantId !== undefined && tenantId !== null)
1104
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1105
+ url_ = url_.replace(/[?&]$/, "");
1106
+ let options_ = {
1107
+ observe: "response",
1108
+ responseType: "blob",
1109
+ headers: new HttpHeaders({
1110
+ "Accept": "application/json"
1111
+ })
1112
+ };
1113
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1114
+ return this.http.request("get", url_, transformedOptions_);
1115
+ })).pipe(mergeMap((response_) => {
1116
+ return this.transformResult(url_, response_, (r) => this.processGetAllProducts(r));
1117
+ })).pipe(catchError((response_) => {
1118
+ if (response_ instanceof HttpResponseBase) {
1119
+ try {
1120
+ return this.transformResult(url_, response_, (r) => this.processGetAllProducts(r));
1121
+ }
1122
+ catch (e) {
1123
+ return throwError(e);
1124
+ }
1125
+ }
1126
+ else
1127
+ return throwError(response_);
1128
+ }));
1129
+ }
1130
+ processGetAllProducts(response) {
1131
+ const status = response.status;
1132
+ const responseBlob = response instanceof HttpResponse ? response.body :
1133
+ response.error instanceof Blob ? response.error : undefined;
1134
+ let _headers = {};
1135
+ if (response.headers) {
1136
+ for (let key of response.headers.keys()) {
1137
+ _headers[key] = response.headers.get(key);
1138
+ }
1139
+ }
1140
+ if (status === 200) {
1141
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1142
+ let result200 = null;
1143
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1144
+ return of(result200);
1145
+ }));
1146
+ }
1147
+ else if (status === 409) {
1148
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1149
+ let result409 = null;
1150
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1151
+ return throwException("Conflict", status, _responseText, _headers, result409);
1152
+ }));
1153
+ }
1154
+ else if (status === 401) {
1155
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1156
+ return throwException("Unauthorized", status, _responseText, _headers);
1157
+ }));
1158
+ }
1159
+ else if (status === 403) {
1160
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1161
+ return throwException("Forbidden", status, _responseText, _headers);
1162
+ }));
1163
+ }
1164
+ else if (status !== 200 && status !== 204) {
1165
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1166
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1167
+ }));
1168
+ }
1169
+ return of(null);
1170
+ }
1171
+ /**
1172
+ * Returns a list of product links associated with storefront product references relevant to the specified query parameters.
1173
+ * @param storefrontId Storefront identifier.
1174
+ * @param productReference (optional) Product reference filter.
1175
+ Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
1176
+ * @param productSpecificationId (optional) Customer's Canvas product specification filter.
1177
+ * @param productId (optional) Customer's Canvas product filter.
1178
+ * @param productLinkId (optional) Customer's Canvas product link filter.
1179
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
1180
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
1181
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
1182
+ * @param search (optional) Search string for partial match.
1183
+ * @param sku (optional) SKU filter.
1184
+ * @param tags (optional) List of tags that product should have.
1185
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
1186
+ * @param tenantId (optional) Tenant identifier.
1187
+ * @return Success
1188
+ */
1189
+ getAllProductLinks(storefrontId, productReference, productSpecificationId, productId, productLinkId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
1190
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/product-links?";
1191
+ if (storefrontId === undefined || storefrontId === null)
1192
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1193
+ else
1194
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1195
+ if (productReference !== undefined && productReference !== null)
1196
+ url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
1197
+ if (productSpecificationId !== undefined && productSpecificationId !== null)
1198
+ url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
1199
+ if (productId !== undefined && productId !== null)
1200
+ url_ += "productId=" + encodeURIComponent("" + productId) + "&";
1201
+ if (productLinkId !== undefined && productLinkId !== null)
1202
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
1203
+ if (skip !== undefined && skip !== null)
1204
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
1205
+ if (take !== undefined && take !== null)
1206
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
1207
+ if (sorting !== undefined && sorting !== null)
1208
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
1209
+ if (search !== undefined && search !== null)
1210
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
1211
+ if (sku !== undefined && sku !== null)
1212
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1213
+ if (tags !== undefined && tags !== null)
1214
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
1215
+ if (customFields !== undefined && customFields !== null)
1216
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
1217
+ if (tenantId !== undefined && tenantId !== null)
1218
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1219
+ url_ = url_.replace(/[?&]$/, "");
1220
+ let options_ = {
1221
+ observe: "response",
1222
+ responseType: "blob",
1223
+ headers: new HttpHeaders({
1224
+ "Accept": "application/json"
1225
+ })
1226
+ };
1227
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1228
+ return this.http.request("get", url_, transformedOptions_);
1229
+ })).pipe(mergeMap((response_) => {
1230
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductLinks(r));
1231
+ })).pipe(catchError((response_) => {
1232
+ if (response_ instanceof HttpResponseBase) {
1233
+ try {
1234
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductLinks(r));
1235
+ }
1236
+ catch (e) {
1237
+ return throwError(e);
1238
+ }
1239
+ }
1240
+ else
1241
+ return throwError(response_);
1242
+ }));
1243
+ }
1244
+ processGetAllProductLinks(response) {
1245
+ const status = response.status;
1246
+ const responseBlob = response instanceof HttpResponse ? response.body :
1247
+ response.error instanceof Blob ? response.error : undefined;
1248
+ let _headers = {};
1249
+ if (response.headers) {
1250
+ for (let key of response.headers.keys()) {
1251
+ _headers[key] = response.headers.get(key);
1252
+ }
1253
+ }
1254
+ if (status === 200) {
1255
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1256
+ let result200 = null;
1257
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1258
+ return of(result200);
1259
+ }));
1260
+ }
1261
+ else if (status === 409) {
1262
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1263
+ let result409 = null;
1264
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1265
+ return throwException("Conflict", status, _responseText, _headers, result409);
1266
+ }));
1267
+ }
1268
+ else if (status === 401) {
1269
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1270
+ return throwException("Unauthorized", status, _responseText, _headers);
1271
+ }));
1272
+ }
1273
+ else if (status === 403) {
1274
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1275
+ return throwException("Forbidden", status, _responseText, _headers);
1276
+ }));
1277
+ }
1278
+ else if (status !== 200 && status !== 204) {
1279
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1280
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1281
+ }));
1282
+ }
1283
+ return of(null);
1284
+ }
1285
+ /**
1286
+ * Returns a storefront product reference.
1287
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1288
+ * @param storefrontId Storefront identifier.
1289
+ * @param tenantId (optional) Tenant identifier.
1290
+ * @return Success
1291
+ */
1292
+ get(reference, storefrontId, tenantId) {
1293
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
975
1294
  if (reference === undefined || reference === null)
976
1295
  throw new Error("The parameter 'reference' must be defined.");
977
1296
  url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
@@ -986,17 +1305,2312 @@ class ProductReferencesApiClient extends ApiClientBase {
986
1305
  observe: "response",
987
1306
  responseType: "blob",
988
1307
  headers: new HttpHeaders({
989
- "Accept": "text/plain"
1308
+ "Accept": "application/json"
1309
+ })
1310
+ };
1311
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1312
+ return this.http.request("get", url_, transformedOptions_);
1313
+ })).pipe(mergeMap((response_) => {
1314
+ return this.transformResult(url_, response_, (r) => this.processGet(r));
1315
+ })).pipe(catchError((response_) => {
1316
+ if (response_ instanceof HttpResponseBase) {
1317
+ try {
1318
+ return this.transformResult(url_, response_, (r) => this.processGet(r));
1319
+ }
1320
+ catch (e) {
1321
+ return throwError(e);
1322
+ }
1323
+ }
1324
+ else
1325
+ return throwError(response_);
1326
+ }));
1327
+ }
1328
+ processGet(response) {
1329
+ const status = response.status;
1330
+ const responseBlob = response instanceof HttpResponse ? response.body :
1331
+ response.error instanceof Blob ? response.error : undefined;
1332
+ let _headers = {};
1333
+ if (response.headers) {
1334
+ for (let key of response.headers.keys()) {
1335
+ _headers[key] = response.headers.get(key);
1336
+ }
1337
+ }
1338
+ if (status === 200) {
1339
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1340
+ let result200 = null;
1341
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1342
+ return of(result200);
1343
+ }));
1344
+ }
1345
+ else if (status === 409) {
1346
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1347
+ let result409 = null;
1348
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1349
+ return throwException("Conflict", status, _responseText, _headers, result409);
1350
+ }));
1351
+ }
1352
+ else if (status === 404) {
1353
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1354
+ let result404 = null;
1355
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1356
+ return throwException("Not Found", status, _responseText, _headers, result404);
1357
+ }));
1358
+ }
1359
+ else if (status === 401) {
1360
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1361
+ return throwException("Unauthorized", status, _responseText, _headers);
1362
+ }));
1363
+ }
1364
+ else if (status === 403) {
1365
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1366
+ return throwException("Forbidden", status, _responseText, _headers);
1367
+ }));
1368
+ }
1369
+ else if (status !== 200 && status !== 204) {
1370
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1371
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1372
+ }));
1373
+ }
1374
+ return of(null);
1375
+ }
1376
+ /**
1377
+ * Deletes the storefront product reference.
1378
+ * @param reference Product reference - external reference to Customer's Canvas product specification, e.g online store product identifier.
1379
+ * @param storefrontId Storefront identifier.
1380
+ * @param tenantId (optional) Tenant identifier.
1381
+ * @return Success
1382
+ */
1383
+ delete(reference, storefrontId, tenantId) {
1384
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
1385
+ if (reference === undefined || reference === null)
1386
+ throw new Error("The parameter 'reference' must be defined.");
1387
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1388
+ if (storefrontId === undefined || storefrontId === null)
1389
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1390
+ else
1391
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1392
+ if (tenantId !== undefined && tenantId !== null)
1393
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1394
+ url_ = url_.replace(/[?&]$/, "");
1395
+ let options_ = {
1396
+ observe: "response",
1397
+ responseType: "blob",
1398
+ headers: new HttpHeaders({
1399
+ "Accept": "application/json"
1400
+ })
1401
+ };
1402
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1403
+ return this.http.request("delete", url_, transformedOptions_);
1404
+ })).pipe(mergeMap((response_) => {
1405
+ return this.transformResult(url_, response_, (r) => this.processDelete(r));
1406
+ })).pipe(catchError((response_) => {
1407
+ if (response_ instanceof HttpResponseBase) {
1408
+ try {
1409
+ return this.transformResult(url_, response_, (r) => this.processDelete(r));
1410
+ }
1411
+ catch (e) {
1412
+ return throwError(e);
1413
+ }
1414
+ }
1415
+ else
1416
+ return throwError(response_);
1417
+ }));
1418
+ }
1419
+ processDelete(response) {
1420
+ const status = response.status;
1421
+ const responseBlob = response instanceof HttpResponse ? response.body :
1422
+ response.error instanceof Blob ? response.error : undefined;
1423
+ let _headers = {};
1424
+ if (response.headers) {
1425
+ for (let key of response.headers.keys()) {
1426
+ _headers[key] = response.headers.get(key);
1427
+ }
1428
+ }
1429
+ if (status === 200) {
1430
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1431
+ let result200 = null;
1432
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1433
+ return of(result200);
1434
+ }));
1435
+ }
1436
+ else if (status === 404) {
1437
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1438
+ let result404 = null;
1439
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1440
+ return throwException("Not Found", status, _responseText, _headers, result404);
1441
+ }));
1442
+ }
1443
+ else if (status === 409) {
1444
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1445
+ let result409 = null;
1446
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1447
+ return throwException("Conflict", status, _responseText, _headers, result409);
1448
+ }));
1449
+ }
1450
+ else if (status === 401) {
1451
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1452
+ return throwException("Unauthorized", status, _responseText, _headers);
1453
+ }));
1454
+ }
1455
+ else if (status === 403) {
1456
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1457
+ return throwException("Forbidden", status, _responseText, _headers);
1458
+ }));
1459
+ }
1460
+ else if (status !== 200 && status !== 204) {
1461
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1462
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1463
+ }));
1464
+ }
1465
+ return of(null);
1466
+ }
1467
+ /**
1468
+ * Returns a product specification by the storefront product reference.
1469
+ * @param reference Product reference - external reference to Customer's Canvas product, e.g online store product identifier.
1470
+ * @param storefrontId Storefront identifier.
1471
+ * @param tenantId (optional) Tenant identifier.
1472
+ * @return Success
1473
+ */
1474
+ getProductSpecification(reference, storefrontId, tenantId) {
1475
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
1476
+ if (reference === undefined || reference === null)
1477
+ throw new Error("The parameter 'reference' must be defined.");
1478
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1479
+ if (storefrontId === undefined || storefrontId === null)
1480
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1481
+ else
1482
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1483
+ if (tenantId !== undefined && tenantId !== null)
1484
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1485
+ url_ = url_.replace(/[?&]$/, "");
1486
+ let options_ = {
1487
+ observe: "response",
1488
+ responseType: "blob",
1489
+ headers: new HttpHeaders({
1490
+ "Accept": "application/json"
1491
+ })
1492
+ };
1493
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1494
+ return this.http.request("get", url_, transformedOptions_);
1495
+ })).pipe(mergeMap((response_) => {
1496
+ return this.transformResult(url_, response_, (r) => this.processGetProductSpecification(r));
1497
+ })).pipe(catchError((response_) => {
1498
+ if (response_ instanceof HttpResponseBase) {
1499
+ try {
1500
+ return this.transformResult(url_, response_, (r) => this.processGetProductSpecification(r));
1501
+ }
1502
+ catch (e) {
1503
+ return throwError(e);
1504
+ }
1505
+ }
1506
+ else
1507
+ return throwError(response_);
1508
+ }));
1509
+ }
1510
+ processGetProductSpecification(response) {
1511
+ const status = response.status;
1512
+ const responseBlob = response instanceof HttpResponse ? response.body :
1513
+ response.error instanceof Blob ? response.error : undefined;
1514
+ let _headers = {};
1515
+ if (response.headers) {
1516
+ for (let key of response.headers.keys()) {
1517
+ _headers[key] = response.headers.get(key);
1518
+ }
1519
+ }
1520
+ if (status === 200) {
1521
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1522
+ let result200 = null;
1523
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1524
+ return of(result200);
1525
+ }));
1526
+ }
1527
+ else if (status === 404) {
1528
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1529
+ let result404 = null;
1530
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1531
+ return throwException("Not Found", status, _responseText, _headers, result404);
1532
+ }));
1533
+ }
1534
+ else if (status === 409) {
1535
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1536
+ let result409 = null;
1537
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1538
+ return throwException("Conflict", status, _responseText, _headers, result409);
1539
+ }));
1540
+ }
1541
+ else if (status === 401) {
1542
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1543
+ return throwException("Unauthorized", status, _responseText, _headers);
1544
+ }));
1545
+ }
1546
+ else if (status === 403) {
1547
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1548
+ return throwException("Forbidden", status, _responseText, _headers);
1549
+ }));
1550
+ }
1551
+ else if (status !== 200 && status !== 204) {
1552
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1553
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1554
+ }));
1555
+ }
1556
+ return of(null);
1557
+ }
1558
+ /**
1559
+ * Returns a product by storefront product reference.
1560
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1561
+ * @param storefrontId Storefront identifier.
1562
+ * @param tenantId (optional) Tenant identifier.
1563
+ * @return Success
1564
+ */
1565
+ getProduct(reference, storefrontId, tenantId) {
1566
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product?";
1567
+ if (reference === undefined || reference === null)
1568
+ throw new Error("The parameter 'reference' must be defined.");
1569
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1570
+ if (storefrontId === undefined || storefrontId === null)
1571
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1572
+ else
1573
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1574
+ if (tenantId !== undefined && tenantId !== null)
1575
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1576
+ url_ = url_.replace(/[?&]$/, "");
1577
+ let options_ = {
1578
+ observe: "response",
1579
+ responseType: "blob",
1580
+ headers: new HttpHeaders({
1581
+ "Accept": "application/json"
1582
+ })
1583
+ };
1584
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1585
+ return this.http.request("get", url_, transformedOptions_);
1586
+ })).pipe(mergeMap((response_) => {
1587
+ return this.transformResult(url_, response_, (r) => this.processGetProduct(r));
1588
+ })).pipe(catchError((response_) => {
1589
+ if (response_ instanceof HttpResponseBase) {
1590
+ try {
1591
+ return this.transformResult(url_, response_, (r) => this.processGetProduct(r));
1592
+ }
1593
+ catch (e) {
1594
+ return throwError(e);
1595
+ }
1596
+ }
1597
+ else
1598
+ return throwError(response_);
1599
+ }));
1600
+ }
1601
+ processGetProduct(response) {
1602
+ const status = response.status;
1603
+ const responseBlob = response instanceof HttpResponse ? response.body :
1604
+ response.error instanceof Blob ? response.error : undefined;
1605
+ let _headers = {};
1606
+ if (response.headers) {
1607
+ for (let key of response.headers.keys()) {
1608
+ _headers[key] = response.headers.get(key);
1609
+ }
1610
+ }
1611
+ if (status === 200) {
1612
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1613
+ let result200 = null;
1614
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1615
+ return of(result200);
1616
+ }));
1617
+ }
1618
+ else if (status === 404) {
1619
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1620
+ let result404 = null;
1621
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1622
+ return throwException("Not Found", status, _responseText, _headers, result404);
1623
+ }));
1624
+ }
1625
+ else if (status === 409) {
1626
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1627
+ let result409 = null;
1628
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1629
+ return throwException("Conflict", status, _responseText, _headers, result409);
1630
+ }));
1631
+ }
1632
+ else if (status === 401) {
1633
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1634
+ return throwException("Unauthorized", status, _responseText, _headers);
1635
+ }));
1636
+ }
1637
+ else if (status === 403) {
1638
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1639
+ return throwException("Forbidden", status, _responseText, _headers);
1640
+ }));
1641
+ }
1642
+ else if (status !== 200 && status !== 204) {
1643
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1644
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1645
+ }));
1646
+ }
1647
+ return of(null);
1648
+ }
1649
+ /**
1650
+ * Returns a product summary by storefront product reference.
1651
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1652
+ * @param storefrontId Storefront identifier.
1653
+ * @param productVariantId (optional) Product variant identifier.
1654
+ * @param sku (optional) Product variant SKU.
1655
+ * @param tenantId (optional) Tenant identifier.
1656
+ * @return Success
1657
+ */
1658
+ getProductSummary(reference, storefrontId, productVariantId, sku, tenantId) {
1659
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-summary?";
1660
+ if (reference === undefined || reference === null)
1661
+ throw new Error("The parameter 'reference' must be defined.");
1662
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1663
+ if (storefrontId === undefined || storefrontId === null)
1664
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1665
+ else
1666
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1667
+ if (productVariantId !== undefined && productVariantId !== null)
1668
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
1669
+ if (sku !== undefined && sku !== null)
1670
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1671
+ if (tenantId !== undefined && tenantId !== null)
1672
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1673
+ url_ = url_.replace(/[?&]$/, "");
1674
+ let options_ = {
1675
+ observe: "response",
1676
+ responseType: "blob",
1677
+ headers: new HttpHeaders({
1678
+ "Accept": "application/json"
1679
+ })
1680
+ };
1681
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1682
+ return this.http.request("get", url_, transformedOptions_);
1683
+ })).pipe(mergeMap((response_) => {
1684
+ return this.transformResult(url_, response_, (r) => this.processGetProductSummary(r));
1685
+ })).pipe(catchError((response_) => {
1686
+ if (response_ instanceof HttpResponseBase) {
1687
+ try {
1688
+ return this.transformResult(url_, response_, (r) => this.processGetProductSummary(r));
1689
+ }
1690
+ catch (e) {
1691
+ return throwError(e);
1692
+ }
1693
+ }
1694
+ else
1695
+ return throwError(response_);
1696
+ }));
1697
+ }
1698
+ processGetProductSummary(response) {
1699
+ const status = response.status;
1700
+ const responseBlob = response instanceof HttpResponse ? response.body :
1701
+ response.error instanceof Blob ? response.error : undefined;
1702
+ let _headers = {};
1703
+ if (response.headers) {
1704
+ for (let key of response.headers.keys()) {
1705
+ _headers[key] = response.headers.get(key);
1706
+ }
1707
+ }
1708
+ if (status === 200) {
1709
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1710
+ let result200 = null;
1711
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1712
+ return of(result200);
1713
+ }));
1714
+ }
1715
+ else if (status === 404) {
1716
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1717
+ let result404 = null;
1718
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1719
+ return throwException("Not Found", status, _responseText, _headers, result404);
1720
+ }));
1721
+ }
1722
+ else if (status === 409) {
1723
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1724
+ let result409 = null;
1725
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1726
+ return throwException("Conflict", status, _responseText, _headers, result409);
1727
+ }));
1728
+ }
1729
+ else if (status === 401) {
1730
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1731
+ return throwException("Unauthorized", status, _responseText, _headers);
1732
+ }));
1733
+ }
1734
+ else if (status === 403) {
1735
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1736
+ return throwException("Forbidden", status, _responseText, _headers);
1737
+ }));
1738
+ }
1739
+ else if (status !== 200 && status !== 204) {
1740
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1741
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1742
+ }));
1743
+ }
1744
+ return of(null);
1745
+ }
1746
+ /**
1747
+ * Returns a product link by storefront product reference.
1748
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1749
+ * @param storefrontId Storefront identifier.
1750
+ * @param tenantId (optional) Tenant identifier.
1751
+ * @return Success
1752
+ */
1753
+ getProductLink(reference, storefrontId, tenantId) {
1754
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-link?";
1755
+ if (reference === undefined || reference === null)
1756
+ throw new Error("The parameter 'reference' must be defined.");
1757
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1758
+ if (storefrontId === undefined || storefrontId === null)
1759
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1760
+ else
1761
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1762
+ if (tenantId !== undefined && tenantId !== null)
1763
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1764
+ url_ = url_.replace(/[?&]$/, "");
1765
+ let options_ = {
1766
+ observe: "response",
1767
+ responseType: "blob",
1768
+ headers: new HttpHeaders({
1769
+ "Accept": "application/json"
1770
+ })
1771
+ };
1772
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1773
+ return this.http.request("get", url_, transformedOptions_);
1774
+ })).pipe(mergeMap((response_) => {
1775
+ return this.transformResult(url_, response_, (r) => this.processGetProductLink(r));
1776
+ })).pipe(catchError((response_) => {
1777
+ if (response_ instanceof HttpResponseBase) {
1778
+ try {
1779
+ return this.transformResult(url_, response_, (r) => this.processGetProductLink(r));
1780
+ }
1781
+ catch (e) {
1782
+ return throwError(e);
1783
+ }
1784
+ }
1785
+ else
1786
+ return throwError(response_);
1787
+ }));
1788
+ }
1789
+ processGetProductLink(response) {
1790
+ const status = response.status;
1791
+ const responseBlob = response instanceof HttpResponse ? response.body :
1792
+ response.error instanceof Blob ? response.error : undefined;
1793
+ let _headers = {};
1794
+ if (response.headers) {
1795
+ for (let key of response.headers.keys()) {
1796
+ _headers[key] = response.headers.get(key);
1797
+ }
1798
+ }
1799
+ if (status === 200) {
1800
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1801
+ let result200 = null;
1802
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1803
+ return of(result200);
1804
+ }));
1805
+ }
1806
+ else if (status === 404) {
1807
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1808
+ let result404 = null;
1809
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1810
+ return throwException("Not Found", status, _responseText, _headers, result404);
1811
+ }));
1812
+ }
1813
+ else if (status === 409) {
1814
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1815
+ let result409 = null;
1816
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1817
+ return throwException("Conflict", status, _responseText, _headers, result409);
1818
+ }));
1819
+ }
1820
+ else if (status === 401) {
1821
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1822
+ return throwException("Unauthorized", status, _responseText, _headers);
1823
+ }));
1824
+ }
1825
+ else if (status === 403) {
1826
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1827
+ return throwException("Forbidden", status, _responseText, _headers);
1828
+ }));
1829
+ }
1830
+ else if (status !== 200 && status !== 204) {
1831
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1832
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1833
+ }));
1834
+ }
1835
+ return of(null);
1836
+ }
1837
+ /**
1838
+ * Returns a product cost details from ecommerce system.
1839
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1840
+ * @param sku Product SKU.
1841
+ * @param storefrontId Storefront identifier.
1842
+ * @param storefrontUserId (optional) Storefront user identifier.
1843
+ * @param currencyCode (optional) Product cost currency code.
1844
+ * @param quantity (optional) Product quantity.
1845
+ * @param tenantId (optional) Tenant identifier.
1846
+ * @return Success
1847
+ */
1848
+ getProductCostDetails(reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId) {
1849
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
1850
+ if (reference === undefined || reference === null)
1851
+ throw new Error("The parameter 'reference' must be defined.");
1852
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1853
+ if (sku === undefined || sku === null)
1854
+ throw new Error("The parameter 'sku' must be defined and cannot be null.");
1855
+ else
1856
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
1857
+ if (storefrontId === undefined || storefrontId === null)
1858
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
1859
+ else
1860
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1861
+ if (storefrontUserId !== undefined && storefrontUserId !== null)
1862
+ url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
1863
+ if (currencyCode !== undefined && currencyCode !== null)
1864
+ url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
1865
+ if (quantity === null)
1866
+ throw new Error("The parameter 'quantity' cannot be null.");
1867
+ else if (quantity !== undefined)
1868
+ url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
1869
+ if (tenantId !== undefined && tenantId !== null)
1870
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1871
+ url_ = url_.replace(/[?&]$/, "");
1872
+ let options_ = {
1873
+ observe: "response",
1874
+ responseType: "blob",
1875
+ headers: new HttpHeaders({
1876
+ "Accept": "application/json"
1877
+ })
1878
+ };
1879
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1880
+ return this.http.request("get", url_, transformedOptions_);
1881
+ })).pipe(mergeMap((response_) => {
1882
+ return this.transformResult(url_, response_, (r) => this.processGetProductCostDetails(r));
1883
+ })).pipe(catchError((response_) => {
1884
+ if (response_ instanceof HttpResponseBase) {
1885
+ try {
1886
+ return this.transformResult(url_, response_, (r) => this.processGetProductCostDetails(r));
1887
+ }
1888
+ catch (e) {
1889
+ return throwError(e);
1890
+ }
1891
+ }
1892
+ else
1893
+ return throwError(response_);
1894
+ }));
1895
+ }
1896
+ processGetProductCostDetails(response) {
1897
+ const status = response.status;
1898
+ const responseBlob = response instanceof HttpResponse ? response.body :
1899
+ response.error instanceof Blob ? response.error : undefined;
1900
+ let _headers = {};
1901
+ if (response.headers) {
1902
+ for (let key of response.headers.keys()) {
1903
+ _headers[key] = response.headers.get(key);
1904
+ }
1905
+ }
1906
+ if (status === 200) {
1907
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1908
+ let result200 = null;
1909
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1910
+ return of(result200);
1911
+ }));
1912
+ }
1913
+ else if (status === 404) {
1914
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1915
+ let result404 = null;
1916
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1917
+ return throwException("Not Found", status, _responseText, _headers, result404);
1918
+ }));
1919
+ }
1920
+ else if (status === 409) {
1921
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1922
+ let result409 = null;
1923
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1924
+ return throwException("Conflict", status, _responseText, _headers, result409);
1925
+ }));
1926
+ }
1927
+ else if (status === 401) {
1928
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1929
+ return throwException("Unauthorized", status, _responseText, _headers);
1930
+ }));
1931
+ }
1932
+ else if (status === 403) {
1933
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1934
+ return throwException("Forbidden", status, _responseText, _headers);
1935
+ }));
1936
+ }
1937
+ else if (status !== 200 && status !== 204) {
1938
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1939
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1940
+ }));
1941
+ }
1942
+ return of(null);
1943
+ }
1944
+ /**
1945
+ * Returns a product personalization workflow.
1946
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
1947
+ * @param storefrontId (optional) Storefront identifier.
1948
+ * @param tenantId (optional) Tenant identifier.
1949
+ * @return Success
1950
+ */
1951
+ getPersonalizationWorkflow(reference, storefrontId, tenantId) {
1952
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/personalization-workflow?";
1953
+ if (reference === undefined || reference === null)
1954
+ throw new Error("The parameter 'reference' must be defined.");
1955
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
1956
+ if (storefrontId === null)
1957
+ throw new Error("The parameter 'storefrontId' cannot be null.");
1958
+ else if (storefrontId !== undefined)
1959
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1960
+ if (tenantId !== undefined && tenantId !== null)
1961
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1962
+ url_ = url_.replace(/[?&]$/, "");
1963
+ let options_ = {
1964
+ observe: "response",
1965
+ responseType: "blob",
1966
+ headers: new HttpHeaders({
1967
+ "Accept": "application/json"
1968
+ })
1969
+ };
1970
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1971
+ return this.http.request("get", url_, transformedOptions_);
1972
+ })).pipe(mergeMap((response_) => {
1973
+ return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
1974
+ })).pipe(catchError((response_) => {
1975
+ if (response_ instanceof HttpResponseBase) {
1976
+ try {
1977
+ return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
1978
+ }
1979
+ catch (e) {
1980
+ return throwError(e);
1981
+ }
1982
+ }
1983
+ else
1984
+ return throwError(response_);
1985
+ }));
1986
+ }
1987
+ processGetPersonalizationWorkflow(response) {
1988
+ const status = response.status;
1989
+ const responseBlob = response instanceof HttpResponse ? response.body :
1990
+ response.error instanceof Blob ? response.error : undefined;
1991
+ let _headers = {};
1992
+ if (response.headers) {
1993
+ for (let key of response.headers.keys()) {
1994
+ _headers[key] = response.headers.get(key);
1995
+ }
1996
+ }
1997
+ if (status === 200) {
1998
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1999
+ let result200 = null;
2000
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2001
+ return of(result200);
2002
+ }));
2003
+ }
2004
+ else if (status === 404) {
2005
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2006
+ let result404 = null;
2007
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2008
+ return throwException("Not Found", status, _responseText, _headers, result404);
2009
+ }));
2010
+ }
2011
+ else if (status === 409) {
2012
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2013
+ let result409 = null;
2014
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2015
+ return throwException("Conflict", status, _responseText, _headers, result409);
2016
+ }));
2017
+ }
2018
+ else if (status === 401) {
2019
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2020
+ return throwException("Unauthorized", status, _responseText, _headers);
2021
+ }));
2022
+ }
2023
+ else if (status === 403) {
2024
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2025
+ return throwException("Forbidden", status, _responseText, _headers);
2026
+ }));
2027
+ }
2028
+ else if (status !== 200 && status !== 204) {
2029
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2030
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2031
+ }));
2032
+ }
2033
+ return of(null);
2034
+ }
2035
+ /**
2036
+ * Returns a product personalization workflow configuration by storefront product reference.
2037
+ * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
2038
+ * @param storefrontId Storefront identifier.
2039
+ * @param tenantId (optional) Tenant identifier.
2040
+ * @return Success
2041
+ * @deprecated
2042
+ */
2043
+ getProductConfig(reference, storefrontId, tenantId) {
2044
+ let url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-config?";
2045
+ if (reference === undefined || reference === null)
2046
+ throw new Error("The parameter 'reference' must be defined.");
2047
+ url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
2048
+ if (storefrontId === undefined || storefrontId === null)
2049
+ throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
2050
+ else
2051
+ url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
2052
+ if (tenantId !== undefined && tenantId !== null)
2053
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2054
+ url_ = url_.replace(/[?&]$/, "");
2055
+ let options_ = {
2056
+ observe: "response",
2057
+ responseType: "blob",
2058
+ headers: new HttpHeaders({
2059
+ "Accept": "text/plain"
2060
+ })
2061
+ };
2062
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2063
+ return this.http.request("get", url_, transformedOptions_);
2064
+ })).pipe(mergeMap((response_) => {
2065
+ return this.transformResult(url_, response_, (r) => this.processGetProductConfig(r));
2066
+ })).pipe(catchError((response_) => {
2067
+ if (response_ instanceof HttpResponseBase) {
2068
+ try {
2069
+ return this.transformResult(url_, response_, (r) => this.processGetProductConfig(r));
2070
+ }
2071
+ catch (e) {
2072
+ return throwError(e);
2073
+ }
2074
+ }
2075
+ else
2076
+ return throwError(response_);
2077
+ }));
2078
+ }
2079
+ processGetProductConfig(response) {
2080
+ const status = response.status;
2081
+ const responseBlob = response instanceof HttpResponse ? response.body :
2082
+ response.error instanceof Blob ? response.error : undefined;
2083
+ let _headers = {};
2084
+ if (response.headers) {
2085
+ for (let key of response.headers.keys()) {
2086
+ _headers[key] = response.headers.get(key);
2087
+ }
2088
+ }
2089
+ if (status === 200) {
2090
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2091
+ let result200 = null;
2092
+ result200 = _responseText === "" ? null : _responseText;
2093
+ return of(result200);
2094
+ }));
2095
+ }
2096
+ else if (status === 404) {
2097
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2098
+ let result404 = null;
2099
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2100
+ return throwException("Not Found", status, _responseText, _headers, result404);
2101
+ }));
2102
+ }
2103
+ else if (status === 409) {
2104
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2105
+ let result409 = null;
2106
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2107
+ return throwException("Conflict", status, _responseText, _headers, result409);
2108
+ }));
2109
+ }
2110
+ else if (status === 401) {
2111
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2112
+ return throwException("Unauthorized", status, _responseText, _headers);
2113
+ }));
2114
+ }
2115
+ else if (status === 403) {
2116
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2117
+ return throwException("Forbidden", status, _responseText, _headers);
2118
+ }));
2119
+ }
2120
+ else if (status !== 200 && status !== 204) {
2121
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2122
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2123
+ }));
2124
+ }
2125
+ return of(null);
2126
+ }
2127
+ }
2128
+ ProductReferencesApiClient.ɵprov = ɵɵdefineInjectable({ factory: function ProductReferencesApiClient_Factory() { return new ProductReferencesApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: ProductReferencesApiClient, providedIn: "root" });
2129
+ ProductReferencesApiClient.decorators = [
2130
+ { type: Injectable, args: [{
2131
+ providedIn: 'root'
2132
+ },] }
2133
+ ];
2134
+ ProductReferencesApiClient.ctorParameters = () => [
2135
+ { type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
2136
+ { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
2137
+ { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
2138
+ ];
2139
+ class ProductsApiClient extends ApiClientBase {
2140
+ constructor(configuration, http, baseUrl) {
2141
+ super(configuration);
2142
+ this.jsonParseReviver = undefined;
2143
+ this.http = http;
2144
+ this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : this.getBaseUrl("");
2145
+ }
2146
+ /**
2147
+ * Returns all products, relevant to the specified query parameters.
2148
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2149
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2150
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
2151
+ * @param search (optional) Search string for partial match.
2152
+ * @param sku (optional) SKU of linked ecommerce product.
2153
+ * @param tags (optional) List of tags that product should have.
2154
+ * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
2155
+ * @param tenantId (optional) Tenant identifier.
2156
+ * @return Success
2157
+ */
2158
+ getAllProducts(skip, take, sorting, search, sku, tags, customFields, tenantId) {
2159
+ let url_ = this.baseUrl + "/api/storefront/v1/products?";
2160
+ if (skip !== undefined && skip !== null)
2161
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2162
+ if (take !== undefined && take !== null)
2163
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2164
+ if (sorting !== undefined && sorting !== null)
2165
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
2166
+ if (search !== undefined && search !== null)
2167
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2168
+ if (sku !== undefined && sku !== null)
2169
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2170
+ if (tags !== undefined && tags !== null)
2171
+ tags && tags.forEach(item => { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
2172
+ if (customFields !== undefined && customFields !== null)
2173
+ url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
2174
+ if (tenantId !== undefined && tenantId !== null)
2175
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2176
+ url_ = url_.replace(/[?&]$/, "");
2177
+ let options_ = {
2178
+ observe: "response",
2179
+ responseType: "blob",
2180
+ headers: new HttpHeaders({
2181
+ "Accept": "application/json"
2182
+ })
2183
+ };
2184
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2185
+ return this.http.request("get", url_, transformedOptions_);
2186
+ })).pipe(mergeMap((response_) => {
2187
+ return this.transformResult(url_, response_, (r) => this.processGetAllProducts(r));
2188
+ })).pipe(catchError((response_) => {
2189
+ if (response_ instanceof HttpResponseBase) {
2190
+ try {
2191
+ return this.transformResult(url_, response_, (r) => this.processGetAllProducts(r));
2192
+ }
2193
+ catch (e) {
2194
+ return throwError(e);
2195
+ }
2196
+ }
2197
+ else
2198
+ return throwError(response_);
2199
+ }));
2200
+ }
2201
+ processGetAllProducts(response) {
2202
+ const status = response.status;
2203
+ const responseBlob = response instanceof HttpResponse ? response.body :
2204
+ response.error instanceof Blob ? response.error : undefined;
2205
+ let _headers = {};
2206
+ if (response.headers) {
2207
+ for (let key of response.headers.keys()) {
2208
+ _headers[key] = response.headers.get(key);
2209
+ }
2210
+ }
2211
+ if (status === 200) {
2212
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2213
+ let result200 = null;
2214
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2215
+ return of(result200);
2216
+ }));
2217
+ }
2218
+ else if (status === 401) {
2219
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2220
+ return throwException("Unauthorized", status, _responseText, _headers);
2221
+ }));
2222
+ }
2223
+ else if (status === 403) {
2224
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2225
+ return throwException("Forbidden", status, _responseText, _headers);
2226
+ }));
2227
+ }
2228
+ else if (status !== 200 && status !== 204) {
2229
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2230
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2231
+ }));
2232
+ }
2233
+ return of(null);
2234
+ }
2235
+ /**
2236
+ * Returns a product by identifier.
2237
+ * @param id Product identifier.
2238
+ * @param productVersionId (optional) Product version identifier.
2239
+ * @param tenantId (optional) Tenant identifier.
2240
+ * @return Success
2241
+ */
2242
+ getProduct(id, productVersionId, tenantId) {
2243
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}?";
2244
+ if (id === undefined || id === null)
2245
+ throw new Error("The parameter 'id' must be defined.");
2246
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2247
+ if (productVersionId !== undefined && productVersionId !== null)
2248
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2249
+ if (tenantId !== undefined && tenantId !== null)
2250
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2251
+ url_ = url_.replace(/[?&]$/, "");
2252
+ let options_ = {
2253
+ observe: "response",
2254
+ responseType: "blob",
2255
+ headers: new HttpHeaders({
2256
+ "Accept": "application/json"
2257
+ })
2258
+ };
2259
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2260
+ return this.http.request("get", url_, transformedOptions_);
2261
+ })).pipe(mergeMap((response_) => {
2262
+ return this.transformResult(url_, response_, (r) => this.processGetProduct(r));
2263
+ })).pipe(catchError((response_) => {
2264
+ if (response_ instanceof HttpResponseBase) {
2265
+ try {
2266
+ return this.transformResult(url_, response_, (r) => this.processGetProduct(r));
2267
+ }
2268
+ catch (e) {
2269
+ return throwError(e);
2270
+ }
2271
+ }
2272
+ else
2273
+ return throwError(response_);
2274
+ }));
2275
+ }
2276
+ processGetProduct(response) {
2277
+ const status = response.status;
2278
+ const responseBlob = response instanceof HttpResponse ? response.body :
2279
+ response.error instanceof Blob ? response.error : undefined;
2280
+ let _headers = {};
2281
+ if (response.headers) {
2282
+ for (let key of response.headers.keys()) {
2283
+ _headers[key] = response.headers.get(key);
2284
+ }
2285
+ }
2286
+ if (status === 200) {
2287
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2288
+ let result200 = null;
2289
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2290
+ return of(result200);
2291
+ }));
2292
+ }
2293
+ else if (status === 404) {
2294
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2295
+ let result404 = null;
2296
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2297
+ return throwException("Not Found", status, _responseText, _headers, result404);
2298
+ }));
2299
+ }
2300
+ else if (status === 409) {
2301
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2302
+ let result409 = null;
2303
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2304
+ return throwException("Conflict", status, _responseText, _headers, result409);
2305
+ }));
2306
+ }
2307
+ else if (status === 401) {
2308
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2309
+ return throwException("Unauthorized", status, _responseText, _headers);
2310
+ }));
2311
+ }
2312
+ else if (status === 403) {
2313
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2314
+ return throwException("Forbidden", status, _responseText, _headers);
2315
+ }));
2316
+ }
2317
+ else if (status !== 200 && status !== 204) {
2318
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2319
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2320
+ }));
2321
+ }
2322
+ return of(null);
2323
+ }
2324
+ /**
2325
+ * Returns a product summary by product identifier.
2326
+ * @param id Product identifier.
2327
+ * @param productVersionId (optional) Product version identifier.
2328
+ * @param productLinkId (optional) Product link identifier.
2329
+ * @param productVariantId (optional) Product variant identifier.
2330
+ * @param sku (optional) Product variant SKU.
2331
+ * @param tenantId (optional) Tenant identifier.
2332
+ * @return Success
2333
+ */
2334
+ getProductSummary(id, productVersionId, productLinkId, productVariantId, sku, tenantId) {
2335
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/summary?";
2336
+ if (id === undefined || id === null)
2337
+ throw new Error("The parameter 'id' must be defined.");
2338
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2339
+ if (productVersionId !== undefined && productVersionId !== null)
2340
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2341
+ if (productLinkId !== undefined && productLinkId !== null)
2342
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
2343
+ if (productVariantId !== undefined && productVariantId !== null)
2344
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2345
+ if (sku !== undefined && sku !== null)
2346
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2347
+ if (tenantId !== undefined && tenantId !== null)
2348
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2349
+ url_ = url_.replace(/[?&]$/, "");
2350
+ let options_ = {
2351
+ observe: "response",
2352
+ responseType: "blob",
2353
+ headers: new HttpHeaders({
2354
+ "Accept": "application/json"
2355
+ })
2356
+ };
2357
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2358
+ return this.http.request("get", url_, transformedOptions_);
2359
+ })).pipe(mergeMap((response_) => {
2360
+ return this.transformResult(url_, response_, (r) => this.processGetProductSummary(r));
2361
+ })).pipe(catchError((response_) => {
2362
+ if (response_ instanceof HttpResponseBase) {
2363
+ try {
2364
+ return this.transformResult(url_, response_, (r) => this.processGetProductSummary(r));
2365
+ }
2366
+ catch (e) {
2367
+ return throwError(e);
2368
+ }
2369
+ }
2370
+ else
2371
+ return throwError(response_);
2372
+ }));
2373
+ }
2374
+ processGetProductSummary(response) {
2375
+ const status = response.status;
2376
+ const responseBlob = response instanceof HttpResponse ? response.body :
2377
+ response.error instanceof Blob ? response.error : undefined;
2378
+ let _headers = {};
2379
+ if (response.headers) {
2380
+ for (let key of response.headers.keys()) {
2381
+ _headers[key] = response.headers.get(key);
2382
+ }
2383
+ }
2384
+ if (status === 200) {
2385
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2386
+ let result200 = null;
2387
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2388
+ return of(result200);
2389
+ }));
2390
+ }
2391
+ else if (status === 404) {
2392
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2393
+ let result404 = null;
2394
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2395
+ return throwException("Not Found", status, _responseText, _headers, result404);
2396
+ }));
2397
+ }
2398
+ else if (status === 409) {
2399
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2400
+ let result409 = null;
2401
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2402
+ return throwException("Conflict", status, _responseText, _headers, result409);
2403
+ }));
2404
+ }
2405
+ else if (status === 401) {
2406
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2407
+ return throwException("Unauthorized", status, _responseText, _headers);
2408
+ }));
2409
+ }
2410
+ else if (status === 403) {
2411
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2412
+ return throwException("Forbidden", status, _responseText, _headers);
2413
+ }));
2414
+ }
2415
+ else if (status !== 200 && status !== 204) {
2416
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2417
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2418
+ }));
2419
+ }
2420
+ return of(null);
2421
+ }
2422
+ /**
2423
+ * Returns a list of product options.
2424
+ * @param id Product identifier.
2425
+ * @param productVersionId (optional) Product version identifier.
2426
+ * @param tenantId (optional) Tenant identifier.
2427
+ * @return Success
2428
+ */
2429
+ getProductOptions(id, productVersionId, tenantId) {
2430
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/options?";
2431
+ if (id === undefined || id === null)
2432
+ throw new Error("The parameter 'id' must be defined.");
2433
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2434
+ if (productVersionId !== undefined && productVersionId !== null)
2435
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2436
+ if (tenantId !== undefined && tenantId !== null)
2437
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2438
+ url_ = url_.replace(/[?&]$/, "");
2439
+ let options_ = {
2440
+ observe: "response",
2441
+ responseType: "blob",
2442
+ headers: new HttpHeaders({
2443
+ "Accept": "application/json"
2444
+ })
2445
+ };
2446
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2447
+ return this.http.request("get", url_, transformedOptions_);
2448
+ })).pipe(mergeMap((response_) => {
2449
+ return this.transformResult(url_, response_, (r) => this.processGetProductOptions(r));
2450
+ })).pipe(catchError((response_) => {
2451
+ if (response_ instanceof HttpResponseBase) {
2452
+ try {
2453
+ return this.transformResult(url_, response_, (r) => this.processGetProductOptions(r));
2454
+ }
2455
+ catch (e) {
2456
+ return throwError(e);
2457
+ }
2458
+ }
2459
+ else
2460
+ return throwError(response_);
2461
+ }));
2462
+ }
2463
+ processGetProductOptions(response) {
2464
+ const status = response.status;
2465
+ const responseBlob = response instanceof HttpResponse ? response.body :
2466
+ response.error instanceof Blob ? response.error : undefined;
2467
+ let _headers = {};
2468
+ if (response.headers) {
2469
+ for (let key of response.headers.keys()) {
2470
+ _headers[key] = response.headers.get(key);
2471
+ }
2472
+ }
2473
+ if (status === 200) {
2474
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2475
+ let result200 = null;
2476
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2477
+ return of(result200);
2478
+ }));
2479
+ }
2480
+ else if (status === 404) {
2481
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2482
+ let result404 = null;
2483
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2484
+ return throwException("Not Found", status, _responseText, _headers, result404);
2485
+ }));
2486
+ }
2487
+ else if (status === 409) {
2488
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2489
+ let result409 = null;
2490
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2491
+ return throwException("Conflict", status, _responseText, _headers, result409);
2492
+ }));
2493
+ }
2494
+ else if (status === 401) {
2495
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2496
+ return throwException("Unauthorized", status, _responseText, _headers);
2497
+ }));
2498
+ }
2499
+ else if (status === 403) {
2500
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2501
+ return throwException("Forbidden", status, _responseText, _headers);
2502
+ }));
2503
+ }
2504
+ else if (status !== 200 && status !== 204) {
2505
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2506
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2507
+ }));
2508
+ }
2509
+ return of(null);
2510
+ }
2511
+ /**
2512
+ * Returns a list of product options for all products.
2513
+ * @param tenantId (optional) Tenant identifier.
2514
+ * @return Success
2515
+ */
2516
+ getAllProductOptions(tenantId) {
2517
+ let url_ = this.baseUrl + "/api/storefront/v1/products/options?";
2518
+ if (tenantId !== undefined && tenantId !== null)
2519
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2520
+ url_ = url_.replace(/[?&]$/, "");
2521
+ let options_ = {
2522
+ observe: "response",
2523
+ responseType: "blob",
2524
+ headers: new HttpHeaders({
2525
+ "Accept": "application/json"
2526
+ })
2527
+ };
2528
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2529
+ return this.http.request("get", url_, transformedOptions_);
2530
+ })).pipe(mergeMap((response_) => {
2531
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductOptions(r));
2532
+ })).pipe(catchError((response_) => {
2533
+ if (response_ instanceof HttpResponseBase) {
2534
+ try {
2535
+ return this.transformResult(url_, response_, (r) => this.processGetAllProductOptions(r));
2536
+ }
2537
+ catch (e) {
2538
+ return throwError(e);
2539
+ }
2540
+ }
2541
+ else
2542
+ return throwError(response_);
2543
+ }));
2544
+ }
2545
+ processGetAllProductOptions(response) {
2546
+ const status = response.status;
2547
+ const responseBlob = response instanceof HttpResponse ? response.body :
2548
+ response.error instanceof Blob ? response.error : undefined;
2549
+ let _headers = {};
2550
+ if (response.headers) {
2551
+ for (let key of response.headers.keys()) {
2552
+ _headers[key] = response.headers.get(key);
2553
+ }
2554
+ }
2555
+ if (status === 200) {
2556
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2557
+ let result200 = null;
2558
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2559
+ return of(result200);
2560
+ }));
2561
+ }
2562
+ else if (status === 401) {
2563
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2564
+ return throwException("Unauthorized", status, _responseText, _headers);
2565
+ }));
2566
+ }
2567
+ else if (status === 403) {
2568
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2569
+ return throwException("Forbidden", status, _responseText, _headers);
2570
+ }));
2571
+ }
2572
+ else if (status !== 200 && status !== 204) {
2573
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2574
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2575
+ }));
2576
+ }
2577
+ return of(null);
2578
+ }
2579
+ /**
2580
+ * Returns a list of product links.
2581
+ * @param id Product identifier.
2582
+ * @param productVersionId (optional)
2583
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2584
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2585
+ * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
2586
+ * @param search (optional) Search string for partial match.
2587
+ * @param tenantId (optional) Tenant identifier.
2588
+ * @return Success
2589
+ */
2590
+ getProductLinks(id, productVersionId, skip, take, sorting, search, tenantId) {
2591
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links?";
2592
+ if (id === undefined || id === null)
2593
+ throw new Error("The parameter 'id' must be defined.");
2594
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2595
+ if (productVersionId !== undefined && productVersionId !== null)
2596
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2597
+ if (skip !== undefined && skip !== null)
2598
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2599
+ if (take !== undefined && take !== null)
2600
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2601
+ if (sorting !== undefined && sorting !== null)
2602
+ url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
2603
+ if (search !== undefined && search !== null)
2604
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
2605
+ if (tenantId !== undefined && tenantId !== null)
2606
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2607
+ url_ = url_.replace(/[?&]$/, "");
2608
+ let options_ = {
2609
+ observe: "response",
2610
+ responseType: "blob",
2611
+ headers: new HttpHeaders({
2612
+ "Accept": "application/json"
2613
+ })
2614
+ };
2615
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2616
+ return this.http.request("get", url_, transformedOptions_);
2617
+ })).pipe(mergeMap((response_) => {
2618
+ return this.transformResult(url_, response_, (r) => this.processGetProductLinks(r));
2619
+ })).pipe(catchError((response_) => {
2620
+ if (response_ instanceof HttpResponseBase) {
2621
+ try {
2622
+ return this.transformResult(url_, response_, (r) => this.processGetProductLinks(r));
2623
+ }
2624
+ catch (e) {
2625
+ return throwError(e);
2626
+ }
2627
+ }
2628
+ else
2629
+ return throwError(response_);
2630
+ }));
2631
+ }
2632
+ processGetProductLinks(response) {
2633
+ const status = response.status;
2634
+ const responseBlob = response instanceof HttpResponse ? response.body :
2635
+ response.error instanceof Blob ? response.error : undefined;
2636
+ let _headers = {};
2637
+ if (response.headers) {
2638
+ for (let key of response.headers.keys()) {
2639
+ _headers[key] = response.headers.get(key);
2640
+ }
2641
+ }
2642
+ if (status === 200) {
2643
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2644
+ let result200 = null;
2645
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2646
+ return of(result200);
2647
+ }));
2648
+ }
2649
+ else if (status === 404) {
2650
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2651
+ let result404 = null;
2652
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2653
+ return throwException("Not Found", status, _responseText, _headers, result404);
2654
+ }));
2655
+ }
2656
+ else if (status === 409) {
2657
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2658
+ let result409 = null;
2659
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2660
+ return throwException("Conflict", status, _responseText, _headers, result409);
2661
+ }));
2662
+ }
2663
+ else if (status === 401) {
2664
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2665
+ return throwException("Unauthorized", status, _responseText, _headers);
2666
+ }));
2667
+ }
2668
+ else if (status === 403) {
2669
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2670
+ return throwException("Forbidden", status, _responseText, _headers);
2671
+ }));
2672
+ }
2673
+ else if (status !== 200 && status !== 204) {
2674
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2675
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2676
+ }));
2677
+ }
2678
+ return of(null);
2679
+ }
2680
+ /**
2681
+ * Returns a product link.
2682
+ * @param id Product identifier.
2683
+ * @param productLinkId Product link identifier.
2684
+ * @param productVersionId (optional)
2685
+ * @param tenantId (optional) Tenant identifier.
2686
+ * @return Success
2687
+ */
2688
+ getProductLink(id, productLinkId, productVersionId, tenantId) {
2689
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links/{productLinkId}?";
2690
+ if (id === undefined || id === null)
2691
+ throw new Error("The parameter 'id' must be defined.");
2692
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2693
+ if (productLinkId === undefined || productLinkId === null)
2694
+ throw new Error("The parameter 'productLinkId' must be defined.");
2695
+ url_ = url_.replace("{productLinkId}", encodeURIComponent("" + productLinkId));
2696
+ if (productVersionId !== undefined && productVersionId !== null)
2697
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2698
+ if (tenantId !== undefined && tenantId !== null)
2699
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2700
+ url_ = url_.replace(/[?&]$/, "");
2701
+ let options_ = {
2702
+ observe: "response",
2703
+ responseType: "blob",
2704
+ headers: new HttpHeaders({
2705
+ "Accept": "application/json"
2706
+ })
2707
+ };
2708
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2709
+ return this.http.request("get", url_, transformedOptions_);
2710
+ })).pipe(mergeMap((response_) => {
2711
+ return this.transformResult(url_, response_, (r) => this.processGetProductLink(r));
2712
+ })).pipe(catchError((response_) => {
2713
+ if (response_ instanceof HttpResponseBase) {
2714
+ try {
2715
+ return this.transformResult(url_, response_, (r) => this.processGetProductLink(r));
2716
+ }
2717
+ catch (e) {
2718
+ return throwError(e);
2719
+ }
2720
+ }
2721
+ else
2722
+ return throwError(response_);
2723
+ }));
2724
+ }
2725
+ processGetProductLink(response) {
2726
+ const status = response.status;
2727
+ const responseBlob = response instanceof HttpResponse ? response.body :
2728
+ response.error instanceof Blob ? response.error : undefined;
2729
+ let _headers = {};
2730
+ if (response.headers) {
2731
+ for (let key of response.headers.keys()) {
2732
+ _headers[key] = response.headers.get(key);
2733
+ }
2734
+ }
2735
+ if (status === 200) {
2736
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2737
+ let result200 = null;
2738
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2739
+ return of(result200);
2740
+ }));
2741
+ }
2742
+ else if (status === 404) {
2743
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2744
+ let result404 = null;
2745
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2746
+ return throwException("Not Found", status, _responseText, _headers, result404);
2747
+ }));
2748
+ }
2749
+ else if (status === 409) {
2750
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2751
+ let result409 = null;
2752
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2753
+ return throwException("Conflict", status, _responseText, _headers, result409);
2754
+ }));
2755
+ }
2756
+ else if (status === 401) {
2757
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2758
+ return throwException("Unauthorized", status, _responseText, _headers);
2759
+ }));
2760
+ }
2761
+ else if (status === 403) {
2762
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2763
+ return throwException("Forbidden", status, _responseText, _headers);
2764
+ }));
2765
+ }
2766
+ else if (status !== 200 && status !== 204) {
2767
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2768
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2769
+ }));
2770
+ }
2771
+ return of(null);
2772
+ }
2773
+ /**
2774
+ * Returns a list of product variants.
2775
+ * @param id Product identifier.
2776
+ * @param productVersionId (optional) Product version identifier.
2777
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2778
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2779
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2780
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2781
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2782
+ * @param sku (optional) SKU of linked ecommerce product.
2783
+ * @param tenantId (optional) Tenant identifier.
2784
+ * @return Success
2785
+ */
2786
+ getProductVariants(id, productVersionId, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
2787
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants?";
2788
+ if (id === undefined || id === null)
2789
+ throw new Error("The parameter 'id' must be defined.");
2790
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2791
+ if (productVersionId !== undefined && productVersionId !== null)
2792
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2793
+ if (skip !== undefined && skip !== null)
2794
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
2795
+ if (take !== undefined && take !== null)
2796
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
2797
+ if (options !== undefined && options !== null)
2798
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
2799
+ if (productFilterId !== undefined && productFilterId !== null)
2800
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
2801
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
2802
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
2803
+ if (sku !== undefined && sku !== null)
2804
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
2805
+ if (tenantId !== undefined && tenantId !== null)
2806
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2807
+ url_ = url_.replace(/[?&]$/, "");
2808
+ let options_ = {
2809
+ observe: "response",
2810
+ responseType: "blob",
2811
+ headers: new HttpHeaders({
2812
+ "Accept": "application/json"
2813
+ })
2814
+ };
2815
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2816
+ return this.http.request("get", url_, transformedOptions_);
2817
+ })).pipe(mergeMap((response_) => {
2818
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariants(r));
2819
+ })).pipe(catchError((response_) => {
2820
+ if (response_ instanceof HttpResponseBase) {
2821
+ try {
2822
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariants(r));
2823
+ }
2824
+ catch (e) {
2825
+ return throwError(e);
2826
+ }
2827
+ }
2828
+ else
2829
+ return throwError(response_);
2830
+ }));
2831
+ }
2832
+ processGetProductVariants(response) {
2833
+ const status = response.status;
2834
+ const responseBlob = response instanceof HttpResponse ? response.body :
2835
+ response.error instanceof Blob ? response.error : undefined;
2836
+ let _headers = {};
2837
+ if (response.headers) {
2838
+ for (let key of response.headers.keys()) {
2839
+ _headers[key] = response.headers.get(key);
2840
+ }
2841
+ }
2842
+ if (status === 200) {
2843
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2844
+ let result200 = null;
2845
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2846
+ return of(result200);
2847
+ }));
2848
+ }
2849
+ else if (status === 404) {
2850
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2851
+ let result404 = null;
2852
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2853
+ return throwException("Not Found", status, _responseText, _headers, result404);
2854
+ }));
2855
+ }
2856
+ else if (status === 409) {
2857
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2858
+ let result409 = null;
2859
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2860
+ return throwException("Conflict", status, _responseText, _headers, result409);
2861
+ }));
2862
+ }
2863
+ else if (status === 401) {
2864
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2865
+ return throwException("Unauthorized", status, _responseText, _headers);
2866
+ }));
2867
+ }
2868
+ else if (status === 403) {
2869
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2870
+ return throwException("Forbidden", status, _responseText, _headers);
2871
+ }));
2872
+ }
2873
+ else if (status !== 200 && status !== 204) {
2874
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2875
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2876
+ }));
2877
+ }
2878
+ return of(null);
2879
+ }
2880
+ /**
2881
+ * Returns a product variant.
2882
+ * @param id Product identifier.
2883
+ * @param productVariantId Product variant identifier.
2884
+ * @param productVersionId (optional) Product version identifier.
2885
+ * @param tenantId (optional) Tenant identifier.
2886
+ * @return Success
2887
+ */
2888
+ getProductVariant(id, productVariantId, productVersionId, tenantId) {
2889
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants/{productVariantId}?";
2890
+ if (id === undefined || id === null)
2891
+ throw new Error("The parameter 'id' must be defined.");
2892
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2893
+ if (productVariantId === undefined || productVariantId === null)
2894
+ throw new Error("The parameter 'productVariantId' must be defined.");
2895
+ url_ = url_.replace("{productVariantId}", encodeURIComponent("" + productVariantId));
2896
+ if (productVersionId !== undefined && productVersionId !== null)
2897
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2898
+ if (tenantId !== undefined && tenantId !== null)
2899
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
2900
+ url_ = url_.replace(/[?&]$/, "");
2901
+ let options_ = {
2902
+ observe: "response",
2903
+ responseType: "blob",
2904
+ headers: new HttpHeaders({
2905
+ "Accept": "application/json"
2906
+ })
2907
+ };
2908
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
2909
+ return this.http.request("get", url_, transformedOptions_);
2910
+ })).pipe(mergeMap((response_) => {
2911
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariant(r));
2912
+ })).pipe(catchError((response_) => {
2913
+ if (response_ instanceof HttpResponseBase) {
2914
+ try {
2915
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariant(r));
2916
+ }
2917
+ catch (e) {
2918
+ return throwError(e);
2919
+ }
2920
+ }
2921
+ else
2922
+ return throwError(response_);
2923
+ }));
2924
+ }
2925
+ processGetProductVariant(response) {
2926
+ const status = response.status;
2927
+ const responseBlob = response instanceof HttpResponse ? response.body :
2928
+ response.error instanceof Blob ? response.error : undefined;
2929
+ let _headers = {};
2930
+ if (response.headers) {
2931
+ for (let key of response.headers.keys()) {
2932
+ _headers[key] = response.headers.get(key);
2933
+ }
2934
+ }
2935
+ if (status === 200) {
2936
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2937
+ let result200 = null;
2938
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2939
+ return of(result200);
2940
+ }));
2941
+ }
2942
+ else if (status === 404) {
2943
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2944
+ let result404 = null;
2945
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2946
+ return throwException("Not Found", status, _responseText, _headers, result404);
2947
+ }));
2948
+ }
2949
+ else if (status === 409) {
2950
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2951
+ let result409 = null;
2952
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
2953
+ return throwException("Conflict", status, _responseText, _headers, result409);
2954
+ }));
2955
+ }
2956
+ else if (status === 401) {
2957
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2958
+ return throwException("Unauthorized", status, _responseText, _headers);
2959
+ }));
2960
+ }
2961
+ else if (status === 403) {
2962
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2963
+ return throwException("Forbidden", status, _responseText, _headers);
2964
+ }));
2965
+ }
2966
+ else if (status !== 200 && status !== 204) {
2967
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2968
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2969
+ }));
2970
+ }
2971
+ return of(null);
2972
+ }
2973
+ /**
2974
+ * Returns a list of product variant designs.
2975
+ * @param id Product identifier.
2976
+ * @param productVersionId (optional) Product version identifier.
2977
+ * @param productVariantId (optional) Product variant identifier.
2978
+ * @param search (optional) Search string for design name partial match.
2979
+ * @param designCustomFields (optional) Custom attributes dictionary filter for designs. For example: {"public":"true","name":"my item"}
2980
+ * @param designPath (optional) Path filter for designs. Subfolders included by default.
2981
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
2982
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
2983
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
2984
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
2985
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
2986
+ * @param sku (optional) SKU of linked ecommerce product.
2987
+ * @param tenantId (optional) Tenant identifier.
2988
+ * @return Success
2989
+ */
2990
+ getProductVariantDesigns(id, productVersionId, productVariantId, search, designCustomFields, designPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
2991
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-designs?";
2992
+ if (id === undefined || id === null)
2993
+ throw new Error("The parameter 'id' must be defined.");
2994
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
2995
+ if (productVersionId !== undefined && productVersionId !== null)
2996
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
2997
+ if (productVariantId !== undefined && productVariantId !== null)
2998
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
2999
+ if (search !== undefined && search !== null)
3000
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3001
+ if (designCustomFields !== undefined && designCustomFields !== null)
3002
+ url_ += "designCustomFields=" + encodeURIComponent("" + designCustomFields) + "&";
3003
+ if (designPath !== undefined && designPath !== null)
3004
+ url_ += "designPath=" + encodeURIComponent("" + designPath) + "&";
3005
+ if (skip !== undefined && skip !== null)
3006
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
3007
+ if (take !== undefined && take !== null)
3008
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
3009
+ if (options !== undefined && options !== null)
3010
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
3011
+ if (productFilterId !== undefined && productFilterId !== null)
3012
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
3013
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
3014
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
3015
+ if (sku !== undefined && sku !== null)
3016
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
3017
+ if (tenantId !== undefined && tenantId !== null)
3018
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3019
+ url_ = url_.replace(/[?&]$/, "");
3020
+ let options_ = {
3021
+ observe: "response",
3022
+ responseType: "blob",
3023
+ headers: new HttpHeaders({
3024
+ "Accept": "application/json"
3025
+ })
3026
+ };
3027
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3028
+ return this.http.request("get", url_, transformedOptions_);
3029
+ })).pipe(mergeMap((response_) => {
3030
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariantDesigns(r));
3031
+ })).pipe(catchError((response_) => {
3032
+ if (response_ instanceof HttpResponseBase) {
3033
+ try {
3034
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariantDesigns(r));
3035
+ }
3036
+ catch (e) {
3037
+ return throwError(e);
3038
+ }
3039
+ }
3040
+ else
3041
+ return throwError(response_);
3042
+ }));
3043
+ }
3044
+ processGetProductVariantDesigns(response) {
3045
+ const status = response.status;
3046
+ const responseBlob = response instanceof HttpResponse ? response.body :
3047
+ response.error instanceof Blob ? response.error : undefined;
3048
+ let _headers = {};
3049
+ if (response.headers) {
3050
+ for (let key of response.headers.keys()) {
3051
+ _headers[key] = response.headers.get(key);
3052
+ }
3053
+ }
3054
+ if (status === 200) {
3055
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3056
+ let result200 = null;
3057
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3058
+ return of(result200);
3059
+ }));
3060
+ }
3061
+ else if (status === 404) {
3062
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3063
+ let result404 = null;
3064
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3065
+ return throwException("Not Found", status, _responseText, _headers, result404);
3066
+ }));
3067
+ }
3068
+ else if (status === 409) {
3069
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3070
+ let result409 = null;
3071
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3072
+ return throwException("Conflict", status, _responseText, _headers, result409);
3073
+ }));
3074
+ }
3075
+ else if (status === 401) {
3076
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3077
+ return throwException("Unauthorized", status, _responseText, _headers);
3078
+ }));
3079
+ }
3080
+ else if (status === 403) {
3081
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3082
+ return throwException("Forbidden", status, _responseText, _headers);
3083
+ }));
3084
+ }
3085
+ else if (status !== 200 && status !== 204) {
3086
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3087
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3088
+ }));
3089
+ }
3090
+ return of(null);
3091
+ }
3092
+ /**
3093
+ * Returns a list of product variant mockups.
3094
+ * @param id Product identifier.
3095
+ * @param productVersionId (optional) Product version identifier.
3096
+ * @param productVariantId (optional) Product variant identifier.
3097
+ * @param search (optional) Search string for design name partial match.
3098
+ * @param mockupCustomFields (optional) Custom attributes dictionary filter for mockups. For example: {"public":"true","name":"my item"}
3099
+ * @param mockupPath (optional) Path filter for mockups. Subfolders included by default.
3100
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
3101
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
3102
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
3103
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
3104
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
3105
+ * @param sku (optional) SKU of linked ecommerce product.
3106
+ * @param tenantId (optional) Tenant identifier.
3107
+ * @return Success
3108
+ */
3109
+ getProductVariantMockups(id, productVersionId, productVariantId, search, mockupCustomFields, mockupPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
3110
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-mockups?";
3111
+ if (id === undefined || id === null)
3112
+ throw new Error("The parameter 'id' must be defined.");
3113
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3114
+ if (productVersionId !== undefined && productVersionId !== null)
3115
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3116
+ if (productVariantId !== undefined && productVariantId !== null)
3117
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
3118
+ if (search !== undefined && search !== null)
3119
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3120
+ if (mockupCustomFields !== undefined && mockupCustomFields !== null)
3121
+ url_ += "mockupCustomFields=" + encodeURIComponent("" + mockupCustomFields) + "&";
3122
+ if (mockupPath !== undefined && mockupPath !== null)
3123
+ url_ += "mockupPath=" + encodeURIComponent("" + mockupPath) + "&";
3124
+ if (skip !== undefined && skip !== null)
3125
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
3126
+ if (take !== undefined && take !== null)
3127
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
3128
+ if (options !== undefined && options !== null)
3129
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
3130
+ if (productFilterId !== undefined && productFilterId !== null)
3131
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
3132
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
3133
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
3134
+ if (sku !== undefined && sku !== null)
3135
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
3136
+ if (tenantId !== undefined && tenantId !== null)
3137
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3138
+ url_ = url_.replace(/[?&]$/, "");
3139
+ let options_ = {
3140
+ observe: "response",
3141
+ responseType: "blob",
3142
+ headers: new HttpHeaders({
3143
+ "Accept": "application/json"
3144
+ })
3145
+ };
3146
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3147
+ return this.http.request("get", url_, transformedOptions_);
3148
+ })).pipe(mergeMap((response_) => {
3149
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariantMockups(r));
3150
+ })).pipe(catchError((response_) => {
3151
+ if (response_ instanceof HttpResponseBase) {
3152
+ try {
3153
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariantMockups(r));
3154
+ }
3155
+ catch (e) {
3156
+ return throwError(e);
3157
+ }
3158
+ }
3159
+ else
3160
+ return throwError(response_);
3161
+ }));
3162
+ }
3163
+ processGetProductVariantMockups(response) {
3164
+ const status = response.status;
3165
+ const responseBlob = response instanceof HttpResponse ? response.body :
3166
+ response.error instanceof Blob ? response.error : undefined;
3167
+ let _headers = {};
3168
+ if (response.headers) {
3169
+ for (let key of response.headers.keys()) {
3170
+ _headers[key] = response.headers.get(key);
3171
+ }
3172
+ }
3173
+ if (status === 200) {
3174
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3175
+ let result200 = null;
3176
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3177
+ return of(result200);
3178
+ }));
3179
+ }
3180
+ else if (status === 404) {
3181
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3182
+ let result404 = null;
3183
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3184
+ return throwException("Not Found", status, _responseText, _headers, result404);
3185
+ }));
3186
+ }
3187
+ else if (status === 409) {
3188
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3189
+ let result409 = null;
3190
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3191
+ return throwException("Conflict", status, _responseText, _headers, result409);
3192
+ }));
3193
+ }
3194
+ else if (status === 401) {
3195
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3196
+ return throwException("Unauthorized", status, _responseText, _headers);
3197
+ }));
3198
+ }
3199
+ else if (status === 403) {
3200
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3201
+ return throwException("Forbidden", status, _responseText, _headers);
3202
+ }));
3203
+ }
3204
+ else if (status !== 200 && status !== 204) {
3205
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3206
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3207
+ }));
3208
+ }
3209
+ return of(null);
3210
+ }
3211
+ /**
3212
+ * Returns a list of product variant documents.
3213
+ * @param id Product identifier.
3214
+ * @param productVersionId (optional) Product version identifier.
3215
+ * @param productVariantId (optional) Product variant identifier.
3216
+ * @param search (optional) Search string for document name partial match.
3217
+ * @param documentCustomFields (optional) Custom attributes dictionary filter for documents. For example: {"public":"true","name":"my item"}
3218
+ * @param documentPath (optional) Path filter for documents. Subfolders included by default.
3219
+ * @param skip (optional) Defines page start offset from beginning of sorted result list.
3220
+ * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
3221
+ * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
3222
+ * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
3223
+ * @param takeAvailableOnly (optional) Defines special filter for available product variants.
3224
+ * @param sku (optional) SKU of linked ecommerce product.
3225
+ * @param tenantId (optional) Tenant identifier.
3226
+ * @return Success
3227
+ */
3228
+ getProductVariantDocuments(id, productVersionId, productVariantId, search, documentCustomFields, documentPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
3229
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-documents?";
3230
+ if (id === undefined || id === null)
3231
+ throw new Error("The parameter 'id' must be defined.");
3232
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3233
+ if (productVersionId !== undefined && productVersionId !== null)
3234
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3235
+ if (productVariantId !== undefined && productVariantId !== null)
3236
+ url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
3237
+ if (search !== undefined && search !== null)
3238
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3239
+ if (documentCustomFields !== undefined && documentCustomFields !== null)
3240
+ url_ += "documentCustomFields=" + encodeURIComponent("" + documentCustomFields) + "&";
3241
+ if (documentPath !== undefined && documentPath !== null)
3242
+ url_ += "documentPath=" + encodeURIComponent("" + documentPath) + "&";
3243
+ if (skip !== undefined && skip !== null)
3244
+ url_ += "skip=" + encodeURIComponent("" + skip) + "&";
3245
+ if (take !== undefined && take !== null)
3246
+ url_ += "take=" + encodeURIComponent("" + take) + "&";
3247
+ if (options !== undefined && options !== null)
3248
+ url_ += "options=" + encodeURIComponent("" + options) + "&";
3249
+ if (productFilterId !== undefined && productFilterId !== null)
3250
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
3251
+ if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
3252
+ url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
3253
+ if (sku !== undefined && sku !== null)
3254
+ url_ += "sku=" + encodeURIComponent("" + sku) + "&";
3255
+ if (tenantId !== undefined && tenantId !== null)
3256
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3257
+ url_ = url_.replace(/[?&]$/, "");
3258
+ let options_ = {
3259
+ observe: "response",
3260
+ responseType: "blob",
3261
+ headers: new HttpHeaders({
3262
+ "Accept": "application/json"
3263
+ })
3264
+ };
3265
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3266
+ return this.http.request("get", url_, transformedOptions_);
3267
+ })).pipe(mergeMap((response_) => {
3268
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariantDocuments(r));
3269
+ })).pipe(catchError((response_) => {
3270
+ if (response_ instanceof HttpResponseBase) {
3271
+ try {
3272
+ return this.transformResult(url_, response_, (r) => this.processGetProductVariantDocuments(r));
3273
+ }
3274
+ catch (e) {
3275
+ return throwError(e);
3276
+ }
3277
+ }
3278
+ else
3279
+ return throwError(response_);
3280
+ }));
3281
+ }
3282
+ processGetProductVariantDocuments(response) {
3283
+ const status = response.status;
3284
+ const responseBlob = response instanceof HttpResponse ? response.body :
3285
+ response.error instanceof Blob ? response.error : undefined;
3286
+ let _headers = {};
3287
+ if (response.headers) {
3288
+ for (let key of response.headers.keys()) {
3289
+ _headers[key] = response.headers.get(key);
3290
+ }
3291
+ }
3292
+ if (status === 200) {
3293
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3294
+ let result200 = null;
3295
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3296
+ return of(result200);
3297
+ }));
3298
+ }
3299
+ else if (status === 404) {
3300
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3301
+ let result404 = null;
3302
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3303
+ return throwException("Not Found", status, _responseText, _headers, result404);
3304
+ }));
3305
+ }
3306
+ else if (status === 409) {
3307
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3308
+ let result409 = null;
3309
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3310
+ return throwException("Conflict", status, _responseText, _headers, result409);
3311
+ }));
3312
+ }
3313
+ else if (status === 401) {
3314
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3315
+ return throwException("Unauthorized", status, _responseText, _headers);
3316
+ }));
3317
+ }
3318
+ else if (status === 403) {
3319
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3320
+ return throwException("Forbidden", status, _responseText, _headers);
3321
+ }));
3322
+ }
3323
+ else if (status !== 200 && status !== 204) {
3324
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3325
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3326
+ }));
3327
+ }
3328
+ return of(null);
3329
+ }
3330
+ /**
3331
+ * Updates product variant resources.
3332
+ * @param id Product identifier.
3333
+ * @param productVersionId (optional) Product version identifier.
3334
+ * @param tenantId (optional) Tenant identifier.
3335
+ * @return Success
3336
+ */
3337
+ updateProductVariantResources(id, productVersionId, tenantId) {
3338
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/update-variant-resources?";
3339
+ if (id === undefined || id === null)
3340
+ throw new Error("The parameter 'id' must be defined.");
3341
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3342
+ if (productVersionId !== undefined && productVersionId !== null)
3343
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3344
+ if (tenantId !== undefined && tenantId !== null)
3345
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3346
+ url_ = url_.replace(/[?&]$/, "");
3347
+ let options_ = {
3348
+ observe: "response",
3349
+ responseType: "blob",
3350
+ headers: new HttpHeaders({})
3351
+ };
3352
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3353
+ return this.http.request("post", url_, transformedOptions_);
3354
+ })).pipe(mergeMap((response_) => {
3355
+ return this.transformResult(url_, response_, (r) => this.processUpdateProductVariantResources(r));
3356
+ })).pipe(catchError((response_) => {
3357
+ if (response_ instanceof HttpResponseBase) {
3358
+ try {
3359
+ return this.transformResult(url_, response_, (r) => this.processUpdateProductVariantResources(r));
3360
+ }
3361
+ catch (e) {
3362
+ return throwError(e);
3363
+ }
3364
+ }
3365
+ else
3366
+ return throwError(response_);
3367
+ }));
3368
+ }
3369
+ processUpdateProductVariantResources(response) {
3370
+ const status = response.status;
3371
+ const responseBlob = response instanceof HttpResponse ? response.body :
3372
+ response.error instanceof Blob ? response.error : undefined;
3373
+ let _headers = {};
3374
+ if (response.headers) {
3375
+ for (let key of response.headers.keys()) {
3376
+ _headers[key] = response.headers.get(key);
3377
+ }
3378
+ }
3379
+ if (status === 200) {
3380
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3381
+ return of(null);
3382
+ }));
3383
+ }
3384
+ else if (status === 404) {
3385
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3386
+ let result404 = null;
3387
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3388
+ return throwException("Not Found", status, _responseText, _headers, result404);
3389
+ }));
3390
+ }
3391
+ else if (status === 409) {
3392
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3393
+ let result409 = null;
3394
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3395
+ return throwException("Conflict", status, _responseText, _headers, result409);
3396
+ }));
3397
+ }
3398
+ else if (status === 401) {
3399
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3400
+ return throwException("Unauthorized", status, _responseText, _headers);
3401
+ }));
3402
+ }
3403
+ else if (status === 403) {
3404
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3405
+ return throwException("Forbidden", status, _responseText, _headers);
3406
+ }));
3407
+ }
3408
+ else if (status !== 200 && status !== 204) {
3409
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3410
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3411
+ }));
3412
+ }
3413
+ return of(null);
3414
+ }
3415
+ /**
3416
+ * Set product variant price.
3417
+ * @param id Product identifier.
3418
+ * @param productVersionId (optional) Product version identifier.
3419
+ * @param tenantId (optional) Tenant identifier.
3420
+ * @param body (optional) Set product variant price operation parameters.
3421
+ * @return Success
3422
+ */
3423
+ setProductVariantPrice(id, productVersionId, tenantId, body) {
3424
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/set-variant-price?";
3425
+ if (id === undefined || id === null)
3426
+ throw new Error("The parameter 'id' must be defined.");
3427
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3428
+ if (productVersionId !== undefined && productVersionId !== null)
3429
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3430
+ if (tenantId !== undefined && tenantId !== null)
3431
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3432
+ url_ = url_.replace(/[?&]$/, "");
3433
+ const content_ = JSON.stringify(body);
3434
+ let options_ = {
3435
+ body: content_,
3436
+ observe: "response",
3437
+ responseType: "blob",
3438
+ headers: new HttpHeaders({
3439
+ "Content-Type": "application/json",
3440
+ })
3441
+ };
3442
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3443
+ return this.http.request("post", url_, transformedOptions_);
3444
+ })).pipe(mergeMap((response_) => {
3445
+ return this.transformResult(url_, response_, (r) => this.processSetProductVariantPrice(r));
3446
+ })).pipe(catchError((response_) => {
3447
+ if (response_ instanceof HttpResponseBase) {
3448
+ try {
3449
+ return this.transformResult(url_, response_, (r) => this.processSetProductVariantPrice(r));
3450
+ }
3451
+ catch (e) {
3452
+ return throwError(e);
3453
+ }
3454
+ }
3455
+ else
3456
+ return throwError(response_);
3457
+ }));
3458
+ }
3459
+ processSetProductVariantPrice(response) {
3460
+ const status = response.status;
3461
+ const responseBlob = response instanceof HttpResponse ? response.body :
3462
+ response.error instanceof Blob ? response.error : undefined;
3463
+ let _headers = {};
3464
+ if (response.headers) {
3465
+ for (let key of response.headers.keys()) {
3466
+ _headers[key] = response.headers.get(key);
3467
+ }
3468
+ }
3469
+ if (status === 200) {
3470
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3471
+ return of(null);
3472
+ }));
3473
+ }
3474
+ else if (status === 404) {
3475
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3476
+ let result404 = null;
3477
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3478
+ return throwException("Not Found", status, _responseText, _headers, result404);
3479
+ }));
3480
+ }
3481
+ else if (status === 409) {
3482
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3483
+ let result409 = null;
3484
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3485
+ return throwException("Conflict", status, _responseText, _headers, result409);
3486
+ }));
3487
+ }
3488
+ else if (status === 401) {
3489
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3490
+ return throwException("Unauthorized", status, _responseText, _headers);
3491
+ }));
3492
+ }
3493
+ else if (status === 403) {
3494
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3495
+ return throwException("Forbidden", status, _responseText, _headers);
3496
+ }));
3497
+ }
3498
+ else if (status !== 200 && status !== 204) {
3499
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3500
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3501
+ }));
3502
+ }
3503
+ return of(null);
3504
+ }
3505
+ /**
3506
+ * Returns a list of all available product tags.
3507
+ * @param search (optional) Search string for partial match.
3508
+ * @param tenantId (optional) Tenant identifier.
3509
+ * @return Success
3510
+ */
3511
+ getAvailableProductTags(search, tenantId) {
3512
+ let url_ = this.baseUrl + "/api/storefront/v1/products/available-tags?";
3513
+ if (search !== undefined && search !== null)
3514
+ url_ += "search=" + encodeURIComponent("" + search) + "&";
3515
+ if (tenantId !== undefined && tenantId !== null)
3516
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3517
+ url_ = url_.replace(/[?&]$/, "");
3518
+ let options_ = {
3519
+ observe: "response",
3520
+ responseType: "blob",
3521
+ headers: new HttpHeaders({
3522
+ "Accept": "application/json"
3523
+ })
3524
+ };
3525
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
3526
+ return this.http.request("get", url_, transformedOptions_);
3527
+ })).pipe(mergeMap((response_) => {
3528
+ return this.transformResult(url_, response_, (r) => this.processGetAvailableProductTags(r));
3529
+ })).pipe(catchError((response_) => {
3530
+ if (response_ instanceof HttpResponseBase) {
3531
+ try {
3532
+ return this.transformResult(url_, response_, (r) => this.processGetAvailableProductTags(r));
3533
+ }
3534
+ catch (e) {
3535
+ return throwError(e);
3536
+ }
3537
+ }
3538
+ else
3539
+ return throwError(response_);
3540
+ }));
3541
+ }
3542
+ processGetAvailableProductTags(response) {
3543
+ const status = response.status;
3544
+ const responseBlob = response instanceof HttpResponse ? response.body :
3545
+ response.error instanceof Blob ? response.error : undefined;
3546
+ let _headers = {};
3547
+ if (response.headers) {
3548
+ for (let key of response.headers.keys()) {
3549
+ _headers[key] = response.headers.get(key);
3550
+ }
3551
+ }
3552
+ if (status === 200) {
3553
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3554
+ let result200 = null;
3555
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3556
+ return of(result200);
3557
+ }));
3558
+ }
3559
+ else if (status === 401) {
3560
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3561
+ return throwException("Unauthorized", status, _responseText, _headers);
3562
+ }));
3563
+ }
3564
+ else if (status === 403) {
3565
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3566
+ return throwException("Forbidden", status, _responseText, _headers);
3567
+ }));
3568
+ }
3569
+ else if (status !== 200 && status !== 204) {
3570
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3571
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
3572
+ }));
3573
+ }
3574
+ return of(null);
3575
+ }
3576
+ /**
3577
+ * Returns a product personalization workflow description by product identifier.
3578
+ * @param id Product identifier.
3579
+ * @param productVersionId (optional) Product version identifier.
3580
+ * @param productLinkId (optional) Product link identifier.
3581
+ * @param productFilterId (optional) Product filter identifier.
3582
+ * @param tenantId (optional) Tenant identifier.
3583
+ * @return Success
3584
+ */
3585
+ getPersonalizationWorkflow(id, productVersionId, productLinkId, productFilterId, tenantId) {
3586
+ let url_ = this.baseUrl + "/api/storefront/v1/products/{id}/personalization-workflow?";
3587
+ if (id === undefined || id === null)
3588
+ throw new Error("The parameter 'id' must be defined.");
3589
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
3590
+ if (productVersionId !== undefined && productVersionId !== null)
3591
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
3592
+ if (productLinkId !== undefined && productLinkId !== null)
3593
+ url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
3594
+ if (productFilterId !== undefined && productFilterId !== null)
3595
+ url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
3596
+ if (tenantId !== undefined && tenantId !== null)
3597
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
3598
+ url_ = url_.replace(/[?&]$/, "");
3599
+ let options_ = {
3600
+ observe: "response",
3601
+ responseType: "blob",
3602
+ headers: new HttpHeaders({
3603
+ "Accept": "application/json"
990
3604
  })
991
3605
  };
992
3606
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
993
3607
  return this.http.request("get", url_, transformedOptions_);
994
3608
  })).pipe(mergeMap((response_) => {
995
- return this.transformResult(url_, response_, (r) => this.processGetProductConfig(r));
3609
+ return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
996
3610
  })).pipe(catchError((response_) => {
997
3611
  if (response_ instanceof HttpResponseBase) {
998
3612
  try {
999
- return this.transformResult(url_, response_, (r) => this.processGetProductConfig(r));
3613
+ return this.transformResult(url_, response_, (r) => this.processGetPersonalizationWorkflow(r));
1000
3614
  }
1001
3615
  catch (e) {
1002
3616
  return throwError(e);
@@ -1006,7 +3620,7 @@ class ProductReferencesApiClient extends ApiClientBase {
1006
3620
  return throwError(response_);
1007
3621
  }));
1008
3622
  }
1009
- processGetProductConfig(response) {
3623
+ processGetPersonalizationWorkflow(response) {
1010
3624
  const status = response.status;
1011
3625
  const responseBlob = response instanceof HttpResponse ? response.body :
1012
3626
  response.error instanceof Blob ? response.error : undefined;
@@ -1019,17 +3633,24 @@ class ProductReferencesApiClient extends ApiClientBase {
1019
3633
  if (status === 200) {
1020
3634
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1021
3635
  let result200 = null;
1022
- result200 = _responseText === "" ? null : _responseText;
3636
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1023
3637
  return of(result200);
1024
3638
  }));
1025
3639
  }
1026
3640
  else if (status === 404) {
1027
3641
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1028
3642
  let result404 = null;
1029
- result404 = _responseText === "" ? null : _responseText;
3643
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1030
3644
  return throwException("Not Found", status, _responseText, _headers, result404);
1031
3645
  }));
1032
3646
  }
3647
+ else if (status === 409) {
3648
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3649
+ let result409 = null;
3650
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3651
+ return throwException("Conflict", status, _responseText, _headers, result409);
3652
+ }));
3653
+ }
1033
3654
  else if (status === 401) {
1034
3655
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1035
3656
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1048,13 +3669,13 @@ class ProductReferencesApiClient extends ApiClientBase {
1048
3669
  return of(null);
1049
3670
  }
1050
3671
  }
1051
- ProductReferencesApiClient.ɵprov = ɵɵdefineInjectable({ factory: function ProductReferencesApiClient_Factory() { return new ProductReferencesApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: ProductReferencesApiClient, providedIn: "root" });
1052
- ProductReferencesApiClient.decorators = [
3672
+ ProductsApiClient.ɵprov = ɵɵdefineInjectable({ factory: function ProductsApiClient_Factory() { return new ProductsApiClient(ɵɵinject(ApiClientConfiguration), ɵɵinject(HttpClient), ɵɵinject(API_BASE_URL, 8)); }, token: ProductsApiClient, providedIn: "root" });
3673
+ ProductsApiClient.decorators = [
1053
3674
  { type: Injectable, args: [{
1054
3675
  providedIn: 'root'
1055
3676
  },] }
1056
3677
  ];
1057
- ProductReferencesApiClient.ctorParameters = () => [
3678
+ ProductsApiClient.ctorParameters = () => [
1058
3679
  { type: ApiClientConfiguration, decorators: [{ type: Inject, args: [ApiClientConfiguration,] }] },
1059
3680
  { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
1060
3681
  { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
@@ -1092,7 +3713,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1092
3713
  observe: "response",
1093
3714
  responseType: "blob",
1094
3715
  headers: new HttpHeaders({
1095
- "Accept": "text/plain"
3716
+ "Accept": "application/json"
1096
3717
  })
1097
3718
  };
1098
3719
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -1164,7 +3785,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1164
3785
  observe: "response",
1165
3786
  responseType: "blob",
1166
3787
  headers: new HttpHeaders({
1167
- "Accept": "text/plain"
3788
+ "Accept": "application/json"
1168
3789
  })
1169
3790
  };
1170
3791
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -1243,7 +3864,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1243
3864
  observe: "response",
1244
3865
  responseType: "blob",
1245
3866
  headers: new HttpHeaders({
1246
- "Accept": "text/plain"
3867
+ "Accept": "application/json"
1247
3868
  })
1248
3869
  };
1249
3870
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -1363,7 +3984,7 @@ class ProductSpecificationsApiClient extends ApiClientBase {
1363
3984
  else if (status === 404) {
1364
3985
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1365
3986
  let result404 = null;
1366
- result404 = _responseText === "" ? null : _responseText;
3987
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1367
3988
  return throwException("Not Found", status, _responseText, _headers, result404);
1368
3989
  }));
1369
3990
  }
@@ -1415,11 +4036,12 @@ class ProjectsApiClient extends ApiClientBase {
1415
4036
  * @param search (optional) Search string for partial match.
1416
4037
  * @param orderId (optional) Identifier of corresponding order.
1417
4038
  * @param processingStatus (optional) Project processing status filter.
4039
+ * @param includeObsolete (optional) Indicates if obsolete projects prepared to be removed should be included to result.
1418
4040
  * @param storefrontId (optional) Storefront identifier.
1419
4041
  * @param tenantId (optional) Tenant identifier.
1420
4042
  * @return Success
1421
4043
  */
1422
- getAll(ownerId, productReference, status, datePeriod, skip, take, sorting, search, orderId, processingStatus, storefrontId, tenantId) {
4044
+ getAll(ownerId, productReference, status, datePeriod, skip, take, sorting, search, orderId, processingStatus, includeObsolete, storefrontId, tenantId) {
1423
4045
  let url_ = this.baseUrl + "/api/storefront/v1/projects?";
1424
4046
  if (ownerId !== undefined && ownerId !== null)
1425
4047
  url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
@@ -1443,6 +4065,10 @@ class ProjectsApiClient extends ApiClientBase {
1443
4065
  url_ += "orderId=" + encodeURIComponent("" + orderId) + "&";
1444
4066
  if (processingStatus !== undefined && processingStatus !== null)
1445
4067
  url_ += "processingStatus=" + encodeURIComponent("" + processingStatus) + "&";
4068
+ if (includeObsolete === null)
4069
+ throw new Error("The parameter 'includeObsolete' cannot be null.");
4070
+ else if (includeObsolete !== undefined)
4071
+ url_ += "includeObsolete=" + encodeURIComponent("" + includeObsolete) + "&";
1446
4072
  if (storefrontId !== undefined && storefrontId !== null)
1447
4073
  url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
1448
4074
  if (tenantId !== undefined && tenantId !== null)
@@ -1452,7 +4078,7 @@ class ProjectsApiClient extends ApiClientBase {
1452
4078
  observe: "response",
1453
4079
  responseType: "blob",
1454
4080
  headers: new HttpHeaders({
1455
- "Accept": "text/plain"
4081
+ "Accept": "application/json"
1456
4082
  })
1457
4083
  };
1458
4084
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -1524,7 +4150,7 @@ class ProjectsApiClient extends ApiClientBase {
1524
4150
  observe: "response",
1525
4151
  responseType: "blob",
1526
4152
  headers: new HttpHeaders({
1527
- "Accept": "text/plain"
4153
+ "Accept": "application/json"
1528
4154
  })
1529
4155
  };
1530
4156
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -1568,6 +4194,13 @@ class ProjectsApiClient extends ApiClientBase {
1568
4194
  return throwException("Not Found", status, _responseText, _headers, result404);
1569
4195
  }));
1570
4196
  }
4197
+ else if (status === 409) {
4198
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4199
+ let result409 = null;
4200
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4201
+ return throwException("Conflict", status, _responseText, _headers, result409);
4202
+ }));
4203
+ }
1571
4204
  else if (status === 401) {
1572
4205
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1573
4206
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1643,6 +4276,13 @@ class ProjectsApiClient extends ApiClientBase {
1643
4276
  return throwException("Not Found", status, _responseText, _headers, result404);
1644
4277
  }));
1645
4278
  }
4279
+ else if (status === 409) {
4280
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4281
+ let result409 = null;
4282
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4283
+ return throwException("Conflict", status, _responseText, _headers, result409);
4284
+ }));
4285
+ }
1646
4286
  else if (status === 401) {
1647
4287
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1648
4288
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1678,7 +4318,7 @@ class ProjectsApiClient extends ApiClientBase {
1678
4318
  observe: "response",
1679
4319
  responseType: "blob",
1680
4320
  headers: new HttpHeaders({
1681
- "Accept": "text/plain"
4321
+ "Accept": "application/octet-stream"
1682
4322
  })
1683
4323
  };
1684
4324
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -1721,6 +4361,13 @@ class ProjectsApiClient extends ApiClientBase {
1721
4361
  return throwException("Not Found", status, _responseText, _headers, result404);
1722
4362
  }));
1723
4363
  }
4364
+ else if (status === 409) {
4365
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4366
+ let result409 = null;
4367
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4368
+ return throwException("Conflict", status, _responseText, _headers, result409);
4369
+ }));
4370
+ }
1724
4371
  else if (status === 401) {
1725
4372
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1726
4373
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1796,10 +4443,17 @@ class ProjectsApiClient extends ApiClientBase {
1796
4443
  else if (status === 404) {
1797
4444
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1798
4445
  let result404 = null;
1799
- result404 = _responseText === "" ? null : _responseText;
4446
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1800
4447
  return throwException("Not Found", status, _responseText, _headers, result404);
1801
4448
  }));
1802
4449
  }
4450
+ else if (status === 409) {
4451
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
4452
+ let result409 = null;
4453
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
4454
+ return throwException("Conflict", status, _responseText, _headers, result409);
4455
+ }));
4456
+ }
1803
4457
  else if (status === 401) {
1804
4458
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1805
4459
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -1839,8 +4493,8 @@ class ProjectsApiClient extends ApiClientBase {
1839
4493
  observe: "response",
1840
4494
  responseType: "blob",
1841
4495
  headers: new HttpHeaders({
1842
- "Content-Type": "application/json-patch+json",
1843
- "Accept": "text/plain"
4496
+ "Content-Type": "application/json",
4497
+ "Accept": "application/json"
1844
4498
  })
1845
4499
  };
1846
4500
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -1930,8 +4584,8 @@ class ProjectsApiClient extends ApiClientBase {
1930
4584
  observe: "response",
1931
4585
  responseType: "blob",
1932
4586
  headers: new HttpHeaders({
1933
- "Content-Type": "application/json-patch+json",
1934
- "Accept": "text/plain"
4587
+ "Content-Type": "application/json",
4588
+ "Accept": "application/json"
1935
4589
  })
1936
4590
  };
1937
4591
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2021,8 +4675,8 @@ class ProjectsApiClient extends ApiClientBase {
2021
4675
  observe: "response",
2022
4676
  responseType: "blob",
2023
4677
  headers: new HttpHeaders({
2024
- "Content-Type": "application/json-patch+json",
2025
- "Accept": "text/plain"
4678
+ "Content-Type": "application/json",
4679
+ "Accept": "application/json"
2026
4680
  })
2027
4681
  };
2028
4682
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2112,8 +4766,8 @@ class ProjectsApiClient extends ApiClientBase {
2112
4766
  observe: "response",
2113
4767
  responseType: "blob",
2114
4768
  headers: new HttpHeaders({
2115
- "Content-Type": "application/json-patch+json",
2116
- "Accept": "text/plain"
4769
+ "Content-Type": "application/json",
4770
+ "Accept": "application/json"
2117
4771
  })
2118
4772
  };
2119
4773
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2199,7 +4853,7 @@ class ProjectsApiClient extends ApiClientBase {
2199
4853
  observe: "response",
2200
4854
  responseType: "blob",
2201
4855
  headers: new HttpHeaders({
2202
- "Accept": "text/plain"
4856
+ "Accept": "application/json"
2203
4857
  })
2204
4858
  };
2205
4859
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2296,7 +4950,7 @@ class ProjectsApiClient extends ApiClientBase {
2296
4950
  observe: "response",
2297
4951
  responseType: "blob",
2298
4952
  headers: new HttpHeaders({
2299
- "Accept": "text/plain"
4953
+ "Accept": "application/json"
2300
4954
  })
2301
4955
  };
2302
4956
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2393,7 +5047,7 @@ class ProjectsApiClient extends ApiClientBase {
2393
5047
  observe: "response",
2394
5048
  responseType: "blob",
2395
5049
  headers: new HttpHeaders({
2396
- "Accept": "text/plain"
5050
+ "Accept": "application/json"
2397
5051
  })
2398
5052
  };
2399
5053
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2444,6 +5098,86 @@ class ProjectsApiClient extends ApiClientBase {
2444
5098
  return throwException("Not Found", status, _responseText, _headers, result404);
2445
5099
  }));
2446
5100
  }
5101
+ else if (status === 409) {
5102
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5103
+ let result409 = null;
5104
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5105
+ return throwException("Conflict", status, _responseText, _headers, result409);
5106
+ }));
5107
+ }
5108
+ else if (status === 401) {
5109
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5110
+ return throwException("Unauthorized", status, _responseText, _headers);
5111
+ }));
5112
+ }
5113
+ else if (status === 403) {
5114
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5115
+ return throwException("Forbidden", status, _responseText, _headers);
5116
+ }));
5117
+ }
5118
+ else if (status !== 200 && status !== 204) {
5119
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5120
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
5121
+ }));
5122
+ }
5123
+ return of(null);
5124
+ }
5125
+ /**
5126
+ * Deletes specified projects.
5127
+ These projects will be hide from projects list immediately, but complete projects data cleaning will take some additional time.
5128
+ * @param tenantId (optional) Tenant identifier.
5129
+ * @param body (optional) Operation parameters.
5130
+ * @return Success
5131
+ */
5132
+ batchDelete(tenantId, body) {
5133
+ let url_ = this.baseUrl + "/api/storefront/v1/projects/batch-delete?";
5134
+ if (tenantId !== undefined && tenantId !== null)
5135
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
5136
+ url_ = url_.replace(/[?&]$/, "");
5137
+ const content_ = JSON.stringify(body);
5138
+ let options_ = {
5139
+ body: content_,
5140
+ observe: "response",
5141
+ responseType: "blob",
5142
+ headers: new HttpHeaders({
5143
+ "Content-Type": "application/json",
5144
+ "Accept": "application/json"
5145
+ })
5146
+ };
5147
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
5148
+ return this.http.request("delete", url_, transformedOptions_);
5149
+ })).pipe(mergeMap((response_) => {
5150
+ return this.transformResult(url_, response_, (r) => this.processBatchDelete(r));
5151
+ })).pipe(catchError((response_) => {
5152
+ if (response_ instanceof HttpResponseBase) {
5153
+ try {
5154
+ return this.transformResult(url_, response_, (r) => this.processBatchDelete(r));
5155
+ }
5156
+ catch (e) {
5157
+ return throwError(e);
5158
+ }
5159
+ }
5160
+ else
5161
+ return throwError(response_);
5162
+ }));
5163
+ }
5164
+ processBatchDelete(response) {
5165
+ const status = response.status;
5166
+ const responseBlob = response instanceof HttpResponse ? response.body :
5167
+ response.error instanceof Blob ? response.error : undefined;
5168
+ let _headers = {};
5169
+ if (response.headers) {
5170
+ for (let key of response.headers.keys()) {
5171
+ _headers[key] = response.headers.get(key);
5172
+ }
5173
+ }
5174
+ if (status === 200) {
5175
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5176
+ let result200 = null;
5177
+ result200 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5178
+ return of(result200);
5179
+ }));
5180
+ }
2447
5181
  else if (status === 401) {
2448
5182
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2449
5183
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2475,7 +5209,7 @@ class ProjectsApiClient extends ApiClientBase {
2475
5209
  observe: "response",
2476
5210
  responseType: "blob",
2477
5211
  headers: new HttpHeaders({
2478
- "Accept": "text/plain"
5212
+ "Accept": "application/json"
2479
5213
  })
2480
5214
  };
2481
5215
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2543,7 +5277,7 @@ class ProjectsApiClient extends ApiClientBase {
2543
5277
  observe: "response",
2544
5278
  responseType: "blob",
2545
5279
  headers: new HttpHeaders({
2546
- "Accept": "text/plain"
5280
+ "Accept": "application/json"
2547
5281
  })
2548
5282
  };
2549
5283
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2626,7 +5360,7 @@ class ProjectsApiClient extends ApiClientBase {
2626
5360
  observe: "response",
2627
5361
  responseType: "blob",
2628
5362
  headers: new HttpHeaders({
2629
- "Accept": "text/plain"
5363
+ "Accept": "application/json"
2630
5364
  })
2631
5365
  };
2632
5366
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2663,6 +5397,13 @@ class ProjectsApiClient extends ApiClientBase {
2663
5397
  return of(result200);
2664
5398
  }));
2665
5399
  }
5400
+ else if (status === 409) {
5401
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5402
+ let result409 = null;
5403
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5404
+ return throwException("Conflict", status, _responseText, _headers, result409);
5405
+ }));
5406
+ }
2666
5407
  else if (status === 401) {
2667
5408
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2668
5409
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2755,6 +5496,13 @@ class ProjectsApiClient extends ApiClientBase {
2755
5496
  return throwException("Not Found", status, _responseText, _headers, result404);
2756
5497
  }));
2757
5498
  }
5499
+ else if (status === 409) {
5500
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5501
+ let result409 = null;
5502
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5503
+ return throwException("Conflict", status, _responseText, _headers, result409);
5504
+ }));
5505
+ }
2758
5506
  else if (status === 401) {
2759
5507
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2760
5508
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2793,7 +5541,7 @@ class ProjectsApiClient extends ApiClientBase {
2793
5541
  observe: "response",
2794
5542
  responseType: "blob",
2795
5543
  headers: new HttpHeaders({
2796
- "Accept": "text/plain"
5544
+ "Accept": "application/json"
2797
5545
  })
2798
5546
  };
2799
5547
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -2837,6 +5585,13 @@ class ProjectsApiClient extends ApiClientBase {
2837
5585
  return throwException("Not Found", status, _responseText, _headers, result404);
2838
5586
  }));
2839
5587
  }
5588
+ else if (status === 409) {
5589
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5590
+ let result409 = null;
5591
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5592
+ return throwException("Conflict", status, _responseText, _headers, result409);
5593
+ }));
5594
+ }
2840
5595
  else if (status === 401) {
2841
5596
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2842
5597
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2915,6 +5670,13 @@ class ProjectsApiClient extends ApiClientBase {
2915
5670
  return throwException("Not Found", status, _responseText, _headers, result404);
2916
5671
  }));
2917
5672
  }
5673
+ else if (status === 409) {
5674
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5675
+ let result409 = null;
5676
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5677
+ return throwException("Conflict", status, _responseText, _headers, result409);
5678
+ }));
5679
+ }
2918
5680
  else if (status === 401) {
2919
5681
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2920
5682
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -2993,6 +5755,13 @@ class ProjectsApiClient extends ApiClientBase {
2993
5755
  return throwException("Not Found", status, _responseText, _headers, result404);
2994
5756
  }));
2995
5757
  }
5758
+ else if (status === 409) {
5759
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5760
+ let result409 = null;
5761
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5762
+ return throwException("Conflict", status, _responseText, _headers, result409);
5763
+ }));
5764
+ }
2996
5765
  else if (status === 401) {
2997
5766
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2998
5767
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3072,6 +5841,13 @@ class ProjectsApiClient extends ApiClientBase {
3072
5841
  return throwException("Not Found", status, _responseText, _headers, result404);
3073
5842
  }));
3074
5843
  }
5844
+ else if (status === 409) {
5845
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5846
+ let result409 = null;
5847
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5848
+ return throwException("Conflict", status, _responseText, _headers, result409);
5849
+ }));
5850
+ }
3075
5851
  else if (status === 401) {
3076
5852
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3077
5853
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3092,7 +5868,7 @@ class ProjectsApiClient extends ApiClientBase {
3092
5868
  /**
3093
5869
  * Attachs the specified data to the project's order in ecommerce system.
3094
5870
  * @param id Project identifier.
3095
- * @param itemId (optional)
5871
+ * @param itemId (optional) Project item identifier.
3096
5872
  * @param tenantId (optional) Tenant identifier.
3097
5873
  * @param body (optional) A list of data items, which should be attached to project's order.
3098
5874
  * @return Success
@@ -3113,7 +5889,7 @@ class ProjectsApiClient extends ApiClientBase {
3113
5889
  observe: "response",
3114
5890
  responseType: "blob",
3115
5891
  headers: new HttpHeaders({
3116
- "Content-Type": "application/json-patch+json",
5892
+ "Content-Type": "application/json",
3117
5893
  })
3118
5894
  };
3119
5895
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3155,6 +5931,13 @@ class ProjectsApiClient extends ApiClientBase {
3155
5931
  return throwException("Not Found", status, _responseText, _headers, result404);
3156
5932
  }));
3157
5933
  }
5934
+ else if (status === 409) {
5935
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
5936
+ let result409 = null;
5937
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
5938
+ return throwException("Conflict", status, _responseText, _headers, result409);
5939
+ }));
5940
+ }
3158
5941
  else if (status === 401) {
3159
5942
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3160
5943
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3220,7 +6003,7 @@ class StorefrontsApiClient extends ApiClientBase {
3220
6003
  observe: "response",
3221
6004
  responseType: "blob",
3222
6005
  headers: new HttpHeaders({
3223
- "Accept": "text/plain"
6006
+ "Accept": "application/json"
3224
6007
  })
3225
6008
  };
3226
6009
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3292,7 +6075,7 @@ class StorefrontsApiClient extends ApiClientBase {
3292
6075
  observe: "response",
3293
6076
  responseType: "blob",
3294
6077
  headers: new HttpHeaders({
3295
- "Accept": "text/plain"
6078
+ "Accept": "application/json"
3296
6079
  })
3297
6080
  };
3298
6081
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3336,6 +6119,13 @@ class StorefrontsApiClient extends ApiClientBase {
3336
6119
  return throwException("Not Found", status, _responseText, _headers, result404);
3337
6120
  }));
3338
6121
  }
6122
+ else if (status === 409) {
6123
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6124
+ let result409 = null;
6125
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6126
+ return throwException("Conflict", status, _responseText, _headers, result409);
6127
+ }));
6128
+ }
3339
6129
  else if (status === 401) {
3340
6130
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3341
6131
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3406,7 +6196,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3406
6196
  observe: "response",
3407
6197
  responseType: "blob",
3408
6198
  headers: new HttpHeaders({
3409
- "Accept": "text/plain"
6199
+ "Accept": "application/json"
3410
6200
  })
3411
6201
  };
3412
6202
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3443,6 +6233,13 @@ class StorefrontUsersApiClient extends ApiClientBase {
3443
6233
  return of(result200);
3444
6234
  }));
3445
6235
  }
6236
+ else if (status === 409) {
6237
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6238
+ let result409 = null;
6239
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6240
+ return throwException("Conflict", status, _responseText, _headers, result409);
6241
+ }));
6242
+ }
3446
6243
  else if (status === 401) {
3447
6244
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3448
6245
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3482,8 +6279,8 @@ class StorefrontUsersApiClient extends ApiClientBase {
3482
6279
  observe: "response",
3483
6280
  responseType: "blob",
3484
6281
  headers: new HttpHeaders({
3485
- "Content-Type": "application/json-patch+json",
3486
- "Accept": "text/plain"
6282
+ "Content-Type": "application/json",
6283
+ "Accept": "application/json"
3487
6284
  })
3488
6285
  };
3489
6286
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3567,7 +6364,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3567
6364
  observe: "response",
3568
6365
  responseType: "blob",
3569
6366
  headers: new HttpHeaders({
3570
- "Accept": "text/plain"
6367
+ "Accept": "application/json"
3571
6368
  })
3572
6369
  };
3573
6370
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3611,6 +6408,13 @@ class StorefrontUsersApiClient extends ApiClientBase {
3611
6408
  return throwException("Not Found", status, _responseText, _headers, result404);
3612
6409
  }));
3613
6410
  }
6411
+ else if (status === 409) {
6412
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
6413
+ let result409 = null;
6414
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
6415
+ return throwException("Conflict", status, _responseText, _headers, result409);
6416
+ }));
6417
+ }
3614
6418
  else if (status === 401) {
3615
6419
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3616
6420
  return throwException("Unauthorized", status, _responseText, _headers);
@@ -3650,8 +6454,8 @@ class StorefrontUsersApiClient extends ApiClientBase {
3650
6454
  observe: "response",
3651
6455
  responseType: "blob",
3652
6456
  headers: new HttpHeaders({
3653
- "Content-Type": "application/json-patch+json",
3654
- "Accept": "text/plain"
6457
+ "Content-Type": "application/json",
6458
+ "Accept": "application/json"
3655
6459
  })
3656
6460
  };
3657
6461
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3734,7 +6538,7 @@ class StorefrontUsersApiClient extends ApiClientBase {
3734
6538
  observe: "response",
3735
6539
  responseType: "blob",
3736
6540
  headers: new HttpHeaders({
3737
- "Content-Type": "application/json-patch+json",
6541
+ "Content-Type": "application/json",
3738
6542
  })
3739
6543
  };
3740
6544
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3864,14 +6668,14 @@ class StorefrontUsersApiClient extends ApiClientBase {
3864
6668
  else if (status === 404) {
3865
6669
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3866
6670
  let result404 = null;
3867
- result404 = _responseText === "" ? null : _responseText;
6671
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3868
6672
  return throwException("Not Found", status, _responseText, _headers, result404);
3869
6673
  }));
3870
6674
  }
3871
6675
  else if (status === 409) {
3872
6676
  return blobToText(responseBlob).pipe(mergeMap(_responseText => {
3873
6677
  let result409 = null;
3874
- result409 = _responseText === "" ? null : _responseText;
6678
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
3875
6679
  return throwException("Conflict", status, _responseText, _headers, result409);
3876
6680
  }));
3877
6681
  }
@@ -3925,7 +6729,7 @@ class TenantInfoApiClient extends ApiClientBase {
3925
6729
  observe: "response",
3926
6730
  responseType: "blob",
3927
6731
  headers: new HttpHeaders({
3928
- "Accept": "text/plain"
6732
+ "Accept": "application/json"
3929
6733
  })
3930
6734
  };
3931
6735
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -3993,7 +6797,7 @@ class TenantInfoApiClient extends ApiClientBase {
3993
6797
  observe: "response",
3994
6798
  responseType: "blob",
3995
6799
  headers: new HttpHeaders({
3996
- "Accept": "text/plain"
6800
+ "Accept": "application/json"
3997
6801
  })
3998
6802
  };
3999
6803
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -4061,7 +6865,7 @@ class TenantInfoApiClient extends ApiClientBase {
4061
6865
  observe: "response",
4062
6866
  responseType: "blob",
4063
6867
  headers: new HttpHeaders({
4064
- "Accept": "text/plain"
6868
+ "Accept": "application/json"
4065
6869
  })
4066
6870
  };
4067
6871
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -4129,7 +6933,7 @@ class TenantInfoApiClient extends ApiClientBase {
4129
6933
  observe: "response",
4130
6934
  responseType: "blob",
4131
6935
  headers: new HttpHeaders({
4132
- "Accept": "text/plain"
6936
+ "Accept": "application/json"
4133
6937
  })
4134
6938
  };
4135
6939
  return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
@@ -4195,6 +6999,32 @@ TenantInfoApiClient.ctorParameters = () => [
4195
6999
  { type: HttpClient, decorators: [{ type: Inject, args: [HttpClient,] }] },
4196
7000
  { type: String, decorators: [{ type: Optional }, { type: Inject, args: [API_BASE_URL,] }] }
4197
7001
  ];
7002
+ /** Available option types. */
7003
+ var OptionType;
7004
+ (function (OptionType) {
7005
+ OptionType["Simple"] = "Simple";
7006
+ OptionType["Size"] = "Size";
7007
+ OptionType["PageCount"] = "PageCount";
7008
+ })(OptionType || (OptionType = {}));
7009
+ /** Conflict types. */
7010
+ var ConflictType;
7011
+ (function (ConflictType) {
7012
+ ConflictType["NameConflict"] = "NameConflict";
7013
+ ConflictType["FolderOverwriteConflict"] = "FolderOverwriteConflict";
7014
+ ConflictType["IdConflict"] = "IdConflict";
7015
+ ConflictType["GeneralConflict"] = "GeneralConflict";
7016
+ })(ConflictType || (ConflictType = {}));
7017
+ /** Available appearance types. */
7018
+ var AppearanceDataType;
7019
+ (function (AppearanceDataType) {
7020
+ AppearanceDataType["Radio"] = "Radio";
7021
+ AppearanceDataType["Dropdown"] = "Dropdown";
7022
+ AppearanceDataType["Chips"] = "Chips";
7023
+ AppearanceDataType["ColorGrid"] = "ColorGrid";
7024
+ AppearanceDataType["ColorList"] = "ColorList";
7025
+ AppearanceDataType["ImageGrid"] = "ImageGrid";
7026
+ AppearanceDataType["ImageList"] = "ImageList";
7027
+ })(AppearanceDataType || (AppearanceDataType = {}));
4198
7028
  /** Type of editor that should be configured by workflow. */
4199
7029
  var WorkflowType;
4200
7030
  (function (WorkflowType) {
@@ -4203,6 +7033,34 @@ var WorkflowType;
4203
7033
  WorkflowType["DesignEditor"] = "DesignEditor";
4204
7034
  WorkflowType["WorkflowElements"] = "WorkflowElements";
4205
7035
  })(WorkflowType || (WorkflowType = {}));
7036
+ /** Available product reference target types. */
7037
+ var ProductReferenceType;
7038
+ (function (ProductReferenceType) {
7039
+ ProductReferenceType["ProductSpecification"] = "ProductSpecification";
7040
+ ProductReferenceType["Product"] = "Product";
7041
+ ProductReferenceType["ProductLink"] = "ProductLink";
7042
+ })(ProductReferenceType || (ProductReferenceType = {}));
7043
+ /** Available product variant resource types. */
7044
+ var ProductVariantResourceType;
7045
+ (function (ProductVariantResourceType) {
7046
+ ProductVariantResourceType["Preview"] = "Preview";
7047
+ ProductVariantResourceType["EditorModel"] = "EditorModel";
7048
+ ProductVariantResourceType["Custom"] = "Custom";
7049
+ })(ProductVariantResourceType || (ProductVariantResourceType = {}));
7050
+ /** Available mockup types. */
7051
+ var ProductVariantMockupType;
7052
+ (function (ProductVariantMockupType) {
7053
+ ProductVariantMockupType["Thumbnail"] = "Thumbnail";
7054
+ ProductVariantMockupType["Editor"] = "Editor";
7055
+ ProductVariantMockupType["Preview"] = "Preview";
7056
+ })(ProductVariantMockupType || (ProductVariantMockupType = {}));
7057
+ /** Available surface usage types. */
7058
+ var SurfaceUsageType;
7059
+ (function (SurfaceUsageType) {
7060
+ SurfaceUsageType["Individual"] = "Individual";
7061
+ SurfaceUsageType["Custom"] = "Custom";
7062
+ SurfaceUsageType["All"] = "All";
7063
+ })(SurfaceUsageType || (SurfaceUsageType = {}));
4206
7064
  /** Defines all available date period filter values for queries. */
4207
7065
  var DatePeriod;
4208
7066
  (function (DatePeriod) {
@@ -4247,6 +7105,14 @@ var RenderHiResScenarioOutputFlipMode;
4247
7105
  RenderHiResScenarioOutputFlipMode["Vertical"] = "Vertical";
4248
7106
  RenderHiResScenarioOutputFlipMode["Both"] = "Both";
4249
7107
  })(RenderHiResScenarioOutputFlipMode || (RenderHiResScenarioOutputFlipMode = {}));
7108
+ var RenderHiResScenarioOutputRotateMode;
7109
+ (function (RenderHiResScenarioOutputRotateMode) {
7110
+ RenderHiResScenarioOutputRotateMode["None"] = "None";
7111
+ RenderHiResScenarioOutputRotateMode["Rotate90"] = "Rotate90";
7112
+ RenderHiResScenarioOutputRotateMode["Rotate180"] = "Rotate180";
7113
+ RenderHiResScenarioOutputRotateMode["Rotate270"] = "Rotate270";
7114
+ RenderHiResScenarioOutputRotateMode["Auto"] = "Auto";
7115
+ })(RenderHiResScenarioOutputRotateMode || (RenderHiResScenarioOutputRotateMode = {}));
4250
7116
  /** Available value types for order data item. */
4251
7117
  var OrderDataItemValueType;
4252
7118
  (function (OrderDataItemValueType) {
@@ -4346,5 +7212,5 @@ StorefrontModule.decorators = [
4346
7212
  * Generated bundle index. Do not edit.
4347
7213
  */
4348
7214
 
4349
- export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, BuildInfoApiClient, CreateApiClientConfiguration, DatePeriod, OrderDataItemValueType, ProcessingPipelinesApiClient, ProductReferencesApiClient, ProductSpecificationsApiClient, ProjectItemResourceType, ProjectProcessingStatus, ProjectsApiClient, RenderHiResScenarioOutputColorSpace, RenderHiResScenarioOutputFlipMode, RenderHiResScenarioOutputFormat, StorefrontModule, StorefrontType, StorefrontUsersApiClient, StorefrontsApiClient, TenantInfoApiClient, WorkflowType };
7215
+ export { API_BASE_URL, ApiClientBase, ApiClientConfiguration, ApiException, AppearanceDataType, BuildInfoApiClient, ConflictType, CreateApiClientConfiguration, DatePeriod, OptionType, OrderDataItemValueType, ProcessingPipelinesApiClient, ProductLinksApiClient, ProductReferenceType, ProductReferencesApiClient, ProductSpecificationsApiClient, ProductVariantMockupType, ProductVariantResourceType, ProductsApiClient, ProjectItemResourceType, ProjectProcessingStatus, ProjectsApiClient, RenderHiResScenarioOutputColorSpace, RenderHiResScenarioOutputFlipMode, RenderHiResScenarioOutputFormat, RenderHiResScenarioOutputRotateMode, StorefrontModule, StorefrontType, StorefrontUsersApiClient, StorefrontsApiClient, SurfaceUsageType, TenantInfoApiClient, WorkflowType };
4350
7216
  //# sourceMappingURL=aurigma-ng-storefront-api-client.js.map