/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type DownloadClientCategory = { clientCategory?: string | null | undefined; categories?: Array | null | undefined; }; /** @internal */ export const DownloadClientCategory$inboundSchema: z.ZodType< DownloadClientCategory, z.ZodTypeDef, unknown > = z.object({ clientCategory: z.nullable(z.string()).optional(), categories: z.nullable(z.array(z.number().int())).optional(), }); /** @internal */ export type DownloadClientCategory$Outbound = { clientCategory?: string | null | undefined; categories?: Array | null | undefined; }; /** @internal */ export const DownloadClientCategory$outboundSchema: z.ZodType< DownloadClientCategory$Outbound, z.ZodTypeDef, DownloadClientCategory > = z.object({ clientCategory: z.nullable(z.string()).optional(), categories: z.nullable(z.array(z.number().int())).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace DownloadClientCategory$ { /** @deprecated use `DownloadClientCategory$inboundSchema` instead. */ export const inboundSchema = DownloadClientCategory$inboundSchema; /** @deprecated use `DownloadClientCategory$outboundSchema` instead. */ export const outboundSchema = DownloadClientCategory$outboundSchema; /** @deprecated use `DownloadClientCategory$Outbound` instead. */ export type Outbound = DownloadClientCategory$Outbound; } export function downloadClientCategoryToJSON( downloadClientCategory: DownloadClientCategory, ): string { return JSON.stringify( DownloadClientCategory$outboundSchema.parse(downloadClientCategory), ); } export function downloadClientCategoryFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DownloadClientCategory$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DownloadClientCategory' from JSON`, ); }