/* * 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"; import { AccountDocumentUploadRequestCreate, AccountDocumentUploadRequestCreate$inboundSchema, AccountDocumentUploadRequestCreate$Outbound, AccountDocumentUploadRequestCreate$outboundSchema, } from "./accountdocumentuploadrequestcreate.js"; import { IDDocumentUploadRequestCreate, IDDocumentUploadRequestCreate$inboundSchema, IDDocumentUploadRequestCreate$Outbound, IDDocumentUploadRequestCreate$outboundSchema, } from "./iddocumentuploadrequestcreate.js"; /** * Document to be uploaded; These descriptions allow the document to be searched for after it is uploaded. */ export type CreateUploadLinkRequestCreate = { /** * Account document to be uploaded; */ accountDocumentUploadRequest?: AccountDocumentUploadRequestCreate | undefined; /** * User-provided identifier that relates this document with the signed link that will be generated for it; Required for all documents; Must be unique for each document in the request */ clientBatchSourceId: string; /** * Identity document to be uploaded; */ idDocumentUploadRequest?: IDDocumentUploadRequestCreate | undefined; /** * Media type for the document to be uploaded; Required for all documents; Must be one of: application/json, application/pdf, image/jpeg, image/png, image/tiff, text/csv, or text/plain */ mimeType: string; }; /** @internal */ export const CreateUploadLinkRequestCreate$inboundSchema: z.ZodType< CreateUploadLinkRequestCreate, z.ZodTypeDef, unknown > = z.object({ account_document_upload_request: AccountDocumentUploadRequestCreate$inboundSchema.optional(), client_batch_source_id: z.string(), id_document_upload_request: IDDocumentUploadRequestCreate$inboundSchema .optional(), mime_type: z.string(), }).transform((v) => { return remap$(v, { "account_document_upload_request": "accountDocumentUploadRequest", "client_batch_source_id": "clientBatchSourceId", "id_document_upload_request": "idDocumentUploadRequest", "mime_type": "mimeType", }); }); /** @internal */ export type CreateUploadLinkRequestCreate$Outbound = { account_document_upload_request?: | AccountDocumentUploadRequestCreate$Outbound | undefined; client_batch_source_id: string; id_document_upload_request?: | IDDocumentUploadRequestCreate$Outbound | undefined; mime_type: string; }; /** @internal */ export const CreateUploadLinkRequestCreate$outboundSchema: z.ZodType< CreateUploadLinkRequestCreate$Outbound, z.ZodTypeDef, CreateUploadLinkRequestCreate > = z.object({ accountDocumentUploadRequest: AccountDocumentUploadRequestCreate$outboundSchema.optional(), clientBatchSourceId: z.string(), idDocumentUploadRequest: IDDocumentUploadRequestCreate$outboundSchema .optional(), mimeType: z.string(), }).transform((v) => { return remap$(v, { accountDocumentUploadRequest: "account_document_upload_request", clientBatchSourceId: "client_batch_source_id", idDocumentUploadRequest: "id_document_upload_request", mimeType: "mime_type", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CreateUploadLinkRequestCreate$ { /** @deprecated use `CreateUploadLinkRequestCreate$inboundSchema` instead. */ export const inboundSchema = CreateUploadLinkRequestCreate$inboundSchema; /** @deprecated use `CreateUploadLinkRequestCreate$outboundSchema` instead. */ export const outboundSchema = CreateUploadLinkRequestCreate$outboundSchema; /** @deprecated use `CreateUploadLinkRequestCreate$Outbound` instead. */ export type Outbound = CreateUploadLinkRequestCreate$Outbound; } export function createUploadLinkRequestCreateToJSON( createUploadLinkRequestCreate: CreateUploadLinkRequestCreate, ): string { return JSON.stringify( CreateUploadLinkRequestCreate$outboundSchema.parse( createUploadLinkRequestCreate, ), ); } export function createUploadLinkRequestCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateUploadLinkRequestCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateUploadLinkRequestCreate' from JSON`, ); }