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

export interface PredefinedMetricSpecificationArgs extends core.SchemaArgs {
  predefinedMetricType: string | core.StringOut;

  resourceLabel?: string | core.StringOut;
}

export class PredefinedMetricSpecification extends core.Schema<PredefinedMetricSpecificationArgs> {
  @core.attr(String)
  public predefinedMetricType!: string | core.StringOut;

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

export interface MetricDimensionArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  value: string | core.StringOut;
}

export class MetricDimension extends core.Schema<MetricDimensionArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

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

export interface CustomizedMetricSpecificationArgs extends core.SchemaArgs {
  metricDimension?:
    | core.Array<MetricDimension>
    | core.ArrayOut<MetricDimension>;

  metricName: string | core.StringOut;

  namespace: string | core.StringOut;

  statistic: string | core.StringOut;

  unit?: string | core.StringOut;
}

export class CustomizedMetricSpecification extends core.Schema<CustomizedMetricSpecificationArgs> {
  @core.attr(MetricDimension, { kind: "array" })
  public metricDimension?:
    | core.Array<MetricDimension>
    | core.ArrayOut<MetricDimension>;

  @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 TargetTrackingConfigurationArgs extends core.SchemaArgs {
  customizedMetricSpecification?: CustomizedMetricSpecification;

  disableScaleIn?: boolean | core.BooleanOut;

  predefinedMetricSpecification?: PredefinedMetricSpecification;

  targetValue: number | core.NumberOut;
}

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

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

  @core.attr(PredefinedMetricSpecification)
  public predefinedMetricSpecification?: PredefinedMetricSpecification;

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

export interface StepAdjustmentArgs extends core.SchemaArgs {
  metricIntervalLowerBound?: string | core.StringOut;

  metricIntervalUpperBound?: string | core.StringOut;

  scalingAdjustment: number | core.NumberOut;
}

export class StepAdjustment extends core.Schema<StepAdjustmentArgs> {
  @core.attr(String)
  public metricIntervalLowerBound?: string | core.StringOut;

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

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

export interface DimensionsArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  value: string | core.StringOut;
}

export class Dimensions extends core.Schema<DimensionsArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

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

export interface MetricArgs extends core.SchemaArgs {
  dimensions?: core.Array<Dimensions> | core.ArrayOut<Dimensions>;

  metricName: string | core.StringOut;

  namespace: string | core.StringOut;
}

export class Metric extends core.Schema<MetricArgs> {
  @core.attr(Dimensions, { kind: "array" })
  public dimensions?: core.Array<Dimensions> | core.ArrayOut<Dimensions>;

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

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

export interface MetricStatArgs extends core.SchemaArgs {
  metric: Metric;

  stat: string | core.StringOut;

  unit?: string | core.StringOut;
}

export class MetricStat extends core.Schema<MetricStatArgs> {
  @core.attr(Metric)
  public metric!: Metric;

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

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

export interface MetricDataQueriesArgs extends core.SchemaArgs {
  expression?: string | core.StringOut;

  id: string | core.StringOut;

  label?: string | core.StringOut;

  metricStat?: MetricStat;

  returnData?: boolean | core.BooleanOut;
}

export class MetricDataQueries extends core.Schema<MetricDataQueriesArgs> {
  @core.attr(String)
  public expression?: string | core.StringOut;

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

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

  @core.attr(MetricStat)
  public metricStat?: MetricStat;

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

export interface CustomizedCapacityMetricSpecificationArgs
  extends core.SchemaArgs {
  metricDataQueries:
    | core.Array<MetricDataQueries>
    | core.ArrayOut<MetricDataQueries>;
}

export class CustomizedCapacityMetricSpecification extends core.Schema<CustomizedCapacityMetricSpecificationArgs> {
  @core.attr(MetricDataQueries, { kind: "array" })
  public metricDataQueries!:
    | core.Array<MetricDataQueries>
    | core.ArrayOut<MetricDataQueries>;
}

export interface CustomizedLoadMetricSpecificationArgs extends core.SchemaArgs {
  metricDataQueries:
    | core.Array<MetricDataQueries>
    | core.ArrayOut<MetricDataQueries>;
}

export class CustomizedLoadMetricSpecification extends core.Schema<CustomizedLoadMetricSpecificationArgs> {
  @core.attr(MetricDataQueries, { kind: "array" })
  public metricDataQueries!:
    | core.Array<MetricDataQueries>
    | core.ArrayOut<MetricDataQueries>;
}

export interface CustomizedScalingMetricSpecificationArgs
  extends core.SchemaArgs {
  metricDataQueries:
    | core.Array<MetricDataQueries>
    | core.ArrayOut<MetricDataQueries>;
}

export class CustomizedScalingMetricSpecification extends core.Schema<CustomizedScalingMetricSpecificationArgs> {
  @core.attr(MetricDataQueries, { kind: "array" })
  public metricDataQueries!:
    | core.Array<MetricDataQueries>
    | core.ArrayOut<MetricDataQueries>;
}

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

