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

export interface RestoreToPointInTimeArgs extends core.SchemaArgs {
  restoreToTime?: string | core.StringOut;

  restoreType?: string | core.StringOut;

  sourceClusterIdentifier: string | core.StringOut;

  useLatestRestorableTime?: boolean | core.BooleanOut;
}

export class RestoreToPointInTime extends core.Schema<RestoreToPointInTimeArgs> {
  @core.attr(String)
  public restoreToTime?: string | core.StringOut;

  @core.attr(String)
  public restoreType?: string | core.StringOut;

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

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

export interface ScalingConfigurationArgs extends core.SchemaArgs {
  autoPause?: boolean | core.BooleanOut;

  maxCapacity?: number | core.NumberOut;

  minCapacity?: number | core.NumberOut;

  secondsUntilAutoPause?: number | core.NumberOut;

  timeoutAction?: string | core.StringOut;
}

export class ScalingConfiguration extends core.Schema<ScalingConfigurationArgs> {
  @core.attr(Boolean)
  public autoPause?: boolean | core.BooleanOut;

  @core.attr(Number)
  public maxCapacity?: number | core.NumberOut;

  @core.attr(Number)
  public minCapacity?: number | core.NumberOut;

  @core.attr(Number)
  public secondsUntilAutoPause?: number | core.NumberOut;

  @core.attr(String)
  public timeoutAction?: string | core.StringOut;
}

export interface Serverlessv2ScalingConfigurationArgs extends core.SchemaArgs {
  maxCapacity: number | core.NumberOut;

  minCapacity: number | core.NumberOut;
}

export class Serverlessv2ScalingConfiguration extends core.Schema<Serverlessv2ScalingConfigurationArgs> {
  @core.attr(Number)
  public maxCapacity!: number | core.NumberOut;

  @core.attr(Number)
  public minCapacity!: number | core.NumberOut;
}

export interface S3ImportArgs extends core.SchemaArgs {
  bucketName: string | core.StringOut;

  bucketPrefix?: string | core.StringOut;

  ingestionRole: string | core.StringOut;

  sourceEngine: string | core.StringOut;

  sourceEngineVersion: string | core.StringOut;
}

export class S3Import extends core.Schema<S3ImportArgs> {
  @core.attr(String)
  public bucketName!: string | core.StringOut;

  @core.attr(String)
  public bucketPrefix?: string | core.StringOut;

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

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

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

export interface ClusterArgs extends core.ResourceArgs {
  allocatedStorage?: number | core.NumberOut;

  allowMajorVersionUpgrade?: boolean | core.BooleanOut;

  applyImmediately?: boolean | core.BooleanOut;

  availabilityZones?: core.Array<string> | core.ArrayOut<core.StringOut>;

  backtrackWindow?: number | core.NumberOut;

  backupRetentionPeriod?: number | core.NumberOut;

  clusterIdentifier?: string | core.StringOut;

  clusterIdentifierPrefix?: string | core.StringOut;

  clusterMembers?: core.Array<string> | core.ArrayOut<core.StringOut>;

  copyTagsToSnapshot?: boolean | core.BooleanOut;

  databaseName?: string | core.StringOut;

  dbClusterInstanceClass?: string | core.StringOut;

  dbClusterParameterGroupName?: string | core.StringOut;

  dbInstanceParameterGroupName?: string | core.StringOut;

  dbSubnetGroupName?: string | core.StringOut;

  deletionProtection?: boolean | core.BooleanOut;

  enableGlobalWriteForwarding?: boolean | core.BooleanOut;

  enableHttpEndpoint?: boolean | core.BooleanOut;

  enabledCloudwatchLogsExports?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

  engine?: string | core.StringOut;

  engineMode?: string | core.StringOut;

  engineVersion?: string | core.StringOut;

  finalSnapshotIdentifier?: string | core.StringOut;

  globalClusterIdentifier?: string | core.StringOut;

  iamDatabaseAuthenticationEnabled?: boolean | core.BooleanOut;

  iamRoles?: core.Array<string> | core.ArrayOut<core.StringOut>;

  iops?: number | core.NumberOut;

  kmsKeyId?: string | core.StringOut;

  masterPassword?: string | core.StringOut;

  masterUsername?: string | core.StringOut;

  port?: number | core.NumberOut;

  preferredBackupWindow?: string | core.StringOut;

  preferredMaintenanceWindow?: string | core.StringOut;

  replicationSourceIdentifier?: string | core.StringOut;

  restoreToPointInTime?: RestoreToPointInTime;

  s3Import?: S3Import;

  scalingConfiguration?: ScalingConfiguration;

  serverlessv2ScalingConfiguration?: Serverlessv2ScalingConfiguration;

  skipFinalSnapshot?: boolean | core.BooleanOut;

  snapshotIdentifier?: string | core.StringOut;

  sourceRegion?: string | core.StringOut;

  storageEncrypted?: boolean | core.BooleanOut;

  storageType?: string | core.StringOut;

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

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

  vpcSecurityGroupIds?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class Cluster extends core.Resource<ClusterArgs> {
  @core.attr(Number, { computed: true })
  public allocatedStorage?: number | core.NumberOut;

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

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

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

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

  @core.attr(Number)
  public backtrackWindow?: number | core.NumberOut;

  @core.attr(Number)
  public backupRetentionPeriod?: number | core.NumberOut;

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

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

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

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

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

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

  @core.attr(String)
  public dbClusterInstanceClass?: string | core.StringOut;

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

  @core.attr(String)
  public dbInstanceParameterGroupName?: string | core.StringOut;

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

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

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

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

  @core.attr(String, { kind: "array" })
  public enabledCloudwatchLogsExports?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

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

  @core.attr(String)
  public engine?: string | core.StringOut;

  @core.attr(String)
  public engineMode?: string | core.StringOut;

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

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

  @core.attr(String)
  public finalSnapshotIdentifier?: string | core.StringOut;

  @core.attr(String)
  public globalClusterIdentifier?: string | core.StringOut;

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

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

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

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

  @core.attr(Number)
  public iops?: number | core.NumberOut;

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

  @core.attr(String)
  public masterPassword?: string | core.StringOut;

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

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

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

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

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

  @core.attr(String)
  public replicationSourceIdentifier?: string | core.StringOut;

  @core.attr(RestoreToPointInTime)
  public restoreToPointInTime?: RestoreToPointInTime;

  @core.attr(S3Import)
  public s3Import?: S3Import;

  @core.attr(ScalingConfiguration)
  public scalingConfiguration?: ScalingConfiguration;

  @core.attr(Serverlessv2ScalingConfiguration)
  public serverlessv2ScalingConfiguration?: Serverlessv2ScalingConfiguration;

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

  @core.attr(String)
  public snapshotIdentifier?: string | core.StringOut;

  @core.attr(String)
  public sourceRegion?: string | core.StringOut;

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

  @core.attr(String)
  public storageType?: string | core.StringOut;

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

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

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

  constructor(name: string, args?: ClusterArgs) {
    super(name, "aws_rds_cluster", args);
  }

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