sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ FMS/ GetProtectionStatus.ts

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

/**
 * Request for {@link GetProtectionStatus}.
 */
export interface GetProtectionStatusRequest extends fms.GetProtectionStatusRequest {}

/**
 * Runtime binding for `fms:GetProtectionStatus`.
 *
 * Returns policy-level attack summary information for Shield Advanced policies — DDoS attacks detected during the specified time period. Provide the
 * implementation with `Effect.provide(AWS.FMS.GetProtectionStatusHttp)`.
 * ### Compliance and Protection Status
 * **Example:** Read a Shield Policy's Protection Status
 * ```typescript
 * // init — account-level binding takes no resource
 * const getProtectionStatus = yield* AWS.FMS.GetProtectionStatus();
 *
 * // runtime
 * const result = yield* getProtectionStatus({ PolicyId: policyId });
 * console.log(result.ServiceType, result.Data);
 * ```
 *
 * @binding
 */
export interface GetProtectionStatus extends Binding.Service<
  GetProtectionStatus,
  "AWS.FMS.GetProtectionStatus",
  () => Effect.Effect<
    (
      request: GetProtectionStatusRequest,
    ) => Effect.Effect<fms.GetProtectionStatusResponse, fms.GetProtectionStatusError>
  >
> {}

export const GetProtectionStatus = Binding.Service<GetProtectionStatus>(
  "AWS.FMS.GetProtectionStatus",
);