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 DockerHost from "./DockerHost";
import Host from "./Host";
import KubernetesCluster from "./KubernetesCluster";
import Label from "./Label";
import Monitor from "./Monitor";
import MonitorStatus from "./MonitorStatus";
import Project from "./Project";
import ScheduledMaintenanceState from "./ScheduledMaintenanceState";
import Service from "./Service";
import StatusPage from "./StatusPage";
import User from "./User";
import BaseModel from "./DatabaseBaseModel/DatabaseBaseModel";
import Route from "../../Types/API/Route";
import ColumnAccessControl from "../../Types/Database/AccessControl/ColumnAccessControl";
import OperationalResource from "../../Types/Database/AccessControl/OperationalResource";
import TableAccessControl from "../../Types/Database/AccessControl/TableAccessControl";
import AccessControlColumn from "../../Types/Database/AccessControlColumn";
import ColumnLength from "../../Types/Database/ColumnLength";
import ColumnType from "../../Types/Database/ColumnType";
import CrudApiEndpoint from "../../Types/Database/CrudApiEndpoint";
import EnableDocumentation from "../../Types/Database/EnableDocumentation";
import EnableMCP from "../../Types/Database/EnableMCP";
import EnableAuditLog from "../../Types/Database/EnableAuditLog";
import EnableWorkflow from "../../Types/Database/EnableWorkflow";
import MultiTenentQueryAllowed from "../../Types/Database/MultiTenentQueryAllowed";
import SlugifyColumn from "../../Types/Database/SlugifyColumn";
import TableColumn from "../../Types/Database/TableColumn";
import TableColumnType from "../../Types/Database/TableColumnType";
import TableMetadata from "../../Types/Database/TableMetadata";
import TenantColumn from "../../Types/Database/TenantColumn";
import IconProp from "../../Types/Icon/IconProp";
import ObjectID from "../../Types/ObjectID";
import Permission from "../../Types/Permission";
import StatusPageSubscriberNotificationStatus from "../../Types/StatusPage/StatusPageSubscriberNotificationStatus";
import { Column, Entity, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, } from "typeorm";
import Recurring from "../../Types/Events/Recurring";
let ScheduledMaintenance = class ScheduledMaintenance extends BaseModel {
    constructor() {
        super(...arguments);
        this.project = undefined;
        this.projectId = undefined;
        this.title = undefined;
        this.description = undefined;
        this.slug = undefined;
        this.createdByUser = undefined;
        this.createdByUserId = undefined;
        this.deletedByUser = undefined;
        this.deletedByUserId = undefined;
        this.monitors = undefined; // monitors affected by this scheduledMaintenance.
        this.hosts = undefined;
        this.kubernetesClusters = undefined;
        this.dockerHosts = undefined;
        this.services = undefined;
        this.statusPages = undefined; // visible on which status page?
        this.labels = undefined;
        this.currentScheduledMaintenanceState = undefined;
        this.currentScheduledMaintenanceStateId = undefined;
        this.changeMonitorStatusTo = undefined;
        this.changeMonitorStatusToId = undefined;
        this.startsAt = undefined;
        this.endsAt = undefined;
        this.subscriberNotificationStatusOnEventScheduled = undefined;
        this.subscriberNotificationStatusMessage = undefined;
        this.shouldStatusPageSubscribersBeNotifiedOnEventCreated = undefined;
        this.shouldStatusPageSubscribersBeNotifiedWhenEventChangedToOngoing = undefined;
        this.shouldStatusPageSubscribersBeNotifiedWhenEventChangedToEnded = undefined;
        this.customFields = undefined;
        this.isOwnerNotifiedOfResourceCreation = undefined;
        this.sendSubscriberNotificationsOnBeforeTheEvent = undefined;
        this.nextSubscriberNotificationBeforeTheEventAt = undefined;
        this.scheduledMaintenanceNumber = undefined;
        this.scheduledMaintenanceNumberWithPrefix = undefined;
        this.postUpdatesToWorkspaceChannels = undefined;
        this.isVisibleOnStatusPage = undefined;
    }
};
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "projectId",
        type: TableColumnType.Entity,
        modelType: Project,
        title: "Project",
        description: "Relation to Project Resource in which this object belongs",
    }),
    ManyToOne(() => {
        return Project;
    }, {
        eager: false,
        nullable: true,
        onDelete: "CASCADE",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "projectId" }),
    __metadata("design:type", Project)
], ScheduledMaintenance.prototype, "project", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: true,
        canReadOnRelationQuery: true,
        title: "Project ID",
        description: "ID of your OneUptime Project in which this object belongs",
        example: "5f8b9c0d-e1a2-4b3c-8d5e-6f7a8b9c0d1e",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: false,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], ScheduledMaintenance.prototype, "projectId", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    Index(),
    TableColumn({
        required: true,
        type: TableColumnType.ShortText,
        canReadOnRelationQuery: true,
        title: "Title",
        description: "Title of this scheduled event.",
        example: "Database Migration and Server Upgrade",
    }),
    Column({
        nullable: false,
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
    }),
    __metadata("design:type", String)
], ScheduledMaintenance.prototype, "title", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.Markdown,
        title: "Description",
        description: "Description of this scheduled event that will show up on Status Page. This is in markdown.",
        example: "We will be performing routine database maintenance and upgrading our servers to improve performance. Services may experience brief interruptions during this window.",
    }),
    Column({
        nullable: true,
        type: ColumnType.Markdown,
    }),
    __metadata("design:type", String)
], ScheduledMaintenance.prototype, "description", void 0);
__decorate([
    Index(),
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        required: true,
        unique: true,
        type: TableColumnType.Slug,
        computed: true,
        title: "Slug",
        description: "Friendly globally unique name for your object",
    }),
    Column({
        nullable: false,
        type: ColumnType.Slug,
        length: ColumnLength.Slug,
        unique: true,
    }),
    __metadata("design:type", String)
], ScheduledMaintenance.prototype, "slug", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "createdByUserId",
        type: TableColumnType.Entity,
        modelType: User,
        title: "Created by User",
        description: "Relation to User who created this object (if this object was created by a User)",
    }),
    ManyToOne(() => {
        return User;
    }, {
        eager: false,
        nullable: true,
        onDelete: "SET NULL",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "createdByUserId" }),
    __metadata("design:type", User)
], ScheduledMaintenance.prototype, "createdByUser", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ObjectID,
        title: "Created by User ID",
        description: "User ID who created this object (if this object was created by a User)",
        example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], ScheduledMaintenance.prototype, "createdByUserId", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "deletedByUserId",
        type: TableColumnType.Entity,
        title: "Deleted by User",
        modelType: User,
        description: "Relation to User who deleted this object (if this object was deleted by a User)",
    }),
    ManyToOne(() => {
        return User;
    }, {
        cascade: false,
        eager: false,
        nullable: true,
        onDelete: "SET NULL",
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "deletedByUserId" }),
    __metadata("design:type", User)
], ScheduledMaintenance.prototype, "deletedByUser", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        type: TableColumnType.ObjectID,
        title: "Deleted by User ID",
        description: "User ID who deleted this object (if this object was deleted by a User)",
        example: "b2c3d4e5-f6a7-8901-bcde-f2345678901a",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], ScheduledMaintenance.prototype, "deletedByUserId", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.EntityArray,
        modelType: Monitor,
        title: "Monitors",
        description: "List of monitors attached to this event",
    }),
    ManyToMany(() => {
        return Monitor;
    }, { eager: false }),
    JoinTable({
        name: "ScheduledMaintenanceMonitor",
        inverseJoinColumn: {
            name: "monitorId",
            referencedColumnName: "_id",
        },
        joinColumn: {
            name: "scheduledMaintenanceId",
            referencedColumnName: "_id",
        },
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "monitors", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.EntityArray,
        modelType: Host,
        title: "Hosts",
        description: "List of hosts affected by this event.",
    }),
    ManyToMany(() => {
        return Host;
    }, { eager: false }),
    JoinTable({
        name: "ScheduledMaintenanceHost",
        inverseJoinColumn: {
            name: "hostId",
            referencedColumnName: "_id",
        },
        joinColumn: {
            name: "scheduledMaintenanceId",
            referencedColumnName: "_id",
        },
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "hosts", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.EntityArray,
        modelType: KubernetesCluster,
        title: "Kubernetes Clusters",
        description: "List of Kubernetes clusters affected by this event.",
    }),
    ManyToMany(() => {
        return KubernetesCluster;
    }, { eager: false }),
    JoinTable({
        name: "ScheduledMaintenanceKubernetesCluster",
        inverseJoinColumn: {
            name: "kubernetesClusterId",
            referencedColumnName: "_id",
        },
        joinColumn: {
            name: "scheduledMaintenanceId",
            referencedColumnName: "_id",
        },
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "kubernetesClusters", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.EntityArray,
        modelType: DockerHost,
        title: "Docker Hosts",
        description: "List of Docker hosts affected by this event.",
    }),
    ManyToMany(() => {
        return DockerHost;
    }, { eager: false }),
    JoinTable({
        name: "ScheduledMaintenanceDockerHost",
        inverseJoinColumn: {
            name: "dockerHostId",
            referencedColumnName: "_id",
        },
        joinColumn: {
            name: "scheduledMaintenanceId",
            referencedColumnName: "_id",
        },
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "dockerHosts", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.EntityArray,
        modelType: Service,
        title: "Services",
        description: "List of services affected by this event.",
    }),
    ManyToMany(() => {
        return Service;
    }, { eager: false }),
    JoinTable({
        name: "ScheduledMaintenanceService",
        inverseJoinColumn: {
            name: "serviceId",
            referencedColumnName: "_id",
        },
        joinColumn: {
            name: "scheduledMaintenanceId",
            referencedColumnName: "_id",
        },
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "services", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.EntityArray,
        modelType: StatusPage,
        title: "Status Pages",
        description: "List of status pages to show this event on",
    }),
    ManyToMany(() => {
        return StatusPage;
    }, { eager: false }),
    JoinTable({
        name: "ScheduledMaintenanceStatusPage",
        inverseJoinColumn: {
            name: "statusPageId",
            referencedColumnName: "_id",
        },
        joinColumn: {
            name: "scheduledMaintenanceId",
            referencedColumnName: "_id",
        },
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "statusPages", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        required: false,
        type: TableColumnType.EntityArray,
        modelType: Label,
        title: "Labels",
        description: "Relation to Labels Array where this object is categorized in.",
    }),
    ManyToMany(() => {
        return Label;
    }, { eager: false }),
    JoinTable({
        name: "ScheduledMaintenanceLabel",
        inverseJoinColumn: {
            name: "labelId",
            referencedColumnName: "_id",
        },
        joinColumn: {
            name: "scheduledMaintenanceId",
            referencedColumnName: "_id",
        },
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "labels", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        manyToOneRelationColumn: "currentScheduledMaintenanceStateId",
        type: TableColumnType.Entity,
        modelType: ScheduledMaintenanceState,
        title: "Current Scheduled Maintenance State",
        description: "Relation to Scheduled Maintenance State. The state the event currently is in.",
    }),
    ManyToOne(() => {
        return ScheduledMaintenanceState;
    }, {
        eager: false,
        nullable: true,
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "currentScheduledMaintenanceStateId" }),
    __metadata("design:type", ScheduledMaintenanceState)
], ScheduledMaintenance.prototype, "currentScheduledMaintenanceState", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: true,
        isDefaultValueColumn: true,
        title: "Current Scheduled Maintenance State ID",
        description: "Scheduled Maintenance State ID. The state the event currently is in.",
        example: "c3d4e5f6-a7b8-9012-cdef-3456789012ab",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: false,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], ScheduledMaintenance.prototype, "currentScheduledMaintenanceStateId", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        manyToOneRelationColumn: "changeMonitorStatusToId",
        type: TableColumnType.Entity,
        modelType: ScheduledMaintenanceState,
        title: "Change Monitor Status To",
        description: "Relation to Monitor Status Object. All monitors connected to this event will be changed to this status when the event is ongoing.",
    }),
    ManyToOne(() => {
        return MonitorStatus;
    }, {
        eager: false,
        nullable: true,
        orphanedRowAction: "nullify",
    }),
    JoinColumn({ name: "changeMonitorStatusToId" }),
    __metadata("design:type", MonitorStatus)
], ScheduledMaintenance.prototype, "changeMonitorStatusTo", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.ObjectID,
        required: false,
        title: "Change Monitor Status To ID",
        description: "Relation to Monitor Status Object ID. All monitors connected to this incident will be changed to this status when the event is ongoing.",
        example: "d4e5f6a7-b8c9-0123-def4-56789012abcd",
    }),
    Column({
        type: ColumnType.ObjectID,
        nullable: true,
        transformer: ObjectID.getDatabaseTransformer(),
    }),
    __metadata("design:type", ObjectID)
], ScheduledMaintenance.prototype, "changeMonitorStatusToId", void 0);
__decorate([
    TableColumn({
        title: "Start At",
        type: TableColumnType.Date,
        required: true,
        description: "When does this event start?",
    }),
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    Column({
        nullable: false,
        type: ColumnType.Date,
    }),
    __metadata("design:type", Date)
], ScheduledMaintenance.prototype, "startsAt", void 0);
__decorate([
    TableColumn({
        title: "End At",
        type: TableColumnType.Date,
        required: true,
        description: "When does this event end?",
    }),
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    Column({
        nullable: false,
        type: ColumnType.Date,
    }),
    __metadata("design:type", Date)
], ScheduledMaintenance.prototype, "endsAt", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        isDefaultValueColumn: true,
        computed: true,
        hideColumnInDocumentation: true,
        type: TableColumnType.ShortText,
        title: "Subscriber Notification Status On Event Scheduled",
        description: "Status of notification sent to subscribers when event was scheduled",
        defaultValue: StatusPageSubscriberNotificationStatus.Pending,
    }),
    Column({
        type: ColumnType.ShortText,
        default: StatusPageSubscriberNotificationStatus.Pending,
    }),
    __metadata("design:type", String)
], ScheduledMaintenance.prototype, "subscriberNotificationStatusOnEventScheduled", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateIncidentPublicNote,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        type: TableColumnType.VeryLongText,
        title: "Notification Status Message On Event Scheduled",
        description: "Status message for subscriber notifications when event is scheduled - includes success messages, failure reasons, or skip reasons",
        required: false,
    }),
    Column({
        type: ColumnType.VeryLongText,
        nullable: true,
    }),
    __metadata("design:type", String)
], ScheduledMaintenance.prototype, "subscriberNotificationStatusMessage", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        isDefaultValueColumn: true,
        type: TableColumnType.Boolean,
        title: "Should subscribers be notified when event is created?",
        description: "Should subscribers be notified about this event creation?",
        defaultValue: true,
    }),
    Column({
        type: ColumnType.Boolean,
        default: true,
    }),
    __metadata("design:type", Boolean)
], ScheduledMaintenance.prototype, "shouldStatusPageSubscribersBeNotifiedOnEventCreated", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        isDefaultValueColumn: true,
        type: TableColumnType.Boolean,
        title: "Should subscribers be notified when event is changed to ongoing?",
        description: "Should subscribers be notified about this event event is changed to ongoing?",
        defaultValue: true,
    }),
    Column({
        type: ColumnType.Boolean,
        default: true,
    }),
    __metadata("design:type", Boolean)
], ScheduledMaintenance.prototype, "shouldStatusPageSubscribersBeNotifiedWhenEventChangedToOngoing", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        isDefaultValueColumn: true,
        type: TableColumnType.Boolean,
        title: "Should subscribers be notified when event is changed to ended?",
        description: "Should subscribers be notified about this event event is changed to ended?",
        defaultValue: true,
    }),
    Column({
        type: ColumnType.Boolean,
        default: true,
    }),
    __metadata("design:type", Boolean)
], ScheduledMaintenance.prototype, "shouldStatusPageSubscribersBeNotifiedWhenEventChangedToEnded", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        isDefaultValueColumn: false,
        required: false,
        type: TableColumnType.JSON,
        title: "Custom Fields",
        description: "Custom Fields on this resource.",
    }),
    Column({
        type: ColumnType.JSON,
        nullable: true,
    }),
    __metadata("design:type", Object)
], ScheduledMaintenance.prototype, "customFields", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        type: TableColumnType.Boolean,
        computed: true,
        hideColumnInDocumentation: true,
        required: true,
        isDefaultValueColumn: true,
        title: "Are Owners Notified Of Resource Creation?",
        description: "Are owners notified of when this resource is created?",
        defaultValue: false,
    }),
    Column({
        type: ColumnType.Boolean,
        nullable: false,
        default: false,
    }),
    __metadata("design:type", Boolean)
], ScheduledMaintenance.prototype, "isOwnerNotifiedOfResourceCreation", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        type: TableColumnType.JSON,
        required: false,
        isDefaultValueColumn: false,
        title: "Subscriber notifications before the event",
        description: "Should subscribers be notified before the event?",
    }),
    Column({
        type: ColumnType.JSON,
        nullable: true,
        transformer: Recurring.getDatabaseTransformer(),
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "sendSubscriberNotificationsOnBeforeTheEvent", void 0);
__decorate([
    Index(),
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        type: TableColumnType.Date,
        required: false,
        isDefaultValueColumn: false,
        title: "Next subscriber notification before the event at?",
        description: "When will the next notification to subscribers be sent out?",
    }),
    Index(),
    Column({
        type: ColumnType.Date,
        nullable: true,
    }),
    __metadata("design:type", Date)
], ScheduledMaintenance.prototype, "nextSubscriberNotificationBeforeTheEventAt", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    Index(),
    TableColumn({
        isDefaultValueColumn: false,
        required: false,
        type: TableColumnType.Number,
        computed: true,
        title: "Scheduled Maintenance Number",
        description: "Scheduled Maintenance Number",
    }),
    Column({
        type: ColumnType.Number,
        nullable: true,
    }),
    __metadata("design:type", Number)
], ScheduledMaintenance.prototype, "scheduledMaintenanceNumber", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [],
    }),
    TableColumn({
        isDefaultValueColumn: false,
        required: false,
        type: TableColumnType.ShortText,
        title: "Scheduled Maintenance Number With Prefix",
        description: "Scheduled maintenance number with prefix (e.g., 'SM-42' or '#42')",
        computed: true,
    }),
    Column({
        type: ColumnType.ShortText,
        length: ColumnLength.ShortText,
        nullable: true,
    }),
    __metadata("design:type", String)
], ScheduledMaintenance.prototype, "scheduledMaintenanceNumberWithPrefix", void 0);
__decorate([
    ColumnAccessControl({
        create: [],
        read: [],
        update: [],
    }),
    TableColumn({
        isDefaultValueColumn: false,
        required: false,
        type: TableColumnType.JSON,
        title: "Post Updates To Workspace Channel Name",
        description: "Post Updates To Workspace Channel Name",
    }),
    Column({
        type: ColumnType.JSON,
        nullable: true,
    }),
    __metadata("design:type", Array)
], ScheduledMaintenance.prototype, "postUpdatesToWorkspaceChannels", void 0);
__decorate([
    ColumnAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    TableColumn({
        isDefaultValueColumn: true,
        type: TableColumnType.Boolean,
        title: "Should be visible on status page?",
        description: "Should this incident be visible on the status page?",
        defaultValue: true,
    }),
    Column({
        type: ColumnType.Boolean,
        default: true,
        nullable: true,
    }),
    __metadata("design:type", Boolean)
], ScheduledMaintenance.prototype, "isVisibleOnStatusPage", void 0);
ScheduledMaintenance = __decorate([
    OperationalResource(),
    EnableDocumentation(),
    EnableMCP(),
    AccessControlColumn("labels"),
    MultiTenentQueryAllowed(true),
    TenantColumn("projectId"),
    TableAccessControl({
        create: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.CreateProjectScheduledMaintenance,
        ],
        read: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.Viewer,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.ScheduledMaintenanceViewer,
            Permission.ReadProjectScheduledMaintenance,
        ],
        delete: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.DeleteProjectScheduledMaintenance,
        ],
        update: [
            Permission.ProjectOwner,
            Permission.ProjectAdmin,
            Permission.ProjectMember,
            Permission.ScheduledMaintenanceAdmin,
            Permission.ScheduledMaintenanceMember,
            Permission.EditProjectScheduledMaintenance,
        ],
    }),
    CrudApiEndpoint(new Route("/scheduled-maintenance")),
    SlugifyColumn("name", "slug"),
    Entity({
        name: "ScheduledMaintenance",
    }),
    EnableWorkflow({
        create: true,
        delete: true,
        update: true,
        read: true,
    }),
    EnableAuditLog(),
    TableMetadata({
        singularName: "Scheduled Maintenance Event",
        pluralName: "Scheduled Maintenance Events",
        icon: IconProp.Clock,
        tableName: "ScheduledMaintenance",
        tableDescription: "Manage scheduled maintenance event for your project",
    })
], ScheduledMaintenance);
export default ScheduledMaintenance;
//# sourceMappingURL=ScheduledMaintenance.js.map