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

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

  databaseName: string | core.StringOut;

  name?: string | core.StringOut;

  wildcard?: boolean | core.BooleanOut;
}

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

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

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

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

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

  key: string | core.StringOut;

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

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

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

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

export interface ExpressionArgs extends core.SchemaArgs {
  key: string | core.StringOut;

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

export class Expression extends core.Schema<ExpressionArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

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

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

  expression: core.Array<Expression> | core.ArrayOut<Expression>;

  resourceType: string | core.StringOut;
}

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

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

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

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

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

  databaseName: string | core.StringOut;

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

  name: string | core.StringOut;

  wildcard?: boolean | core.BooleanOut;
}

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

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

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

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

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

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

export interface DataLocationArgs extends core.SchemaArgs {
  arn: string | core.StringOut;

  catalogId?: string | core.StringOut;
}

export class DataLocation extends core.Schema<DataLocationArgs> {
  @core.attr(String)
  public arn!: string | core.StringOut;

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

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

  name: string | core.StringOut;
}

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

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

export interface DsPermissionsArgs {
  catalogId?: string | core.StringOut;

  catalogResource?: boolean | core.BooleanOut;

  dataLocation?: DataLocation;

  database?: Database;

  lfTag?: LfTag;

  lfTagPolicy?: LfTagPolicy;

  principal: string | core.StringOut;

  table?: Table;

  tableWithColumns?: TableWithColumns;
}

export class DsPermissions extends core.Data<DsPermissionsArgs> {
  @core.attr(String)
  public catalogId?: string | core.StringOut;

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

  @core.attr(DataLocation, { computed: true })
  public dataLocation?: DataLocation;

  @core.attr(Database, { computed: true })
  public database?: Database;

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

  @core.attr(LfTag, { computed: true })
  public lfTag?: LfTag;

  @core.attr(LfTagPolicy, { computed: true })
  public lfTagPolicy?: LfTagPolicy;

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

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

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

  @core.attr(Table, { computed: true })
  public table?: Table;

  @core.attr(TableWithColumns, { computed: true })
  public tableWithColumns?: TableWithColumns;

  constructor(name: string, args?: DsPermissionsArgs) {
    super(name, "aws_lakeformation_permissions", args);
  }

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