/* * 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"; import { LocationServicesLocationManagementGetListsExternalResponsePointData, LocationServicesLocationManagementGetListsExternalResponsePointData$inboundSchema, } from "./locationserviceslocationmanagementgetlistsexternalresponsepointdata.js"; export type LocationServicesLocationManagementGetListsExternalEndpointResponseItem = { /** * An automatically generated GuID used to uniquely identify a list. */ listId?: string | undefined; /** * The name of the list passed in the request. */ listName?: string | undefined; latestRelatedListId?: string | undefined; isErrorList?: boolean | undefined; /** * The description of the list passed in the request. */ listDescription?: string | undefined; /** * An array of objects that is populated with information about a location. Also contains a uniquely generated GuID per point. */ locations?: | Array< LocationServicesLocationManagementGetListsExternalResponsePointData > | undefined; /** * The date and time of when the list was initially created. */ createdOn?: Date | null | undefined; /** * The date and time of when the list was last modified. */ lastModifiedOn?: Date | null | undefined; }; /** @internal */ export const LocationServicesLocationManagementGetListsExternalEndpointResponseItem$inboundSchema: z.ZodType< LocationServicesLocationManagementGetListsExternalEndpointResponseItem, z.ZodTypeDef, unknown > = z.object({ ListId: z.string().optional(), ListName: z.string().optional(), LatestRelatedListId: z.string().optional(), IsErrorList: z.boolean().optional(), ListDescription: z.string().optional(), Locations: z.array( LocationServicesLocationManagementGetListsExternalResponsePointData$inboundSchema, ).optional(), CreatedOn: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), LastModifiedOn: z.nullable( z.string().datetime({ offset: true }).transform(v => new Date(v)), ).optional(), }).transform((v) => { return remap$(v, { "ListId": "listId", "ListName": "listName", "LatestRelatedListId": "latestRelatedListId", "IsErrorList": "isErrorList", "ListDescription": "listDescription", "Locations": "locations", "CreatedOn": "createdOn", "LastModifiedOn": "lastModifiedOn", }); }); export function locationServicesLocationManagementGetListsExternalEndpointResponseItemFromJSON( jsonString: string, ): SafeParseResult< LocationServicesLocationManagementGetListsExternalEndpointResponseItem, SDKValidationError > { return safeParse( jsonString, (x) => LocationServicesLocationManagementGetListsExternalEndpointResponseItem$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'LocationServicesLocationManagementGetListsExternalEndpointResponseItem' from JSON`, ); }