"use strict";
var __extends = (this && this.__extends) || (function () {
    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);
    };
    return function (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 __());
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultExtractor = exports.Routes = void 0;
var BringgException_1 = require("../../Core/BringgException");
var Route_1 = require("../../Services/Route");
var SessionBasedService_1 = require("../../Services/SessionBasedService");
exports.Routes = {
    GET: new Route_1.Route('/merchant/customer_configuration', 0 /* HttpMethod.GET */),
    UPDATE: new Route_1.Route('/merchant/customer_configuration', 2 /* HttpMethod.PUT */)
};
var defaultExtractor = function (config) { return config; };
exports.defaultExtractor = defaultExtractor;
var CustomerConfigurationService = /** @class */ (function (_super) {
    __extends(CustomerConfigurationService, _super);
    function CustomerConfigurationService(session) {
        return _super.call(this, session.config.getApiEndpoint(), session) || this;
    }
    CustomerConfigurationService.prototype.get = function () {
        return this.handleAuthorizedRequest({
            route: exports.Routes.GET,
            extractor: exports.defaultExtractor,
            exceptionProducer: BringgException_1.BringgException.serviceException('Failed to get customer configurations')
        });
    };
    CustomerConfigurationService.prototype.update = function (configuration) {
        return this.handleAuthorizedRequest({
            route: exports.Routes.UPDATE,
            extractor: exports.defaultExtractor,
            exceptionProducer: BringgException_1.BringgException.serviceException('Failed to update customer configurations'),
            payload: configuration
        });
    };
    return CustomerConfigurationService;
}(SessionBasedService_1.SessionBasedService));
exports.default = CustomerConfigurationService;
//# sourceMappingURL=customer.configuration.service.js.map