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

export interface PrimaryKeyArgs extends core.SchemaArgs {
  arn: string | core.StringOut;

  region: string | core.StringOut;
}

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

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

export interface ReplicaKeysArgs extends core.SchemaArgs {
  arn: string | core.StringOut;

  region: string | core.StringOut;
}

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

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

export interface MultiRegionConfigurationArgs extends core.SchemaArgs {
  multiRegionKeyType: string | core.StringOut;

  primaryKey: core.Array<PrimaryKey> | core.ArrayOut<PrimaryKey>;

  replicaKeys: core.Array<ReplicaKeys> | core.ArrayOut<ReplicaKeys>;
}

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

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

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

export interface DsKeyArgs {
  grantTokens?: core.Array<string> | core.ArrayOut<core.StringOut>;

  keyId: string | core.StringOut;
}

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

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

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

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

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

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

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

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

  @core.attr(String, { kind: "array" })
  public grantTokens?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: DsKeyArgs) {
    super(name, "aws_kms_key", args);
  }

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