| 1 | import type * as shield from "@distilled.cloud/aws/shield"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `shield:GetSubscriptionState`. |
| 7 | * |
| 8 | * Returns whether the account's Shield Advanced subscription is `ACTIVE` or |
| 9 | * `INACTIVE` — available to every account, subscribed or not, so a handler |
| 10 | * can branch on Shield Advanced availability before calling gated operations. |
| 11 | * Provide the implementation with |
| 12 | * `Effect.provide(AWS.Shield.GetSubscriptionStateHttp)`. |
| 13 | * ### Subscription Visibility |
| 14 | * **Example:** Check Shield Advanced Availability |
| 15 | * ```typescript |
| 16 | * // init — account-level binding, no resource argument |
| 17 | * const getSubscriptionState = yield* AWS.Shield.GetSubscriptionState(); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { SubscriptionState } = yield* getSubscriptionState(); |
| 21 | * if (SubscriptionState === "ACTIVE") { |
| 22 | * // Shield Advanced operations are available |
| 23 | * } |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface GetSubscriptionState extends Binding.Service< |
| 29 | GetSubscriptionState, |
| 30 | "AWS.Shield.GetSubscriptionState", |
| 31 | () => Effect.Effect< |
| 32 | ( |
| 33 | request?: shield.GetSubscriptionStateRequest, |
| 34 | ) => Effect.Effect< |
| 35 | shield.GetSubscriptionStateResponse, |
| 36 | shield.GetSubscriptionStateError |
| 37 | > |
| 38 | > |
| 39 | > {} |
| 40 | export const GetSubscriptionState = Binding.Service<GetSubscriptionState>( |
| 41 | "AWS.Shield.GetSubscriptionState", |
| 42 | ); |