/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 421cd0769811 */ import * as z from "zod/v4"; 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 GetSearchIndexDetailResponseSchemaModel = { name: string; id: string; documentCount: number | null; lastModified: Date; latencyP95SThreshold: number | null; }; /** @internal */ export const GetSearchIndexDetailResponseSchemaModel$inboundSchema: z.ZodType< GetSearchIndexDetailResponseSchemaModel, unknown > = z.object({ name: z.string(), id: z.string(), document_count: z.nullable(z.int()), last_modified: z.iso.datetime({ offset: true }).transform(v => new Date(v)), latency_p95_s_threshold: z.nullable(z.number()), }).transform((v) => { return remap$(v, { "document_count": "documentCount", "last_modified": "lastModified", "latency_p95_s_threshold": "latencyP95SThreshold", }); }); export function getSearchIndexDetailResponseSchemaModelFromJSON( jsonString: string, ): SafeParseResult< GetSearchIndexDetailResponseSchemaModel, SDKValidationError > { return safeParse( jsonString, (x) => GetSearchIndexDetailResponseSchemaModel$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetSearchIndexDetailResponseSchemaModel' from JSON`, ); }