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

export interface TlsConfigArgs extends core.SchemaArgs {
  serverNameToVerify?: string | core.StringOut;
}

export class TlsConfig extends core.Schema<TlsConfigArgs> {
  @core.attr(String)
  public serverNameToVerify?: string | core.StringOut;
}

export interface ResponseParametersArgs extends core.SchemaArgs {
  mappings: core.Map<string, string> | core.MapOut<core.StringOut>;

  statusCode: string | core.StringOut;
}

export class ResponseParameters extends core.Schema<ResponseParametersArgs> {
  @core.attr(String, { kind: "map" })
  public mappings!: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

  connectionId?: string | core.StringOut;

  connectionType?: string | core.StringOut;

  contentHandlingStrategy?: string | core.StringOut;

  credentialsArn?: string | core.StringOut;

  description?: string | core.StringOut;

  integrationMethod?: string | core.StringOut;

  integrationSubtype?: string | core.StringOut;

  integrationType: string | core.StringOut;

  integrationUri?: string | core.StringOut;

  passthroughBehavior?: string | core.StringOut;

  payloadFormatVersion?: string | core.StringOut;

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

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

  responseParameters?:
    | core.Array<ResponseParameters>
    | core.ArrayOut<ResponseParameters>;

  templateSelectionExpression?: string | core.StringOut;

  timeoutMilliseconds?: number | core.NumberOut;

  tlsConfig?: TlsConfig;
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(TlsConfig)
  public tlsConfig?: TlsConfig;

  constructor(name: string, args?: IntegrationArgs) {
    super(name, "aws_apigatewayv2_integration", args);
  }

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