/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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"; /** * Maps the correlation id to the signed link that can be used to upload the described document. */ export type UploadLink = { /** * User-provided identifier that relates this signed link with the request used to get it */ clientBatchSourceId?: string | undefined; /** * Identifier for the upload link; This can be used to retrieve the document after it is uploaded */ name?: string | undefined; /** * Signed link used to upload a document; The link expires one hour after being generated */ uploadLink?: string | undefined; }; /** @internal */ export const UploadLink$inboundSchema: z.ZodType< UploadLink, z.ZodTypeDef, unknown > = z.object({ client_batch_source_id: z.string().optional(), name: z.string().optional(), upload_link: z.string().optional(), }).transform((v) => { return remap$(v, { "client_batch_source_id": "clientBatchSourceId", "upload_link": "uploadLink", }); }); /** @internal */ export type UploadLink$Outbound = { client_batch_source_id?: string | undefined; name?: string | undefined; upload_link?: string | undefined; }; /** @internal */ export const UploadLink$outboundSchema: z.ZodType< UploadLink$Outbound, z.ZodTypeDef, UploadLink > = z.object({ clientBatchSourceId: z.string().optional(), name: z.string().optional(), uploadLink: z.string().optional(), }).transform((v) => { return remap$(v, { clientBatchSourceId: "client_batch_source_id", uploadLink: "upload_link", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UploadLink$ { /** @deprecated use `UploadLink$inboundSchema` instead. */ export const inboundSchema = UploadLink$inboundSchema; /** @deprecated use `UploadLink$outboundSchema` instead. */ export const outboundSchema = UploadLink$outboundSchema; /** @deprecated use `UploadLink$Outbound` instead. */ export type Outbound = UploadLink$Outbound; } export function uploadLinkToJSON(uploadLink: UploadLink): string { return JSON.stringify(UploadLink$outboundSchema.parse(uploadLink)); } export function uploadLinkFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UploadLink$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadLink' from JSON`, ); }