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

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

  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)
  public type?: string | 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>;

  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, { 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(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 PartitionArgs extends core.ResourceArgs {
  catalogId?: string | core.StringOut;

  databaseName: string | core.StringOut;

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

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

  storageDescriptor?: StorageDescriptor;

  tableName: string | core.StringOut;
}

export class Partition extends core.Resource<PartitionArgs> {
  @core.attr(String, { computed: true })
  public catalogId?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: PartitionArgs) {
    super(name, "aws_glue_partition", args);
  }

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