/* * 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 CustomFilterResource = { id?: number | undefined; type?: string | null | undefined; label?: string | null | undefined; filters?: Array<{ [k: string]: any }> | null | undefined; }; /** @internal */ export const CustomFilterResource$inboundSchema: z.ZodType< CustomFilterResource, z.ZodTypeDef, unknown > = z.object({ id: z.number().int().optional(), type: z.nullable(z.string()).optional(), label: z.nullable(z.string()).optional(), filters: z.nullable(z.array(z.record(z.any()))).optional(), }); /** @internal */ export type CustomFilterResource$Outbound = { id?: number | undefined; type?: string | null | undefined; label?: string | null | undefined; filters?: Array<{ [k: string]: any }> | null | undefined; }; /** @internal */ export const CustomFilterResource$outboundSchema: z.ZodType< CustomFilterResource$Outbound, z.ZodTypeDef, CustomFilterResource > = z.object({ id: z.number().int().optional(), type: z.nullable(z.string()).optional(), label: z.nullable(z.string()).optional(), filters: z.nullable(z.array(z.record(z.any()))).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace CustomFilterResource$ { /** @deprecated use `CustomFilterResource$inboundSchema` instead. */ export const inboundSchema = CustomFilterResource$inboundSchema; /** @deprecated use `CustomFilterResource$outboundSchema` instead. */ export const outboundSchema = CustomFilterResource$outboundSchema; /** @deprecated use `CustomFilterResource$Outbound` instead. */ export type Outbound = CustomFilterResource$Outbound; } export function customFilterResourceToJSON( customFilterResource: CustomFilterResource, ): string { return JSON.stringify( CustomFilterResource$outboundSchema.parse(customFilterResource), ); } export function customFilterResourceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomFilterResource$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomFilterResource' from JSON`, ); }