GetPlace
Source:
src/AWS/GeoPlaces/GetPlace.ts
Runtime binding for geo-places:GetPlace — fetch the full details of a
place (address, contacts, opening hours, time zone, …) by its PlaceId,
as returned by Geocode, SearchText, SearchNearby, Suggest, or
Autocomplete.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:GetPlace. Requests and responses are raw distilled types (no
marshalling).
Fetching Place Details
Section titled “Fetching Place Details”Provide the GetPlaceHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.GetPlaceHttp))), bind in the init
phase, then call the client at runtime.
// initconst geocode = yield* AWS.GeoPlaces.Geocode();const getPlace = yield* AWS.GeoPlaces.GetPlace();
// runtimeconst geocoded = yield* geocode({ QueryText: "Space Needle, Seattle" });const placeId = geocoded.ResultItems?.[0]?.PlaceId;const place = yield* getPlace({ PlaceId: placeId! });const label = place.Address?.Label;