/* * 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"; export type GetDocumentChunkRequest = { /** * The id of the document. */ documentId: string; /** * The ID of the chunk. */ chunkId: string; /** * An optional partition to scope the request to. If omitted, accounts created after 1/9/2025 will have the request scoped to the default partition, while older accounts will have the request scoped to all partitions. Older accounts may opt in to strict partition scoping by contacting support@ragie.ai. Older accounts using the partitions feature are strongly recommended to scope the request to a partition. */ partition?: string | null | undefined; }; /** @internal */ export const GetDocumentChunkRequest$inboundSchema: z.ZodType< GetDocumentChunkRequest, z.ZodTypeDef, unknown > = z.object({ document_id: z.string(), chunk_id: z.string(), partition: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "document_id": "documentId", "chunk_id": "chunkId", }); }); /** @internal */ export type GetDocumentChunkRequest$Outbound = { document_id: string; chunk_id: string; partition?: string | null | undefined; }; /** @internal */ export const GetDocumentChunkRequest$outboundSchema: z.ZodType< GetDocumentChunkRequest$Outbound, z.ZodTypeDef, GetDocumentChunkRequest > = z.object({ documentId: z.string(), chunkId: z.string(), partition: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { documentId: "document_id", chunkId: "chunk_id", }); }); export function getDocumentChunkRequestToJSON( getDocumentChunkRequest: GetDocumentChunkRequest, ): string { return JSON.stringify( GetDocumentChunkRequest$outboundSchema.parse(getDocumentChunkRequest), ); } export function getDocumentChunkRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetDocumentChunkRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetDocumentChunkRequest' from JSON`, ); }