sailfork / t3code-github / .repos/ alchemy-effect/ packages/ aws/ src/ GuardDuty/ CreateSampleFindings.ts

import type * as guardduty from "@distilled.cloud/aws/guardduty";
import * as Binding from "alchemy/Binding";
import type * as Effect from "effect/Effect";
import type { Detector } from "./Detector.ts";

/**
 * Runtime binding for `guardduty:CreateSampleFindings`.
 *
 * Generates sample findings of the requested types — the standard way to exercise a finding-consumer pipeline end-to-end without staging a real threat.
 * The detector id is injected from the bound {@link Detector}.
 * Provide the implementation with
 * `Effect.provide(AWS.GuardDuty.CreateSampleFindingsHttp)`.
 * ### Working with Findings
 * **Example:** Generate a Sample Finding
 * ```typescript
 * // init
 * const createSampleFindings = yield* AWS.GuardDuty.CreateSampleFindings(detector);
 *
 * // runtime
 * yield* createSampleFindings({
 *   FindingTypes: ["Recon:EC2/PortProbeUnprotectedPort"],
 * });
 * ```
 *
 * @binding
 */
export interface CreateSampleFindings extends Binding.Service<
  CreateSampleFindings,
  "AWS.GuardDuty.CreateSampleFindings",
  (
    detector: Detector,
  ) => Effect.Effect<
    (
      request?: Omit<guardduty.CreateSampleFindingsRequest, "DetectorId">,
    ) => Effect.Effect<guardduty.CreateSampleFindingsResponse, guardduty.CreateSampleFindingsError>
  >
> {}
export const CreateSampleFindings = Binding.Service<CreateSampleFindings>(
  "AWS.GuardDuty.CreateSampleFindings",
);