import * as core from "@terrascript/core";

export interface DurationArgs extends core.SchemaArgs {
  unit: string | core.StringOut;

  value: number | core.NumberOut;
}

export class Duration extends core.Schema<DurationArgs> {
  @core.attr(String, { computed: true })
  public unit!: string | core.StringOut;

  @core.attr(Number, { computed: true })
  public value!: number | core.NumberOut;
}

export interface MaintenanceScheduleArgs extends core.SchemaArgs {
  cronExpressionForRecurrence: string | core.StringOut;

  duration: core.Array<Duration> | core.ArrayOut<Duration>;

  startAt: string | core.StringOut;
}

export class MaintenanceSchedule extends core.Schema<MaintenanceScheduleArgs> {
  @core.attr(String, { computed: true })
  public cronExpressionForRecurrence!: string | core.StringOut;

  @core.attr(Duration, { computed: true, kind: "array" })
  public duration!: core.Array<Duration> | core.ArrayOut<Duration>;

  @core.attr(String, { computed: true })
  public startAt!: string | core.StringOut;
}

export interface AutoTuneOptionsArgs extends core.SchemaArgs {
  desiredState: string | core.StringOut;

  maintenanceSchedule:
    | core.Array<MaintenanceSchedule>
    | core.ArrayOut<MaintenanceSchedule>;

  rollbackOnDisable: string | core.StringOut;
}

export class AutoTuneOptions extends core.Schema<AutoTuneOptionsArgs> {
  @core.attr(String, { computed: true })
  public desiredState!: string | core.StringOut;

  @core.attr(MaintenanceSchedule, { computed: true, kind: "array" })
  public maintenanceSchedule!:
    | core.Array<MaintenanceSchedule>
    | core.ArrayOut<MaintenanceSchedule>;

  @core.attr(String, { computed: true })
  public rollbackOnDisable!: string | core.StringOut;
}

export interface SnapshotOptionsArgs extends core.SchemaArgs {
  automatedSnapshotStartHour: number | core.NumberOut;
}

export class SnapshotOptions extends core.Schema<SnapshotOptionsArgs> {
  @core.attr(Number, { computed: true })
  public automatedSnapshotStartHour!: number | core.NumberOut;
}

export interface EbsOptionsArgs extends core.SchemaArgs {
  ebsEnabled: boolean | core.BooleanOut;

  iops: number | core.NumberOut;

  throughput: number | core.NumberOut;

  volumeSize: number | core.NumberOut;

  volumeType: string | core.StringOut;
}

export class EbsOptions extends core.Schema<EbsOptionsArgs> {
  @core.attr(Boolean, { computed: true })
  public ebsEnabled!: boolean | core.BooleanOut;

  @core.attr(Number, { computed: true })
  public iops!: number | core.NumberOut;

  @core.attr(Number, { computed: true })
  public throughput!: number | core.NumberOut;

  @core.attr(Number, { computed: true })
  public volumeSize!: number | core.NumberOut;

  @core.attr(String, { computed: true })
  public volumeType!: string | core.StringOut;
}

export interface CognitoOptionsArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;

  identityPoolId: string | core.StringOut;

  roleArn: string | core.StringOut;

  userPoolId: string | core.StringOut;
}

export class CognitoOptions extends core.Schema<CognitoOptionsArgs> {
  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;

  @core.attr(String, { computed: true })
  public identityPoolId!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public roleArn!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public userPoolId!: string | core.StringOut;
}

export interface ZoneAwarenessConfigArgs extends core.SchemaArgs {
  availabilityZoneCount: number | core.NumberOut;
}

export class ZoneAwarenessConfig extends core.Schema<ZoneAwarenessConfigArgs> {
  @core.attr(Number, { computed: true })
  public availabilityZoneCount!: number | core.NumberOut;
}

export interface ColdStorageOptionsArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;
}

export class ColdStorageOptions extends core.Schema<ColdStorageOptionsArgs> {
  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;
}

export interface ClusterConfigArgs extends core.SchemaArgs {
  coldStorageOptions:
    | core.Array<ColdStorageOptions>
    | core.ArrayOut<ColdStorageOptions>;

  dedicatedMasterCount: number | core.NumberOut;

  dedicatedMasterEnabled: boolean | core.BooleanOut;

  dedicatedMasterType: string | core.StringOut;

  instanceCount: number | core.NumberOut;

  instanceType: string | core.StringOut;

  warmCount: number | core.NumberOut;

  warmEnabled?: boolean | core.BooleanOut;

  warmType: string | core.StringOut;

  zoneAwarenessConfig:
    | core.Array<ZoneAwarenessConfig>
    | core.ArrayOut<ZoneAwarenessConfig>;

  zoneAwarenessEnabled: boolean | core.BooleanOut;
}

export class ClusterConfig extends core.Schema<ClusterConfigArgs> {
  @core.attr(ColdStorageOptions, { computed: true, kind: "array" })
  public coldStorageOptions!:
    | core.Array<ColdStorageOptions>
    | core.ArrayOut<ColdStorageOptions>;

  @core.attr(Number, { computed: true })
  public dedicatedMasterCount!: number | core.NumberOut;

  @core.attr(Boolean, { computed: true })
  public dedicatedMasterEnabled!: boolean | core.BooleanOut;

  @core.attr(String, { computed: true })
  public dedicatedMasterType!: string | core.StringOut;

  @core.attr(Number, { computed: true })
  public instanceCount!: number | core.NumberOut;

  @core.attr(String, { computed: true })
  public instanceType!: string | core.StringOut;

  @core.attr(Number, { computed: true })
  public warmCount!: number | core.NumberOut;

