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

export interface CorsConfigurationArgs extends core.SchemaArgs {
  allowCredentials: boolean | core.BooleanOut;

  allowHeaders: core.Array<string> | core.ArrayOut<core.StringOut>;

  allowMethods: core.Array<string> | core.ArrayOut<core.StringOut>;

  allowOrigins: core.Array<string> | core.ArrayOut<core.StringOut>;

  exposeHeaders: core.Array<string> | core.ArrayOut<core.StringOut>;

  maxAge: number | core.NumberOut;
}

export class CorsConfiguration extends core.Schema<CorsConfigurationArgs> {
  @core.attr(Boolean, { computed: true })
  public allowCredentials!: boolean | core.BooleanOut;

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

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

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

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

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

export interface DsApiArgs {
  apiId: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: DsApiArgs) {
    super(name, "aws_apigatewayv2_api", args);
  }

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