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

export interface InvocationArgs extends core.ResourceArgs {
  functionName: string | core.StringOut;

  input: string | core.StringOut;

  qualifier?: string | core.StringOut;

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

export class Invocation extends core.Resource<InvocationArgs> {
  @core.attr(String)
  public functionName!: string | core.StringOut;

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

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

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

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

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

  constructor(name: string, args?: InvocationArgs) {
    super(name, "aws_lambda_invocation", args);
  }

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