UNPKG

@aurigma/ng-storefront-api-client

Version:

Angular API Client for Storefront API service of Customer's Canvas web-to-print system.

8,521 lines 453 kB
(function (global, factory) {
    typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs/operators'), require('rxjs'), require('@angular/common/http')) :
    typeof define === 'function' && define.amd ? define('@aurigma/ng-storefront-api-client', ['exports', '@angular/core', 'rxjs/operators', 'rxjs', '@angular/common/http'], factory) :
    (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.aurigma = global.aurigma || {}, global.aurigma['ng-storefront-api-client'] = {}), global.ng.core, global.rxjs.operators, global.rxjs, global.ng.common.http));
}(this, (function (exports, i0, operators, rxjs, i1) { 'use strict';

    /*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */
    /* global Reflect, Promise */
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b)
                if (Object.prototype.hasOwnProperty.call(b, p))
                    d[p] = b[p]; };
        return extendStatics(d, b);
    };
    function __extends(d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    }
    var __assign = function () {
        __assign = Object.assign || function __assign(t) {
            for (var s, i = 1, n = arguments.length; i < n; i++) {
                s = arguments[i];
                for (var p in s)
                    if (Object.prototype.hasOwnProperty.call(s, p))
                        t[p] = s[p];
            }
            return t;
        };
        return __assign.apply(this, arguments);
    };
    function __rest(s, e) {
        var t = {};
        for (var p in s)
            if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
                t[p] = s[p];
        if (s != null && typeof Object.getOwnPropertySymbols === "function")
            for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
                if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                    t[p[i]] = s[p[i]];
            }
        return t;
    }
    function __decorate(decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
            r = Reflect.decorate(decorators, target, key, desc);
        else
            for (var i = decorators.length - 1; i >= 0; i--)
                if (d = decorators[i])
                    r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    }
    function __param(paramIndex, decorator) {
        return function (target, key) { decorator(target, key, paramIndex); };
    }
    function __metadata(metadataKey, metadataValue) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
            return Reflect.metadata(metadataKey, metadataValue);
    }
    function __awaiter(thisArg, _arguments, P, generator) {
        function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
        return new (P || (P = Promise))(function (resolve, reject) {
            function fulfilled(value) { try {
                step(generator.next(value));
            }
            catch (e) {
                reject(e);
            } }
            function rejected(value) { try {
                step(generator["throw"](value));
            }
            catch (e) {
                reject(e);
            } }
            function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
            step((generator = generator.apply(thisArg, _arguments || [])).next());
        });
    }
    function __generator(thisArg, body) {
        var _ = { label: 0, sent: function () { if (t[0] & 1)
                throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
        return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
        function verb(n) { return function (v) { return step([n, v]); }; }
        function step(op) {
            if (f)
                throw new TypeError("Generator is already executing.");
            while (_)
                try {
                    if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
                        return t;
                    if (y = 0, t)
                        op = [op[0] & 2, t.value];
                    switch (op[0]) {
                        case 0:
                        case 1:
                            t = op;
                            break;
                        case 4:
                            _.label++;
                            return { value: op[1], done: false };
                        case 5:
                            _.label++;
                            y = op[1];
                            op = [0];
                            continue;
                        case 7:
                            op = _.ops.pop();
                            _.trys.pop();
                            continue;
                        default:
                            if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                                _ = 0;
                                continue;
                            }
                            if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
                                _.label = op[1];
                                break;
                            }
                            if (op[0] === 6 && _.label < t[1]) {
                                _.label = t[1];
                                t = op;
                                break;
                            }
                            if (t && _.label < t[2]) {
                                _.label = t[2];
                                _.ops.push(op);
                                break;
                            }
                            if (t[2])
                                _.ops.pop();
                            _.trys.pop();
                            continue;
                    }
                    op = body.call(thisArg, _);
                }
                catch (e) {
                    op = [6, e];
                    y = 0;
                }
                finally {
                    f = t = 0;
                }
            if (op[0] & 5)
                throw op[1];
            return { value: op[0] ? op[1] : void 0, done: true };
        }
    }
    var __createBinding = Object.create ? (function (o, m, k, k2) {
        if (k2 === undefined)
            k2 = k;
        Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
    }) : (function (o, m, k, k2) {
        if (k2 === undefined)
            k2 = k;
        o[k2] = m[k];
    });
    function __exportStar(m, o) {
        for (var p in m)
            if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
                __createBinding(o, m, p);
    }
    function __values(o) {
        var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
        if (m)
            return m.call(o);
        if (o && typeof o.length === "number")
            return {
                next: function () {
                    if (o && i >= o.length)
                        o = void 0;
                    return { value: o && o[i++], done: !o };
                }
            };
        throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
    }
    function __read(o, n) {
        var m = typeof Symbol === "function" && o[Symbol.iterator];
        if (!m)
            return o;
        var i = m.call(o), r, ar = [], e;
        try {
            while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
                ar.push(r.value);
        }
        catch (error) {
            e = { error: error };
        }
        finally {
            try {
                if (r && !r.done && (m = i["return"]))
                    m.call(i);
            }
            finally {
                if (e)
                    throw e.error;
            }
        }
        return ar;
    }
    /** @deprecated */
    function __spread() {
        for (var ar = [], i = 0; i < arguments.length; i++)
            ar = ar.concat(__read(arguments[i]));
        return ar;
    }
    /** @deprecated */
    function __spreadArrays() {
        for (var s = 0, i = 0, il = arguments.length; i < il; i++)
            s += arguments[i].length;
        for (var r = Array(s), k = 0, i = 0; i < il; i++)
            for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
                r[k] = a[j];
        return r;
    }
    function __spreadArray(to, from) {
        for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
            to[j] = from[i];
        return to;
    }
    function __await(v) {
        return this instanceof __await ? (this.v = v, this) : new __await(v);
    }
    function __asyncGenerator(thisArg, _arguments, generator) {
        if (!Symbol.asyncIterator)
            throw new TypeError("Symbol.asyncIterator is not defined.");
        var g = generator.apply(thisArg, _arguments || []), i, q = [];
        return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
        function verb(n) { if (g[n])
            i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
        function resume(n, v) { try {
            step(g[n](v));
        }
        catch (e) {
            settle(q[0][3], e);
        } }
        function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
        function fulfill(value) { resume("next", value); }
        function reject(value) { resume("throw", value); }
        function settle(f, v) { if (f(v), q.shift(), q.length)
            resume(q[0][0], q[0][1]); }
    }
    function __asyncDelegator(o) {
        var i, p;
        return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
        function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
    }
    function __asyncValues(o) {
        if (!Symbol.asyncIterator)
            throw new TypeError("Symbol.asyncIterator is not defined.");
        var m = o[Symbol.asyncIterator], i;
        return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
        function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
        function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
    }
    function __makeTemplateObject(cooked, raw) {
        if (Object.defineProperty) {
            Object.defineProperty(cooked, "raw", { value: raw });
        }
        else {
            cooked.raw = raw;
        }
        return cooked;
    }
    ;
    var __setModuleDefault = Object.create ? (function (o, v) {
        Object.defineProperty(o, "default", { enumerable: true, value: v });
    }) : function (o, v) {
        o["default"] = v;
    };
    function __importStar(mod) {
        if (mod && mod.__esModule)
            return mod;
        var result = {};
        if (mod != null)
            for (var k in mod)
                if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
                    __createBinding(result, mod, k);
        __setModuleDefault(result, mod);
        return result;
    }
    function __importDefault(mod) {
        return (mod && mod.__esModule) ? mod : { default: mod };
    }
    function __classPrivateFieldGet(receiver, state, kind, f) {
        if (kind === "a" && !f)
            throw new TypeError("Private accessor was defined without a getter");
        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
            throw new TypeError("Cannot read private member from an object whose class did not declare it");
        return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
    }
    function __classPrivateFieldSet(receiver, state, value, kind, f) {
        if (kind === "m")
            throw new TypeError("Private method is not writable");
        if (kind === "a" && !f)
            throw new TypeError("Private accessor was defined without a setter");
        if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
            throw new TypeError("Cannot write private member to an object whose class did not declare it");
        return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
    }

    var API_BASE_URL = new i0.InjectionToken('API_BASE_URL');
    var ApiClientConfiguration = /** @class */ (function () {
        function ApiClientConfiguration() {
            this.apiKey = '';
            this.authorizationToken = null;
        }
        ApiClientConfiguration.prototype.getAuthorizationToken = function () {
            return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
                return [2 /*return*/, this.authorizationToken];
            }); });
        };
        ;
        ApiClientConfiguration.prototype.setAuthorizationToken = function (token) { this.authorizationToken = token; };
        ;
        return ApiClientConfiguration;
    }());
    var ApiClientBase = /** @class */ (function () {
        function ApiClientBase(configuration) {
            this.configuration = configuration;
        }
        ApiClientBase.prototype.transformOptions = function (options) {
            return __awaiter(this, void 0, void 0, function () {
                var token;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0: return [4 /*yield*/, this.configuration.getAuthorizationToken()];
                        case 1:
                            token = _a.sent();
                            if (token != null) {
                                options.headers = options.headers.append("authorization", "Bearer " + token);
                            }
                            else {
                                options.headers = options.headers.append("X-API-Key", this.configuration.apiKey);
                            }
                            //options = { ...options, transformResponse: (res) => res, responseType: 'json' };
                            return [2 /*return*/, options];
                    }
                });
            });
        };
        ApiClientBase.prototype.getBaseUrl = function (defultUrl) {
            if (this.configuration.apiUrl.endsWith('/')) {
                return this.configuration.apiUrl.slice(0, -1);
            }
            return this.configuration.apiUrl;
        };
        ApiClientBase.prototype.transformResult = function (url, res, cb) {
            return cb(res);
        };
        return ApiClientBase;
    }());
    var BuildInfoApiClient = /** @class */ (function (_super) {
        __extends(BuildInfoApiClient, _super);
        function BuildInfoApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns an assembly build info.
         * @return Success
         */
        BuildInfoApiClient.prototype.headInfo = function () {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/info";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({})
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("head", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processHeadInfo(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processHeadInfo(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        BuildInfoApiClient.prototype.processHeadInfo = function (response) {
            var e_1, _a;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_1_1) { e_1 = { error: e_1_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_1) throw e_1.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return rxjs.of(null);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns an assembly build info.
         * @return Success
         */
        BuildInfoApiClient.prototype.getInfo = function () {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/info";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        BuildInfoApiClient.prototype.processGetInfo = function (response) {
            var e_2, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_2_1) { e_2 = { error: e_2_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_2) throw e_2.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return BuildInfoApiClient;
    }(ApiClientBase));
    BuildInfoApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function BuildInfoApiClient_Factory() { return new BuildInfoApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: BuildInfoApiClient, providedIn: "root" });
    BuildInfoApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    BuildInfoApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var ProcessingPipelinesApiClient = /** @class */ (function (_super) {
        __extends(ProcessingPipelinesApiClient, _super);
        function ProcessingPipelinesApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all processing pipelines relevant to the specified query parameters.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param search (optional) Search string for partial by processing pipeline name.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProcessingPipelinesApiClient.prototype.getAll = function (skip, take, search, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/processing-pipelines?";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProcessingPipelinesApiClient.prototype.processGetAll = function (response) {
            var e_3, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_3_1) { e_3 = { error: e_3_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_3) throw e_3.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a processing pipeline.
         * @param id Processing pipeline identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProcessingPipelinesApiClient.prototype.get = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/processing-pipelines/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProcessingPipelinesApiClient.prototype.processGet = function (response) {
            var e_4, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_4_1) { e_4 = { error: e_4_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_4) throw e_4.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return ProcessingPipelinesApiClient;
    }(ApiClientBase));
    ProcessingPipelinesApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProcessingPipelinesApiClient_Factory() { return new ProcessingPipelinesApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProcessingPipelinesApiClient, providedIn: "root" });
    ProcessingPipelinesApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    ProcessingPipelinesApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var ProductBundlesApiClient = /** @class */ (function (_super) {
        __extends(ProductBundlesApiClient, _super);
        function ProductBundlesApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all product bundles, relevant to the specified query parameters.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductBundlesApiClient.prototype.getAllProductBundles = function (skip, take, sorting, search, customFields, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-bundles?";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (customFields !== undefined && customFields !== null)
                url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductBundles(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductBundles(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductBundlesApiClient.prototype.processGetAllProductBundles = function (response) {
            var e_5, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_5_1) { e_5 = { error: e_5_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_5) throw e_5.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product bundle by its identifier.
         * @param id Product identifier.
         * @param productBundleVersionId (optional) Product bundle version identifier. Optional
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductBundlesApiClient.prototype.getProductBundle = function (id, productBundleVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-bundles/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productBundleVersionId !== undefined && productBundleVersionId !== null)
                url_ += "productBundleVersionId=" + encodeURIComponent("" + productBundleVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductBundle(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductBundle(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductBundlesApiClient.prototype.processGetProductBundle = function (response) {
            var e_6, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_6_1) { e_6 = { error: e_6_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_6) throw e_6.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product bundle summary by product bundle identifier.
         * @param id Product bundle identifier.
         * @param productBundleVersionId (optional) Product bundle version identifier.
         * @param productVariantId (optional) Product variant identifier.
         * @param sku (optional) Product variant SKU.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductBundlesApiClient.prototype.getProductSummary = function (id, productBundleVersionId, productVariantId, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-bundles/{id}/summary?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productBundleVersionId !== undefined && productBundleVersionId !== null)
                url_ += "productBundleVersionId=" + encodeURIComponent("" + productBundleVersionId) + "&";
            if (productVariantId !== undefined && productVariantId !== null)
                url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductBundlesApiClient.prototype.processGetProductSummary = function (response) {
            var e_7, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_7_1) { e_7 = { error: e_7_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_7) throw e_7.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product bundle personalization workflow description by product bundle identifier.
         * @param id Product bundle identifier.
         * @param productBundleVersionId (optional) Product bundle version identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductBundlesApiClient.prototype.getPersonalizationWorkflow = function (id, productBundleVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-bundles/{id}/personalization-workflow?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productBundleVersionId !== undefined && productBundleVersionId !== null)
                url_ += "productBundleVersionId=" + encodeURIComponent("" + productBundleVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductBundlesApiClient.prototype.processGetPersonalizationWorkflow = function (response) {
            var e_8, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_8_1) { e_8 = { error: e_8_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_8) throw e_8.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return ProductBundlesApiClient;
    }(ApiClientBase));
    ProductBundlesApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductBundlesApiClient_Factory() { return new ProductBundlesApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProductBundlesApiClient, providedIn: "root" });
    ProductBundlesApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    ProductBundlesApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var ProductLinksApiClient = /** @class */ (function (_super) {
        __extends(ProductLinksApiClient, _super);
        function ProductLinksApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all product links, relevant to the specified query parameters.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductLinksApiClient.prototype.getAllProductLinks = function (skip, take, sorting, search, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-links?";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductLinks(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductLinks(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductLinksApiClient.prototype.processGetAllProductLinks = function (response) {
            var e_9, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_9_1) { e_9 = { error: e_9_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_9) throw e_9.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product link by its identifier.
         * @param id Product identifier.
         * @param productLinkVersionId (optional) Product link version identifier. Optional
         * @param productVersionId (optional) Product version identifier which represents linked product version. Optional
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductLinksApiClient.prototype.getProductLink = function (id, productLinkVersionId, productVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productLinkVersionId !== undefined && productLinkVersionId !== null)
                url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLink(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLink(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductLinksApiClient.prototype.processGetProductLink = function (response) {
            var e_10, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_10_1) { e_10 = { error: e_10_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_10) throw e_10.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product link summary by product link identifier.
         * @param id Product link identifier.
         * @param productLinkVersionId (optional) Product link version identifier.
         * @param productVersionId (optional) Product link identifier.
         * @param productVariantId (optional) Product variant identifier.
         * @param sku (optional) Product variant SKU.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductLinksApiClient.prototype.getProductSummary = function (id, productLinkVersionId, productVersionId, productVariantId, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/summary?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productLinkVersionId !== undefined && productLinkVersionId !== null)
                url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (productVariantId !== undefined && productVariantId !== null)
                url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductLinksApiClient.prototype.processGetProductSummary = function (response) {
            var e_11, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_11_1) { e_11 = { error: e_11_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_11) throw e_11.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product link personalization workflow description by product link identifier.
         * @param id Product link identifier.
         * @param productLinkVersionId (optional) Product link version identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param productFilterId (optional) Product filter identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductLinksApiClient.prototype.getPersonalizationWorkflow = function (id, productLinkVersionId, productVersionId, productFilterId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-links/{id}/personalization-workflow?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productLinkVersionId !== undefined && productLinkVersionId !== null)
                url_ += "productLinkVersionId=" + encodeURIComponent("" + productLinkVersionId) + "&";
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (productFilterId !== undefined && productFilterId !== null)
                url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductLinksApiClient.prototype.processGetPersonalizationWorkflow = function (response) {
            var e_12, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_12_1) { e_12 = { error: e_12_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_12) throw e_12.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return ProductLinksApiClient;
    }(ApiClientBase));
    ProductLinksApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductLinksApiClient_Factory() { return new ProductLinksApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProductLinksApiClient, providedIn: "root" });
    ProductLinksApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    ProductLinksApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var ProductReferencesApiClient = /** @class */ (function (_super) {
        __extends(ProductReferencesApiClient, _super);
        function ProductReferencesApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all storefront product references relevant to the specified query parameters.
         * @param storefrontId Storefront identifier.
         * @param productReference (optional) Product reference filter.
        Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
         * @param productSpecificationId (optional) Customer's Canvas product specification filter.
         * @param productId (optional) Customer's Canvas product filter.
         * @param productLinkId (optional) Customer's Canvas product link filter.
         * @param productBundleId (optional) Customer's Canvas product bundle filter.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param sku (optional) SKU filter.
         * @param tags (optional) List of tags that product should have.
         * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getAll = function (storefrontId, productReference, productSpecificationId, productId, productLinkId, productBundleId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (productReference !== undefined && productReference !== null)
                url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
            if (productSpecificationId !== undefined && productSpecificationId !== null)
                url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
            if (productId !== undefined && productId !== null)
                url_ += "productId=" + encodeURIComponent("" + productId) + "&";
            if (productLinkId !== undefined && productLinkId !== null)
                url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
            if (productBundleId !== undefined && productBundleId !== null)
                url_ += "productBundleId=" + encodeURIComponent("" + productBundleId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tags !== undefined && tags !== null)
                tags && tags.forEach(function (item) { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
            if (customFields !== undefined && customFields !== null)
                url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetAll = function (response) {
            var e_13, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_13_1) { e_13 = { error: e_13_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_13) throw e_13.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product specifications associated with storefront product references relevant to the specified query parameters.
         * @param storefrontId Storefront identifier.
         * @param productReference (optional) Product reference filter.
        Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
         * @param productSpecificationId (optional) Customer's Canvas product specification filter.
         * @param productId (optional) Customer's Canvas product filter.
         * @param productLinkId (optional) Customer's Canvas product link filter.
         * @param productBundleId (optional) Customer's Canvas product bundle filter.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param sku (optional) SKU filter.
         * @param tags (optional) List of tags that product should have.
         * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getAllProductSpecifications = function (storefrontId, productReference, productSpecificationId, productId, productLinkId, productBundleId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/product-specifications?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (productReference !== undefined && productReference !== null)
                url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
            if (productSpecificationId !== undefined && productSpecificationId !== null)
                url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
            if (productId !== undefined && productId !== null)
                url_ += "productId=" + encodeURIComponent("" + productId) + "&";
            if (productLinkId !== undefined && productLinkId !== null)
                url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
            if (productBundleId !== undefined && productBundleId !== null)
                url_ += "productBundleId=" + encodeURIComponent("" + productBundleId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tags !== undefined && tags !== null)
                tags && tags.forEach(function (item) { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
            if (customFields !== undefined && customFields !== null)
                url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductSpecifications(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductSpecifications(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetAllProductSpecifications = function (response) {
            var e_14, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_14_1) { e_14 = { error: e_14_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_14) throw e_14.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of products associated with storefront product references relevant to the specified query parameters.
         * @param storefrontId Storefront identifier.
         * @param productReference (optional) Product reference filter.
        Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
         * @param productSpecificationId (optional) Customer's Canvas product specification filter.
         * @param productId (optional) Customer's Canvas product filter.
         * @param productLinkId (optional) Customer's Canvas product link filter.
         * @param productBundleId (optional) Customer's Canvas product bundle filter.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param sku (optional) SKU filter.
         * @param tags (optional) List of tags that product should have.
         * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getAllProducts = function (storefrontId, productReference, productSpecificationId, productId, productLinkId, productBundleId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/products?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (productReference !== undefined && productReference !== null)
                url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
            if (productSpecificationId !== undefined && productSpecificationId !== null)
                url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
            if (productId !== undefined && productId !== null)
                url_ += "productId=" + encodeURIComponent("" + productId) + "&";
            if (productLinkId !== undefined && productLinkId !== null)
                url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
            if (productBundleId !== undefined && productBundleId !== null)
                url_ += "productBundleId=" + encodeURIComponent("" + productBundleId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tags !== undefined && tags !== null)
                tags && tags.forEach(function (item) { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
            if (customFields !== undefined && customFields !== null)
                url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProducts(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProducts(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetAllProducts = function (response) {
            var e_15, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_15_1) { e_15 = { error: e_15_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_15) throw e_15.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product links associated with storefront product references relevant to the specified query parameters.
         * @param storefrontId Storefront identifier.
         * @param productReference (optional) Product reference filter.
        Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
         * @param productSpecificationId (optional) Customer's Canvas product specification filter.
         * @param productId (optional) Customer's Canvas product filter.
         * @param productLinkId (optional) Customer's Canvas product link filter.
         * @param productBundleId (optional) Customer's Canvas product bundle filter.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param sku (optional) SKU filter.
         * @param tags (optional) List of tags that product should have.
         * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getAllProductLinks = function (storefrontId, productReference, productSpecificationId, productId, productLinkId, productBundleId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/product-links?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (productReference !== undefined && productReference !== null)
                url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
            if (productSpecificationId !== undefined && productSpecificationId !== null)
                url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
            if (productId !== undefined && productId !== null)
                url_ += "productId=" + encodeURIComponent("" + productId) + "&";
            if (productLinkId !== undefined && productLinkId !== null)
                url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
            if (productBundleId !== undefined && productBundleId !== null)
                url_ += "productBundleId=" + encodeURIComponent("" + productBundleId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tags !== undefined && tags !== null)
                tags && tags.forEach(function (item) { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
            if (customFields !== undefined && customFields !== null)
                url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductLinks(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductLinks(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetAllProductLinks = function (response) {
            var e_16, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_16_1) { e_16 = { error: e_16_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_16) throw e_16.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product bundles associated with storefront product references relevant to the specified query parameters.
         * @param storefrontId Storefront identifier.
         * @param productReference (optional) Product reference filter.
        Product reference is an external reference to Customer's Canvas product, e.g online store product identifier.
         * @param productSpecificationId (optional) Customer's Canvas product specification filter.
         * @param productId (optional) Customer's Canvas product filter.
         * @param productLinkId (optional) Customer's Canvas product link filter.
         * @param productBundleId (optional) Customer's Canvas product bundle filter.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param sku (optional) SKU filter.
         * @param tags (optional) List of tags that product should have.
         * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getAllProductBundles = function (storefrontId, productReference, productSpecificationId, productId, productLinkId, productBundleId, skip, take, sorting, search, sku, tags, customFields, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/product-bundles?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (productReference !== undefined && productReference !== null)
                url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
            if (productSpecificationId !== undefined && productSpecificationId !== null)
                url_ += "productSpecificationId=" + encodeURIComponent("" + productSpecificationId) + "&";
            if (productId !== undefined && productId !== null)
                url_ += "productId=" + encodeURIComponent("" + productId) + "&";
            if (productLinkId !== undefined && productLinkId !== null)
                url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
            if (productBundleId !== undefined && productBundleId !== null)
                url_ += "productBundleId=" + encodeURIComponent("" + productBundleId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tags !== undefined && tags !== null)
                tags && tags.forEach(function (item) { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
            if (customFields !== undefined && customFields !== null)
                url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductBundles(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductBundles(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetAllProductBundles = function (response) {
            var e_17, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_17_1) { e_17 = { error: e_17_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_17) throw e_17.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a storefront product reference.
         * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.get = function (reference, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGet = function (response) {
            var e_18, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_18_1) { e_18 = { error: e_18_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_18) throw e_18.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product specification by the storefront product reference.
         * @param reference Product reference - external reference to Customer's Canvas product, e.g online store product identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getProductSpecification = function (reference, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-specification?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSpecification(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSpecification(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetProductSpecification = function (response) {
            var e_19, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_19_1) { e_19 = { error: e_19_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_19) throw e_19.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product by storefront product reference.
         * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getProduct = function (reference, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProduct(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProduct(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetProduct = function (response) {
            var e_20, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_20_1) { e_20 = { error: e_20_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_20) throw e_20.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product summary by storefront product reference.
         * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
         * @param storefrontId Storefront identifier.
         * @param productVariantId (optional) Product variant identifier.
         * @param sku (optional) Product variant SKU.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getProductSummary = function (reference, storefrontId, productVariantId, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-summary?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (productVariantId !== undefined && productVariantId !== null)
                url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetProductSummary = function (response) {
            var e_21, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_21_1) { e_21 = { error: e_21_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_21) throw e_21.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product link by storefront product reference.
         * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getProductLink = function (reference, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-link?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLink(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLink(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetProductLink = function (response) {
            var e_22, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_22_1) { e_22 = { error: e_22_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_22) throw e_22.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product bundle by storefront product reference.
         * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getProductBundle = function (reference, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-bundle?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductBundle(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductBundle(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetProductBundle = function (response) {
            var e_23, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_23_1) { e_23 = { error: e_23_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_23) throw e_23.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product cost details from ecommerce system.
         * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
         * @param sku Product SKU.
         * @param storefrontId Storefront identifier.
         * @param storefrontUserId (optional) Storefront user identifier.
         * @param currencyCode (optional) Product cost currency code.
         * @param quantity (optional) Product quantity.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getProductCostDetails = function (reference, sku, storefrontId, storefrontUserId, currencyCode, quantity, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/product-cost-details?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (sku === undefined || sku === null)
                throw new Error("The parameter 'sku' must be defined and cannot be null.");
            else
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (storefrontUserId !== undefined && storefrontUserId !== null)
                url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
            if (currencyCode !== undefined && currencyCode !== null)
                url_ += "currencyCode=" + encodeURIComponent("" + currencyCode) + "&";
            if (quantity === null)
                throw new Error("The parameter 'quantity' cannot be null.");
            else if (quantity !== undefined)
                url_ += "quantity=" + encodeURIComponent("" + quantity) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductCostDetails(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductCostDetails(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetProductCostDetails = function (response) {
            var e_24, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_24_1) { e_24 = { error: e_24_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_24) throw e_24.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product personalization workflow.
         * @param reference An external reference to Customer's Canvas product, e.g online store product identifier.
         * @param storefrontId (optional) Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductReferencesApiClient.prototype.getPersonalizationWorkflow = function (reference, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-references/{reference}/personalization-workflow?";
            if (reference === undefined || reference === null)
                throw new Error("The parameter 'reference' must be defined.");
            url_ = url_.replace("{reference}", encodeURIComponent("" + reference));
            if (storefrontId === null)
                throw new Error("The parameter 'storefrontId' cannot be null.");
            else if (storefrontId !== undefined)
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductReferencesApiClient.prototype.processGetPersonalizationWorkflow = function (response) {
            var e_25, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_25_1) { e_25 = { error: e_25_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_25) throw e_25.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return ProductReferencesApiClient;
    }(ApiClientBase));
    ProductReferencesApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductReferencesApiClient_Factory() { return new ProductReferencesApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProductReferencesApiClient, providedIn: "root" });
    ProductReferencesApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    ProductReferencesApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var ProductsApiClient = /** @class */ (function (_super) {
        __extends(ProductsApiClient, _super);
        function ProductsApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all products, relevant to the specified query parameters.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param sku (optional) SKU of linked ecommerce product.
         * @param tags (optional) List of tags that product should have.
         * @param customFields (optional) Serialized custom fields dictionary filter. For example: {"public":"true","name":"my item"}.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getAllProducts = function (skip, take, sorting, search, sku, tags, customFields, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products?";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tags !== undefined && tags !== null)
                tags && tags.forEach(function (item) { url_ += "tags=" + encodeURIComponent("" + item) + "&"; });
            if (customFields !== undefined && customFields !== null)
                url_ += "customFields=" + encodeURIComponent("" + customFields) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProducts(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProducts(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetAllProducts = function (response) {
            var e_26, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_26_1) { e_26 = { error: e_26_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_26) throw e_26.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product by identifier.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProduct = function (id, productVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProduct(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProduct(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProduct = function (response) {
            var e_27, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_27_1) { e_27 = { error: e_27_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_27) throw e_27.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product summary by product identifier.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param productLinkId (optional) Product link identifier.
         * @param productVariantId (optional) Product variant identifier.
         * @param sku (optional) Product variant SKU.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductSummary = function (id, productVersionId, productLinkId, productVariantId, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/summary?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (productLinkId !== undefined && productLinkId !== null)
                url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
            if (productVariantId !== undefined && productVariantId !== null)
                url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductSummary(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductSummary = function (response) {
            var e_28, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_28_1) { e_28 = { error: e_28_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_28) throw e_28.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product options.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductOptions = function (id, productVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/options?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductOptions(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductOptions(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductOptions = function (response) {
            var e_29, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_29_1) { e_29 = { error: e_29_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_29) throw e_29.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product options for all products.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getAllProductOptions = function (tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/options?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductOptions(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllProductOptions(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetAllProductOptions = function (response) {
            var e_30, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_30_1) { e_30 = { error: e_30_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_30) throw e_30.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product links.
         * @param id Product identifier.
         * @param productVersionId (optional)
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductLinks = function (id, productVersionId, skip, take, sorting, search, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLinks(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLinks(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductLinks = function (response) {
            var e_31, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_31_1) { e_31 = { error: e_31_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_31) throw e_31.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product link.
         * @param id Product identifier.
         * @param productLinkId Product link identifier.
         * @param productVersionId (optional)
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductLink = function (id, productLinkId, productVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/links/{productLinkId}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productLinkId === undefined || productLinkId === null)
                throw new Error("The parameter 'productLinkId' must be defined.");
            url_ = url_.replace("{productLinkId}", encodeURIComponent("" + productLinkId));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLink(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductLink(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductLink = function (response) {
            var e_32, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_32_1) { e_32 = { error: e_32_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_32) throw e_32.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product variants.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
         * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
         * @param takeAvailableOnly (optional) Defines special filter for available product variants.
         * @param sku (optional) SKU of linked ecommerce product.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductVariants = function (id, productVersionId, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (options !== undefined && options !== null)
                url_ += "options=" + encodeURIComponent("" + options) + "&";
            if (productFilterId !== undefined && productFilterId !== null)
                url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
            if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
                url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariants(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariants(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductVariants = function (response) {
            var e_33, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_33_1) { e_33 = { error: e_33_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_33) throw e_33.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product variant.
         * @param id Product identifier.
         * @param productVariantId Product variant identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductVariant = function (id, productVariantId, productVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variants/{productVariantId}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVariantId === undefined || productVariantId === null)
                throw new Error("The parameter 'productVariantId' must be defined.");
            url_ = url_.replace("{productVariantId}", encodeURIComponent("" + productVariantId));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariant(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariant(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductVariant = function (response) {
            var e_34, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_34_1) { e_34 = { error: e_34_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_34) throw e_34.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product variant designs.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param productVariantId (optional) Product variant identifier.
         * @param search (optional) Search string for design name partial match.
         * @param designCustomFields (optional) Custom attributes dictionary filter for designs. For example: {"public":"true","name":"my item"}
         * @param designPath (optional) Path filter for designs. Subfolders included by default.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
         * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
         * @param takeAvailableOnly (optional) Defines special filter for available product variants.
         * @param sku (optional) SKU of linked ecommerce product.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductVariantDesigns = function (id, productVersionId, productVariantId, search, designCustomFields, designPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-designs?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (productVariantId !== undefined && productVariantId !== null)
                url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (designCustomFields !== undefined && designCustomFields !== null)
                url_ += "designCustomFields=" + encodeURIComponent("" + designCustomFields) + "&";
            if (designPath !== undefined && designPath !== null)
                url_ += "designPath=" + encodeURIComponent("" + designPath) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (options !== undefined && options !== null)
                url_ += "options=" + encodeURIComponent("" + options) + "&";
            if (productFilterId !== undefined && productFilterId !== null)
                url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
            if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
                url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariantDesigns(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariantDesigns(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductVariantDesigns = function (response) {
            var e_35, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_35_1) { e_35 = { error: e_35_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_35) throw e_35.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product variant mockups.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param productVariantId (optional) Product variant identifier.
         * @param search (optional) Search string for design name partial match.
         * @param mockupCustomFields (optional) Custom attributes dictionary filter for mockups. For example: {"public":"true","name":"my item"}
         * @param mockupPath (optional) Path filter for mockups. Subfolders included by default.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
         * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
         * @param takeAvailableOnly (optional) Defines special filter for available product variants.
         * @param sku (optional) SKU of linked ecommerce product.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductVariantMockups = function (id, productVersionId, productVariantId, search, mockupCustomFields, mockupPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-mockups?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (productVariantId !== undefined && productVariantId !== null)
                url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (mockupCustomFields !== undefined && mockupCustomFields !== null)
                url_ += "mockupCustomFields=" + encodeURIComponent("" + mockupCustomFields) + "&";
            if (mockupPath !== undefined && mockupPath !== null)
                url_ += "mockupPath=" + encodeURIComponent("" + mockupPath) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (options !== undefined && options !== null)
                url_ += "options=" + encodeURIComponent("" + options) + "&";
            if (productFilterId !== undefined && productFilterId !== null)
                url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
            if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
                url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariantMockups(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariantMockups(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductVariantMockups = function (response) {
            var e_36, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_36_1) { e_36 = { error: e_36_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_36) throw e_36.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of product variant documents.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param productVariantId (optional) Product variant identifier.
         * @param search (optional) Search string for document name partial match.
         * @param documentCustomFields (optional) Custom attributes dictionary filter for documents. For example: {"public":"true","name":"my item"}
         * @param documentPath (optional) Path filter for documents. Subfolders included by default.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param options (optional) Defines options filter e.g.: "{ "opt1_id": "opt1_val1_id, opt1_val2_id", "opt2_id": "opt2_val1_id" }".
         * @param productFilterId (optional) Defines special filter based on product filter with specified identifier.
         * @param takeAvailableOnly (optional) Defines special filter for available product variants.
         * @param sku (optional) SKU of linked ecommerce product.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getProductVariantDocuments = function (id, productVersionId, productVariantId, search, documentCustomFields, documentPath, skip, take, options, productFilterId, takeAvailableOnly, sku, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/variant-documents?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (productVariantId !== undefined && productVariantId !== null)
                url_ += "productVariantId=" + encodeURIComponent("" + productVariantId) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (documentCustomFields !== undefined && documentCustomFields !== null)
                url_ += "documentCustomFields=" + encodeURIComponent("" + documentCustomFields) + "&";
            if (documentPath !== undefined && documentPath !== null)
                url_ += "documentPath=" + encodeURIComponent("" + documentPath) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (options !== undefined && options !== null)
                url_ += "options=" + encodeURIComponent("" + options) + "&";
            if (productFilterId !== undefined && productFilterId !== null)
                url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
            if (takeAvailableOnly !== undefined && takeAvailableOnly !== null)
                url_ += "takeAvailableOnly=" + encodeURIComponent("" + takeAvailableOnly) + "&";
            if (sku !== undefined && sku !== null)
                url_ += "sku=" + encodeURIComponent("" + sku) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariantDocuments(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProductVariantDocuments(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetProductVariantDocuments = function (response) {
            var e_37, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_37_1) { e_37 = { error: e_37_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_37) throw e_37.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Updates product variant resources.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.updateProductVariantResources = function (id, productVersionId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/update-variant-resources?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({})
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processUpdateProductVariantResources(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processUpdateProductVariantResources(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processUpdateProductVariantResources = function (response) {
            var e_38, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_38_1) { e_38 = { error: e_38_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_38) throw e_38.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return rxjs.of(null);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of all available product tags.
         * @param search (optional) Search string for partial match.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getAvailableProductTags = function (search, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/available-tags?";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAvailableProductTags(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAvailableProductTags(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetAvailableProductTags = function (response) {
            var e_39, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_39_1) { e_39 = { error: e_39_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_39) throw e_39.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product personalization workflow description by product identifier.
         * @param id Product identifier.
         * @param productVersionId (optional) Product version identifier.
         * @param productLinkId (optional) Product link identifier.
         * @param productFilterId (optional) Product filter identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductsApiClient.prototype.getPersonalizationWorkflow = function (id, productVersionId, productLinkId, productFilterId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/products/{id}/personalization-workflow?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (productVersionId !== undefined && productVersionId !== null)
                url_ += "productVersionId=" + encodeURIComponent("" + productVersionId) + "&";
            if (productLinkId !== undefined && productLinkId !== null)
                url_ += "productLinkId=" + encodeURIComponent("" + productLinkId) + "&";
            if (productFilterId !== undefined && productFilterId !== null)
                url_ += "productFilterId=" + encodeURIComponent("" + productFilterId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductsApiClient.prototype.processGetPersonalizationWorkflow = function (response) {
            var e_40, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_40_1) { e_40 = { error: e_40_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_40) throw e_40.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return ProductsApiClient;
    }(ApiClientBase));
    ProductsApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductsApiClient_Factory() { return new ProductsApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProductsApiClient, providedIn: "root" });
    ProductsApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    ProductsApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var ProductSpecificationsApiClient = /** @class */ (function (_super) {
        __extends(ProductSpecificationsApiClient, _super);
        function ProductSpecificationsApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all product specifications, relevant to the specified query parameters.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductSpecificationsApiClient.prototype.getAll = function (skip, take, sorting, search, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-specifications?";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductSpecificationsApiClient.prototype.processGetAll = function (response) {
            var e_41, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_41_1) { e_41 = { error: e_41_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_41) throw e_41.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product specification by identifier.
         * @param id Product specification identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductSpecificationsApiClient.prototype.get = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductSpecificationsApiClient.prototype.processGet = function (response) {
            var e_42, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_42_1) { e_42 = { error: e_42_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_42) throw e_42.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a product personalization workflow description by product specification identifier.
         * @param id Product specification identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProductSpecificationsApiClient.prototype.getPersonalizationWorkflow = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/product-specifications/{id}/personalization-workflow?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetPersonalizationWorkflow(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProductSpecificationsApiClient.prototype.processGetPersonalizationWorkflow = function (response) {
            var e_43, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_43_1) { e_43 = { error: e_43_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_43) throw e_43.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return ProductSpecificationsApiClient;
    }(ApiClientBase));
    ProductSpecificationsApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProductSpecificationsApiClient_Factory() { return new ProductSpecificationsApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProductSpecificationsApiClient, providedIn: "root" });
    ProductSpecificationsApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    ProductSpecificationsApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var ProjectsApiClient = /** @class */ (function (_super) {
        __extends(ProjectsApiClient, _super);
        function ProjectsApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all projects, relevant to the specified query parameters.
         * @param ownerId (optional) Project owner (storefront user id) filter.
         * @param productReference (optional) Product reference filter.
         * @param status (optional) Project status filter.
         * @param datePeriod (optional) Project date period filter.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param orderId (optional) Identifier of corresponding order.
         * @param processingStatus (optional) Project processing status filter.
         * @param includeObsolete (optional) Indicates if obsolete projects prepared to be removed should be included to result.
         * @param storefrontId (optional) Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getAll = function (ownerId, productReference, status, datePeriod, skip, take, sorting, search, orderId, processingStatus, includeObsolete, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects?";
            if (ownerId !== undefined && ownerId !== null)
                url_ += "ownerId=" + encodeURIComponent("" + ownerId) + "&";
            if (productReference !== undefined && productReference !== null)
                url_ += "productReference=" + encodeURIComponent("" + productReference) + "&";
            if (status !== undefined && status !== null)
                url_ += "status=" + encodeURIComponent("" + status) + "&";
            if (datePeriod === null)
                throw new Error("The parameter 'datePeriod' cannot be null.");
            else if (datePeriod !== undefined)
                url_ += "datePeriod=" + encodeURIComponent("" + datePeriod) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (orderId !== undefined && orderId !== null)
                url_ += "orderId=" + encodeURIComponent("" + orderId) + "&";
            if (processingStatus !== undefined && processingStatus !== null)
                url_ += "processingStatus=" + encodeURIComponent("" + processingStatus) + "&";
            if (includeObsolete === null)
                throw new Error("The parameter 'includeObsolete' cannot be null.");
            else if (includeObsolete !== undefined)
                url_ += "includeObsolete=" + encodeURIComponent("" + includeObsolete) + "&";
            if (storefrontId !== undefined && storefrontId !== null)
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetAll = function (response) {
            var e_44, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_44_1) { e_44 = { error: e_44_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_44) throw e_44.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a project by identifier.
         * @param id Project identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.get = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGet = function (response) {
            var e_45, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_45_1) { e_45 = { error: e_45_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_45) throw e_45.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Removes a project by identifier.
         * @param id Project identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.delete = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({})
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("delete", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processDelete(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processDelete(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processDelete = function (response) {
            var e_46, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_46_1) { e_46 = { error: e_46_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_46) throw e_46.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return rxjs.of(null);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a project preview file by project identifier.
         * @param id Project identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getPreview = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/preview?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/octet-stream"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetPreview(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetPreview(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetPreview = function (response) {
            var e_47, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_47_1) { e_47 = { error: e_47_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_47) throw e_47.error; }
                }
            }
            if (status === 200 || status === 206) {
                var contentDisposition = response.headers ? response.headers.get("content-disposition") : undefined;
                var fileNameMatch = contentDisposition ? /filename="?([^"]*?)"?(;|$)/g.exec(contentDisposition) : undefined;
                var fileName = fileNameMatch && fileNameMatch.length > 1 ? fileNameMatch[1] : undefined;
                return rxjs.of({ fileName: fileName, data: responseBlob, status: status, headers: _headers });
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a project preview URL by project identifier.
         * @param id Project identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getPreviewUrl = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/preview-url?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "text/plain"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetPreviewUrl(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetPreviewUrl(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetPreviewUrl = function (response) {
            var e_48, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_48_1) { e_48 = { error: e_48_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_48) throw e_48.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : _responseText;
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Creates a new project with single item.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Create operation parameters.
         * @return Success
         */
        ProjectsApiClient.prototype.createWithSingleItem = function (storefrontId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/with-single-item?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processCreateWithSingleItem(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processCreateWithSingleItem(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processCreateWithSingleItem = function (response) {
            var e_49, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_49_1) { e_49 = { error: e_49_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_49) throw e_49.error; }
                }
            }
            if (status === 201) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result201 = null;
                    result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result201);
                }));
            }
            else if (status === 400) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result400 = null;
                    result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Bad Request", status, _responseText, _headers, result400);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Creates a new project with multiple items.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Create operation parameters.
         * @return Success
         */
        ProjectsApiClient.prototype.createWithMultipleItems = function (storefrontId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/with-multiple-items?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processCreateWithMultipleItems(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processCreateWithMultipleItems(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processCreateWithMultipleItems = function (response) {
            var e_50, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_50_1) { e_50 = { error: e_50_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_50) throw e_50.error; }
                }
            }
            if (status === 201) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result201 = null;
                    result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result201);
                }));
            }
            else if (status === 400) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result400 = null;
                    result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Bad Request", status, _responseText, _headers, result400);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Creates a new project by 'Render HiRes' scenario.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Create operation parameters.
         * @return Success
         */
        ProjectsApiClient.prototype.createByRenderHiResScenario = function (storefrontId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/by-scenario/render-hires?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processCreateByRenderHiResScenario(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processCreateByRenderHiResScenario(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processCreateByRenderHiResScenario = function (response) {
            var e_51, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_51_1) { e_51 = { error: e_51_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_51) throw e_51.error; }
                }
            }
            if (status === 201) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result201 = null;
                    result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result201);
                }));
            }
            else if (status === 400) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result400 = null;
                    result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Bad Request", status, _responseText, _headers, result400);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Creates a new project by 'Specific Pipeline' scenario.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Create operation parameters.
         * @return Success
         */
        ProjectsApiClient.prototype.createBySpecificPipelineScenario = function (storefrontId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/by-scenario/specific-pipeline?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processCreateBySpecificPipelineScenario(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processCreateBySpecificPipelineScenario(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processCreateBySpecificPipelineScenario = function (response) {
            var e_52, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_52_1) { e_52 = { error: e_52_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_52) throw e_52.error; }
                }
            }
            if (status === 201) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result201 = null;
                    result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result201);
                }));
            }
            else if (status === 400) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result400 = null;
                    result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Bad Request", status, _responseText, _headers, result400);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns all available status transitions for a project.
         * @param id Project identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getAvailableTransitions = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAvailableTransitions(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAvailableTransitions(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetAvailableTransitions = function (response) {
            var e_53, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_53_1) { e_53 = { error: e_53_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_53) throw e_53.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 400) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result400 = null;
                    result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Bad Request", status, _responseText, _headers, result400);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Changes the project status.
         * @param id Project identifier
         * @param transition Transition identifying name.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.changeStatus = function (id, transition, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/transitions/{transition}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (transition === undefined || transition === null)
                throw new Error("The parameter 'transition' must be defined.");
            url_ = url_.replace("{transition}", encodeURIComponent("" + transition));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processChangeStatus(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processChangeStatus(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processChangeStatus = function (response) {
            var e_54, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_54_1) { e_54 = { error: e_54_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_54) throw e_54.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 400) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result400 = null;
                    result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Bad Request", status, _responseText, _headers, result400);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Changes the project status forcibly without a proper transition.
         * @param id Project identifier.
         * @param status Project status code.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.forceStatus = function (id, status, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/statuses/{status}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (status === undefined || status === null)
                throw new Error("The parameter 'status' must be defined.");
            url_ = url_.replace("{status}", encodeURIComponent("" + status));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processForceStatus(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processForceStatus(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processForceStatus = function (response) {
            var e_55, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_55_1) { e_55 = { error: e_55_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_55) throw e_55.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 400) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result400 = null;
                    result400 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Bad Request", status, _responseText, _headers, result400);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Deletes specified projects.
        These projects will be hide from projects list immediately, but complete projects data cleaning will take some additional time.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Operation parameters.
         * @return Success
         */
        ProjectsApiClient.prototype.batchDelete = function (tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/batch-delete?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("delete", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processBatchDelete(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processBatchDelete(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processBatchDelete = function (response) {
            var e_56, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_56_1) { e_56 = { error: e_56_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_56) throw e_56.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of all existing project statuses.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getAllStatuses = function (tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/statuses?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllStatuses(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllStatuses(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetAllStatuses = function (response) {
            var e_57, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_57_1) { e_57 = { error: e_57_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_57) throw e_57.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of all existing project status transitions.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getAllTransitions = function (tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/transitions?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAllTransitions(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAllTransitions(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetAllTransitions = function (response) {
            var e_58, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_58_1) { e_58 = { error: e_58_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_58) throw e_58.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a project processing results.
         * @param id Project identifier.
         * @param itemId (optional) Project item identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getProjectProcessingResults = function (id, itemId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/processing-results?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (itemId !== undefined && itemId !== null)
                url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectProcessingResults(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectProcessingResults(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetProjectProcessingResults = function (response) {
            var e_59, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_59_1) { e_59 = { error: e_59_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_59) throw e_59.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Resumes project processing.
         * @param id Project identifier.
         * @param itemId (optional) Project item identifier. If value is set, only specified item processing will be resumed.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.resumeProjectProcessing = function (id, itemId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/resume-processing?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (itemId !== undefined && itemId !== null)
                url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({})
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processResumeProjectProcessing(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processResumeProjectProcessing(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processResumeProjectProcessing = function (response) {
            var e_60, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_60_1) { e_60 = { error: e_60_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_60) throw e_60.error; }
                }
            }
            if (status === 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return rxjs.of(null);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Restarts a project processing routine.
         * @param id Project identifier.
         * @param itemId (optional) Project item identifier. If value is set, only specified item processing will be restarted.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.restartProjectProcessing = function (id, itemId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/restart-processing?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (itemId !== undefined && itemId !== null)
                url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({})
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processRestartProjectProcessing(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processRestartProjectProcessing(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processRestartProjectProcessing = function (response) {
            var e_61, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_61_1) { e_61 = { error: e_61_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_61) throw e_61.error; }
                }
            }
            if (status === 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return rxjs.of(null);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns an order description from the ecommerce system for the specified project.
         * @param id Project identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        ProjectsApiClient.prototype.getProjectOrder = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectOrder(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetProjectOrder(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processGetProjectOrder = function (response) {
            var e_62, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_62_1) { e_62 = { error: e_62_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_62) throw e_62.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Attachs the specified data to the project's order in ecommerce system.
         * @param id Project identifier.
         * @param itemId (optional) Project item identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) A list of data items, which should be attached to project's order.
         * @return Success
         */
        ProjectsApiClient.prototype.attachDataToProjectOrder = function (id, itemId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/projects/{id}/order-data?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (itemId !== undefined && itemId !== null)
                url_ += "itemId=" + encodeURIComponent("" + itemId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processAttachDataToProjectOrder(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processAttachDataToProjectOrder(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        ProjectsApiClient.prototype.processAttachDataToProjectOrder = function (response) {
            var e_63, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_63_1) { e_63 = { error: e_63_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_63) throw e_63.error; }
                }
            }
            if (status === 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return rxjs.of(null);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return ProjectsApiClient;
    }(ApiClientBase));
    ProjectsApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function ProjectsApiClient_Factory() { return new ProjectsApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: ProjectsApiClient, providedIn: "root" });
    ProjectsApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    ProjectsApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var StorefrontsApiClient = /** @class */ (function (_super) {
        __extends(StorefrontsApiClient, _super);
        function StorefrontsApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all storefronts, relevant to the specified query parameters.
         * @param types (optional) Storefront type filter.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        StorefrontsApiClient.prototype.getAll = function (types, skip, take, sorting, search, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefronts?";
            if (types !== undefined && types !== null)
                types && types.forEach(function (item) { url_ += "types=" + encodeURIComponent("" + item) + "&"; });
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontsApiClient.prototype.processGetAll = function (response) {
            var e_64, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_64_1) { e_64 = { error: e_64_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_64) throw e_64.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a storefront by identifier.
         * @param id Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        StorefrontsApiClient.prototype.get = function (id, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefronts/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontsApiClient.prototype.processGet = function (response) {
            var e_65, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_65_1) { e_65 = { error: e_65_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_65) throw e_65.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return StorefrontsApiClient;
    }(ApiClientBase));
    StorefrontsApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function StorefrontsApiClient_Factory() { return new StorefrontsApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: StorefrontsApiClient, providedIn: "root" });
    StorefrontsApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    StorefrontsApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var StorefrontUsersApiClient = /** @class */ (function (_super) {
        __extends(StorefrontUsersApiClient, _super);
        function StorefrontUsersApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns all storefront users, relevant to the specified query parameters.
         * @param storefrontId Storefront identifier.
         * @param storefrontUserId (optional) Storefront user identifier.
         * @param skip (optional) Defines page start offset from beginning of sorted result list.
         * @param take (optional) Defines page length (how many consequent items of sorted result list should be taken).
         * @param sorting (optional) Defines sorting order of result list e.g.: "Title ASC, LastModified DESC".
         * @param search (optional) Search string for partial match.
         * @param includeAnonymous (optional) Flag that indicates if anonymous users should be included. `True` by default.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        StorefrontUsersApiClient.prototype.getAll = function (storefrontId, storefrontUserId, skip, take, sorting, search, includeAnonymous, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (storefrontUserId !== undefined && storefrontUserId !== null)
                url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
            if (skip !== undefined && skip !== null)
                url_ += "skip=" + encodeURIComponent("" + skip) + "&";
            if (take !== undefined && take !== null)
                url_ += "take=" + encodeURIComponent("" + take) + "&";
            if (sorting !== undefined && sorting !== null)
                url_ += "sorting=" + encodeURIComponent("" + sorting) + "&";
            if (search !== undefined && search !== null)
                url_ += "search=" + encodeURIComponent("" + search) + "&";
            if (includeAnonymous !== undefined && includeAnonymous !== null)
                url_ += "includeAnonymous=" + encodeURIComponent("" + includeAnonymous) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetAll(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontUsersApiClient.prototype.processGetAll = function (response) {
            var e_66, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_66_1) { e_66 = { error: e_66_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_66) throw e_66.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Creates a new storefront user.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Operation parameters.
         * @return Success
         */
        StorefrontUsersApiClient.prototype.create = function (storefrontId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefront-users?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processCreate(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontUsersApiClient.prototype.processCreate = function (response) {
            var e_67, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_67_1) { e_67 = { error: e_67_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_67) throw e_67.error; }
                }
            }
            if (status === 201) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result201 = null;
                    result201 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result201);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a storefront user by identifier.
         * @param id Storefront user identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        StorefrontUsersApiClient.prototype.get = function (id, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/{id}?";
            if (id === undefined || id === null)
                throw new Error("The parameter 'id' must be defined.");
            url_ = url_.replace("{id}", encodeURIComponent("" + id));
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGet(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontUsersApiClient.prototype.processGet = function (response) {
            var e_68, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_68_1) { e_68 = { error: e_68_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_68) throw e_68.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Registers a storefront user with the specified identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Operation parameters.
         * @return Success
         */
        StorefrontUsersApiClient.prototype.register = function (storefrontId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/register?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processRegister(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processRegister(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontUsersApiClient.prototype.processRegister = function (response) {
            var e_69, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_69_1) { e_69 = { error: e_69_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_69) throw e_69.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Transfers all existing data for the anonymous storefront user to the selected regular storefront user account.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @param body (optional) Operation parameters.
         * @return Success
         */
        StorefrontUsersApiClient.prototype.mergeAnonymous = function (storefrontId, tenantId, body) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/merge-anonymous?";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var content_ = JSON.stringify(body);
            var options_ = {
                body: content_,
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Content-Type": "application/json",
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("post", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processMergeAnonymous(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processMergeAnonymous(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontUsersApiClient.prototype.processMergeAnonymous = function (response) {
            var e_70, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_70_1) { e_70 = { error: e_70_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_70) throw e_70.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return rxjs.of(null);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns an API access token for the specified storefront user.
         * @param storefrontUserId Storefront user identifier.
         * @param storefrontId Storefront identifier.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        StorefrontUsersApiClient.prototype.getToken = function (storefrontUserId, storefrontId, tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/storefront-users/token?";
            if (storefrontUserId === undefined || storefrontUserId === null)
                throw new Error("The parameter 'storefrontUserId' must be defined and cannot be null.");
            else
                url_ += "storefrontUserId=" + encodeURIComponent("" + storefrontUserId) + "&";
            if (storefrontId === undefined || storefrontId === null)
                throw new Error("The parameter 'storefrontId' must be defined and cannot be null.");
            else
                url_ += "storefrontId=" + encodeURIComponent("" + storefrontId) + "&";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "text/plain"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetToken(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetToken(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        StorefrontUsersApiClient.prototype.processGetToken = function (response) {
            var e_71, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_71_1) { e_71 = { error: e_71_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_71) throw e_71.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : _responseText;
                    return rxjs.of(result200);
                }));
            }
            else if (status === 404) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result404 = null;
                    result404 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Not Found", status, _responseText, _headers, result404);
                }));
            }
            else if (status === 409) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result409 = null;
                    result409 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return throwException("Conflict", status, _responseText, _headers, result409);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return StorefrontUsersApiClient;
    }(ApiClientBase));
    StorefrontUsersApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function StorefrontUsersApiClient_Factory() { return new StorefrontUsersApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: StorefrontUsersApiClient, providedIn: "root" });
    StorefrontUsersApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    StorefrontUsersApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    var TenantInfoApiClient = /** @class */ (function (_super) {
        __extends(TenantInfoApiClient, _super);
        function TenantInfoApiClient(configuration, http, baseUrl) {
            var _this = _super.call(this, configuration) || this;
            _this.jsonParseReviver = undefined;
            _this.http = http;
            _this.baseUrl = baseUrl !== undefined && baseUrl !== null ? baseUrl : _this.getBaseUrl("");
            return _this;
        }
        /**
         * Returns an information about the tenant applications.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        TenantInfoApiClient.prototype.getApplicationsInfo = function (tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/tenant-info/applications?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetApplicationsInfo(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetApplicationsInfo(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        TenantInfoApiClient.prototype.processGetApplicationsInfo = function (response) {
            var e_72, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_72_1) { e_72 = { error: e_72_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_72) throw e_72.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns an information about the tenant.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        TenantInfoApiClient.prototype.getInfo = function (tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/tenant-info?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetInfo(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        TenantInfoApiClient.prototype.processGetInfo = function (response) {
            var e_73, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_73_1) { e_73 = { error: e_73_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_73) throw e_73.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns an information about the tenant measure units.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        TenantInfoApiClient.prototype.getMeasureUnitsInfo = function (tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/tenant-info/measure-units?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetMeasureUnitsInfo(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetMeasureUnitsInfo(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        TenantInfoApiClient.prototype.processGetMeasureUnitsInfo = function (response) {
            var e_74, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_74_1) { e_74 = { error: e_74_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_74) throw e_74.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        /**
         * Returns a list of tenant users.
         * @param tenantId (optional) Tenant identifier.
         * @return Success
         */
        TenantInfoApiClient.prototype.getUsersInfo = function (tenantId) {
            var _this = this;
            var url_ = this.baseUrl + "/api/storefront/v1/tenant-info/users?";
            if (tenantId !== undefined && tenantId !== null)
                url_ += "tenantId=" + encodeURIComponent("" + tenantId) + "&";
            url_ = url_.replace(/[?&]$/, "");
            var options_ = {
                observe: "response",
                responseType: "blob",
                headers: new i1.HttpHeaders({
                    "Accept": "application/json"
                })
            };
            return rxjs.from(this.transformOptions(options_)).pipe(operators.mergeMap(function (transformedOptions_) {
                return _this.http.request("get", url_, transformedOptions_);
            })).pipe(operators.mergeMap(function (response_) {
                return _this.transformResult(url_, response_, function (r) { return _this.processGetUsersInfo(r); });
            })).pipe(operators.catchError(function (response_) {
                if (response_ instanceof i1.HttpResponseBase) {
                    try {
                        return _this.transformResult(url_, response_, function (r) { return _this.processGetUsersInfo(r); });
                    }
                    catch (e) {
                        return rxjs.throwError(e);
                    }
                }
                else
                    return rxjs.throwError(response_);
            }));
        };
        TenantInfoApiClient.prototype.processGetUsersInfo = function (response) {
            var e_75, _a;
            var _this = this;
            var status = response.status;
            var responseBlob = response instanceof i1.HttpResponse ? response.body :
                response.error instanceof Blob ? response.error : undefined;
            var _headers = {};
            if (response.headers) {
                try {
                    for (var _b = __values(response.headers.keys()), _c = _b.next(); !_c.done; _c = _b.next()) {
                        var key = _c.value;
                        _headers[key] = response.headers.get(key);
                    }
                }
                catch (e_75_1) { e_75 = { error: e_75_1 }; }
                finally {
                    try {
                        if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_75) throw e_75.error; }
                }
            }
            if (status === 200) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    var result200 = null;
                    result200 = _responseText === "" ? null : JSON.parse(_responseText, _this.jsonParseReviver);
                    return rxjs.of(result200);
                }));
            }
            else if (status === 401) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Unauthorized", status, _responseText, _headers);
                }));
            }
            else if (status === 403) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("Forbidden", status, _responseText, _headers);
                }));
            }
            else if (status !== 200 && status !== 204) {
                return blobToText(responseBlob).pipe(operators.mergeMap(function (_responseText) {
                    return throwException("An unexpected server error occurred.", status, _responseText, _headers);
                }));
            }
            return rxjs.of(null);
        };
        return TenantInfoApiClient;
    }(ApiClientBase));
    TenantInfoApiClient.ɵprov = i0.ɵɵdefineInjectable({ factory: function TenantInfoApiClient_Factory() { return new TenantInfoApiClient(i0.ɵɵinject(ApiClientConfiguration), i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(API_BASE_URL, 8)); }, token: TenantInfoApiClient, providedIn: "root" });
    TenantInfoApiClient.decorators = [
        { type: i0.Injectable, args: [{
                    providedIn: 'root'
                },] }
    ];
    TenantInfoApiClient.ctorParameters = function () { return [
        { type: ApiClientConfiguration, decorators: [{ type: i0.Inject, args: [ApiClientConfiguration,] }] },
        { type: i1.HttpClient, decorators: [{ type: i0.Inject, args: [i1.HttpClient,] }] },
        { type: String, decorators: [{ type: i0.Optional }, { type: i0.Inject, args: [API_BASE_URL,] }] }
    ]; };
    (function (ProductBundleResourceType) {
        ProductBundleResourceType["Custom"] = "Custom";
        ProductBundleResourceType["Preview"] = "Preview";
    })(exports.ProductBundleResourceType || (exports.ProductBundleResourceType = {}));
    (function (ConflictType) {
        ConflictType["NameConflict"] = "NameConflict";
        ConflictType["FolderOverwriteConflict"] = "FolderOverwriteConflict";
        ConflictType["IdConflict"] = "IdConflict";
        ConflictType["GeneralConflict"] = "GeneralConflict";
    })(exports.ConflictType || (exports.ConflictType = {}));
    (function (AppearanceDataType) {
        AppearanceDataType["Radio"] = "Radio";
        AppearanceDataType["Dropdown"] = "Dropdown";
        AppearanceDataType["Chips"] = "Chips";
        AppearanceDataType["ColorGrid"] = "ColorGrid";
        AppearanceDataType["ColorList"] = "ColorList";
        AppearanceDataType["ImageGrid"] = "ImageGrid";
        AppearanceDataType["ImageList"] = "ImageList";
    })(exports.AppearanceDataType || (exports.AppearanceDataType = {}));
    (function (WorkflowType) {
        WorkflowType["UIFramework"] = "UIFramework";
        WorkflowType["SimpleEditor"] = "SimpleEditor";
        WorkflowType["DesignEditor"] = "DesignEditor";
        WorkflowType["WorkflowElements"] = "WorkflowElements";
    })(exports.WorkflowType || (exports.WorkflowType = {}));
    (function (ProductLinkResourceType) {
        ProductLinkResourceType["Preview"] = "Preview";
        ProductLinkResourceType["Custom"] = "Custom";
    })(exports.ProductLinkResourceType || (exports.ProductLinkResourceType = {}));
    (function (OptionType) {
        OptionType["Simple"] = "Simple";
        OptionType["Size"] = "Size";
        OptionType["PageCount"] = "PageCount";
    })(exports.OptionType || (exports.OptionType = {}));
    (function (ProductReferenceType) {
        ProductReferenceType["ProductSpecification"] = "ProductSpecification";
        ProductReferenceType["Product"] = "Product";
        ProductReferenceType["ProductLink"] = "ProductLink";
        ProductReferenceType["ProductBundle"] = "ProductBundle";
    })(exports.ProductReferenceType || (exports.ProductReferenceType = {}));
    (function (ProductVariantResourceType) {
        ProductVariantResourceType["Preview"] = "Preview";
        ProductVariantResourceType["EditorModel"] = "EditorModel";
        ProductVariantResourceType["Custom"] = "Custom";
    })(exports.ProductVariantResourceType || (exports.ProductVariantResourceType = {}));
    (function (ProductVariantMockupType) {
        ProductVariantMockupType["Thumbnail"] = "Thumbnail";
        ProductVariantMockupType["Editor"] = "Editor";
        ProductVariantMockupType["Preview"] = "Preview";
    })(exports.ProductVariantMockupType || (exports.ProductVariantMockupType = {}));
    (function (SurfaceUsageType) {
        SurfaceUsageType["Individual"] = "Individual";
        SurfaceUsageType["Custom"] = "Custom";
        SurfaceUsageType["All"] = "All";
    })(exports.SurfaceUsageType || (exports.SurfaceUsageType = {}));
    (function (DatePeriod) {
        DatePeriod["All"] = "All";
        DatePeriod["Today"] = "Today";
        DatePeriod["Last7Days"] = "Last7Days";
        DatePeriod["Last30Days"] = "Last30Days";
    })(exports.DatePeriod || (exports.DatePeriod = {}));
    (function (ProjectProcessingStatus) {
        ProjectProcessingStatus["Pending"] = "Pending";
        ProjectProcessingStatus["InProgress"] = "InProgress";
        ProjectProcessingStatus["Completed"] = "Completed";
        ProjectProcessingStatus["Failed"] = "Failed";
    })(exports.ProjectProcessingStatus || (exports.ProjectProcessingStatus = {}));
    (function (ProjectItemResourceType) {
        ProjectItemResourceType["General"] = "General";
        ProjectItemResourceType["Preview"] = "Preview";
        ProjectItemResourceType["Hires"] = "Hires";
    })(exports.ProjectItemResourceType || (exports.ProjectItemResourceType = {}));
    (function (ProjectItemProductType) {
        ProjectItemProductType["ProductSpecification"] = "ProductSpecification";
        ProjectItemProductType["Product"] = "Product";
        ProjectItemProductType["ProductLink"] = "ProductLink";
    })(exports.ProjectItemProductType || (exports.ProjectItemProductType = {}));
    (function (RenderHiResScenarioOutputFormat) {
        RenderHiResScenarioOutputFormat["Pdf"] = "Pdf";
        RenderHiResScenarioOutputFormat["Jpeg"] = "Jpeg";
        RenderHiResScenarioOutputFormat["Png"] = "Png";
        RenderHiResScenarioOutputFormat["Tiff"] = "Tiff";
        RenderHiResScenarioOutputFormat["Bmp"] = "Bmp";
    })(exports.RenderHiResScenarioOutputFormat || (exports.RenderHiResScenarioOutputFormat = {}));
    (function (RenderHiResScenarioOutputColorSpace) {
        RenderHiResScenarioOutputColorSpace["Rgb"] = "Rgb";
        RenderHiResScenarioOutputColorSpace["Grayscale"] = "Grayscale";
        RenderHiResScenarioOutputColorSpace["Cmyk"] = "Cmyk";
    })(exports.RenderHiResScenarioOutputColorSpace || (exports.RenderHiResScenarioOutputColorSpace = {}));
    (function (RenderHiResScenarioOutputFlipMode) {
        RenderHiResScenarioOutputFlipMode["None"] = "None";
        RenderHiResScenarioOutputFlipMode["Horizontal"] = "Horizontal";
        RenderHiResScenarioOutputFlipMode["Vertical"] = "Vertical";
        RenderHiResScenarioOutputFlipMode["Both"] = "Both";
    })(exports.RenderHiResScenarioOutputFlipMode || (exports.RenderHiResScenarioOutputFlipMode = {}));
    (function (RenderHiResScenarioOutputRotateMode) {
        RenderHiResScenarioOutputRotateMode["None"] = "None";
        RenderHiResScenarioOutputRotateMode["Rotate90"] = "Rotate90";
        RenderHiResScenarioOutputRotateMode["Rotate180"] = "Rotate180";
        RenderHiResScenarioOutputRotateMode["Rotate270"] = "Rotate270";
        RenderHiResScenarioOutputRotateMode["Auto"] = "Auto";
    })(exports.RenderHiResScenarioOutputRotateMode || (exports.RenderHiResScenarioOutputRotateMode = {}));
    (function (OrderDataItemValueType) {
        OrderDataItemValueType["PlainText"] = "PlainText";
        OrderDataItemValueType["CommaSeparatedList"] = "CommaSeparatedList";
        OrderDataItemValueType["SerializedJson"] = "SerializedJson";
    })(exports.OrderDataItemValueType || (exports.OrderDataItemValueType = {}));
    (function (StorefrontType) {
        StorefrontType["Custom"] = "Custom";
        StorefrontType["ShopifyLegacy"] = "ShopifyLegacy";
        StorefrontType["DocketManager"] = "DocketManager";
        StorefrontType["CustomSaml"] = "CustomSaml";
        StorefrontType["NopCommerce"] = "NopCommerce";
        StorefrontType["WooCommerce"] = "WooCommerce";
        StorefrontType["Magento"] = "Magento";
        StorefrontType["BigCommerce"] = "BigCommerce";
        StorefrontType["Shopify"] = "Shopify";
        StorefrontType["ShopifyCustom"] = "ShopifyCustom";
    })(exports.StorefrontType || (exports.StorefrontType = {}));
    var ApiException = /** @class */ (function (_super) {
        __extends(ApiException, _super);
        function ApiException(message, status, response, headers, result) {
            var _this = _super.call(this) || this;
            _this.isApiException = true;
            _this.message = message;
            _this.status = status;
            _this.response = response;
            _this.headers = headers;
            _this.result = result;
            return _this;
        }
        ApiException.isApiException = function (obj) {
            return obj.isApiException === true;
        };
        return ApiException;
    }(Error));
    function throwException(message, status, response, headers, result) {
        return rxjs.throwError(new ApiException(message, status, response, headers, result));
    }
    function blobToText(blob) {
        return new rxjs.Observable(function (observer) {
            if (!blob) {
                observer.next("");
                observer.complete();
            }
            else {
                var reader = new FileReader();
                reader.onload = function (event) {
                    observer.next(event.target.result);
                    observer.complete();
                };
                reader.readAsText(blob);
            }
        });
    }

    // @dynamic
    function CreateApiClientConfiguration(token, apiUrl, apiKey) {
        if (apiKey === void 0) { apiKey = 'ApiKey'; }
        var apiConf = new ApiClientConfiguration();
        apiConf.apiKey = apiKey;
        apiConf.apiUrl = apiUrl;
        apiConf.setAuthorizationToken(token);
        return apiConf;
    }
    var StorefrontModule = /** @class */ (function () {
        function StorefrontModule() {
        }
        StorefrontModule.forRoot = function (token, apiUrl, apiKey) {
            if (apiKey === void 0) { apiKey = 'ApiKey'; }
            return {
                ngModule: StorefrontModule,
                providers: [
                    {
                        provide: API_BASE_URL,
                        useValue: apiUrl
                    },
                    {
                        provide: ApiClientConfiguration,
                        useFactory: CreateApiClientConfiguration.bind(this, token, apiUrl, apiKey)
                    },
                ]
            };
        };
        return StorefrontModule;
    }());
    StorefrontModule.decorators = [
        { type: i0.NgModule, args: [{
                    declarations: [],
                    imports: [],
                    exports: []
                },] }
    ];

    /*
     * Public API Surface of client
     */

    /**
     * Generated bundle index. Do not edit.
     */

    exports.API_BASE_URL = API_BASE_URL;
    exports.ApiClientBase = ApiClientBase;
    exports.ApiClientConfiguration = ApiClientConfiguration;
    exports.ApiException = ApiException;
    exports.BuildInfoApiClient = BuildInfoApiClient;
    exports.CreateApiClientConfiguration = CreateApiClientConfiguration;
    exports.ProcessingPipelinesApiClient = ProcessingPipelinesApiClient;
    exports.ProductBundlesApiClient = ProductBundlesApiClient;
    exports.ProductLinksApiClient = ProductLinksApiClient;
    exports.ProductReferencesApiClient = ProductReferencesApiClient;
    exports.ProductSpecificationsApiClient = ProductSpecificationsApiClient;
    exports.ProductsApiClient = ProductsApiClient;
    exports.ProjectsApiClient = ProjectsApiClient;
    exports.StorefrontModule = StorefrontModule;
    exports.StorefrontUsersApiClient = StorefrontUsersApiClient;
    exports.StorefrontsApiClient = StorefrontsApiClient;
    exports.TenantInfoApiClient = TenantInfoApiClient;

    Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=aurigma-ng-storefront-api-client.umd.js.map