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

export interface AccessLogSettingsArgs extends core.SchemaArgs {
  destinationArn: string | core.StringOut;

  format: string | core.StringOut;
}

export class AccessLogSettings extends core.Schema<AccessLogSettingsArgs> {
  @core.attr(String)
  public destinationArn!: string | core.StringOut;

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

export interface CanarySettingsArgs extends core.SchemaArgs {
  percentTraffic?: number | core.NumberOut;

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

  useStageCache?: boolean | core.BooleanOut;
}

export class CanarySettings extends core.Schema<CanarySettingsArgs> {
  @core.attr(Number)
  public percentTraffic?: number | core.NumberOut;

  @core.attr(String, { kind: "map" })
  public stageVariableOverrides?:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

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

export interface StageArgs extends core.ResourceArgs {
  accessLogSettings?: AccessLogSettings;

  cacheClusterEnabled?: boolean | core.BooleanOut;

  cacheClusterSize?: string | core.StringOut;

  canarySettings?: CanarySettings;

  clientCertificateId?: string | core.StringOut;

  deploymentId: string | core.StringOut;

  description?: string | core.StringOut;

  documentationVersion?: string | core.StringOut;

  restApiId: string | core.StringOut;

  stageName: string | core.StringOut;

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

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

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

  xrayTracingEnabled?: boolean | core.BooleanOut;
}

export class Stage extends core.Resource<StageArgs> {
  @core.attr(AccessLogSettings)
  public accessLogSettings?: AccessLogSettings;

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

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

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

  @core.attr(CanarySettings)
  public canarySettings?: CanarySettings;

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

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

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

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

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

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

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

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

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

  @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(String, { kind: "map" })
  public variables?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

  constructor(name: string, args?: StageArgs) {
    super(name, "aws_api_gateway_stage", args);
  }

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