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

export interface ComputeLimitsArgs extends core.SchemaArgs {
  maximumCapacityUnits: number | core.NumberOut;

  maximumCoreCapacityUnits?: number | core.NumberOut;

  maximumOndemandCapacityUnits?: number | core.NumberOut;

  minimumCapacityUnits: number | core.NumberOut;

  unitType: string | core.StringOut;
}

export class ComputeLimits extends core.Schema<ComputeLimitsArgs> {
  @core.attr(Number)
  public maximumCapacityUnits!: number | core.NumberOut;

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

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

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

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

export interface ManagedScalingPolicyArgs extends core.ResourceArgs {
  clusterId: string | core.StringOut;

  computeLimits: core.Array<ComputeLimits> | core.ArrayOut<ComputeLimits>;
}

export class ManagedScalingPolicy extends core.Resource<ManagedScalingPolicyArgs> {
  @core.attr(String)
  public clusterId!: string | core.StringOut;

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

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

  constructor(name: string, args?: ManagedScalingPolicyArgs) {
    super(name, "aws_emr_managed_scaling_policy", args);
  }

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