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

export interface PoliciesArgs extends core.SchemaArgs {
  untrustedArtifactOnDeployment: string | core.StringOut;
}

export class Policies extends core.Schema<PoliciesArgs> {
  @core.attr(String)
  public untrustedArtifactOnDeployment!: string | core.StringOut;
}

export interface AllowedPublishersArgs extends core.SchemaArgs {
  signingProfileVersionArns: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class AllowedPublishers extends core.Schema<AllowedPublishersArgs> {
  @core.attr(String, { kind: "array" })
  public signingProfileVersionArns!:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;
}

export interface CodeSigningConfigArgs extends core.ResourceArgs {
  allowedPublishers: AllowedPublishers;

  description?: string | core.StringOut;

  policies?: Policies;
}

export class CodeSigningConfig extends core.Resource<CodeSigningConfigArgs> {
  @core.attr(AllowedPublishers)
  public allowedPublishers!: AllowedPublishers;

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

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

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

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

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

  @core.attr(Policies, { computed: true })
  public policies?: Policies;

  constructor(name: string, args?: CodeSigningConfigArgs) {
    super(name, "aws_lambda_code_signing_config", args);
  }

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