@aurigma/ng-backoffice-api-client 2.62.12 → 2.63.14

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.
@@ -1295,6 +1295,173 @@ class ProductsManagementApiClient extends ApiClientBase {
1295
1295
  }
1296
1296
  return of(null);
1297
1297
  }
1298
+ /**
1299
+ * Updates product variant resources.
1300
+ * @param id Product identifier.
1301
+ * @param productVersionId (optional) Product version identifier.
1302
+ * @param tenantId (optional) Tenant identifier.
1303
+ * @return Success
1304
+ */
1305
+ updateProductVariantResources(id, productVersionId, tenantId) {
1306
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/update-variant-resources?";
1307
+ if (id === undefined || id === null)
1308
+ throw new Error("The parameter 'id' must be defined.");
1309
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1310
+ if (productVersionId !== undefined && productVersionId !== null)
1311
+ url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
1312
+ if (tenantId !== undefined && tenantId !== null)
1313
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1314
+ url_ = url_.replace(/[?&]$/, "");
1315
+ let options_ = {
1316
+ observe: "response",
1317
+ responseType: "blob",
1318
+ headers: new HttpHeaders({})
1319
+ };
1320
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1321
+ return this.http.request("post", url_, transformedOptions_);
1322
+ })).pipe(mergeMap((response_) => {
1323
+ return this.transformResult(url_, response_, (r) => this.processUpdateProductVariantResources(r));
1324
+ })).pipe(catchError((response_) => {
1325
+ if (response_ instanceof HttpResponseBase) {
1326
+ try {
1327
+ return this.transformResult(url_, response_, (r) => this.processUpdateProductVariantResources(r));
1328
+ }
1329
+ catch (e) {
1330
+ return throwError(e);
1331
+ }
1332
+ }
1333
+ else
1334
+ return throwError(response_);
1335
+ }));
1336
+ }
1337
+ processUpdateProductVariantResources(response) {
1338
+ const status = response.status;
1339
+ const responseBlob = response instanceof HttpResponse ? response.body :
1340
+ response.error instanceof Blob ? response.error : undefined;
1341
+ let _headers = {};
1342
+ if (response.headers) {
1343
+ for (let key of response.headers.keys()) {
1344
+ _headers[key] = response.headers.get(key);
1345
+ }
1346
+ }
1347
+ if (status === 200) {
1348
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1349
+ return of(null);
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 === 409) {
1360
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1361
+ let result409 = null;
1362
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1363
+ return throwException("Conflict", status, _responseText, _headers, result409);
1364
+ }));
1365
+ }
1366
+ else if (status === 401) {
1367
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1368
+ return throwException("Unauthorized", status, _responseText, _headers);
1369
+ }));
1370
+ }
1371
+ else if (status === 403) {
1372
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1373
+ return throwException("Forbidden", status, _responseText, _headers);
1374
+ }));
1375
+ }
1376
+ else if (status !== 200 && status !== 204) {
1377
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1378
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1379
+ }));
1380
+ }
1381
+ return of(null);
1382
+ }
1383
+ /**
1384
+ * Validates product variant resources.
1385
+ * @param id Product identifier.
1386
+ * @param tenantId (optional) Tenant identifier.
1387
+ * @return Success
1388
+ */
1389
+ validateProductVariantResources(id, tenantId) {
1390
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/validate-variant-resources?";
1391
+ if (id === undefined || id === null)
1392
+ throw new Error("The parameter 'id' must be defined.");
1393
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1394
+ if (tenantId !== undefined && tenantId !== null)
1395
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1396
+ url_ = url_.replace(/[?&]$/, "");
1397
+ let options_ = {
1398
+ observe: "response",
1399
+ responseType: "blob",
1400
+ headers: new HttpHeaders({})
1401
+ };
1402
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1403
+ return this.http.request("post", url_, transformedOptions_);
1404
+ })).pipe(mergeMap((response_) => {
1405
+ return this.transformResult(url_, response_, (r) => this.processValidateProductVariantResources(r));
1406
+ })).pipe(catchError((response_) => {
1407
+ if (response_ instanceof HttpResponseBase) {
1408
+ try {
1409
+ return this.transformResult(url_, response_, (r) => this.processValidateProductVariantResources(r));
1410
+ }
1411
+ catch (e) {
1412
+ return throwError(e);
1413
+ }
1414
+ }
1415
+ else
1416
+ return throwError(response_);
1417
+ }));
1418
+ }
1419
+ processValidateProductVariantResources(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
+ return of(null);
1432
+ }));
1433
+ }
1434
+ else if (status === 404) {
1435
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1436
+ let result404 = null;
1437
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1438
+ return throwException("Not Found", status, _responseText, _headers, result404);
1439
+ }));
1440
+ }
1441
+ else if (status === 409) {
1442
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1443
+ let result409 = null;
1444
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1445
+ return throwException("Conflict", status, _responseText, _headers, result409);
1446
+ }));
1447
+ }
1448
+ else if (status === 401) {
1449
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1450
+ return throwException("Unauthorized", status, _responseText, _headers);
1451
+ }));
1452
+ }
1453
+ else if (status === 403) {
1454
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1455
+ return throwException("Forbidden", status, _responseText, _headers);
1456
+ }));
1457
+ }
1458
+ else if (status !== 200 && status !== 204) {
1459
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1460
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
1461
+ }));
1462
+ }
1463
+ return of(null);
1464
+ }
1298
1465
  /**
1299
1466
  * Returns a list of product variant designs.
1300
1467
  * @param id Product identifier.
@@ -1746,6 +1913,100 @@ class ProductsManagementApiClient extends ApiClientBase {
1746
1913
  }
1747
1914
  return of(null);
1748
1915
  }
1916
+ /**
1917
+ * Set product variants weight. Variants identifiers will be changed.
1918
+ * @param id Product identifier.
1919
+ * @param tenantId (optional) Tenant identifier.
1920
+ * @param body (optional) Set product variants weight operation parameters.
1921
+ * @return Success
1922
+ */
1923
+ setProductVariantWeight(id, tenantId, body) {
1924
+ let url_ = this.baseUrl + "/api/backoffice/v1/products/{id}/set-variant-weight?";
1925
+ if (id === undefined || id === null)
1926
+ throw new Error("The parameter 'id' must be defined.");
1927
+ url_ = url_.replace("{id}", encodeURIComponent("" + id));
1928
+ if (tenantId !== undefined && tenantId !== null)
1929
+ url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
1930
+ url_ = url_.replace(/[?&]$/, "");
1931
+ const content_ = JSON.stringify(body);
1932
+ let options_ = {
1933
+ body: content_,
1934
+ observe: "response",
1935
+ responseType: "blob",
1936
+ headers: new HttpHeaders({
1937
+ "Content-Type": "application/json",
1938
+ })
1939
+ };
1940
+ return from(this.transformOptions(options_)).pipe(mergeMap(transformedOptions_ => {
1941
+ return this.http.request("post", url_, transformedOptions_);
1942
+ })).pipe(mergeMap((response_) => {
1943
+ return this.transformResult(url_, response_, (r) => this.processSetProductVariantWeight(r));
1944
+ })).pipe(catchError((response_) => {
1945
+ if (response_ instanceof HttpResponseBase) {
1946
+ try {
1947
+ return this.transformResult(url_, response_, (r) => this.processSetProductVariantWeight(r));
1948
+ }
1949
+ catch (e) {
1950
+ return throwError(e);
1951
+ }
1952
+ }
1953
+ else
1954
+ return throwError(response_);
1955
+ }));
1956
+ }
1957
+ processSetProductVariantWeight(response) {
1958
+ const status = response.status;
1959
+ const responseBlob = response instanceof HttpResponse ? response.body :
1960
+ response.error instanceof Blob ? response.error : undefined;
1961
+ let _headers = {};
1962
+ if (response.headers) {
1963
+ for (let key of response.headers.keys()) {
1964
+ _headers[key] = response.headers.get(key);
1965
+ }
1966
+ }
1967
+ if (status === 200) {
1968
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1969
+ return of(null);
1970
+ }));
1971
+ }
1972
+ else if (status === 400) {
1973
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1974
+ let result400 = null;
1975
+ result400 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1976
+ return throwException("Bad Request", status, _responseText, _headers, result400);
1977
+ }));
1978
+ }
1979
+ else if (status === 404) {
1980
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1981
+ let result404 = null;
1982
+ result404 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1983
+ return throwException("Not Found", status, _responseText, _headers, result404);
1984
+ }));
1985
+ }
1986
+ else if (status === 409) {
1987
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1988
+ let result409 = null;
1989
+ result409 = _responseText === "" ? null : JSON.parse(_responseText, this.jsonParseReviver);
1990
+ return throwException("Conflict", status, _responseText, _headers, result409);
1991
+ }));
1992
+ }
1993
+ else if (status === 401) {
1994
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
1995
+ return throwException("Unauthorized", status, _responseText, _headers);
1996
+ }));
1997
+ }
1998
+ else if (status === 403) {
1999
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2000
+ return throwException("Forbidden", status, _responseText, _headers);
2001
+ }));
2002
+ }
2003
+ else if (status !== 200 && status !== 204) {
2004
+ return blobToText(responseBlob).pipe(mergeMap(_responseText => {
2005
+ return throwException("An unexpected server error occurred.", status, _responseText, _headers);
2006
+ }));
2007
+ }
2008
+ return of(null);
2009
+ }
1749
2010
  /**
1750
2011
  * Set product variants availability. Variants identifiers will be changed.
1751
2012
  * @param id Product identifier.