  @core.attr(Boolean)
  public warmEnabled?: boolean | core.BooleanOut;

  @core.attr(String, { computed: true })
  public warmType!: string | core.StringOut;

  @core.attr(ZoneAwarenessConfig, { computed: true, kind: "array" })
  public zoneAwarenessConfig!:
    | core.Array<ZoneAwarenessConfig>
    | core.ArrayOut<ZoneAwarenessConfig>;

  @core.attr(Boolean, { computed: true })
  public zoneAwarenessEnabled!: boolean | core.BooleanOut;
}

export interface EncryptionAtRestArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;

  kmsKeyId: string | core.StringOut;
}

export class EncryptionAtRest extends core.Schema<EncryptionAtRestArgs> {
  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;

  @core.attr(String, { computed: true })
  public kmsKeyId!: string | core.StringOut;
}

export interface LogPublishingOptionsArgs extends core.SchemaArgs {
  cloudwatchLogGroupArn: string | core.StringOut;

  enabled: boolean | core.BooleanOut;

  logType: string | core.StringOut;
}

export class LogPublishingOptions extends core.Schema<LogPublishingOptionsArgs> {
  @core.attr(String, { computed: true })
  public cloudwatchLogGroupArn!: string | core.StringOut;

  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;

  @core.attr(String, { computed: true })
  public logType!: string | core.StringOut;
}

export interface NodeToNodeEncryptionArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;
}

export class NodeToNodeEncryption extends core.Schema<NodeToNodeEncryptionArgs> {
  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;
}

export interface AdvancedSecurityOptionsArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;

  internalUserDatabaseEnabled: boolean | core.BooleanOut;
}

export class AdvancedSecurityOptions extends core.Schema<AdvancedSecurityOptionsArgs> {
  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;

  @core.attr(Boolean, { computed: true })
  public internalUserDatabaseEnabled!: boolean | core.BooleanOut;
}

export interface VpcOptionsArgs extends core.SchemaArgs {
  availabilityZones: core.Array<string> | core.ArrayOut<core.StringOut>;

  securityGroupIds: core.Array<string> | core.ArrayOut<core.StringOut>;

  subnetIds: core.Array<string> | core.ArrayOut<core.StringOut>;

  vpcId: string | core.StringOut;
}

export class VpcOptions extends core.Schema<VpcOptionsArgs> {
  @core.attr(String, { computed: true, kind: "array" })
  public availabilityZones!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "array" })
  public securityGroupIds!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "array" })
  public subnetIds!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true })
  public vpcId!: string | core.StringOut;
}

export interface DsDomainArgs {
  domainName: string | core.StringOut;

  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export class DsDomain extends core.Data<DsDomainArgs> {
  @core.attr(String, { computed: true })
  public accessPolicies!: string | core.StringOut;

  @core.attr(String, { computed: true, kind: "map" })
  public advancedOptions!:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

  @core.attr(AdvancedSecurityOptions, { computed: true, kind: "array" })
  public advancedSecurityOptions!:
    | core.Array<AdvancedSecurityOptions>
    | core.ArrayOut<AdvancedSecurityOptions>;

  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(AutoTuneOptions, { computed: true, kind: "array" })
  public autoTuneOptions!:
    | core.Array<AutoTuneOptions>
    | core.ArrayOut<AutoTuneOptions>;

  @core.attr(ClusterConfig, { computed: true, kind: "array" })
  public clusterConfig!:
    | core.Array<ClusterConfig>
    | core.ArrayOut<ClusterConfig>;

  @core.attr(CognitoOptions, { computed: true, kind: "array" })
  public cognitoOptions!:
    | core.Array<CognitoOptions>
    | core.ArrayOut<CognitoOptions>;

  @core.attr(Boolean, { computed: true })
  public created!: boolean | core.BooleanOut;

  @core.attr(Boolean, { computed: true })
  public deleted!: boolean | core.BooleanOut;

  @core.attr(String, { computed: true })
  public domainId!: string | core.StringOut;

  @core.attr(String)
  public domainName!: string | core.StringOut;

  @core.attr(EbsOptions, { computed: true, kind: "array" })
  public ebsOptions!: core.Array<EbsOptions> | core.ArrayOut<EbsOptions>;

  @core.attr(EncryptionAtRest, { computed: true, kind: "array" })
  public encryptionAtRest!:
    | core.Array<EncryptionAtRest>
    | core.ArrayOut<EncryptionAtRest>;

  @core.attr(String, { computed: true })
  public endpoint!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public engineVersion!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public kibanaEndpoint!: string | core.StringOut;

  @core.attr(LogPublishingOptions, { computed: true, kind: "array" })
  public logPublishingOptions!:
    | core.Array<LogPublishingOptions>
    | core.ArrayOut<LogPublishingOptions>;

  @core.attr(NodeToNodeEncryption, { computed: true, kind: "array" })
  public nodeToNodeEncryption!:
    | core.Array<NodeToNodeEncryption>
    | core.ArrayOut<NodeToNodeEncryption>;

  @core.attr(Boolean, { computed: true })
  public processing!: boolean | core.BooleanOut;

  @core.attr(SnapshotOptions, { computed: true, kind: "array" })
  public snapshotOptions!:
    | core.Array<SnapshotOptions>
    | core.ArrayOut<SnapshotOptions>;

  @core.attr(String, { computed: true, kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(VpcOptions, { computed: true, kind: "array" })
  public vpcOptions!: core.Array<VpcOptions> | core.ArrayOut<VpcOptions>;

  constructor(name: string, args?: DsDomainArgs) {
    super(name, "aws_opensearch_domain", args);
  }

  public override getNamespace(): string {
    return "aws_opensearch";
  }
}
