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

export interface RevocationRecordArgs extends core.SchemaArgs {
  revocationEffectiveFrom: string | core.StringOut;

  revokedAt: string | core.StringOut;

  revokedBy: string | core.StringOut;
}

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

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

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

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

  value: number | core.NumberOut;
}

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

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

export interface SigningProfileArgs extends core.ResourceArgs {
  name?: string | core.StringOut;

  namePrefix?: string | core.StringOut;

  platformId: string | core.StringOut;

  signatureValidityPeriod?: SignatureValidityPeriod;

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

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

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

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

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

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

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

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

  @core.attr(RevocationRecord, { computed: true, kind: "array" })
  public revocationRecord!:
    | core.Array<RevocationRecord>
    | core.ArrayOut<RevocationRecord>;

  @core.attr(SignatureValidityPeriod, { computed: true })
  public signatureValidityPeriod?: SignatureValidityPeriod;

  @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, { computed: true })
  public version!: string | core.StringOut;

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

  constructor(name: string, args?: SigningProfileArgs) {
    super(name, "aws_signer_signing_profile", args);
  }

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