"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
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 __importStar = (this && this.__importStar) || function (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;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.StringPropertyDefinitionResource = exports.LongPropertyDefinitionResource = exports.JsonPropertyDefinitionResource = exports.IntegerPropertyDefinitionResource = exports.DecimalPropertyDefinitionResource = exports.DateTimeOffsetPropertyDefinitionResource = exports.DateTimePropertyDefinitionResource = exports.BooleanPropertyDefinitionResource = exports.PropertyDefinitionResource = void 0;
const ta_json_1 = require("ta-json");
const data_type_1 = __importStar(require("../contracts/base/data-type"));
const member_definition_type_1 = require("../contracts/base/member-definition-type");
const string_content_type_1 = require("../contracts/base/string-content-type");
const link_1 = __importDefault(require("../link"));
const conditional_validation_resource_1 = require("./conditional-validation-resource");
const member_definition_resource_1 = require("./member-definition-resource");
let PropertyDefinitionResource = class PropertyDefinitionResource extends member_definition_resource_1.MemberDefinitionResource {
    get definitionType() {
        return member_definition_type_1.MemberDefinitionType.Property;
    }
};
exports.PropertyDefinitionResource = PropertyDefinitionResource;
__decorate([
    (0, ta_json_1.JsonProperty)("is_indexed"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "indexed", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_mandatory"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isMandatory", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_multilanguage"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isMultiLanguage", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_multivalue"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isMultiValue", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_unique"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isUnique", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("boost"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "boost", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("included_in_content"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "includeInContent", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("included_in_completion"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "includeInCompletion", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("ignore_on_export"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "ignoreOnExport", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("stored_in_graph"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "storedInGraph", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("conditional_validation"),
    (0, ta_json_1.JsonConverter)(conditional_validation_resource_1.ConditionalValidationResourceConverter),
    __metadata("design:type", conditional_validation_resource_1.ConditionalValidationResource)
], PropertyDefinitionResource.prototype, "conditionalValidation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("validation_expression"),
    __metadata("design:type", Object)
], PropertyDefinitionResource.prototype, "validationExpression", void 0);
exports.PropertyDefinitionResource = PropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)()
], PropertyDefinitionResource);
let BooleanPropertyDefinitionResource = class BooleanPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.Boolean);
        Object.assign(this, init);
    }
};
exports.BooleanPropertyDefinitionResource = BooleanPropertyDefinitionResource;
exports.BooleanPropertyDefinitionResource = BooleanPropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.Boolean),
    __metadata("design:paramtypes", [Object])
], BooleanPropertyDefinitionResource);
let DateTimePropertyDefinitionResource = class DateTimePropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.DateTime);
        Object.assign(this, init);
    }
};
exports.DateTimePropertyDefinitionResource = DateTimePropertyDefinitionResource;
exports.DateTimePropertyDefinitionResource = DateTimePropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.DateTime),
    __metadata("design:paramtypes", [Object])
], DateTimePropertyDefinitionResource);
let DateTimeOffsetPropertyDefinitionResource = class DateTimeOffsetPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.DateTimeOffset);
        Object.assign(this, init);
    }
};
exports.DateTimeOffsetPropertyDefinitionResource = DateTimeOffsetPropertyDefinitionResource;
exports.DateTimeOffsetPropertyDefinitionResource = DateTimeOffsetPropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.DateTimeOffset),
    __metadata("design:paramtypes", [Object])
], DateTimeOffsetPropertyDefinitionResource);
let DecimalPropertyDefinitionResource = class DecimalPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.Decimal);
        Object.assign(this, init);
    }
};
exports.DecimalPropertyDefinitionResource = DecimalPropertyDefinitionResource;
exports.DecimalPropertyDefinitionResource = DecimalPropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.Decimal),
    __metadata("design:paramtypes", [Object])
], DecimalPropertyDefinitionResource);
let IntegerPropertyDefinitionResource = class IntegerPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.Integer);
        Object.assign(this, init);
    }
};
exports.IntegerPropertyDefinitionResource = IntegerPropertyDefinitionResource;
exports.IntegerPropertyDefinitionResource = IntegerPropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.Integer),
    __metadata("design:paramtypes", [Object])
], IntegerPropertyDefinitionResource);
let JsonPropertyDefinitionResource = class JsonPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.Json);
        this.contentType = null;
        Object.assign(this, init);
    }
};
exports.JsonPropertyDefinitionResource = JsonPropertyDefinitionResource;
__decorate([
    (0, ta_json_1.JsonProperty)("content_type"),
    __metadata("design:type", Object)
], JsonPropertyDefinitionResource.prototype, "contentType", void 0);
exports.JsonPropertyDefinitionResource = JsonPropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.Json),
    __metadata("design:paramtypes", [Object])
], JsonPropertyDefinitionResource);
let LongPropertyDefinitionResource = class LongPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.Long);
        Object.assign(this, init);
    }
};
exports.LongPropertyDefinitionResource = LongPropertyDefinitionResource;
exports.LongPropertyDefinitionResource = LongPropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.Long),
    __metadata("design:paramtypes", [Object])
], LongPropertyDefinitionResource);
let StringPropertyDefinitionResource = class StringPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(data_type_1.PropertyDataType.String);
        this.contentType = string_content_type_1.StringContentType.SingleLine;
        this.validationExpression = null;
        this.dataSource = null;
        Object.assign(this, init);
    }
};
exports.StringPropertyDefinitionResource = StringPropertyDefinitionResource;
__decorate([
    (0, ta_json_1.JsonProperty)("content_type"),
    __metadata("design:type", String)
], StringPropertyDefinitionResource.prototype, "contentType", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("validation_expression"),
    __metadata("design:type", Object)
], StringPropertyDefinitionResource.prototype, "validationExpression", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("datasource"),
    (0, ta_json_1.JsonType)(link_1.default),
    __metadata("design:type", Object)
], StringPropertyDefinitionResource.prototype, "dataSource", void 0);
exports.StringPropertyDefinitionResource = StringPropertyDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.String),
    __metadata("design:paramtypes", [Object])
], StringPropertyDefinitionResource);
//# sourceMappingURL=property-definition-resource.js.map