/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type UpdateDocumentFromUrlRequest = { /** * The id of the document. */ documentId: 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; updateDocumentFromUrlParams: components.UpdateDocumentFromUrlParams; }; /** @internal */ export const UpdateDocumentFromUrlRequest$inboundSchema: z.ZodType< UpdateDocumentFromUrlRequest, z.ZodTypeDef, unknown > = z.object({ document_id: z.string(), partition: z.nullable(z.string()).optional(), UpdateDocumentFromUrlParams: components.UpdateDocumentFromUrlParams$inboundSchema, }).transform((v) => { return remap$(v, { "document_id": "documentId", "UpdateDocumentFromUrlParams": "updateDocumentFromUrlParams", }); }); /** @internal */ export type UpdateDocumentFromUrlRequest$Outbound = { document_id: string; partition?: string | null | undefined; UpdateDocumentFromUrlParams: components.UpdateDocumentFromUrlParams$Outbound; }; /** @internal */ export const UpdateDocumentFromUrlRequest$outboundSchema: z.ZodType< UpdateDocumentFromUrlRequest$Outbound, z.ZodTypeDef, UpdateDocumentFromUrlRequest > = z.object({ documentId: z.string(), partition: z.nullable(z.string()).optional(), updateDocumentFromUrlParams: components.UpdateDocumentFromUrlParams$outboundSchema, }).transform((v) => { return remap$(v, { documentId: "document_id", updateDocumentFromUrlParams: "UpdateDocumentFromUrlParams", }); }); export function updateDocumentFromUrlRequestToJSON( updateDocumentFromUrlRequest: UpdateDocumentFromUrlRequest, ): string { return JSON.stringify( UpdateDocumentFromUrlRequest$outboundSchema.parse( updateDocumentFromUrlRequest, ), ); } export function updateDocumentFromUrlRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateDocumentFromUrlRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateDocumentFromUrlRequest' from JSON`, ); }