"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.CreateServerResponseDto = exports.CreateServerDto = void 0;
const class_validator_1 = require("class-validator");
const swagger_1 = require("@nestjs/swagger");
const cloud_provider_enum_1 = require("../../../../modules/providers/enums/cloud-provider.enum");
class CreateServerDto {
    constructor() {
        this.server_type = 'cx22';
        this.location = 'fsn1';
        this.image = 'ubuntu-22.04';
        this.ssh_keys = [];
        this.enable_ipv6 = true;
        this.environment = 'dev';
    }
}
exports.CreateServerDto = CreateServerDto;
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Name of the server',
        example: 'my-web-server',
        minLength: 1,
        maxLength: 63,
    }),
    (0, class_validator_1.IsString)(),
    (0, class_validator_1.MinLength)(1),
    (0, class_validator_1.MaxLength)(63),
    (0, class_validator_1.Matches)(/^[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]$/, {
        message: 'Server name must contain only alphanumeric characters and hyphens, and cannot start or end with a hyphen',
    }),
    __metadata("design:type", String)
], CreateServerDto.prototype, "name", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        enum: cloud_provider_enum_1.CloudProvider,
        description: 'Cloud provider',
        example: cloud_provider_enum_1.CloudProvider.HETZNER,
    }),
    (0, class_validator_1.IsEnum)(cloud_provider_enum_1.CloudProvider),
    __metadata("design:type", String)
], CreateServerDto.prototype, "provider", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Server type/size',
        example: 'cx22',
        default: 'cx22',
    }),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateServerDto.prototype, "server_type", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({
        description: 'Server location/datacenter',
        example: 'fsn1',
        default: 'fsn1',
    }),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateServerDto.prototype, "location", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Operating system image',
        example: 'ubuntu-22.04',
        default: 'ubuntu-22.04',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateServerDto.prototype, "image", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'SSH key names to add to the server',
        example: ['my-ssh-key', 'backup-key'],
        type: [String],
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsArray)(),
    (0, class_validator_1.IsString)({ each: true }),
    __metadata("design:type", Array)
], CreateServerDto.prototype, "ssh_keys", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Network ID to attach the server to',
        example: '12345',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateServerDto.prototype, "network_id", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Enable IPv6',
        default: true,
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsBoolean)(),
    __metadata("design:type", Boolean)
], CreateServerDto.prototype, "enable_ipv6", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Environment tag',
        example: 'production',
        default: 'dev',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateServerDto.prototype, "environment", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({
        description: 'Cluster name for grouping',
        example: 'web-cluster',
    }),
    (0, class_validator_1.IsOptional)(),
    (0, class_validator_1.IsString)(),
    __metadata("design:type", String)
], CreateServerDto.prototype, "cluster_name", void 0);
class CreateServerResponseDto {
}
exports.CreateServerResponseDto = CreateServerResponseDto;
__decorate([
    (0, swagger_1.ApiProperty)({ description: 'Operation ID for tracking' }),
    __metadata("design:type", String)
], CreateServerResponseDto.prototype, "operation_id", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ description: 'Current status' }),
    __metadata("design:type", String)
], CreateServerResponseDto.prototype, "status", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ description: 'Resource type' }),
    __metadata("design:type", String)
], CreateServerResponseDto.prototype, "resource_type", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ description: 'Cloud provider' }),
    __metadata("design:type", String)
], CreateServerResponseDto.prototype, "provider", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ description: 'Estimated completion time' }),
    __metadata("design:type", String)
], CreateServerResponseDto.prototype, "estimated_duration", void 0);
__decorate([
    (0, swagger_1.ApiPropertyOptional)({ description: 'Created resource ID (when completed)' }),
    __metadata("design:type", String)
], CreateServerResponseDto.prototype, "resource_id", void 0);
__decorate([
    (0, swagger_1.ApiProperty)({ description: 'Creation timestamp' }),
    __metadata("design:type", Date)
], CreateServerResponseDto.prototype, "created_at", void 0);
