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

export interface ManagedScalingArgs extends core.SchemaArgs {
  instanceWarmupPeriod?: number | core.NumberOut;

  maximumScalingStepSize?: number | core.NumberOut;

  minimumScalingStepSize?: number | core.NumberOut;

  status?: string | core.StringOut;

  targetCapacity?: number | core.NumberOut;
}

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

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

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

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

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

export interface AutoScalingGroupProviderArgs extends core.SchemaArgs {
  autoScalingGroupArn: string | core.StringOut;

  managedScaling?: ManagedScaling;

  managedTerminationProtection?: string | core.StringOut;
}

export class AutoScalingGroupProvider extends core.Schema<AutoScalingGroupProviderArgs> {
  @core.attr(String)
  public autoScalingGroupArn!: string | core.StringOut;

  @core.attr(ManagedScaling, { computed: true })
  public managedScaling?: ManagedScaling;

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

export interface CapacityProviderArgs extends core.ResourceArgs {
  autoScalingGroupProvider: AutoScalingGroupProvider;

  name: string | core.StringOut;

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

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

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

  @core.attr(AutoScalingGroupProvider)
  public autoScalingGroupProvider!: AutoScalingGroupProvider;

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

  @core.attr(String)
  public name!: 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>;

  constructor(name: string, args?: CapacityProviderArgs) {
    super(name, "aws_ecs_capacity_provider", args);
  }

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