/* * 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"; import { IppAttribute, IppAttribute$inboundSchema } from "./ippattribute.js"; export type Ipp = { /** * The CUPS version, if any, specified in the list of attributes returned in a get-printer-attributes response or CUPS-get-printers response. Generally in the form 'x.y.z'. */ attributeCupsVersion?: string | undefined; /** * Each IPP version, if any, specified in the list of attributes returned in a get-printer-attributes response or CUPS-get-printers response. Always in the form 'x.y'. */ attributeIppVersions?: Array | null | undefined; /** * Each printer URI, if any, specified in the list of attributes returned in a get-printer-attributes response or CUPS-get-printers response. Uses ipp(s) or http(s) scheme, followed by a hostname or IP, and then the path to a particular printer. */ attributePrinterUris?: Array | null | undefined; /** * All IPP attributes included in any contentful responses obtained. Each has a name, list of values (potentially only one), and a tag denoting how the value should be interpreted. */ attributes?: Array | null | undefined; /** * The CUPS version, if any, specified in the Server header of an IPP get-attributes response. */ cupsVersion?: string | undefined; /** * Major component of IPP version listed in the Server header of a response to an IPP get-printer-attributes request. */ majorVersion?: number | undefined; /** * Minor component of IPP version listed in the Server header of a response to an IPP get-printer-attributes request. */ minorVersion?: number | undefined; /** * The specific IPP version returned in response to an IPP get-printer-attributes request. Always in the form 'IPP/x.y' */ versionString?: string | undefined; }; /** @internal */ export const Ipp$inboundSchema: z.ZodType = z .object({ attribute_cups_version: z.string().optional(), attribute_ipp_versions: z.nullable(z.array(z.string())).optional(), attribute_printer_uris: z.nullable(z.array(z.string())).optional(), attributes: z.nullable(z.array(IppAttribute$inboundSchema)).optional(), cups_version: z.string().optional(), major_version: z.number().int().optional(), minor_version: z.number().int().optional(), version_string: z.string().optional(), }).transform((v) => { return remap$(v, { "attribute_cups_version": "attributeCupsVersion", "attribute_ipp_versions": "attributeIppVersions", "attribute_printer_uris": "attributePrinterUris", "cups_version": "cupsVersion", "major_version": "majorVersion", "minor_version": "minorVersion", "version_string": "versionString", }); }); export function ippFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Ipp$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Ipp' from JSON`, ); }