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

export interface ThrottleSettingsArgs extends core.SchemaArgs {
  burstLimit?: number | core.NumberOut;

  rateLimit?: number | core.NumberOut;
}

export class ThrottleSettings extends core.Schema<ThrottleSettingsArgs> {
  @core.attr(Number)
  public burstLimit?: number | core.NumberOut;

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

export interface ThrottleArgs extends core.SchemaArgs {
  burstLimit?: number | core.NumberOut;

  path: string | core.StringOut;

  rateLimit?: number | core.NumberOut;
}

export class Throttle extends core.Schema<ThrottleArgs> {
  @core.attr(Number)
  public burstLimit?: number | core.NumberOut;

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

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

export interface ApiStagesArgs extends core.SchemaArgs {
  apiId: string | core.StringOut;

  stage: string | core.StringOut;

  throttle?: core.Array<Throttle> | core.ArrayOut<Throttle>;
}

export class ApiStages extends core.Schema<ApiStagesArgs> {
  @core.attr(String)
  public apiId!: string | core.StringOut;

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

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

export interface QuotaSettingsArgs extends core.SchemaArgs {
  limit: number | core.NumberOut;

  offset?: number | core.NumberOut;

  period: string | core.StringOut;
}

export class QuotaSettings extends core.Schema<QuotaSettingsArgs> {
  @core.attr(Number)
  public limit!: number | core.NumberOut;

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

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

export interface UsagePlanArgs extends core.ResourceArgs {
  apiStages?: core.Array<ApiStages> | core.ArrayOut<ApiStages>;

  description?: string | core.StringOut;

  name: string | core.StringOut;

  productCode?: string | core.StringOut;

  quotaSettings?: QuotaSettings;

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

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

  throttleSettings?: ThrottleSettings;
}

export class UsagePlan extends core.Resource<UsagePlanArgs> {
  @core.attr(ApiStages, { kind: "array" })
  public apiStages?: core.Array<ApiStages> | core.ArrayOut<ApiStages>;

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

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

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

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

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

  @core.attr(QuotaSettings)
  public quotaSettings?: QuotaSettings;

  @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>;

  @core.attr(ThrottleSettings)
  public throttleSettings?: ThrottleSettings;

  constructor(name: string, args?: UsagePlanArgs) {
    super(name, "aws_api_gateway_usage_plan", args);
  }

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