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

export interface DefaultCapacityProviderStrategyArgs extends core.SchemaArgs {
  base?: number | core.NumberOut;

  capacityProvider: string | core.StringOut;

  weight?: number | core.NumberOut;
}

export class DefaultCapacityProviderStrategy extends core.Schema<DefaultCapacityProviderStrategyArgs> {
  @core.attr(Number)
  public base?: number | core.NumberOut;

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

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

export interface ClusterCapacityProvidersArgs extends core.ResourceArgs {
  capacityProviders?: core.Array<string> | core.ArrayOut<core.StringOut>;

  clusterName: string | core.StringOut;

  defaultCapacityProviderStrategy?:
    | core.Array<DefaultCapacityProviderStrategy>
    | core.ArrayOut<DefaultCapacityProviderStrategy>;
}

export class ClusterCapacityProviders extends core.Resource<ClusterCapacityProvidersArgs> {
  @core.attr(String, { kind: "array" })
  public capacityProviders?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

  constructor(name: string, args?: ClusterCapacityProvidersArgs) {
    super(name, "aws_ecs_cluster_capacity_providers", args);
  }

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