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

export interface GlobalClusterMembersArgs extends core.SchemaArgs {
  dbClusterArn: string | core.StringOut;

  isWriter: boolean | core.BooleanOut;
}

export class GlobalClusterMembers extends core.Schema<GlobalClusterMembersArgs> {
  @core.attr(String, { computed: true })
  public dbClusterArn!: string | core.StringOut;

  @core.attr(Boolean, { computed: true })
  public isWriter!: boolean | core.BooleanOut;
}

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

  deletionProtection?: boolean | core.BooleanOut;

  engine?: string | core.StringOut;

  engineVersion?: string | core.StringOut;

  globalClusterIdentifier: string | core.StringOut;

  sourceDbClusterIdentifier?: string | core.StringOut;

  storageEncrypted?: boolean | core.BooleanOut;
}

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

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

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

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

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

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

  @core.attr(GlobalClusterMembers, { computed: true, kind: "array" })
  public globalClusterMembers!:
    | core.Array<GlobalClusterMembers>
    | core.ArrayOut<GlobalClusterMembers>;

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

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

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

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

  @core.attr(Boolean, { computed: true })
  public storageEncrypted?: boolean | core.BooleanOut;

  constructor(name: string, args?: GlobalClusterArgs) {
    super(name, "aws_docdb_global_cluster", args);
  }

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