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 { permissionTypes, } from "@meta/core/resources/enums/permission-enums";
import { fdResourceIds } from "@fd-toolbox/constants/fd-resource-ids";
import { resourceMetaId } from "@meta/decorators/resource-id";
import { permissionProps } from "@meta/core/resources/permissions/props/permission-props";
import { descriptionBasedOnPropertyValue } from "@meta/decorators/description-based-on-property-value";
import { expandDescription } from "@meta/decorators/expand-description-properties";
import { flagsEnum } from "@meta/decorators/flags-enum";
import { notDisplayable } from "@meta/decorators/not-displayable";
import { requiredIfPropHasValue } from "@meta/decorators/required-if-prop-has-value";
/** @monorepo-internal */
let Permission = class Permission {
    id;
    workspaceId;
    type;
    resourceId;
    resourcePropertyId;
    name;
    action;
    resource;
    resourceProperty;
    permissionPackageToPermissionList;
    roleToPermissionList;
};
__decorate([
    descriptionBasedOnPropertyValue(permissionTypes.resource, permissionProps.resourceId, permissionProps.action),
    __metadata("design:type", Number)
], Permission.prototype, "type", void 0);
__decorate([
    expandDescription(),
    requiredIfPropHasValue(permissionProps.type, permissionTypes.resource),
    __metadata("design:type", String)
], Permission.prototype, "resourceId", void 0);
__decorate([
    notDisplayable(),
    expandDescription(),
    requiredIfPropHasValue(permissionProps.type, permissionTypes.property),
    __metadata("design:type", String)
], Permission.prototype, "resourcePropertyId", void 0);
__decorate([
    requiredIfPropHasValue(permissionProps.type, permissionTypes.default),
    __metadata("design:type", String)
], Permission.prototype, "name", void 0);
__decorate([
    flagsEnum(),
    __metadata("design:type", Number)
], Permission.prototype, "action", void 0);
Permission = __decorate([
    resourceMetaId(fdResourceIds.permission)
], Permission);
export { Permission };
