| 1 | import type * as geoPlaces from "@distilled.cloud/aws/geo-places"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `geo-places:SearchText` — free-form place search that |
| 7 | * returns ranked results (POIs, addresses, streets) for a text query. |
| 8 | * |
| 9 | * geo-places is a standalone, pay-per-call Amazon Location API with no |
| 10 | * resource to manage: the binding takes no arguments and grants the function |
| 11 | * `geo-places:SearchText`. Requests and responses are raw distilled types (no |
| 12 | * marshalling). |
| 13 | * |
| 14 | * ### Searching Places |
| 15 | * Provide the `SearchTextHttp` implementation layer on the Function effect |
| 16 | * (`.pipe(Effect.provide(AWS.GeoPlaces.SearchTextHttp))`), bind in the init |
| 17 | * phase, then call the client at runtime. |
| 18 | * |
| 19 | * **Example:** Search for a place by text |
| 20 | * ```typescript |
| 21 | * // init |
| 22 | * const searchText = yield* AWS.GeoPlaces.SearchText(); |
| 23 | * |
| 24 | * // runtime |
| 25 | * const result = yield* searchText({ |
| 26 | * QueryText: "Space Needle, Seattle", |
| 27 | * MaxResults: 5, |
| 28 | * }); |
| 29 | * const first = result.ResultItems?.[0]; |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface SearchText extends Binding.Service< |
| 35 | SearchText, |
| 36 | "AWS.GeoPlaces.SearchText", |
| 37 | () => Effect.Effect< |
| 38 | ( |
| 39 | request: geoPlaces.SearchTextRequest, |
| 40 | ) => Effect.Effect<geoPlaces.SearchTextResponse, geoPlaces.SearchTextError> |
| 41 | > |
| 42 | > {} |
| 43 | export const SearchText = Binding.Service<SearchText>( |
| 44 | "AWS.GeoPlaces.SearchText", |
| 45 | ); |