| 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:GetArchiveSearchResults`. |
| 8 | * |
| 9 | * Fetches the result rows of a completed archive search (by |
| 10 | * `SearchId`): sender, subject, envelope, and the `ArchivedMessageId` |
| 11 | * used to download each message. IAM access is granted on the bound |
| 12 | * archive's ARN. Provide the implementation with |
| 13 | * `Effect.provide(AWS.MailManager.GetArchiveSearchResultsHttp)`. |
| 14 | * ### Searching the Archive |
| 15 | * **Example:** Read Search Results |
| 16 | * ```typescript |
| 17 | * const getSearchResults = yield* MailManager.GetArchiveSearchResults(archive); |
| 18 | * |
| 19 | * // runtime |
| 20 | * const { Rows } = yield* getSearchResults({ SearchId }); |
| 21 | * ``` |
| 22 | * |
| 23 | * @binding |
| 24 | */ |
| 25 | export interface GetArchiveSearchResults extends Binding.Service< |
| 26 | GetArchiveSearchResults, |
| 27 | "AWS.MailManager.GetArchiveSearchResults", |
| 28 | ( |
| 29 | archive: Archive, |
| 30 | ) => Effect.Effect< |
| 31 | ( |
| 32 | request: mm.GetArchiveSearchResultsRequest, |
| 33 | ) => Effect.Effect< |
| 34 | mm.GetArchiveSearchResultsResponse, |
| 35 | mm.GetArchiveSearchResultsError |
| 36 | > |
| 37 | > |
| 38 | > {} |
| 39 | export const GetArchiveSearchResults = Binding.Service<GetArchiveSearchResults>( |
| 40 | "AWS.MailManager.GetArchiveSearchResults", |
| 41 | ); |