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

export interface IamArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;
}

export class Iam extends core.Schema<IamArgs> {
  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;
}

export interface SaslArgs extends core.SchemaArgs {
  iam: Iam;
}

export class Sasl extends core.Schema<SaslArgs> {
  @core.attr(Iam)
  public iam!: Iam;
}

export interface ClientAuthenticationArgs extends core.SchemaArgs {
  sasl: Sasl;
}

export class ClientAuthentication extends core.Schema<ClientAuthenticationArgs> {
  @core.attr(Sasl)
  public sasl!: Sasl;
}

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

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

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

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

export interface MskServerlessClusterArgs extends core.ResourceArgs {
  clientAuthentication: ClientAuthentication;

  clusterName: string | core.StringOut;

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

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

  vpcConfig: core.Array<VpcConfig> | core.ArrayOut<VpcConfig>;
}

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

  @core.attr(ClientAuthentication)
  public clientAuthentication!: ClientAuthentication;

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

  @core.attr(String, { computed: true })
  public id!: 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(VpcConfig, { kind: "array" })
  public vpcConfig!: core.Array<VpcConfig> | core.ArrayOut<VpcConfig>;

  constructor(name: string, args?: MskServerlessClusterArgs) {
    super(name, "aws_msk_serverless_cluster", args);
  }

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