/* * 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"; export type AuditorFileUploadGrant = { /** * Opaque identifier for this upload. Pass it unchanged to finalize; it is not the attached file's ID. */ uploadId: string; /** * Temporary URL for the file-transfer request. POST every returned `fields` * * @remarks * entry and the file to this URL, without a Vanta Authorization header. * This is not a download link. */ url: string; /** * Form fields to send with the file to `url`. Copy every returned name and * * @remarks * value unchanged into a multipart/form-data POST, then append the file under * `file` as the final part. These are form fields, not HTTP headers. Field * names may vary between uploads; do not hard-code the example fields. */ fields: { [k: string]: string }; /** * Maximum file size in bytes, inclusive. The limit is 50MB. */ maxSizeBytes: number; /** * UTC expiration timestamp for `url` and `fields`. Start the file-transfer POST well before this time. */ transferExpiresAt: Date; /** * UTC deadline to complete finalization and attach the file, even if the file transfer has already succeeded. */ finalizationExpiresAt: Date; }; /** @internal */ export const AuditorFileUploadGrant$inboundSchema: z.ZodType< AuditorFileUploadGrant, z.ZodTypeDef, unknown > = z.object({ uploadId: z.string(), url: z.string(), fields: z.record(z.string()), maxSizeBytes: z.number(), transferExpiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ), finalizationExpiresAt: z.string().datetime({ offset: true }).transform(v => new Date(v) ), }); export function auditorFileUploadGrantFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuditorFileUploadGrant$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuditorFileUploadGrant' from JSON`, ); }