"use strict";
var __decorate = (this && this.__decorate) || function (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;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SearchRequest = void 0;
const ta_json_1 = require("ta-json");
const aggregation_request_resource_1 = require("./aggregation-request-resource");
const field_filter_request_resource_1 = require("./field-filter-request-resource");
const nested_relation_info_1 = require("./nested-relation-info");
const search_group_request_resource_1 = require("./search-group-request-resource");
const selection_pool_filter_resource_1 = require("./selection-pool-filter-resource");
const sorting_request_resource_1 = require("./sorting-request-resource");
const visual_search_request_resource_1 = require("./visual-search-request-resource");
let SearchRequest = class SearchRequest {
    //? Extension data
    constructor(init) {
        this.culture = "Invariant";
        this.skip = 0;
        this.fieldFilters = [];
        this.fullTextFilters = [];
        this.fields = [];
        this.aggregations = [];
        this.isInitialRequest = false;
        this.takeUserSettings = false;
        Object.assign(this, init);
    }
};
exports.SearchRequest = SearchRequest;
__decorate([
    (0, ta_json_1.JsonProperty)("query"),
    __metadata("design:type", String)
], SearchRequest.prototype, "query", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("logical_grouping_template"),
    __metadata("design:type", String)
], SearchRequest.prototype, "logicalGroupingTemplate", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("defaults"),
    __metadata("design:type", String)
], SearchRequest.prototype, "searchDefaults", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("configuration_category"),
    __metadata("design:type", String)
], SearchRequest.prototype, "configurationCategory", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("component"),
    __metadata("design:type", Number)
], SearchRequest.prototype, "componentId", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("culture"),
    __metadata("design:type", String)
], SearchRequest.prototype, "culture", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("sorting"),
    __metadata("design:type", sorting_request_resource_1.SortingRequestResource)
], SearchRequest.prototype, "sorting", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("skip"),
    __metadata("design:type", Number)
], SearchRequest.prototype, "skip", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("take"),
    __metadata("design:type", Number)
], SearchRequest.prototype, "take", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("filters"),
    (0, ta_json_1.JsonElementType)(field_filter_request_resource_1.FieldFilterRequestResource),
    __metadata("design:type", Array)
], SearchRequest.prototype, "fieldFilters", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("fulltext"),
    (0, ta_json_1.JsonElementType)(String),
    __metadata("design:type", Array)
], SearchRequest.prototype, "fullTextFilters", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("fields"),
    (0, ta_json_1.JsonElementType)(String),
    __metadata("design:type", Array)
], SearchRequest.prototype, "fields", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("saved_selection"),
    __metadata("design:type", Number)
], SearchRequest.prototype, "savedSelection", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("view"),
    __metadata("design:type", String)
], SearchRequest.prototype, "view", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("calendarStartDate"),
    __metadata("design:type", Object)
], SearchRequest.prototype, "calendarStartDate", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("calendarStopDate"),
    __metadata("design:type", Object)
], SearchRequest.prototype, "calendarStopDate", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("selection_pool"),
    __metadata("design:type", selection_pool_filter_resource_1.SelectionPoolFilterResource)
], SearchRequest.prototype, "selectionPool", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("aggregations"),
    (0, ta_json_1.JsonElementType)(aggregation_request_resource_1.AggregationRequestResource),
    __metadata("design:type", Array)
], SearchRequest.prototype, "aggregations", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("nested_relations"),
    (0, ta_json_1.JsonElementType)(nested_relation_info_1.NestedRelationInfo),
    __metadata("design:type", Array)
], SearchRequest.prototype, "nestedRelations", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("group"),
    __metadata("design:type", search_group_request_resource_1.SearchGroupRequestResource)
], SearchRequest.prototype, "group", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_initial_request"),
    __metadata("design:type", Boolean)
], SearchRequest.prototype, "isInitialRequest", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("take_user_settings"),
    __metadata("design:type", Boolean)
], SearchRequest.prototype, "takeUserSettings", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("details_entity_id"),
    __metadata("design:type", Number)
], SearchRequest.prototype, "detailsEntityId", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("l10n"),
    __metadata("design:type", Boolean)
], SearchRequest.prototype, "l10n", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("visualSearch"),
    __metadata("design:type", visual_search_request_resource_1.VisualSearchRequestResource)
], SearchRequest.prototype, "visualSearch", void 0);
exports.SearchRequest = SearchRequest = __decorate([
    (0, ta_json_1.JsonObject)(),
    __metadata("design:paramtypes", [Object])
], SearchRequest);
//# sourceMappingURL=search-request.js.map