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

export interface S3ConfigurationArgs extends core.SchemaArgs {
  bucketName?: string | core.StringOut;

  encryptionOption?: string | core.StringOut;

  kmsKeyId?: string | core.StringOut;

  objectKeyPrefix?: string | core.StringOut;
}

export class S3Configuration extends core.Schema<S3ConfigurationArgs> {
  @core.attr(String)
  public bucketName?: string | core.StringOut;

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

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

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

export interface MagneticStoreRejectedDataLocationArgs extends core.SchemaArgs {
  s3Configuration?: S3Configuration;
}

export class MagneticStoreRejectedDataLocation extends core.Schema<MagneticStoreRejectedDataLocationArgs> {
  @core.attr(S3Configuration)
  public s3Configuration?: S3Configuration;
}

export interface MagneticStoreWritePropertiesArgs extends core.SchemaArgs {
  enableMagneticStoreWrites?: boolean | core.BooleanOut;

  magneticStoreRejectedDataLocation?: MagneticStoreRejectedDataLocation;
}

export class MagneticStoreWriteProperties extends core.Schema<MagneticStoreWritePropertiesArgs> {
  @core.attr(Boolean)
  public enableMagneticStoreWrites?: boolean | core.BooleanOut;

  @core.attr(MagneticStoreRejectedDataLocation)
  public magneticStoreRejectedDataLocation?: MagneticStoreRejectedDataLocation;
}

export interface RetentionPropertiesArgs extends core.SchemaArgs {
  magneticStoreRetentionPeriodInDays: number | core.NumberOut;

  memoryStoreRetentionPeriodInHours: number | core.NumberOut;
}

export class RetentionProperties extends core.Schema<RetentionPropertiesArgs> {
  @core.attr(Number)
  public magneticStoreRetentionPeriodInDays!: number | core.NumberOut;

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

export interface TableArgs extends core.ResourceArgs {
  databaseName: string | core.StringOut;

  magneticStoreWriteProperties?: MagneticStoreWriteProperties;

  retentionProperties?: RetentionProperties;

  tableName: string | core.StringOut;

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

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

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

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

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

  @core.attr(MagneticStoreWriteProperties, { computed: true })
  public magneticStoreWriteProperties?: MagneticStoreWriteProperties;

  @core.attr(RetentionProperties, { computed: true })
  public retentionProperties?: RetentionProperties;

  @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>;

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

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