"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);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RelationDefinitionResource = void 0;
const ta_json_1 = require("ta-json");
const data_type_1 = __importDefault(require("../contracts/base/data-type"));
const member_definition_type_1 = require("../contracts/base/member-definition-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 RelationDefinitionResource = class RelationDefinitionResource extends member_definition_resource_1.MemberDefinitionResource {
    get definitionType() {
        return member_definition_type_1.MemberDefinitionType.Relation;
    }
    constructor(init) {
        super(data_type_1.default.Relation);
        this.allowNavigation = true;
        this.nestedProperties = [];
        this.associatedLabels = {};
        Object.assign(this, init);
    }
};
exports.RelationDefinitionResource = RelationDefinitionResource;
__decorate([
    (0, ta_json_1.JsonProperty)("role"),
    __metadata("design:type", String)
], RelationDefinitionResource.prototype, "role", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("cardinality"),
    __metadata("design:type", String)
], RelationDefinitionResource.prototype, "cardinality", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("child_is_mandatory"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "childIsMandatory", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("child_conditional_validation"),
    (0, ta_json_1.JsonConverter)(conditional_validation_resource_1.ConditionalValidationResourceConverter),
    __metadata("design:type", conditional_validation_resource_1.ConditionalValidationResource)
], RelationDefinitionResource.prototype, "childConditionalValidation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("parent_is_mandatory"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "parentIsMandatory", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("parent_conditional_validation"),
    (0, ta_json_1.JsonConverter)(conditional_validation_resource_1.ConditionalValidationResourceConverter),
    __metadata("design:type", conditional_validation_resource_1.ConditionalValidationResource)
], RelationDefinitionResource.prototype, "parentConditionalValidation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("inherits_security"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "inheritsSecurity", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("allow_navigation"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "allowNavigation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_nested"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "isNested", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("nested_properties"),
    (0, ta_json_1.JsonElementType)(String),
    __metadata("design:type", Array)
], RelationDefinitionResource.prototype, "nestedProperties", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("nested_permissions"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "nestedPermissions", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_taxonomy_relation"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "isTaxonomyRelation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_taxonomy_hierarchy_relation"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "isTaxonomyHierarchyRelation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("content_is_copied"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "contentIsCopied", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("completion_is_copied"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "completionIsCopied", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_path_relation"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "isPathRelation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_path_hierarchy_relation"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "isPathHierarchyRelation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("path_hierarchy_score"),
    __metadata("design:type", String)
], RelationDefinitionResource.prototype, "pathHierarchyScore", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("is_rendition_relation"),
    __metadata("design:type", Boolean)
], RelationDefinitionResource.prototype, "isRenditionRelation", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("associated_labels"),
    __metadata("design:type", Object)
], RelationDefinitionResource.prototype, "associatedLabels", void 0);
__decorate([
    (0, ta_json_1.JsonProperty)("associated_entitydefinition"),
    __metadata("design:type", link_1.default)
], RelationDefinitionResource.prototype, "associatedEntityDefinition", void 0);
exports.RelationDefinitionResource = RelationDefinitionResource = __decorate([
    (0, ta_json_1.JsonObject)(),
    (0, ta_json_1.JsonDiscriminatorValue)(data_type_1.default.Relation),
    __metadata("design:paramtypes", [Object])
], RelationDefinitionResource);
//# sourceMappingURL=relation-definition-resource.js.map