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);
};
import { JsonConverter, JsonDiscriminatorValue, JsonObject, JsonProperty, JsonType } from "ta-json";
import DataType, { PropertyDataType } from "../contracts/base/data-type";
import { MemberDefinitionType } from "../contracts/base/member-definition-type";
import { StringContentType } from "../contracts/base/string-content-type";
import Link from "../link";
import { ConditionalValidationResource, ConditionalValidationResourceConverter, } from "./conditional-validation-resource";
import { MemberDefinitionResource } from "./member-definition-resource";
let PropertyDefinitionResource = class PropertyDefinitionResource extends MemberDefinitionResource {
    get definitionType() {
        return MemberDefinitionType.Property;
    }
};
__decorate([
    JsonProperty("is_indexed"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "indexed", void 0);
__decorate([
    JsonProperty("is_mandatory"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isMandatory", void 0);
__decorate([
    JsonProperty("is_multilanguage"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isMultiLanguage", void 0);
__decorate([
    JsonProperty("is_multivalue"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isMultiValue", void 0);
__decorate([
    JsonProperty("is_unique"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "isUnique", void 0);
__decorate([
    JsonProperty("boost"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "boost", void 0);
__decorate([
    JsonProperty("included_in_content"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "includeInContent", void 0);
__decorate([
    JsonProperty("included_in_completion"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "includeInCompletion", void 0);
__decorate([
    JsonProperty("ignore_on_export"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "ignoreOnExport", void 0);
__decorate([
    JsonProperty("stored_in_graph"),
    __metadata("design:type", Boolean)
], PropertyDefinitionResource.prototype, "storedInGraph", void 0);
__decorate([
    JsonProperty("conditional_validation"),
    JsonConverter(ConditionalValidationResourceConverter),
    __metadata("design:type", ConditionalValidationResource)
], PropertyDefinitionResource.prototype, "conditionalValidation", void 0);
__decorate([
    JsonProperty("validation_expression"),
    __metadata("design:type", Object)
], PropertyDefinitionResource.prototype, "validationExpression", void 0);
PropertyDefinitionResource = __decorate([
    JsonObject()
], PropertyDefinitionResource);
export { PropertyDefinitionResource };
let BooleanPropertyDefinitionResource = class BooleanPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.Boolean);
        Object.assign(this, init);
    }
};
BooleanPropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.Boolean),
    __metadata("design:paramtypes", [Object])
], BooleanPropertyDefinitionResource);
export { BooleanPropertyDefinitionResource };
let DateTimePropertyDefinitionResource = class DateTimePropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.DateTime);
        Object.assign(this, init);
    }
};
DateTimePropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.DateTime),
    __metadata("design:paramtypes", [Object])
], DateTimePropertyDefinitionResource);
export { DateTimePropertyDefinitionResource };
let DateTimeOffsetPropertyDefinitionResource = class DateTimeOffsetPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.DateTimeOffset);
        Object.assign(this, init);
    }
};
DateTimeOffsetPropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.DateTimeOffset),
    __metadata("design:paramtypes", [Object])
], DateTimeOffsetPropertyDefinitionResource);
export { DateTimeOffsetPropertyDefinitionResource };
let DecimalPropertyDefinitionResource = class DecimalPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.Decimal);
        Object.assign(this, init);
    }
};
DecimalPropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.Decimal),
    __metadata("design:paramtypes", [Object])
], DecimalPropertyDefinitionResource);
export { DecimalPropertyDefinitionResource };
let IntegerPropertyDefinitionResource = class IntegerPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.Integer);
        Object.assign(this, init);
    }
};
IntegerPropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.Integer),
    __metadata("design:paramtypes", [Object])
], IntegerPropertyDefinitionResource);
export { IntegerPropertyDefinitionResource };
let JsonPropertyDefinitionResource = class JsonPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.Json);
        this.contentType = null;
        Object.assign(this, init);
    }
};
__decorate([
    JsonProperty("content_type"),
    __metadata("design:type", Object)
], JsonPropertyDefinitionResource.prototype, "contentType", void 0);
JsonPropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.Json),
    __metadata("design:paramtypes", [Object])
], JsonPropertyDefinitionResource);
export { JsonPropertyDefinitionResource };
let LongPropertyDefinitionResource = class LongPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.Long);
        Object.assign(this, init);
    }
};
LongPropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.Long),
    __metadata("design:paramtypes", [Object])
], LongPropertyDefinitionResource);
export { LongPropertyDefinitionResource };
let StringPropertyDefinitionResource = class StringPropertyDefinitionResource extends PropertyDefinitionResource {
    constructor(init) {
        super(PropertyDataType.String);
        this.contentType = StringContentType.SingleLine;
        this.validationExpression = null;
        this.dataSource = null;
        Object.assign(this, init);
    }
};
__decorate([
    JsonProperty("content_type"),
    __metadata("design:type", String)
], StringPropertyDefinitionResource.prototype, "contentType", void 0);
__decorate([
    JsonProperty("validation_expression"),
    __metadata("design:type", Object)
], StringPropertyDefinitionResource.prototype, "validationExpression", void 0);
__decorate([
    JsonProperty("datasource"),
    JsonType(Link),
    __metadata("design:type", Object)
], StringPropertyDefinitionResource.prototype, "dataSource", void 0);
StringPropertyDefinitionResource = __decorate([
    JsonObject(),
    JsonDiscriminatorValue(DataType.String),
    __metadata("design:paramtypes", [Object])
], StringPropertyDefinitionResource);
export { StringPropertyDefinitionResource };
//# sourceMappingURL=property-definition-resource.js.map