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)
  public customCname?: string | core.StringOut;

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

  @core.attr(Number)
  public expirationInDays!: number | core.NumberOut;

  @core.attr(String)
  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)
  public enabled!: boolean | core.BooleanOut;

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

export interface RevocationConfigurationArgs extends core.SchemaArgs {
  crlConfiguration?: CrlConfiguration;

  ocspConfiguration?: OcspConfiguration;
}

export class RevocationConfiguration extends core.Schema<RevocationConfigurationArgs> {
  @core.attr(CrlConfiguration)
  public crlConfiguration?: CrlConfiguration;

  @core.attr(OcspConfiguration)
  public ocspConfiguration?: OcspConfiguration;
}

export interface SubjectArgs extends core.SchemaArgs {
  commonName?: string | core.StringOut;

  country?: string | core.StringOut;

  distinguishedNameQualifier?: string | core.StringOut;

  generationQualifier?: string | core.StringOut;

  givenName?: string | core.StringOut;

  initials?: string | core.StringOut;

  locality?: string | core.StringOut;

  organization?: string | core.StringOut;

  organizationalUnit?: string | core.StringOut;

  pseudonym?: string | core.StringOut;

  state?: string | core.StringOut;

  surname?: string | core.StringOut;

  title?: string | core.StringOut;
}

export class Subject extends core.Schema<SubjectArgs> {
  @core.attr(String)
  public commonName?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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

export interface CertificateAuthorityConfigurationArgs extends core.SchemaArgs {
  keyAlgorithm: string | core.StringOut;

  signingAlgorithm: string | core.StringOut;

  subject: Subject;
}

export class CertificateAuthorityConfiguration extends core.Schema<CertificateAuthorityConfigurationArgs> {
  @core.attr(String)
  public keyAlgorithm!: string | core.StringOut;

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

  @core.attr(Subject)
  public subject!: Subject;
}

export interface CertificateAuthorityArgs extends core.ResourceArgs {
  certificateAuthorityConfiguration: CertificateAuthorityConfiguration;

  enabled?: boolean | core.BooleanOut;

  permanentDeletionTimeInDays?: number | core.NumberOut;

  revocationConfiguration?: RevocationConfiguration;

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

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

  type?: string | core.StringOut;
}

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

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

  @core.attr(CertificateAuthorityConfiguration)
  public certificateAuthorityConfiguration!: CertificateAuthorityConfiguration;

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

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

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

  @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(Number)
  public permanentDeletionTimeInDays?: number | core.NumberOut;

  @core.attr(RevocationConfiguration)
  public revocationConfiguration?: RevocationConfiguration;

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

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

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

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

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

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

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