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

export interface SettingsArgs extends core.SchemaArgs {
  cacheDataEncrypted?: boolean | core.BooleanOut;

  cacheTtlInSeconds?: number | core.NumberOut;

  cachingEnabled?: boolean | core.BooleanOut;

  dataTraceEnabled?: boolean | core.BooleanOut;

  loggingLevel?: string | core.StringOut;

  metricsEnabled?: boolean | core.BooleanOut;

  requireAuthorizationForCacheControl?: boolean | core.BooleanOut;

  throttlingBurstLimit?: number | core.NumberOut;

  throttlingRateLimit?: number | core.NumberOut;

  unauthorizedCacheControlHeaderStrategy?: string | core.StringOut;
}

export class Settings extends core.Schema<SettingsArgs> {
  @core.attr(Boolean, { computed: true })
  public cacheDataEncrypted?: boolean | core.BooleanOut;

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

  @core.attr(Boolean, { computed: true })
  public cachingEnabled?: boolean | core.BooleanOut;

  @core.attr(Boolean, { computed: true })
  public dataTraceEnabled?: boolean | core.BooleanOut;

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

  @core.attr(Boolean, { computed: true })
  public metricsEnabled?: boolean | core.BooleanOut;

  @core.attr(Boolean, { computed: true })
  public requireAuthorizationForCacheControl?: boolean | core.BooleanOut;

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

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

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

export interface MethodSettingsArgs extends core.ResourceArgs {
  methodPath: string | core.StringOut;

  restApiId: string | core.StringOut;

  settings: Settings;

  stageName: string | core.StringOut;
}

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

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

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

  @core.attr(Settings)
  public settings!: Settings;

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

  constructor(name: string, args?: MethodSettingsArgs) {
    super(name, "aws_api_gateway_method_settings", args);
  }

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