/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { blobLikeSchema } from "../../types/blobs.js"; import { ClosedEnum } from "../../types/enums.js"; export type CompanyAttachmentCreateRequestBodyDocument = { fileName: string; content: ReadableStream | Blob | ArrayBuffer | Uint8Array; }; /** * The category of a company attachment. * * @remarks * - `gep_notice`: A tax notice attachment * - `compliance`: A compliance attachment */ export const CompanyAttachmentCreateRequestBodyCategory = { GepNotice: "gep_notice", Compliance: "compliance", } as const; /** * The category of a company attachment. * * @remarks * - `gep_notice`: A tax notice attachment * - `compliance`: A compliance attachment */ export type CompanyAttachmentCreateRequestBodyCategory = ClosedEnum< typeof CompanyAttachmentCreateRequestBodyCategory >; /** * The binary payload of the file and the company attachment category. */ export type CompanyAttachmentCreateRequestBody = { /** * The binary payload of the file to be uploaded. Supported file types are .qbb, .qbm, .gif, .jpg, .png, .pdf, .xls, .xlsx, .doc and .docx. */ document: CompanyAttachmentCreateRequestBodyDocument | Blob; /** * The category of a company attachment. * * @remarks * - `gep_notice`: A tax notice attachment * - `compliance`: A compliance attachment */ category: CompanyAttachmentCreateRequestBodyCategory; }; /** @internal */ export type CompanyAttachmentCreateRequestBodyDocument$Outbound = { fileName: string; content: ReadableStream | Blob | ArrayBuffer | Uint8Array; }; /** @internal */ export const CompanyAttachmentCreateRequestBodyDocument$outboundSchema: z.ZodType< CompanyAttachmentCreateRequestBodyDocument$Outbound, z.ZodTypeDef, CompanyAttachmentCreateRequestBodyDocument > = z.object({ fileName: z.string(), content: z.union([ z.instanceof(ReadableStream), z.instanceof(Blob), z.instanceof(ArrayBuffer), z.instanceof(Uint8Array), ]), }); export function companyAttachmentCreateRequestBodyDocumentToJSON( companyAttachmentCreateRequestBodyDocument: CompanyAttachmentCreateRequestBodyDocument, ): string { return JSON.stringify( CompanyAttachmentCreateRequestBodyDocument$outboundSchema.parse( companyAttachmentCreateRequestBodyDocument, ), ); } /** @internal */ export const CompanyAttachmentCreateRequestBodyCategory$outboundSchema: z.ZodNativeEnum = z .nativeEnum(CompanyAttachmentCreateRequestBodyCategory); /** @internal */ export type CompanyAttachmentCreateRequestBody$Outbound = { document: CompanyAttachmentCreateRequestBodyDocument$Outbound | Blob; category: string; }; /** @internal */ export const CompanyAttachmentCreateRequestBody$outboundSchema: z.ZodType< CompanyAttachmentCreateRequestBody$Outbound, z.ZodTypeDef, CompanyAttachmentCreateRequestBody > = z.object({ document: z.lazy(() => CompanyAttachmentCreateRequestBodyDocument$outboundSchema ).or(blobLikeSchema), category: CompanyAttachmentCreateRequestBodyCategory$outboundSchema, }); export function companyAttachmentCreateRequestBodyToJSON( companyAttachmentCreateRequestBody: CompanyAttachmentCreateRequestBody, ): string { return JSON.stringify( CompanyAttachmentCreateRequestBody$outboundSchema.parse( companyAttachmentCreateRequestBody, ), ); }