/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LocationServicesMappingGetUrlGlobals = { source?: string | undefined; }; export type TileUrlGeneratorRequest = { key?: string | undefined; }; /** * Success */ export type TileUrlGeneratorResponse = { /** * Signed URL to use when wanting to render Vector tiles, valid for one hour after creation. This URL contains all the information required by a map renderer to draw the layers of data for the final map. Vector tiles offer more flexibility with styling and improved performance when navigating the map but they can be more demanding on end user hardware. */ vectorStyleUrl?: string | undefined; /** * Signed URL to use when wanting to render Raster tiles, valid for one hour after creation. This will give you no flexibility over styling options and can be slower to load but is generally less demanding on end user hardware. */ rasterStyleUrl?: string | undefined; /** * UTC Timestamp representing when the URLs were signed and generated. */ generatedOnUtc?: Date | undefined; }; /** @internal */ export type TileUrlGeneratorRequest$Outbound = { Key?: string | undefined; }; /** @internal */ export const TileUrlGeneratorRequest$outboundSchema: z.ZodType< TileUrlGeneratorRequest$Outbound, z.ZodTypeDef, TileUrlGeneratorRequest > = z.object({ key: z.string().optional(), }).transform((v) => { return remap$(v, { key: "Key", }); }); export function tileUrlGeneratorRequestToJSON( tileUrlGeneratorRequest: TileUrlGeneratorRequest, ): string { return JSON.stringify( TileUrlGeneratorRequest$outboundSchema.parse(tileUrlGeneratorRequest), ); } /** @internal */ export const TileUrlGeneratorResponse$inboundSchema: z.ZodType< TileUrlGeneratorResponse, z.ZodTypeDef, unknown > = z.object({ VectorStyleUrl: z.string().optional(), RasterStyleUrl: z.string().optional(), GeneratedOnUtc: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), }).transform((v) => { return remap$(v, { "VectorStyleUrl": "vectorStyleUrl", "RasterStyleUrl": "rasterStyleUrl", "GeneratedOnUtc": "generatedOnUtc", }); }); export function tileUrlGeneratorResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TileUrlGeneratorResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TileUrlGeneratorResponse' from JSON`, ); }