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

export interface TargetTableArgs extends core.SchemaArgs {
  catalogId: string | core.StringOut;

  databaseName: string | core.StringOut;

  name: string | core.StringOut;
}

export class TargetTable extends core.Schema<TargetTableArgs> {
  @core.attr(String)
  public catalogId!: string | core.StringOut;

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

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

export interface PartitionIndexArgs extends core.SchemaArgs {
  indexName: string | core.StringOut;

  indexStatus: string | core.StringOut;

  keys: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class PartitionIndex extends core.Schema<PartitionIndexArgs> {
  @core.attr(String)
  public indexName!: string | core.StringOut;

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

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

export interface PartitionKeysArgs extends core.SchemaArgs {
  comment?: string | core.StringOut;

  name: string | core.StringOut;

  type?: string | core.StringOut;
}

export class PartitionKeys extends core.Schema<PartitionKeysArgs> {
  @core.attr(String)
  public comment?: string | core.StringOut;

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

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

export interface SchemaIdArgs extends core.SchemaArgs {
  registryName?: string | core.StringOut;

  schemaArn?: string | core.StringOut;

  schemaName?: string | core.StringOut;
}

export class SchemaId extends core.Schema<SchemaIdArgs> {
  @core.attr(String)
  public registryName?: string | core.StringOut;

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

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

export interface SchemaReferenceArgs extends core.SchemaArgs {
  schemaId?: SchemaId;

  schemaVersionId?: string | core.StringOut;

  schemaVersionNumber: number | core.NumberOut;
}

export class SchemaReference extends core.Schema<SchemaReferenceArgs> {
  @core.attr(SchemaId)
  public schemaId?: SchemaId;

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

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

export interface SortColumnsArgs extends core.SchemaArgs {
  column: string | core.StringOut;

  sortOrder: number | core.NumberOut;
}

export class SortColumns extends core.Schema<SortColumnsArgs> {
  @core.attr(String)
  public column!: string | core.StringOut;

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

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

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

  serializationLibrary?: string | core.StringOut;
}

export class SerDeInfo extends core.Schema<SerDeInfoArgs> {
  @core.attr(String)
  public name?: string | core.StringOut;

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

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

export interface ColumnsArgs extends core.SchemaArgs {
  comment?: string | core.StringOut;

  name: string | core.StringOut;

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

  type?: string | core.StringOut;
}

export class Columns extends core.Schema<ColumnsArgs> {
  @core.attr(String)
  public comment?: string | core.StringOut;

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

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

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

export interface SkewedInfoArgs extends core.SchemaArgs {
  skewedColumnNames?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

  skewedColumnValues?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class SkewedInfo extends core.Schema<SkewedInfoArgs> {
  @core.attr(String, { kind: "array" })
  public skewedColumnNames?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

export interface StorageDescriptorArgs extends core.SchemaArgs {
  bucketColumns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  columns?: core.Array<Columns> | core.ArrayOut<Columns>;

  compressed?: boolean | core.BooleanOut;

  inputFormat?: string | core.StringOut;

  location?: string | core.StringOut;

  numberOfBuckets?: number | core.NumberOut;

  outputFormat?: string | core.StringOut;

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

  schemaReference?: SchemaReference;

  serDeInfo?: SerDeInfo;

  skewedInfo?: SkewedInfo;

  sortColumns?: core.Array<SortColumns> | core.ArrayOut<SortColumns>;

  storedAsSubDirectories?: boolean | core.BooleanOut;
}

export class StorageDescriptor extends core.Schema<StorageDescriptorArgs> {
  @core.attr(String, { kind: "array" })
  public bucketColumns?: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(Columns, { computed: true, kind: "array" })
  public columns?: core.Array<Columns> | core.ArrayOut<Columns>;

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

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

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

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

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

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

  @core.attr(SchemaReference)
  public schemaReference?: SchemaReference;

  @core.attr(SerDeInfo)
  public serDeInfo?: SerDeInfo;

  @core.attr(SkewedInfo)
  public skewedInfo?: SkewedInfo;

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

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

export interface CatalogTableArgs extends core.ResourceArgs {
  catalogId?: string | core.StringOut;

  databaseName: string | core.StringOut;

  description?: string | core.StringOut;

  name: string | core.StringOut;

  owner?: string | core.StringOut;

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

  partitionIndex?: core.Array<PartitionIndex> | core.ArrayOut<PartitionIndex>;

  partitionKeys?: core.Array<PartitionKeys> | core.ArrayOut<PartitionKeys>;

  retention?: number | core.NumberOut;

  storageDescriptor?: StorageDescriptor;

  tableType?: string | core.StringOut;

  targetTable?: TargetTable;

  viewExpandedText?: string | core.StringOut;

  viewOriginalText?: string | core.StringOut;
}

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

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

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

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

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

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

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

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

  @core.attr(PartitionIndex, { computed: true, kind: "array" })
  public partitionIndex?:
    | core.Array<PartitionIndex>
    | core.ArrayOut<PartitionIndex>;

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

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

  @core.attr(StorageDescriptor)
  public storageDescriptor?: StorageDescriptor;

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

  @core.attr(TargetTable)
  public targetTable?: TargetTable;

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

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

  constructor(name: string, args?: CatalogTableArgs) {
    super(name, "aws_glue_catalog_table", args);
  }

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