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

export interface PermissionArgs extends core.ResourceArgs {
  action: string | core.StringOut;

  eventSourceToken?: string | core.StringOut;

  functionName: string | core.StringOut;

  functionUrlAuthType?: string | core.StringOut;

  principal: string | core.StringOut;

  principalOrgId?: string | core.StringOut;

  qualifier?: string | core.StringOut;

  sourceAccount?: string | core.StringOut;

  sourceArn?: string | core.StringOut;

  statementId?: string | core.StringOut;

  statementIdPrefix?: string | core.StringOut;
}

export class Permission extends core.Resource<PermissionArgs> {
  @core.attr(String)
  public action!: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: PermissionArgs) {
    super(name, "aws_lambda_permission", args);
  }

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