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

export interface FunctionArgs extends core.ResourceArgs {
  code: string | core.StringOut;

  comment?: string | core.StringOut;

  name: string | core.StringOut;

  publish?: boolean | core.BooleanOut;

  runtime: string | core.StringOut;
}

export class Function extends core.Resource<FunctionArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: FunctionArgs) {
    super(name, "aws_cloudfront_function", args);
  }

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