| 1 | import type * as geoMaps from "@distilled.cloud/aws/geo-maps"; |
| 2 | import type * as Effect from "effect/Effect"; |
| 3 | import * as Binding from "../../Binding.ts"; |
| 4 | |
| 5 | /** |
| 6 | * Runtime binding for `geo-maps:GetStyleDescriptor` — fetch the MapLibre |
| 7 | * style descriptor (JSON) for a map style, optionally customized with |
| 8 | * political view, terrain, traffic, and building options. |
| 9 | * |
| 10 | * geo-maps is a standalone, pay-per-call Amazon Location API with no resource |
| 11 | * to manage: the binding takes no arguments and grants the function |
| 12 | * `geo-maps:GetStyleDescriptor`. Requests and responses are raw distilled |
| 13 | * types; the descriptor payload is returned as `Blob` (`Uint8Array` of JSON). |
| 14 | * |
| 15 | * ### Fetching Style Descriptors |
| 16 | * Provide the `GetStyleDescriptorHttp` implementation layer on the Function |
| 17 | * effect (`.pipe(Effect.provide(AWS.GeoMaps.GetStyleDescriptorHttp))`), bind |
| 18 | * in the init phase, then call the client at runtime. |
| 19 | * |
| 20 | * **Example:** Fetch the Standard style descriptor |
| 21 | * ```typescript |
| 22 | * // init |
| 23 | * const getStyleDescriptor = yield* AWS.GeoMaps.GetStyleDescriptor(); |
| 24 | * |
| 25 | * // runtime — Style is one of "Standard" | "Monochrome" | "Hybrid" | "Satellite" |
| 26 | * const descriptor = yield* getStyleDescriptor({ Style: "Standard" }); |
| 27 | * const json = new TextDecoder().decode(descriptor.Blob); // MapLibre style JSON |
| 28 | * ``` |
| 29 | * |
| 30 | * @binding |
| 31 | */ |
| 32 | export interface GetStyleDescriptor extends Binding.Service< |
| 33 | GetStyleDescriptor, |
| 34 | "AWS.GeoMaps.GetStyleDescriptor", |
| 35 | () => Effect.Effect< |
| 36 | ( |
| 37 | request: geoMaps.GetStyleDescriptorRequest, |
| 38 | ) => Effect.Effect< |
| 39 | geoMaps.GetStyleDescriptorResponse, |
| 40 | geoMaps.GetStyleDescriptorError |
| 41 | > |
| 42 | > |
| 43 | > {} |
| 44 | export const GetStyleDescriptor = Binding.Service<GetStyleDescriptor>( |
| 45 | "AWS.GeoMaps.GetStyleDescriptor", |
| 46 | ); |