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

export interface VpcArgs extends core.SchemaArgs {
  securityGroups: core.Array<string> | core.ArrayOut<core.StringOut>;

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

export class Vpc extends core.Schema<VpcArgs> {
  @core.attr(String, { kind: "array" })
  public securityGroups!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

export interface ApacheKafkaClusterArgs extends core.SchemaArgs {
  bootstrapServers: string | core.StringOut;

  vpc: Vpc;
}

export class ApacheKafkaCluster extends core.Schema<ApacheKafkaClusterArgs> {
  @core.attr(String)
  public bootstrapServers!: string | core.StringOut;

  @core.attr(Vpc)
  public vpc!: Vpc;
}

export interface KafkaClusterArgs extends core.SchemaArgs {
  apacheKafkaCluster: ApacheKafkaCluster;
}

export class KafkaCluster extends core.Schema<KafkaClusterArgs> {
  @core.attr(ApacheKafkaCluster)
  public apacheKafkaCluster!: ApacheKafkaCluster;
}

export interface KafkaClusterClientAuthenticationArgs extends core.SchemaArgs {
  authenticationType?: string | core.StringOut;
}

export class KafkaClusterClientAuthentication extends core.Schema<KafkaClusterClientAuthenticationArgs> {
  @core.attr(String)
  public authenticationType?: string | core.StringOut;
}

export interface ScaleOutPolicyArgs extends core.SchemaArgs {
  cpuUtilizationPercentage?: number | core.NumberOut;
}

export class ScaleOutPolicy extends core.Schema<ScaleOutPolicyArgs> {
  @core.attr(Number, { computed: true })
  public cpuUtilizationPercentage?: number | core.NumberOut;
}

export interface ScaleInPolicyArgs extends core.SchemaArgs {
  cpuUtilizationPercentage?: number | core.NumberOut;
}

export class ScaleInPolicy extends core.Schema<ScaleInPolicyArgs> {
  @core.attr(Number, { computed: true })
  public cpuUtilizationPercentage?: number | core.NumberOut;
}

export interface AutoscalingArgs extends core.SchemaArgs {
  maxWorkerCount: number | core.NumberOut;

  mcuCount?: number | core.NumberOut;

  minWorkerCount: number | core.NumberOut;

  scaleInPolicy?: ScaleInPolicy;

  scaleOutPolicy?: ScaleOutPolicy;
}

export class Autoscaling extends core.Schema<AutoscalingArgs> {
  @core.attr(Number)
  public maxWorkerCount!: number | core.NumberOut;

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

  @core.attr(Number)
  public minWorkerCount!: number | core.NumberOut;

  @core.attr(ScaleInPolicy, { computed: true })
  public scaleInPolicy?: ScaleInPolicy;

  @core.attr(ScaleOutPolicy, { computed: true })
  public scaleOutPolicy?: ScaleOutPolicy;
}

export interface ProvisionedCapacityArgs extends core.SchemaArgs {
  mcuCount?: number | core.NumberOut;

  workerCount: number | core.NumberOut;
}

export class ProvisionedCapacity extends core.Schema<ProvisionedCapacityArgs> {
  @core.attr(Number)
  public mcuCount?: number | core.NumberOut;

  @core.attr(Number)
  public workerCount!: number | core.NumberOut;
}

export interface CapacityArgs extends core.SchemaArgs {
  autoscaling?: Autoscaling;

  provisionedCapacity?: ProvisionedCapacity;
}

export class Capacity extends core.Schema<CapacityArgs> {
  @core.attr(Autoscaling)
  public autoscaling?: Autoscaling;

  @core.attr(ProvisionedCapacity)
  public provisionedCapacity?: ProvisionedCapacity;
}

export interface KafkaClusterEncryptionInTransitArgs extends core.SchemaArgs {
  encryptionType?: string | core.StringOut;
}

export class KafkaClusterEncryptionInTransit extends core.Schema<KafkaClusterEncryptionInTransitArgs> {
  @core.attr(String)
  public encryptionType?: string | core.StringOut;
}

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

  revision: number | core.NumberOut;
}

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

  @core.attr(Number)
  public revision!: number | core.NumberOut;
}

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

  revision: number | core.NumberOut;
}

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

  @core.attr(Number)
  public revision!: number | core.NumberOut;
}

export interface PluginArgs extends core.SchemaArgs {
  customPlugin: CustomPlugin;
}

export class Plugin extends core.Schema<PluginArgs> {
  @core.attr(CustomPlugin)
  public customPlugin!: CustomPlugin;
}

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

  logGroup?: string | core.StringOut;
}

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

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

export interface FirehoseArgs extends core.SchemaArgs {
  deliveryStream?: string | core.StringOut;

  enabled: boolean | core.BooleanOut;
}

export class Firehose extends core.Schema<FirehoseArgs> {
  @core.attr(String)
  public deliveryStream?: string | core.StringOut;

  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;
}

export interface S3Args extends core.SchemaArgs {
  bucket?: string | core.StringOut;

  enabled: boolean | core.BooleanOut;

  prefix?: string | core.StringOut;
}

export class S3 extends core.Schema<S3Args> {
  @core.attr(String)
  public bucket?: string | core.StringOut;

  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;

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

export interface WorkerLogDeliveryArgs extends core.SchemaArgs {
  cloudwatchLogs?: CloudwatchLogs;

  firehose?: Firehose;

  s3?: S3;
}

export class WorkerLogDelivery extends core.Schema<WorkerLogDeliveryArgs> {
  @core.attr(CloudwatchLogs)
  public cloudwatchLogs?: CloudwatchLogs;

  @core.attr(Firehose)
  public firehose?: Firehose;

  @core.attr(S3)
  public s3?: S3;
}

export interface LogDeliveryArgs extends core.SchemaArgs {
  workerLogDelivery: WorkerLogDelivery;
}

export class LogDelivery extends core.Schema<LogDeliveryArgs> {
  @core.attr(WorkerLogDelivery)
  public workerLogDelivery!: WorkerLogDelivery;
}

export interface MskconnectConnectorArgs extends core.ResourceArgs {
  capacity: Capacity;

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

  description?: string | core.StringOut;

  kafkaCluster: KafkaCluster;

  kafkaClusterClientAuthentication: KafkaClusterClientAuthentication;

  kafkaClusterEncryptionInTransit: KafkaClusterEncryptionInTransit;

  kafkaconnectVersion: string | core.StringOut;

  logDelivery?: LogDelivery;

  name: string | core.StringOut;

  plugin: core.Array<Plugin> | core.ArrayOut<Plugin>;

  serviceExecutionRoleArn: string | core.StringOut;

  workerConfiguration?: WorkerConfiguration;
}

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

  @core.attr(Capacity)
  public capacity!: Capacity;

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

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

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

  @core.attr(KafkaCluster)
  public kafkaCluster!: KafkaCluster;

  @core.attr(KafkaClusterClientAuthentication)
  public kafkaClusterClientAuthentication!: KafkaClusterClientAuthentication;

  @core.attr(KafkaClusterEncryptionInTransit)
  public kafkaClusterEncryptionInTransit!: KafkaClusterEncryptionInTransit;

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

  @core.attr(LogDelivery)
  public logDelivery?: LogDelivery;

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

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

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

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

  @core.attr(WorkerConfiguration)
  public workerConfiguration?: WorkerConfiguration;

  constructor(name: string, args?: MskconnectConnectorArgs) {
    super(name, "aws_mskconnect_connector", args);
  }

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