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

export interface PrincipalArgs extends core.SchemaArgs {
  dataLakePrincipalIdentifier?: string | core.StringOut;
}

export class Principal extends core.Schema<PrincipalArgs> {
  @core.attr(String)
  public dataLakePrincipalIdentifier?: string | core.StringOut;
}

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

  principal?: Principal;
}

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

  @core.attr(Principal)
  public principal?: Principal;
}

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

  databaseName: string | core.StringOut;
}

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

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

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

  createTableDefaultPermission?:
    | core.Array<CreateTableDefaultPermission>
    | core.ArrayOut<CreateTableDefaultPermission>;

  description?: string | core.StringOut;

  locationUri?: string | core.StringOut;

  name: string | core.StringOut;

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

  targetDatabase?: TargetDatabase;
}

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

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

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

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

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

  @core.attr(String, { computed: true })
  public locationUri?: 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(TargetDatabase)
  public targetDatabase?: TargetDatabase;

  constructor(name: string, args?: CatalogDatabaseArgs) {
    super(name, "aws_glue_catalog_database", args);
  }

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