| 1 | import type * as guardduty from "@distilled.cloud/aws/guardduty"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Detector } from "./Detector.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `guardduty:CreateSampleFindings`. |
| 8 | * |
| 9 | * Generates sample findings of the requested types — the standard way to exercise a finding-consumer pipeline end-to-end without staging a real threat. |
| 10 | * The detector id is injected from the bound {@link Detector}. |
| 11 | * Provide the implementation with |
| 12 | * `Effect.provide(AWS.GuardDuty.CreateSampleFindingsHttp)`. |
| 13 | * ### Working with Findings |
| 14 | * **Example:** Generate a Sample Finding |
| 15 | * ```typescript |
| 16 | * // init |
| 17 | * const createSampleFindings = yield* AWS.GuardDuty.CreateSampleFindings(detector); |
| 18 | * |
| 19 | * // runtime |
| 20 | * yield* createSampleFindings({ |
| 21 | * FindingTypes: ["Recon:EC2/PortProbeUnprotectedPort"], |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface CreateSampleFindings extends Binding.Service< |
| 28 | CreateSampleFindings, |
| 29 | "AWS.GuardDuty.CreateSampleFindings", |
| 30 | ( |
| 31 | detector: Detector, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request?: Omit<guardduty.CreateSampleFindingsRequest, "DetectorId">, |
| 35 | ) => Effect.Effect< |
| 36 | guardduty.CreateSampleFindingsResponse, |
| 37 | guardduty.CreateSampleFindingsError |
| 38 | > |
| 39 | > |
| 40 | > {} |
| 41 | export const CreateSampleFindings = Binding.Service<CreateSampleFindings>( |
| 42 | "AWS.GuardDuty.CreateSampleFindings", |
| 43 | ); |