"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);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateDashboardVariableDto = exports.SelectionDynamicSourceType = void 0;
const openapi = require("@nestjs/swagger");
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
const class_validator_2 = require("class-validator");
var SelectionDynamicSourceType;
(function (SelectionDynamicSourceType) {
    SelectionDynamicSourceType["SQL"] = "sql";
    SelectionDynamicSourceType["PROVIDER"] = "provider";
})(SelectionDynamicSourceType || (exports.SelectionDynamicSourceType = SelectionDynamicSourceType = {}));
class CreateDashboardVariableDto {
    constructor() {
        this.isMultiSelect = true;
    }
    static _OPENAPI_METADATA_FACTORY() {
        return { variableName: { required: true, type: () => String }, variableType: { required: true, type: () => String }, selectionStaticValues: { required: true, type: () => Object }, selectionDynamicSourceType: { required: true, type: () => String }, selectionDynamicSQL: { required: true, type: () => String }, selectionDynamicProviderName: { required: true, type: () => String }, isMultiSelect: { required: true, type: () => Boolean, default: true }, dashboardId: { required: true, type: () => Number }, dashboardUserKey: { required: true, type: () => String }, defaultValue: { required: true, type: () => String }, defaultOperator: { required: true, type: () => String }, externalId: { required: true, type: () => String } };
    }
}
exports.CreateDashboardVariableDto = CreateDashboardVariableDto;
__decorate([
    (0, class_validator_2.IsNotEmpty)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "variableName", void 0);
__decorate([
    (0, class_validator_2.IsNotEmpty)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "variableType", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_2.IsJSON)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", Object)
], CreateDashboardVariableDto.prototype, "selectionStaticValues", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "selectionDynamicSourceType", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)({ description: "SQL query to fetch the data for this variable when it is rendered at runtime. This is only applicable when selectionDynamicSourceType is set to SQL." }),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "selectionDynamicSQL", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)({ description: "This is only applicable when selectionDynamicSourceType is set to provider. It allows the user to select any pre-existing Dashboard SelectionDynamicProvider implementation used to fetch a dynamic dropdown of values to choose from when this variable is presented to the user." }),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "selectionDynamicProviderName", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_2.IsBoolean)(),
    (0, swagger_1.ApiProperty)({ description: "This is relevant only for variables of type \"selectionStatic\" or \"selectionDynamic\". When set to true, it allows the user to select multiple values from the dropdown." }),
    __metadata("design:type", Boolean)
], CreateDashboardVariableDto.prototype, "isMultiSelect", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_2.IsInt)(),
    (0, swagger_1.ApiProperty)({ description: "Related Dashboard Model" }),
    __metadata("design:type", Number)
], CreateDashboardVariableDto.prototype, "dashboardId", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_2.IsOptional)(),
    (0, swagger_1.ApiProperty)({ description: "Related Dashboard Model" }),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "dashboardUserKey", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)({ description: "This is the default value for this variable when it is rendered at runtime. It can be a static value for this variable when it is rendered at runtime." }),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "defaultValue", void 0);
__decorate([
    (0, class_validator_2.IsOptional)(),
    (0, class_validator_1.IsString)(),
    (0, swagger_1.ApiProperty)({ description: "This is the default operator for this variable when it is rendered at runtime. It can be a static value for this variable when it is rendered at runtime." }),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "defaultOperator", void 0);
__decorate([
    (0, class_validator_1.IsString)(),
    (0, class_validator_2.IsOptional)(),
    (0, swagger_1.ApiProperty)(),
    __metadata("design:type", String)
], CreateDashboardVariableDto.prototype, "externalId", void 0);
//# sourceMappingURL=create-dashboard-variable.dto.js.map