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

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

  kmsKeyArn: string | core.StringOut;
}

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

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

export interface AttributeArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  type: string | core.StringOut;
}

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

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

export interface TtlArgs extends core.SchemaArgs {
  attributeName: string | core.StringOut;

  enabled: boolean | core.BooleanOut;
}

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

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

export interface GlobalSecondaryIndexArgs extends core.SchemaArgs {
  hashKey: string | core.StringOut;

  name: string | core.StringOut;

  nonKeyAttributes: core.Array<string> | core.ArrayOut<core.StringOut>;

  projectionType: string | core.StringOut;

  rangeKey: string | core.StringOut;

  readCapacity: number | core.NumberOut;

  writeCapacity: number | core.NumberOut;
}

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

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

  @core.attr(String, { computed: true, kind: "array" })
  public nonKeyAttributes!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

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

export interface ReplicaArgs extends core.SchemaArgs {
  kmsKeyArn: string | core.StringOut;

  regionName: string | core.StringOut;
}

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

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

export interface LocalSecondaryIndexArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  nonKeyAttributes: core.Array<string> | core.ArrayOut<core.StringOut>;

  projectionType: string | core.StringOut;

  rangeKey: string | core.StringOut;
}

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

  @core.attr(String, { computed: true, kind: "array" })
  public nonKeyAttributes!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

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

export interface DsTableArgs {
  name: string | core.StringOut;

  serverSideEncryption?: ServerSideEncryption;

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(ServerSideEncryption, { computed: true })
  public serverSideEncryption?: ServerSideEncryption;

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

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

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

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

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

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

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

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

  constructor(name: string, args?: DsTableArgs) {
    super(name, "aws_dynamodb_table", args);
  }

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