| 1 | import type * as datazone from "@distilled.cloud/aws/datazone"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | import type { Domain } from "./Domain.ts"; |
| 5 | |
| 6 | export interface SearchListingsRequest extends Omit< |
| 7 | datazone.SearchListingsInput, |
| 8 | "domainIdentifier" |
| 9 | > {} |
| 10 | |
| 11 | /** |
| 12 | * Runtime binding for `datazone:SearchListings`. |
| 13 | * |
| 14 | * Searches published listings (the catalog of subscribable assets and data products) in the bound domain. The domain id is injected from the binding. |
| 15 | * Provide the implementation with |
| 16 | * `Effect.provide(AWS.DataZone.SearchListingsHttp)`. |
| 17 | * ### Searching the Catalog |
| 18 | * **Example:** Find Subscribable Listings |
| 19 | * ```typescript |
| 20 | * // init — bind the operation to the domain |
| 21 | * const searchListings = yield* AWS.DataZone.SearchListings(domain); |
| 22 | * |
| 23 | * // runtime |
| 24 | * const result = yield* searchListings({ searchText: "customer" }); |
| 25 | * const listings = result.items?.map((i) => i.assetListing?.name); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | */ |
| 30 | export interface SearchListings extends Binding.Service< |
| 31 | SearchListings, |
| 32 | "AWS.DataZone.SearchListings", |
| 33 | ( |
| 34 | domain: Domain, |
| 35 | ) => Effect.Effect< |
| 36 | ( |
| 37 | request?: SearchListingsRequest, |
| 38 | ) => Effect.Effect< |
| 39 | datazone.SearchListingsOutput, |
| 40 | datazone.SearchListingsError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const SearchListings = Binding.Service<SearchListings>( |
| 45 | "AWS.DataZone.SearchListings", |
| 46 | ); |