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

export interface TlsConfigArgs extends core.SchemaArgs {
  insecureSkipVerification?: boolean | core.BooleanOut;
}

export class TlsConfig extends core.Schema<TlsConfigArgs> {
  @core.attr(Boolean)
  public insecureSkipVerification?: boolean | core.BooleanOut;
}

export interface IntegrationArgs extends core.ResourceArgs {
  cacheKeyParameters?: core.Array<string> | core.ArrayOut<core.StringOut>;

  cacheNamespace?: string | core.StringOut;

  connectionId?: string | core.StringOut;

  connectionType?: string | core.StringOut;

  contentHandling?: string | core.StringOut;

  credentials?: string | core.StringOut;

  httpMethod: string | core.StringOut;

  integrationHttpMethod?: string | core.StringOut;

  passthroughBehavior?: string | core.StringOut;

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

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

  resourceId: string | core.StringOut;

  restApiId: string | core.StringOut;

  timeoutMilliseconds?: number | core.NumberOut;

  tlsConfig?: TlsConfig;

  type: string | core.StringOut;

  uri?: string | core.StringOut;
}

export class Integration extends core.Resource<IntegrationArgs> {
  @core.attr(String, { kind: "array" })
  public cacheKeyParameters?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

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

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

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

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

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

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

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

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

  @core.attr(String, { computed: true })
  public passthroughBehavior?: 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(String)
  public resourceId!: string | core.StringOut;

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

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

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

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

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

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

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