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

export interface MaximumCapacityArgs extends core.SchemaArgs {
  cpu: string | core.StringOut;

  disk?: string | core.StringOut;

  memory: string | core.StringOut;
}

export class MaximumCapacity extends core.Schema<MaximumCapacityArgs> {
  @core.attr(String)
  public cpu!: string | core.StringOut;

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

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

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

export class AutoStartConfiguration extends core.Schema<AutoStartConfigurationArgs> {
  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;
}

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

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

export class NetworkConfiguration extends core.Schema<NetworkConfigurationArgs> {
  @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 WorkerConfigurationArgs extends core.SchemaArgs {
  cpu: string | core.StringOut;

  disk?: string | core.StringOut;

  memory: string | core.StringOut;
}

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

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

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

export interface InitialCapacityConfigArgs extends core.SchemaArgs {
  workerConfiguration?: WorkerConfiguration;

  workerCount: number | core.NumberOut;
}

export class InitialCapacityConfig extends core.Schema<InitialCapacityConfigArgs> {
  @core.attr(WorkerConfiguration)
  public workerConfiguration?: WorkerConfiguration;

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

export interface InitialCapacityArgs extends core.SchemaArgs {
  initialCapacityConfig?: InitialCapacityConfig;

  initialCapacityType: string | core.StringOut;
}

export class InitialCapacity extends core.Schema<InitialCapacityArgs> {
  @core.attr(InitialCapacityConfig)
  public initialCapacityConfig?: InitialCapacityConfig;

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

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

  idleTimeoutMinutes?: number | core.NumberOut;
}

export class AutoStopConfiguration extends core.Schema<AutoStopConfigurationArgs> {
  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

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

export interface ApplicationArgs extends core.ResourceArgs {
  autoStartConfiguration?: AutoStartConfiguration;

  autoStopConfiguration?: AutoStopConfiguration;

  initialCapacity?:
    | core.Array<InitialCapacity>
    | core.ArrayOut<InitialCapacity>;

  maximumCapacity?: MaximumCapacity;

  name: string | core.StringOut;

  networkConfiguration?: NetworkConfiguration;

  releaseLabel: string | core.StringOut;

  /**
   * (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configu
   * ration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configu
   * ration-block) present, tags with matching keys will overwrite those defined at the provider-level.
   */
  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * Map of tags assigned to the resource, including those inherited from the provider [`default_tags` co
   * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co
   * nfiguration-block).
   */
  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  type: string | core.StringOut;
}

export class Application extends core.Resource<ApplicationArgs> {
  /**
   * ARN of the cluster.
   */
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(AutoStartConfiguration, { computed: true })
  public autoStartConfiguration?: AutoStartConfiguration;

  @core.attr(AutoStopConfiguration, { computed: true })
  public autoStopConfiguration?: AutoStopConfiguration;

  /**
   * The ID of the cluster.
   */
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  @core.attr(InitialCapacity, { kind: "array" })
  public initialCapacity?:
    | core.Array<InitialCapacity>
    | core.ArrayOut<InitialCapacity>;

  @core.attr(MaximumCapacity)
  public maximumCapacity?: MaximumCapacity;

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

  @core.attr(NetworkConfiguration)
  public networkConfiguration?: NetworkConfiguration;

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

  /**
   * (Optional) Key-value mapping of resource tags. If configured with a provider [`default_tags` configu
   * ration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configu
   * ration-block) present, tags with matching keys will overwrite those defined at the provider-level.
   */
  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * Map of tags assigned to the resource, including those inherited from the provider [`default_tags` co
   * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co
   * nfiguration-block).
   */
  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

  constructor(name: string, args?: ApplicationArgs) {
    super(name, "aws_emrserverless_application", args);
  }

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