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

export interface JwtConfigurationArgs extends core.SchemaArgs {
  audience?: core.Array<string> | core.ArrayOut<core.StringOut>;

  issuer?: string | core.StringOut;
}

export class JwtConfiguration extends core.Schema<JwtConfigurationArgs> {
  @core.attr(String, { kind: "array" })
  public audience?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

  authorizerCredentialsArn?: string | core.StringOut;

  authorizerPayloadFormatVersion?: string | core.StringOut;

  authorizerResultTtlInSeconds?: number | core.NumberOut;

  authorizerType: string | core.StringOut;

  authorizerUri?: string | core.StringOut;

  enableSimpleResponses?: boolean | core.BooleanOut;

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

  jwtConfiguration?: JwtConfiguration;

  name: string | core.StringOut;
}

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

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

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

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

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

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

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

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

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

  @core.attr(JwtConfiguration)
  public jwtConfiguration?: JwtConfiguration;

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

  constructor(name: string, args?: AuthorizerArgs) {
    super(name, "aws_apigatewayv2_authorizer", args);
  }

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