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

export interface TagFilterArgs extends core.SchemaArgs {
  key: string | core.StringOut;

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

export class TagFilter extends core.Schema<TagFilterArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

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

export interface ApplicationSourceArgs extends core.SchemaArgs {
  cloudformationStackArn?: string | core.StringOut;

  tagFilter?: core.Array<TagFilter> | core.ArrayOut<TagFilter>;
}

export class ApplicationSource extends core.Schema<ApplicationSourceArgs> {
  @core.attr(String)
  public cloudformationStackArn?: string | core.StringOut;

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

export interface PredefinedLoadMetricSpecificationArgs extends core.SchemaArgs {
  predefinedLoadMetricType: string | core.StringOut;

  resourceLabel?: string | core.StringOut;
}

export class PredefinedLoadMetricSpecification extends core.Schema<PredefinedLoadMetricSpecificationArgs> {
  @core.attr(String)
  public predefinedLoadMetricType!: string | core.StringOut;

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

export interface CustomizedScalingMetricSpecificationArgs
  extends core.SchemaArgs {
  dimensions?: core.Map<string, string> | core.MapOut<core.StringOut>;

  metricName: string | core.StringOut;

  namespace: string | core.StringOut;

  statistic: string | core.StringOut;

  unit?: string | core.StringOut;
}

export class CustomizedScalingMetricSpecification extends core.Schema<CustomizedScalingMetricSpecificationArgs> {
  @core.attr(String, { kind: "map" })
  public dimensions?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

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

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

export interface PredefinedScalingMetricSpecificationArgs
  extends core.SchemaArgs {
  predefinedScalingMetricType: string | core.StringOut;

  resourceLabel?: string | core.StringOut;
}

export class PredefinedScalingMetricSpecification extends core.Schema<PredefinedScalingMetricSpecificationArgs> {
  @core.attr(String)
  public predefinedScalingMetricType!: string | core.StringOut;

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

export interface TargetTrackingConfigurationArgs extends core.SchemaArgs {
  customizedScalingMetricSpecification?: CustomizedScalingMetricSpecification;

  disableScaleIn?: boolean | core.BooleanOut;

  estimatedInstanceWarmup?: number | core.NumberOut;

  predefinedScalingMetricSpecification?: PredefinedScalingMetricSpecification;

  scaleInCooldown?: number | core.NumberOut;

  scaleOutCooldown?: number | core.NumberOut;

  targetValue: number | core.NumberOut;
}

export class TargetTrackingConfiguration extends core.Schema<TargetTrackingConfigurationArgs> {
  @core.attr(CustomizedScalingMetricSpecification)
  public customizedScalingMetricSpecification?: CustomizedScalingMetricSpecification;

  @core.attr(Boolean)
  public disableScaleIn?: boolean | core.BooleanOut;

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

  @core.attr(PredefinedScalingMetricSpecification)
  public predefinedScalingMetricSpecification?: PredefinedScalingMetricSpecification;

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

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

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

export interface CustomizedLoadMetricSpecificationArgs extends core.SchemaArgs {
  dimensions?: core.Map<string, string> | core.MapOut<core.StringOut>;

  metricName: string | core.StringOut;

  namespace: string | core.StringOut;

  statistic: string | core.StringOut;

  unit?: string | core.StringOut;
}

export class CustomizedLoadMetricSpecification extends core.Schema<CustomizedLoadMetricSpecificationArgs> {
  @core.attr(String, { kind: "map" })
  public dimensions?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

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

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

export interface ScalingInstructionArgs extends core.SchemaArgs {
  customizedLoadMetricSpecification?: CustomizedLoadMetricSpecification;

  disableDynamicScaling?: boolean | core.BooleanOut;

  maxCapacity: number | core.NumberOut;

  minCapacity: number | core.NumberOut;

  predefinedLoadMetricSpecification?: PredefinedLoadMetricSpecification;

  predictiveScalingMaxCapacityBehavior?: string | core.StringOut;

  predictiveScalingMaxCapacityBuffer?: number | core.NumberOut;

  predictiveScalingMode?: string | core.StringOut;

  resourceId: string | core.StringOut;

  scalableDimension: string | core.StringOut;

  scalingPolicyUpdateBehavior?: string | core.StringOut;

  scheduledActionBufferTime?: number | core.NumberOut;

  serviceNamespace: string | core.StringOut;

  targetTrackingConfiguration:
    | core.Array<TargetTrackingConfiguration>
    | core.ArrayOut<TargetTrackingConfiguration>;
}

export class ScalingInstruction extends core.Schema<ScalingInstructionArgs> {
  @core.attr(CustomizedLoadMetricSpecification)
  public customizedLoadMetricSpecification?: CustomizedLoadMetricSpecification;

  @core.attr(Boolean)
  public disableDynamicScaling?: boolean | core.BooleanOut;

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

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

  @core.attr(PredefinedLoadMetricSpecification)
  public predefinedLoadMetricSpecification?: PredefinedLoadMetricSpecification;

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

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

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

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

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

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

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

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

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

export interface ScalingPlanArgs extends core.ResourceArgs {
  applicationSource: ApplicationSource;

  name: string | core.StringOut;

  scalingInstruction:
    | core.Array<ScalingInstruction>
    | core.ArrayOut<ScalingInstruction>;
}

export class ScalingPlan extends core.Resource<ScalingPlanArgs> {
  @core.attr(ApplicationSource)
  public applicationSource!: ApplicationSource;

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

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

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

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

  constructor(name: string, args?: ScalingPlanArgs) {
    super(name, "aws_autoscalingplans_scaling_plan", args);
  }

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