/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 49953f07ad83 */ import * as z from "zod/v4"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import * as openEnums from "../../types/enums.js"; import { OpenEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { GetSearchIndexSummaryResponseVespaIndex, GetSearchIndexSummaryResponseVespaIndex$inboundSchema, } from "./getsearchindexsummaryresponsevespaindex.js"; export const GetSearchIndexSummaryResponseIndexStatus = { Online: "online", Offline: "offline", } as const; export type GetSearchIndexSummaryResponseIndexStatus = OpenEnum< typeof GetSearchIndexSummaryResponseIndexStatus >; export type GetSearchIndexSummaryResponseIndexIndex = GetSearchIndexSummaryResponseVespaIndex; export type GetSearchIndexSummaryResponseIndex = { id: string; name: string; creatorId: string; documentCount: number; status: GetSearchIndexSummaryResponseIndexStatus; createdAt: Date; modifiedAt: Date; index: GetSearchIndexSummaryResponseVespaIndex; }; /** @internal */ export const GetSearchIndexSummaryResponseIndexStatus$inboundSchema: z.ZodType< GetSearchIndexSummaryResponseIndexStatus, unknown > = openEnums.inboundSchema(GetSearchIndexSummaryResponseIndexStatus); /** @internal */ export const GetSearchIndexSummaryResponseIndexIndex$inboundSchema: z.ZodType< GetSearchIndexSummaryResponseIndexIndex, unknown > = GetSearchIndexSummaryResponseVespaIndex$inboundSchema; export function getSearchIndexSummaryResponseIndexIndexFromJSON( jsonString: string, ): SafeParseResult< GetSearchIndexSummaryResponseIndexIndex, SDKValidationError > { return safeParse( jsonString, (x) => GetSearchIndexSummaryResponseIndexIndex$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetSearchIndexSummaryResponseIndexIndex' from JSON`, ); } /** @internal */ export const GetSearchIndexSummaryResponseIndex$inboundSchema: z.ZodType< GetSearchIndexSummaryResponseIndex, unknown > = z.object({ id: z.string(), name: z.string(), creator_id: z.string(), document_count: z.int(), status: GetSearchIndexSummaryResponseIndexStatus$inboundSchema, created_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)), modified_at: z.iso.datetime({ offset: true }).transform(v => new Date(v)), index: GetSearchIndexSummaryResponseVespaIndex$inboundSchema, }).transform((v) => { return remap$(v, { "creator_id": "creatorId", "document_count": "documentCount", "created_at": "createdAt", "modified_at": "modifiedAt", }); }); export function getSearchIndexSummaryResponseIndexFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetSearchIndexSummaryResponseIndex$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSearchIndexSummaryResponseIndex' from JSON`, ); }