/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Null when the uploader's account no longer exists. */ export type UploadedBy = { email: string; name: string; }; /** * A file an auditor shared with the customer on an information request. */ export type InformationRequestAuditorFile = { id: string; /** * The filename, falling back to the title or document ID when unavailable. */ filename: string; /** * The stored MIME type, or application/octet-stream when unavailable. */ mimeType: string; /** * A temporary download link that expires one hour after it is * * @remarks * issued. List the files again for a fresh link. Do not use it as a key. * Use `filename` when saving the download; the URL does not supply a filename. */ url: string; /** * Null when the uploader's account no longer exists. */ uploadedBy: UploadedBy | null; uploadedDate: Date; }; /** @internal */ export const UploadedBy$inboundSchema: z.ZodType< UploadedBy, z.ZodTypeDef, unknown > = z.object({ email: z.string(), name: z.string(), }); export function uploadedByFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UploadedBy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UploadedBy' from JSON`, ); } /** @internal */ export const InformationRequestAuditorFile$inboundSchema: z.ZodType< InformationRequestAuditorFile, z.ZodTypeDef, unknown > = z.object({ id: z.string(), filename: z.string(), mimeType: z.string(), url: z.string(), uploadedBy: z.nullable(z.lazy(() => UploadedBy$inboundSchema)), uploadedDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), }); export function informationRequestAuditorFileFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => InformationRequestAuditorFile$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'InformationRequestAuditorFile' from JSON`, ); }