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

export interface ClusterEndpointArgs extends core.SchemaArgs {
  address: string | core.StringOut;

  port: number | core.NumberOut;
}

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

  @core.attr(Number, { computed: true })
  public port!: number | core.NumberOut;
}

export interface EndpointArgs extends core.SchemaArgs {
  address: string | core.StringOut;

  port: number | core.NumberOut;
}

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

  @core.attr(Number, { computed: true })
  public port!: number | core.NumberOut;
}

export interface NodesArgs extends core.SchemaArgs {
  availabilityZone: string | core.StringOut;

  createTime: string | core.StringOut;

  endpoint: core.Array<Endpoint> | core.ArrayOut<Endpoint>;

  name: string | core.StringOut;
}

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

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

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

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

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

  nodes: core.Array<Nodes> | core.ArrayOut<Nodes>;

  numNodes: number | core.NumberOut;

  slots: string | core.StringOut;
}

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

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

  @core.attr(Number, { computed: true })
  public numNodes!: number | core.NumberOut;

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

export interface ClusterArgs extends core.ResourceArgs {
  aclName: string | core.StringOut;

  autoMinorVersionUpgrade?: boolean | core.BooleanOut;

  description?: string | core.StringOut;

  engineVersion?: string | core.StringOut;

  finalSnapshotName?: string | core.StringOut;

  kmsKeyArn?: string | core.StringOut;

  maintenanceWindow?: string | core.StringOut;

  name?: string | core.StringOut;

  namePrefix?: string | core.StringOut;

  nodeType: string | core.StringOut;

  numReplicasPerShard?: number | core.NumberOut;

  numShards?: number | core.NumberOut;

  parameterGroupName?: string | core.StringOut;

  port?: number | core.NumberOut;

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

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

  snapshotName?: string | core.StringOut;

  snapshotRetentionLimit?: number | core.NumberOut;

  snapshotWindow?: string | core.StringOut;

  snsTopicArn?: string | core.StringOut;

  subnetGroupName?: string | core.StringOut;

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

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

  tlsEnabled?: boolean | core.BooleanOut;
}

export class Cluster extends core.Resource<ClusterArgs> {
  @core.attr(String)
  public aclName!: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(Number, { computed: true })
  public port?: number | core.NumberOut;

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

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

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

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

  @core.attr(Number, { computed: true })
  public snapshotRetentionLimit?: number | core.NumberOut;

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

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

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

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

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

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

  constructor(name: string, args?: ClusterArgs) {
    super(name, "aws_memorydb_cluster", args);
  }

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