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

export interface AuthenticateCognitoArgs extends core.SchemaArgs {
  authenticationRequestExtraParams:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

  onUnauthenticatedRequest: string | core.StringOut;

  scope: string | core.StringOut;

  sessionCookieName: string | core.StringOut;

  sessionTimeout: number | core.NumberOut;

  userPoolArn: string | core.StringOut;

  userPoolClientId: string | core.StringOut;

  userPoolDomain: string | core.StringOut;
}

export class AuthenticateCognito extends core.Schema<AuthenticateCognitoArgs> {
  @core.attr(String, { computed: true, kind: "map" })
  public authenticationRequestExtraParams!:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

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

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

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

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

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

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

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

export interface AuthenticateOidcArgs extends core.SchemaArgs {
  authenticationRequestExtraParams:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

  authorizationEndpoint: string | core.StringOut;

  clientId: string | core.StringOut;

  clientSecret: string | core.StringOut;

  issuer: string | core.StringOut;

  onUnauthenticatedRequest: string | core.StringOut;

  scope: string | core.StringOut;

  sessionCookieName: string | core.StringOut;

  sessionTimeout: number | core.NumberOut;

  tokenEndpoint: string | core.StringOut;

  userInfoEndpoint: string | core.StringOut;
}

export class AuthenticateOidc extends core.Schema<AuthenticateOidcArgs> {
  @core.attr(String, { computed: true, kind: "map" })
  public authenticationRequestExtraParams!:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

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

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

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

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

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

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

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

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

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

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

export interface FixedResponseArgs extends core.SchemaArgs {
  contentType: string | core.StringOut;

  messageBody: string | core.StringOut;

  statusCode: string | core.StringOut;
}

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

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

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

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

  enabled: boolean | core.BooleanOut;
}

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

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

export interface TargetGroupArgs extends core.SchemaArgs {
  arn: string | core.StringOut;

  weight: number | core.NumberOut;
}

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

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

export interface ForwardArgs extends core.SchemaArgs {
  stickiness: core.Array<Stickiness> | core.ArrayOut<Stickiness>;

  targetGroup: core.Array<TargetGroup> | core.ArrayOut<TargetGroup>;
}

export class Forward extends core.Schema<ForwardArgs> {
  @core.attr(Stickiness, { computed: true, kind: "array" })
  public stickiness!: core.Array<Stickiness> | core.ArrayOut<Stickiness>;

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

export interface RedirectArgs extends core.SchemaArgs {
  host: string | core.StringOut;

  path: string | core.StringOut;

  port: string | core.StringOut;

  protocol: string | core.StringOut;

  query: string | core.StringOut;

  statusCode: string | core.StringOut;
}

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

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

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

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

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

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

export interface DefaultActionArgs extends core.SchemaArgs {
  authenticateCognito:
    | core.Array<AuthenticateCognito>
    | core.ArrayOut<AuthenticateCognito>;

  authenticateOidc:
    | core.Array<AuthenticateOidc>
    | core.ArrayOut<AuthenticateOidc>;

  fixedResponse: core.Array<FixedResponse> | core.ArrayOut<FixedResponse>;

  forward: core.Array<Forward> | core.ArrayOut<Forward>;

  order: number | core.NumberOut;

  redirect: core.Array<Redirect> | core.ArrayOut<Redirect>;

  targetGroupArn: string | core.StringOut;

  type: string | core.StringOut;
}

export class DefaultAction extends core.Schema<DefaultActionArgs> {
  @core.attr(AuthenticateCognito, { computed: true, kind: "array" })
  public authenticateCognito!:
    | core.Array<AuthenticateCognito>
    | core.ArrayOut<AuthenticateCognito>;

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

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

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

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

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

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

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

export interface DsLbListenerArgs {
  arn?: string | core.StringOut;

  loadBalancerArn?: string | core.StringOut;

  port?: number | core.NumberOut;

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

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

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: DsLbListenerArgs) {
    super(name, "aws_lb_listener", args);
  }

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