/* * 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 * as models from "../index.js"; export type LocationServicesLocationManagementUpdateListOrPointGlobals = { source?: string | undefined; }; export type UpdateListOrPointRequest = { /** * The key you want to use to authenticate with the service (you can request we create one for you or create one in your [account section](https://account.loqate.com/account#/)). */ key?: string | undefined; /** * The unique GuID for a given list. */ listId?: string | undefined; /** * The name of the list being updated or created. */ listName?: string | undefined; latestRelatedListId?: string | undefined; isErrorList?: boolean | undefined; /** * A description of the list being updated or created. */ listDescription?: string | undefined; /** * An array of strings that is populated with information about a location. If latitude and longitude are blank then Geocoding must be set to true. */ locations?: | Array | undefined; createdOn?: Date | null | undefined; lastModifiedOn?: Date | null | undefined; geocoding?: boolean | undefined; }; /** * Success */ export type LocationServicesLocationManagementUpdateListOrPointExternalEndpointResponse = { /** * 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 strings that is populated with information about a location. Also contains a uniquely generated GuID per point. */ locations?: | Array< models.LocationServicesLocationManagementUpdateListOrPoExternalResponsePointData > | 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 type UpdateListOrPointRequest$Outbound = { Key: string; ListId?: string | undefined; ListName?: string | undefined; LatestRelatedListId?: string | undefined; IsErrorList?: boolean | undefined; ListDescription?: string | undefined; Locations?: | Array< models.LocationServicesLocationManagementUpdateListOrPoPointData$Outbound > | undefined; CreatedOn?: string | null | undefined; LastModifiedOn?: string | null | undefined; Geocoding?: boolean | undefined; }; /** @internal */ export const UpdateListOrPointRequest$outboundSchema: z.ZodType< UpdateListOrPointRequest$Outbound, z.ZodTypeDef, UpdateListOrPointRequest > = z.object({ key: z.string().default("AA11-AA11-AA11-AA11"), listId: z.string().optional(), listName: z.string().optional(), latestRelatedListId: z.string().optional(), isErrorList: z.boolean().optional(), listDescription: z.string().optional(), locations: z.array( models .LocationServicesLocationManagementUpdateListOrPoPointData$outboundSchema, ).optional(), createdOn: z.nullable(z.date().transform(v => v.toISOString())).optional(), lastModifiedOn: z.nullable(z.date().transform(v => v.toISOString())) .optional(), geocoding: z.boolean().optional(), }).transform((v) => { return remap$(v, { key: "Key", listId: "ListId", listName: "ListName", latestRelatedListId: "LatestRelatedListId", isErrorList: "IsErrorList", listDescription: "ListDescription", locations: "Locations", createdOn: "CreatedOn", lastModifiedOn: "LastModifiedOn", geocoding: "Geocoding", }); }); export function updateListOrPointRequestToJSON( updateListOrPointRequest: UpdateListOrPointRequest, ): string { return JSON.stringify( UpdateListOrPointRequest$outboundSchema.parse(updateListOrPointRequest), ); } /** @internal */ export const LocationServicesLocationManagementUpdateListOrPointExternalEndpointResponse$inboundSchema: z.ZodType< LocationServicesLocationManagementUpdateListOrPointExternalEndpointResponse, 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( models .LocationServicesLocationManagementUpdateListOrPoExternalResponsePointData$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 locationServicesLocationManagementUpdateListOrPointExternalEndpointResponseFromJSON( jsonString: string, ): SafeParseResult< LocationServicesLocationManagementUpdateListOrPointExternalEndpointResponse, SDKValidationError > { return safeParse( jsonString, (x) => LocationServicesLocationManagementUpdateListOrPointExternalEndpointResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'LocationServicesLocationManagementUpdateListOrPointExternalEndpointResponse' from JSON`, ); }