/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: aad31af8795b */ 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"; import { SchemaFieldDataType, SchemaFieldDataType$inboundSchema, } from "./schemafielddatatype.js"; import { SchemaFieldIndex, SchemaFieldIndex$inboundSchema, } from "./schemafieldindex.js"; import { SchemaFieldStorage, SchemaFieldStorage$inboundSchema, } from "./schemafieldstorage.js"; export type GetSearchIndexSchemaDetailResponseField = { name: string; type: SchemaFieldDataType; storage: SchemaFieldStorage; indexType: SchemaFieldIndex | null; }; /** @internal */ export const GetSearchIndexSchemaDetailResponseField$inboundSchema: z.ZodType< GetSearchIndexSchemaDetailResponseField, unknown > = z.object({ name: z.string(), type: SchemaFieldDataType$inboundSchema, storage: SchemaFieldStorage$inboundSchema, index_type: z.nullable(SchemaFieldIndex$inboundSchema), }).transform((v) => { return remap$(v, { "index_type": "indexType", }); }); export function getSearchIndexSchemaDetailResponseFieldFromJSON( jsonString: string, ): SafeParseResult< GetSearchIndexSchemaDetailResponseField, SDKValidationError > { return safeParse( jsonString, (x) => GetSearchIndexSchemaDetailResponseField$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetSearchIndexSchemaDetailResponseField' from JSON`, ); }