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

export interface RequestParameterArgs extends core.SchemaArgs {
  requestParameterKey: string | core.StringOut;

  required: boolean | core.BooleanOut;
}

export class RequestParameter extends core.Schema<RequestParameterArgs> {
  @core.attr(String)
  public requestParameterKey!: string | core.StringOut;

  @core.attr(Boolean)
  public required!: boolean | core.BooleanOut;
}

export interface RouteArgs extends core.ResourceArgs {
  apiId: string | core.StringOut;

  apiKeyRequired?: boolean | core.BooleanOut;

  authorizationScopes?: core.Array<string> | core.ArrayOut<core.StringOut>;

  authorizationType?: string | core.StringOut;

  authorizerId?: string | core.StringOut;

  modelSelectionExpression?: string | core.StringOut;

  operationName?: string | core.StringOut;

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

  requestParameter?:
    | core.Array<RequestParameter>
    | core.ArrayOut<RequestParameter>;

  routeKey: string | core.StringOut;

  routeResponseSelectionExpression?: string | core.StringOut;

  target?: string | core.StringOut;
}

export class Route extends core.Resource<RouteArgs> {
  @core.attr(String)
  public apiId!: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: RouteArgs) {
    super(name, "aws_apigatewayv2_route", args);
  }

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