sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ Shield/ GetSubscriptionState.ts

import type * as shield from "@distilled.cloud/aws/shield";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";

/**
 * Runtime binding for `shield:GetSubscriptionState`.
 *
 * Returns whether the account's Shield Advanced subscription is `ACTIVE` or
 * `INACTIVE` — available to every account, subscribed or not, so a handler
 * can branch on Shield Advanced availability before calling gated operations.
 * Provide the implementation with
 * `Effect.provide(AWS.Shield.GetSubscriptionStateHttp)`.
 * ### Subscription Visibility
 * **Example:** Check Shield Advanced Availability
 * ```typescript
 * // init — account-level binding, no resource argument
 * const getSubscriptionState = yield* AWS.Shield.GetSubscriptionState();
 *
 * // runtime
 * const { SubscriptionState } = yield* getSubscriptionState();
 * if (SubscriptionState === "ACTIVE") {
 *   // Shield Advanced operations are available
 * }
 * ```
 *
 * @binding
 */
export interface GetSubscriptionState extends Binding.Service<
  GetSubscriptionState,
  "AWS.Shield.GetSubscriptionState",
  () => Effect.Effect<
    (
      request?: shield.GetSubscriptionStateRequest,
    ) => Effect.Effect<shield.GetSubscriptionStateResponse, shield.GetSubscriptionStateError>
  >
> {}
export const GetSubscriptionState = Binding.Service<GetSubscriptionState>(
  "AWS.Shield.GetSubscriptionState",
);