/* * 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 { HostObservationRange, HostObservationRange$inboundSchema, } from "./hostobservationrange.js"; export type HostObservationResponse = { nextPageToken?: string | undefined; ranges: Array | null; totalResults: number; }; /** @internal */ export const HostObservationResponse$inboundSchema: z.ZodType< HostObservationResponse, z.ZodTypeDef, unknown > = z.object({ next_page_token: z.string().optional(), ranges: z.nullable(z.array(HostObservationRange$inboundSchema)), total_results: z.number().int(), }).transform((v) => { return remap$(v, { "next_page_token": "nextPageToken", "total_results": "totalResults", }); }); export function hostObservationResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => HostObservationResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'HostObservationResponse' from JSON`, ); }