var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
define(["require", "exports", "../widgets/magento2.abstract.api.service"], function (require, exports, magento2_abstract_api_service_1) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true });
    var SparepartsService = /** @class */ (function (_super) {
        __extends(SparepartsService, _super);
        function SparepartsService($http, $q, API_URL, API_PRODUCTS_ENDPOINT) {
            var _this = _super.call(this, $http, $q, API_URL, API_PRODUCTS_ENDPOINT) || this;
            _this.$http = $http;
            _this.$q = $q;
            _this.API_URL = API_URL;
            _this.API_PRODUCTS_ENDPOINT = API_PRODUCTS_ENDPOINT;
            _this.attribute = 'kopfhoerermodell';
            return _this;
        }
        SparepartsService.prototype.get = function (categories) {
            return _super.prototype.get.call(this, 'category_id', categories, 'created_at', 'DESC', 'in', '500');
        };
        SparepartsService.prototype.prepareResponse = function (res) {
            return {
                attributeValues: this.getAttributeValues(res.data.items, this.attribute),
                products: res.data.items
            };
        };
        return SparepartsService;
    }(magento2_abstract_api_service_1.Magento2AbstractApiService));
    exports.SparepartsService = SparepartsService;
});
//# sourceMappingURL=spareparts.service.js.map