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

export interface EncryptionSpecificationArgs extends core.SchemaArgs {
  kmsKeyIdentifier?: string | core.StringOut;

  type?: string | core.StringOut;
}

export class EncryptionSpecification extends core.Schema<EncryptionSpecificationArgs> {
  @core.attr(String)
  public kmsKeyIdentifier?: string | core.StringOut;

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

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

  orderBy: string | core.StringOut;
}

export class ClusteringKey extends core.Schema<ClusteringKeyArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

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

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

  type: string | core.StringOut;
}

export class Column extends core.Schema<ColumnArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

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

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

export class PartitionKey extends core.Schema<PartitionKeyArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;
}

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

export class StaticColumn extends core.Schema<StaticColumnArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;
}

export interface SchemaDefinitionArgs extends core.SchemaArgs {
  clusteringKey?: core.Array<ClusteringKey> | core.ArrayOut<ClusteringKey>;

  column: core.Array<Column> | core.ArrayOut<Column>;

  partitionKey: core.Array<PartitionKey> | core.ArrayOut<PartitionKey>;

  staticColumn?: core.Array<StaticColumn> | core.ArrayOut<StaticColumn>;
}

export class SchemaDefinition extends core.Schema<SchemaDefinitionArgs> {
  @core.attr(ClusteringKey, { kind: "array" })
  public clusteringKey?:
    | core.Array<ClusteringKey>
    | core.ArrayOut<ClusteringKey>;

  @core.attr(Column, { kind: "array" })
  public column!: core.Array<Column> | core.ArrayOut<Column>;

  @core.attr(PartitionKey, { kind: "array" })
  public partitionKey!: core.Array<PartitionKey> | core.ArrayOut<PartitionKey>;

  @core.attr(StaticColumn, { kind: "array" })
  public staticColumn?: core.Array<StaticColumn> | core.ArrayOut<StaticColumn>;
}

export interface CommentArgs extends core.SchemaArgs {
  message?: string | core.StringOut;
}

export class Comment extends core.Schema<CommentArgs> {
  @core.attr(String, { computed: true })
  public message?: string | core.StringOut;
}

export interface PointInTimeRecoveryArgs extends core.SchemaArgs {
  status?: string | core.StringOut;
}

export class PointInTimeRecovery extends core.Schema<PointInTimeRecoveryArgs> {
  @core.attr(String, { computed: true })
  public status?: string | core.StringOut;
}

export interface CapacitySpecificationArgs extends core.SchemaArgs {
  readCapacityUnits?: number | core.NumberOut;

  throughputMode?: string | core.StringOut;

  writeCapacityUnits?: number | core.NumberOut;
}

export class CapacitySpecification extends core.Schema<CapacitySpecificationArgs> {
  @core.attr(Number)
  public readCapacityUnits?: number | core.NumberOut;

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

  @core.attr(Number)
  public writeCapacityUnits?: number | core.NumberOut;
}

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

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

export interface TableArgs extends core.ResourceArgs {
  capacitySpecification?: CapacitySpecification;

  comment?: Comment;

  defaultTimeToLive?: number | core.NumberOut;

  encryptionSpecification?: EncryptionSpecification;

  keyspaceName: string | core.StringOut;

  pointInTimeRecovery?: PointInTimeRecovery;

  schemaDefinition: SchemaDefinition;

  tableName: string | core.StringOut;

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

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

  ttl?: Ttl;
}

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

  @core.attr(CapacitySpecification, { computed: true })
  public capacitySpecification?: CapacitySpecification;

  @core.attr(Comment, { computed: true })
  public comment?: Comment;

  @core.attr(Number)
  public defaultTimeToLive?: number | core.NumberOut;

  @core.attr(EncryptionSpecification, { computed: true })
  public encryptionSpecification?: EncryptionSpecification;

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

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

  @core.attr(PointInTimeRecovery, { computed: true })
  public pointInTimeRecovery?: PointInTimeRecovery;

  @core.attr(SchemaDefinition)
  public schemaDefinition!: SchemaDefinition;

  @core.attr(String)
  public tableName!: 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(Ttl)
  public ttl?: Ttl;

  constructor(name: string, args?: TableArgs) {
    super(name, "aws_keyspaces_table", args);
  }

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