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

export interface AuthArgs extends core.SchemaArgs {
  authScheme?: string | core.StringOut;

  description?: string | core.StringOut;

  iamAuth?: string | core.StringOut;

  secretArn?: string | core.StringOut;

  username?: string | core.StringOut;
}

export class Auth extends core.Schema<AuthArgs> {
  @core.attr(String)
  public authScheme?: string | core.StringOut;

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

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

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

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

export interface DbProxyArgs extends core.ResourceArgs {
  auth: core.Array<Auth> | core.ArrayOut<Auth>;

  debugLogging?: boolean | core.BooleanOut;

  engineFamily: string | core.StringOut;

  idleClientTimeout?: number | core.NumberOut;

  name: string | core.StringOut;

  requireTls?: boolean | core.BooleanOut;

  roleArn: 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>;

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

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

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

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

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

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

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

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

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

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

  @core.attr(String)
  public roleArn!: 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>;

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

  constructor(name: string, args?: DbProxyArgs) {
    super(name, "aws_db_proxy", args);
  }

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