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

export interface StickinessArgs extends core.SchemaArgs {
  cookieDuration?: number | core.NumberOut;

  cookieName?: string | core.StringOut;

  enabled?: boolean | core.BooleanOut;

  type: string | core.StringOut;
}

export class Stickiness extends core.Schema<StickinessArgs> {
  @core.attr(Number)
  public cookieDuration?: number | core.NumberOut;

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

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

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

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

  healthyThreshold?: number | core.NumberOut;

  interval?: number | core.NumberOut;

  matcher?: string | core.StringOut;

  path?: string | core.StringOut;

  port?: string | core.StringOut;

  protocol?: string | core.StringOut;

  timeout?: number | core.NumberOut;

  unhealthyThreshold?: number | core.NumberOut;
}

export class HealthCheck extends core.Schema<HealthCheckArgs> {
  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

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

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

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

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

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

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

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

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

export interface LbTargetGroupArgs extends core.ResourceArgs {
  connectionTermination?: boolean | core.BooleanOut;

  deregistrationDelay?: string | core.StringOut;

  healthCheck?: HealthCheck;

  ipAddressType?: string | core.StringOut;

  lambdaMultiValueHeadersEnabled?: boolean | core.BooleanOut;

  loadBalancingAlgorithmType?: string | core.StringOut;

  name?: string | core.StringOut;

  namePrefix?: string | core.StringOut;

  port?: number | core.NumberOut;

  preserveClientIp?: string | core.StringOut;

  protocol?: string | core.StringOut;

  protocolVersion?: string | core.StringOut;

  proxyProtocolV2?: boolean | core.BooleanOut;

  slowStart?: number | core.NumberOut;

  stickiness?: Stickiness;

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

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

  targetType?: string | core.StringOut;

  vpcId?: string | core.StringOut;
}

export class LbTargetGroup extends core.Resource<LbTargetGroupArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(Stickiness, { computed: true })
  public stickiness?: Stickiness;

  @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)
  public targetType?: string | core.StringOut;

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

  constructor(name: string, args?: LbTargetGroupArgs) {
    super(name, "aws_lb_target_group", args);
  }

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