| 1 | import type * as WAFV2 from "@distilled.cloud/aws/wafv2"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `wafv2:CheckCapacity` — compute the web ACL capacity |
| 7 | * units (WCU) a set of rules would consume, e.g. before updating an IP set |
| 8 | * or constructing rules dynamically. |
| 9 | * |
| 10 | * Provide `WAFv2.CheckCapacityHttp` on the hosting Lambda Function to |
| 11 | * satisfy the requirement. |
| 12 | * ### Account Operations |
| 13 | * **Example:** Check the WCU Cost of a Rule |
| 14 | * ```typescript |
| 15 | * // init — grants wafv2:CheckCapacity |
| 16 | * const checkCapacity = yield* AWS.WAFv2.CheckCapacity(); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const { Capacity } = yield* checkCapacity({ |
| 20 | * Scope: "REGIONAL", |
| 21 | * Rules: [rule], |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface CheckCapacity extends Binding.Service< |
| 28 | CheckCapacity, |
| 29 | "AWS.WAFv2.CheckCapacity", |
| 30 | () => Effect.Effect< |
| 31 | ( |
| 32 | request: WAFV2.CheckCapacityRequest, |
| 33 | ) => Effect.Effect<WAFV2.CheckCapacityResponse, WAFV2.CheckCapacityError> |
| 34 | > |
| 35 | > {} |
| 36 | |
| 37 | export const CheckCapacity = Binding.Service<CheckCapacity>( |
| 38 | "AWS.WAFv2.CheckCapacity", |
| 39 | ); |