| 1 | import type * as backupsearch from "@distilled.cloud/aws/backupsearch"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { SearchJob } from "./SearchJob.ts"; |
| 5 | |
| 6 | /** `ListSearchJobResults` request with `SearchJobIdentifier` injected from the bound {@link SearchJob}. */ |
| 7 | export interface ListSearchJobResultsRequest extends Omit< |
| 8 | backupsearch.ListSearchJobResultsInput, |
| 9 | "SearchJobIdentifier" |
| 10 | > {} |
| 11 | |
| 12 | /** |
| 13 | * Runtime binding for `backup-search:ListSearchJobResults`. |
| 14 | * |
| 15 | * Pages through the search results (matched S3 objects / EBS files) of the |
| 16 | * bound search job. Results stream in while the job is `RUNNING` and are |
| 17 | * retained for seven days after it completes. Provide the implementation |
| 18 | * with `Effect.provide(AWS.BackupSearch.ListSearchJobResultsHttp)`. |
| 19 | * ### Reading Search Results |
| 20 | * **Example:** List the Search Job's Results |
| 21 | * ```typescript |
| 22 | * // init — bind the operation to the search job |
| 23 | * const listSearchJobResults = |
| 24 | * yield* AWS.BackupSearch.ListSearchJobResults(search); |
| 25 | * |
| 26 | * // runtime |
| 27 | * const page = yield* listSearchJobResults({ MaxResults: 100 }); |
| 28 | * for (const item of page.Results) { |
| 29 | * if (item.S3ResultItem) console.log(item.S3ResultItem.BackupVaultName); |
| 30 | * } |
| 31 | * ``` |
| 32 | * |
| 33 | * @binding |
| 34 | */ |
| 35 | export interface ListSearchJobResults extends Binding.Service< |
| 36 | ListSearchJobResults, |
| 37 | "AWS.BackupSearch.ListSearchJobResults", |
| 38 | ( |
| 39 | searchJob: SearchJob, |
| 40 | ) => Effect.Effect< |
| 41 | ( |
| 42 | request?: ListSearchJobResultsRequest, |
| 43 | ) => Effect.Effect< |
| 44 | backupsearch.ListSearchJobResultsOutput, |
| 45 | backupsearch.ListSearchJobResultsError |
| 46 | > |
| 47 | > |
| 48 | > {} |
| 49 | |
| 50 | export const ListSearchJobResults = Binding.Service<ListSearchJobResults>( |
| 51 | "AWS.BackupSearch.ListSearchJobResults", |
| 52 | ); |