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

export interface SnapshotCopyArgs extends core.SchemaArgs {
  destinationRegion: string | core.StringOut;

  grantName?: string | core.StringOut;

  retentionPeriod?: number | core.NumberOut;
}

export class SnapshotCopy extends core.Schema<SnapshotCopyArgs> {
  @core.attr(String)
  public destinationRegion!: string | core.StringOut;

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

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

export interface ClusterNodesArgs extends core.SchemaArgs {
  nodeRole: string | core.StringOut;

  privateIpAddress: string | core.StringOut;

  publicIpAddress: string | core.StringOut;
}

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

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

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

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

  enable: boolean | core.BooleanOut;

  logDestinationType?: string | core.StringOut;

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

  s3KeyPrefix?: string | core.StringOut;
}

export class Logging extends core.Schema<LoggingArgs> {
  @core.attr(String, { computed: true })
  public bucketName?: string | core.StringOut;

  @core.attr(Boolean)
  public enable!: boolean | core.BooleanOut;

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

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

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

export interface ClusterArgs extends core.ResourceArgs {
  allowVersionUpgrade?: boolean | core.BooleanOut;

  applyImmediately?: boolean | core.BooleanOut;

  aquaConfigurationStatus?: string | core.StringOut;

  automatedSnapshotRetentionPeriod?: number | core.NumberOut;

  availabilityZone?: string | core.StringOut;

  availabilityZoneRelocationEnabled?: boolean | core.BooleanOut;

  clusterIdentifier: string | core.StringOut;

  clusterParameterGroupName?: string | core.StringOut;

  clusterPublicKey?: string | core.StringOut;

  clusterRevisionNumber?: string | core.StringOut;

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

  clusterSubnetGroupName?: string | core.StringOut;

  clusterType?: string | core.StringOut;

  clusterVersion?: string | core.StringOut;

  databaseName?: string | core.StringOut;

  defaultIamRoleArn?: string | core.StringOut;

  elasticIp?: string | core.StringOut;

  encrypted?: boolean | core.BooleanOut;

  endpoint?: string | core.StringOut;

  enhancedVpcRouting?: boolean | core.BooleanOut;

  finalSnapshotIdentifier?: string | core.StringOut;

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

  kmsKeyId?: string | core.StringOut;

  logging?: Logging;

  maintenanceTrackName?: string | core.StringOut;

  manualSnapshotRetentionPeriod?: number | core.NumberOut;

  masterPassword?: string | core.StringOut;

  masterUsername?: string | core.StringOut;

  nodeType: string | core.StringOut;

  numberOfNodes?: number | core.NumberOut;

  ownerAccount?: string | core.StringOut;

  port?: number | core.NumberOut;

  preferredMaintenanceWindow?: string | core.StringOut;

  publiclyAccessible?: boolean | core.BooleanOut;

  skipFinalSnapshot?: boolean | core.BooleanOut;

  snapshotClusterIdentifier?: string | core.StringOut;

  snapshotCopy?: SnapshotCopy;

  snapshotIdentifier?: 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(Boolean)
  public allowVersionUpgrade?: boolean | core.BooleanOut;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @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(String, { computed: true })
  public kmsKeyId?: string | core.StringOut;

  @core.attr(Logging)
  public logging?: Logging;

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(SnapshotCopy)
  public snapshotCopy?: SnapshotCopy;

  @core.attr(String)
  public snapshotIdentifier?: 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_redshift_cluster", args);
  }

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