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

export interface MethodArgs extends core.ResourceArgs {
  apiKeyRequired?: boolean | core.BooleanOut;

  authorization: string | core.StringOut;

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

  authorizerId?: string | core.StringOut;

  httpMethod: string | core.StringOut;

  operationName?: string | core.StringOut;

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

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

  requestValidatorId?: string | core.StringOut;

  resourceId: string | core.StringOut;

  restApiId: string | core.StringOut;
}

export class Method extends core.Resource<MethodArgs> {
  @core.attr(Boolean)
  public apiKeyRequired?: boolean | core.BooleanOut;

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

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

  @core.attr(String)
  public authorizerId?: 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 operationName?: string | core.StringOut;

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

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

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

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

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

  constructor(name: string, args?: MethodArgs) {
    super(name, "aws_api_gateway_method", args);
  }

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