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

export interface ValidityArgs extends core.SchemaArgs {
  type: string | core.StringOut;

  value: string | core.StringOut;
}

export class Validity extends core.Schema<ValidityArgs> {
  @core.attr(String)
  public type!: string | core.StringOut;

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

export interface CertificateArgs extends core.ResourceArgs {
  certificateAuthorityArn: string | core.StringOut;

  certificateSigningRequest: string | core.StringOut;

  signingAlgorithm: string | core.StringOut;

  templateArn?: string | core.StringOut;

  validity: Validity;
}

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

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

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

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

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

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

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

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

  @core.attr(Validity)
  public validity!: Validity;

  constructor(name: string, args?: CertificateArgs) {
    super(name, "aws_acmpca_certificate", args);
  }

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