| 1 | import type * as mm from "@distilled.cloud/aws/mailmanager"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Archive } from "./Archive.ts"; |
| 5 | |
| 6 | /** |
| 7 | * Runtime binding for `ses:StartArchiveSearch`. |
| 8 | * |
| 9 | * Starts an asynchronous search of the bound archive over a time window |
| 10 | * with optional filters, returning a `SearchId` to poll. The archive id |
| 11 | * is injected from the binding. Provide the implementation with |
| 12 | * `Effect.provide(AWS.MailManager.StartArchiveSearchHttp)`. |
| 13 | * ### Searching the Archive |
| 14 | * **Example:** Search the Last 24 Hours |
| 15 | * ```typescript |
| 16 | * const startSearch = yield* MailManager.StartArchiveSearch(archive); |
| 17 | * |
| 18 | * // runtime |
| 19 | * const { SearchId } = yield* startSearch({ |
| 20 | * FromTimestamp: new Date(Date.now() - 86_400_000), |
| 21 | * ToTimestamp: new Date(), |
| 22 | * MaxResults: 100, |
| 23 | * }); |
| 24 | * ``` |
| 25 | * |
| 26 | * @binding |
| 27 | */ |
| 28 | export interface StartArchiveSearch extends Binding.Service< |
| 29 | StartArchiveSearch, |
| 30 | "AWS.MailManager.StartArchiveSearch", |
| 31 | ( |
| 32 | archive: Archive, |
| 33 | ) => Effect.Effect< |
| 34 | ( |
| 35 | request: Omit<mm.StartArchiveSearchRequest, "ArchiveId">, |
| 36 | ) => Effect.Effect< |
| 37 | mm.StartArchiveSearchResponse, |
| 38 | mm.StartArchiveSearchError |
| 39 | > |
| 40 | > |
| 41 | > {} |
| 42 | export const StartArchiveSearch = Binding.Service<StartArchiveSearch>( |
| 43 | "AWS.MailManager.StartArchiveSearch", |
| 44 | ); |