/* * 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 { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Form1099 = { /** * The UUID of the form */ uuid: string; /** * The type identifier of the form */ name?: string | undefined; /** * The title of the form */ title?: string | undefined; /** * The description of the form */ description?: string | undefined; /** * If the form is in a draft state. E.g. End of year tax forms may be provided in a draft state prior to being finalized. */ draft?: boolean | undefined; /** * The year of this form. For some forms, e.g. tax forms, this is the year which the form represents. A 1099 for January - December 2022 would be delivered in January 2023 and have a year value of 2022. This value is nullable and will not be present on all forms. */ year?: number | null | undefined; /** * The quarter of this form. This value is currently always null since it is not present on any contractor forms. */ quarter?: number | null | undefined; /** * A boolean flag that indicates whether the form needs signing or not. Note that this value will change after the form is signed. */ requiresSigning?: boolean | undefined; /** * The content type of the associated document. Most forms are PDFs with a content type of `application/pdf`. Some tax file packages will be zip files (containing PDFs) with a content type of `application/zip`. This attribute will be `null` when the document has not been prepared. */ documentContentType?: string | null | undefined; /** * The contractor UUID */ contractorUuid?: string | undefined; }; /** @internal */ export const Form1099$inboundSchema: z.ZodType< Form1099, z.ZodTypeDef, unknown > = z.object({ uuid: z.string(), name: z.string().optional(), title: z.string().optional(), description: z.string().optional(), draft: z.boolean().optional(), year: z.nullable(z.number().int()).optional(), quarter: z.nullable(z.number().int()).optional(), requires_signing: z.boolean().optional(), document_content_type: z.nullable(z.string()).optional(), contractor_uuid: z.string().optional(), }).transform((v) => { return remap$(v, { "requires_signing": "requiresSigning", "document_content_type": "documentContentType", "contractor_uuid": "contractorUuid", }); }); export function form1099FromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Form1099$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Form1099' from JSON`, ); }