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

export interface CrlConfigurationArgs extends core.SchemaArgs {
  customCname: string | core.StringOut;

  enabled: boolean | core.BooleanOut;

  expirationInDays: number | core.NumberOut;

  s3BucketName: string | core.StringOut;

  s3ObjectAcl: string | core.StringOut;
}

export class CrlConfiguration extends core.Schema<CrlConfigurationArgs> {
  @core.attr(String, { computed: true })
  public customCname!: string | core.StringOut;

  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;

  @core.attr(Number, { computed: true })
  public expirationInDays!: number | core.NumberOut;

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

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

export interface OcspConfigurationArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;

  ocspCustomCname: string | core.StringOut;
}

export class OcspConfiguration extends core.Schema<OcspConfigurationArgs> {
  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;

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

export interface RevocationConfigurationArgs extends core.SchemaArgs {
  crlConfiguration?:
    | core.Array<CrlConfiguration>
    | core.ArrayOut<CrlConfiguration>;

  ocspConfiguration?:
    | core.Array<OcspConfiguration>
    | core.ArrayOut<OcspConfiguration>;
}

export class RevocationConfiguration extends core.Schema<RevocationConfigurationArgs> {
  @core.attr(CrlConfiguration, { computed: true, kind: "array" })
  public crlConfiguration?:
    | core.Array<CrlConfiguration>
    | core.ArrayOut<CrlConfiguration>;

  @core.attr(OcspConfiguration, { computed: true, kind: "array" })
  public ocspConfiguration?:
    | core.Array<OcspConfiguration>
    | core.ArrayOut<OcspConfiguration>;
}

export interface DsCertificateAuthorityArgs {
  arn: string | core.StringOut;

  revocationConfiguration?:
    | core.Array<RevocationConfiguration>
    | core.ArrayOut<RevocationConfiguration>;

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

export class DsCertificateAuthority extends core.Data<DsCertificateAuthorityArgs> {
  @core.attr(String)
  public arn!: string | core.StringOut;

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

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

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

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

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

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

  @core.attr(RevocationConfiguration, { computed: true, kind: "array" })
  public revocationConfiguration?:
    | core.Array<RevocationConfiguration>
    | core.ArrayOut<RevocationConfiguration>;

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

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

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

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

  constructor(name: string, args?: DsCertificateAuthorityArgs) {
    super(name, "aws_acmpca_certificate_authority", args);
  }

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