/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
/**
* An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges.
*/
export type LatLngCreate = {
/**
* The latitude in degrees. It must be in the range [-90.0, +90.0].
*/
latitude?: number | undefined;
/**
* The longitude in degrees. It must be in the range [-180.0, +180.0].
*/
longitude?: number | undefined;
};
/** @internal */
export const LatLngCreate$inboundSchema: z.ZodType<
LatLngCreate,
z.ZodTypeDef,
unknown
> = z.object({
latitude: z.number().optional(),
longitude: z.number().optional(),
});
/** @internal */
export type LatLngCreate$Outbound = {
latitude?: number | undefined;
longitude?: number | undefined;
};
/** @internal */
export const LatLngCreate$outboundSchema: z.ZodType<
LatLngCreate$Outbound,
z.ZodTypeDef,
LatLngCreate
> = z.object({
latitude: z.number().optional(),
longitude: z.number().optional(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace LatLngCreate$ {
/** @deprecated use `LatLngCreate$inboundSchema` instead. */
export const inboundSchema = LatLngCreate$inboundSchema;
/** @deprecated use `LatLngCreate$outboundSchema` instead. */
export const outboundSchema = LatLngCreate$outboundSchema;
/** @deprecated use `LatLngCreate$Outbound` instead. */
export type Outbound = LatLngCreate$Outbound;
}
export function latLngCreateToJSON(latLngCreate: LatLngCreate): string {
return JSON.stringify(LatLngCreate$outboundSchema.parse(latLngCreate));
}
export function latLngCreateFromJSON(
jsonString: string,
): SafeParseResult {
return safeParse(
jsonString,
(x) => LatLngCreate$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'LatLngCreate' from JSON`,
);
}