  resourceLabel: string | core.StringOut;
}

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

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

export interface PredefinedMetricPairSpecificationArgs extends core.SchemaArgs {
  predefinedMetricType: string | core.StringOut;

  resourceLabel: string | core.StringOut;
}

export class PredefinedMetricPairSpecification extends core.Schema<PredefinedMetricPairSpecificationArgs> {
  @core.attr(String)
  public predefinedMetricType!: string | core.StringOut;

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

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

  resourceLabel: string | core.StringOut;
}

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

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

export interface MetricSpecificationArgs extends core.SchemaArgs {
  customizedCapacityMetricSpecification?: CustomizedCapacityMetricSpecification;

  customizedLoadMetricSpecification?: CustomizedLoadMetricSpecification;

  customizedScalingMetricSpecification?: CustomizedScalingMetricSpecification;

  predefinedLoadMetricSpecification?: PredefinedLoadMetricSpecification;

  predefinedMetricPairSpecification?: PredefinedMetricPairSpecification;

  predefinedScalingMetricSpecification?: PredefinedScalingMetricSpecification;

  targetValue: number | core.NumberOut;
}

export class MetricSpecification extends core.Schema<MetricSpecificationArgs> {
  @core.attr(CustomizedCapacityMetricSpecification)
  public customizedCapacityMetricSpecification?: CustomizedCapacityMetricSpecification;

  @core.attr(CustomizedLoadMetricSpecification)
  public customizedLoadMetricSpecification?: CustomizedLoadMetricSpecification;

  @core.attr(CustomizedScalingMetricSpecification)
  public customizedScalingMetricSpecification?: CustomizedScalingMetricSpecification;

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

  @core.attr(PredefinedMetricPairSpecification)
  public predefinedMetricPairSpecification?: PredefinedMetricPairSpecification;

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

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

export interface PredictiveScalingConfigurationArgs extends core.SchemaArgs {
  maxCapacityBreachBehavior?: string | core.StringOut;

  maxCapacityBuffer?: string | core.StringOut;

  metricSpecification: MetricSpecification;

  mode?: string | core.StringOut;

  schedulingBufferTime?: string | core.StringOut;
}

export class PredictiveScalingConfiguration extends core.Schema<PredictiveScalingConfigurationArgs> {
  @core.attr(String)
  public maxCapacityBreachBehavior?: string | core.StringOut;

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

  @core.attr(MetricSpecification)
  public metricSpecification!: MetricSpecification;

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

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

export interface PolicyArgs extends core.ResourceArgs {
  adjustmentType?: string | core.StringOut;

  autoscalingGroupName: string | core.StringOut;

  cooldown?: number | core.NumberOut;

  enabled?: boolean | core.BooleanOut;

  estimatedInstanceWarmup?: number | core.NumberOut;

  metricAggregationType?: string | core.StringOut;

  minAdjustmentMagnitude?: number | core.NumberOut;

  name: string | core.StringOut;

  policyType?: string | core.StringOut;

  predictiveScalingConfiguration?: PredictiveScalingConfiguration;

  scalingAdjustment?: number | core.NumberOut;

  stepAdjustment?: core.Array<StepAdjustment> | core.ArrayOut<StepAdjustment>;

  targetTrackingConfiguration?: TargetTrackingConfiguration;
}

export class Policy extends core.Resource<PolicyArgs> {
  @core.attr(String)
  public adjustmentType?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

  @core.attr(PredictiveScalingConfiguration)
  public predictiveScalingConfiguration?: PredictiveScalingConfiguration;

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

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

  @core.attr(TargetTrackingConfiguration)
  public targetTrackingConfiguration?: TargetTrackingConfiguration;

  constructor(name: string, args?: PolicyArgs) {
    super(name, "aws_autoscaling_policy", args);
  }

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