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

export interface DestinationS3Args extends core.SchemaArgs {
  bucket: string | core.StringOut;

  prefix?: string | core.StringOut;
}

export class DestinationS3 extends core.Schema<DestinationS3Args> {
  @core.attr(String)
  public bucket!: string | core.StringOut;

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

export interface DestinationArgs extends core.SchemaArgs {
  s3: DestinationS3;
}

export class Destination extends core.Schema<DestinationArgs> {
  @core.attr(DestinationS3)
  public s3!: DestinationS3;
}

export interface SignedObjectS3Args extends core.SchemaArgs {
  bucket: string | core.StringOut;

  key: string | core.StringOut;
}

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

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

export interface SignedObjectArgs extends core.SchemaArgs {
  s3: core.Array<SignedObjectS3> | core.ArrayOut<SignedObjectS3>;
}

export class SignedObject extends core.Schema<SignedObjectArgs> {
  @core.attr(SignedObjectS3, { computed: true, kind: "array" })
  public s3!: core.Array<SignedObjectS3> | core.ArrayOut<SignedObjectS3>;
}

export interface SourceS3Args extends core.SchemaArgs {
  bucket: string | core.StringOut;

  key: string | core.StringOut;

  version: string | core.StringOut;
}

export class SourceS3 extends core.Schema<SourceS3Args> {
  @core.attr(String)
  public bucket!: string | core.StringOut;

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

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

export interface SourceArgs extends core.SchemaArgs {
  s3: SourceS3;
}

export class Source extends core.Schema<SourceArgs> {
  @core.attr(SourceS3)
  public s3!: SourceS3;
}

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

  revokedAt: string | core.StringOut;

  revokedBy: string | core.StringOut;
}

export class RevocationRecord extends core.Schema<RevocationRecordArgs> {
  @core.attr(String, { computed: true })
  public reason!: 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 SigningJobArgs extends core.ResourceArgs {
  destination: Destination;

  ignoreSigningJobFailure?: boolean | core.BooleanOut;

  profileName: string | core.StringOut;

  source: Source;
}

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

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

  @core.attr(Destination)
  public destination!: Destination;

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(Source)
  public source!: Source;

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

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

  constructor(name: string, args?: SigningJobArgs) {
    super(name, "aws_signer_signing_job", args);
  }

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