/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The category of the company attachment. * * @remarks * - `gep_notice`: A tax notice attachment * - `compliance`: A compliance attachment * - `other`: Any other attachment type */ export const Category = { GepNotice: "gep_notice", Compliance: "compliance", Other: "other", } as const; /** * The category of the company attachment. * * @remarks * - `gep_notice`: A tax notice attachment * - `compliance`: A compliance attachment * - `other`: Any other attachment type */ export type Category = ClosedEnum; /** * The company attachment */ export type CompanyAttachment = { /** * UUID of the company attachment */ uuid: string; /** * name of the file uploaded */ name: string; /** * The category of the company attachment. * * @remarks * - `gep_notice`: A tax notice attachment * - `compliance`: A compliance attachment * - `other`: Any other attachment type */ category: Category; /** * The ISO 8601 timestamp of when an attachment was uploaded */ uploadTime: string; }; /** @internal */ export const Category$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Category); /** @internal */ export const CompanyAttachment$inboundSchema: z.ZodType< CompanyAttachment, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), name: z.string(), category: Category$inboundSchema, upload_time: z.string(), }).transform((v) => { return remap$(v, { "upload_time": "uploadTime", }); }); export function companyAttachmentFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CompanyAttachment$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CompanyAttachment' from JSON`, ); }