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

export interface AccessLogsArgs extends core.SchemaArgs {
  bucket: string | core.StringOut;

  bucketPrefix?: string | core.StringOut;

  enabled?: boolean | core.BooleanOut;

  interval?: number | core.NumberOut;
}

export class AccessLogs extends core.Schema<AccessLogsArgs> {
  @core.attr(String)
  public bucket!: string | core.StringOut;

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

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

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

export interface HealthCheckArgs extends core.SchemaArgs {
  healthyThreshold: number | core.NumberOut;

  interval: number | core.NumberOut;

  target: string | core.StringOut;

  timeout: number | core.NumberOut;

  unhealthyThreshold: number | core.NumberOut;
}

export class HealthCheck extends core.Schema<HealthCheckArgs> {
  @core.attr(Number)
  public healthyThreshold!: number | core.NumberOut;

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

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

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

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

export interface ListenerArgs extends core.SchemaArgs {
  instancePort: number | core.NumberOut;

  instanceProtocol: string | core.StringOut;

  lbPort: number | core.NumberOut;

  lbProtocol: string | core.StringOut;

  sslCertificateId?: string | core.StringOut;
}

export class Listener extends core.Schema<ListenerArgs> {
  @core.attr(Number)
  public instancePort!: number | core.NumberOut;

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

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

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

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

export interface MainArgs extends core.ResourceArgs {
  accessLogs?: AccessLogs;

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

  connectionDraining?: boolean | core.BooleanOut;

  connectionDrainingTimeout?: number | core.NumberOut;

  crossZoneLoadBalancing?: boolean | core.BooleanOut;

  desyncMitigationMode?: string | core.StringOut;

  healthCheck?: HealthCheck;

  idleTimeout?: number | core.NumberOut;

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

  internal?: boolean | core.BooleanOut;

  listener: core.Array<Listener> | core.ArrayOut<Listener>;

  name?: string | core.StringOut;

  namePrefix?: string | core.StringOut;

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

  sourceSecurityGroup?: string | core.StringOut;

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

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

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

export class Main extends core.Resource<MainArgs> {
  @core.attr(AccessLogs)
  public accessLogs?: AccessLogs;

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

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

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

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

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

  @core.attr(HealthCheck, { computed: true })
  public healthCheck?: HealthCheck;

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

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

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

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

  @core.attr(Listener, { kind: "array" })
  public listener!: core.Array<Listener> | core.ArrayOut<Listener>;

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

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

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

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

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

  @core.attr(String, { computed: true, kind: "array" })
  public subnets?: core.Array<string> | core.ArrayOut<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 })
  public zoneId!: string | core.StringOut;

  constructor(name: string, args?: MainArgs) {
    super(name, "aws_elb", args);
  }

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