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

export interface RouteSettingsArgs extends core.SchemaArgs {
  dataTraceEnabled?: boolean | core.BooleanOut;

  detailedMetricsEnabled?: boolean | core.BooleanOut;

  loggingLevel?: string | core.StringOut;

  routeKey: string | core.StringOut;

  throttlingBurstLimit?: number | core.NumberOut;

  throttlingRateLimit?: number | core.NumberOut;
}

export class RouteSettings extends core.Schema<RouteSettingsArgs> {
  @core.attr(Boolean)
  public dataTraceEnabled?: boolean | core.BooleanOut;

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

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

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

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

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

export interface AccessLogSettingsArgs extends core.SchemaArgs {
  destinationArn: string | core.StringOut;

  format: string | core.StringOut;
}

export class AccessLogSettings extends core.Schema<AccessLogSettingsArgs> {
  @core.attr(String)
  public destinationArn!: string | core.StringOut;

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

export interface DefaultRouteSettingsArgs extends core.SchemaArgs {
  dataTraceEnabled?: boolean | core.BooleanOut;

  detailedMetricsEnabled?: boolean | core.BooleanOut;

  loggingLevel?: string | core.StringOut;

  throttlingBurstLimit?: number | core.NumberOut;

  throttlingRateLimit?: number | core.NumberOut;
}

export class DefaultRouteSettings extends core.Schema<DefaultRouteSettingsArgs> {
  @core.attr(Boolean)
  public dataTraceEnabled?: boolean | core.BooleanOut;

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

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

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

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

export interface StageArgs extends core.ResourceArgs {
  accessLogSettings?: AccessLogSettings;

  apiId: string | core.StringOut;

  autoDeploy?: boolean | core.BooleanOut;

  clientCertificateId?: string | core.StringOut;

  defaultRouteSettings?: DefaultRouteSettings;

  deploymentId?: string | core.StringOut;

  description?: string | core.StringOut;

  name: string | core.StringOut;

  routeSettings?: core.Array<RouteSettings> | core.ArrayOut<RouteSettings>;

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

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

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

export class Stage extends core.Resource<StageArgs> {
  @core.attr(AccessLogSettings)
  public accessLogSettings?: AccessLogSettings;

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

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

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

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

  @core.attr(DefaultRouteSettings)
  public defaultRouteSettings?: DefaultRouteSettings;

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

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

  @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 invokeUrl!: string | core.StringOut;

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

  @core.attr(RouteSettings, { kind: "array" })
  public routeSettings?:
    | core.Array<RouteSettings>
    | core.ArrayOut<RouteSettings>;

  @core.attr(String, { kind: "map" })
  public stageVariables?:
    | core.Map<string, string>
    | core.MapOut<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>;

  constructor(name: string, args?: StageArgs) {
    super(name, "aws_apigatewayv2_stage", args);
  }

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