/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 SupportedProperty = { /** * Name of the property in our Unified API. */ unifiedProperty?: string | undefined; /** * List of child properties of the unified property. */ childProperties?: Array | undefined; }; /** @internal */ export const SupportedProperty$inboundSchema: z.ZodType< SupportedProperty, z.ZodTypeDef, unknown > = z.object({ unified_property: z.string().optional(), child_properties: z.array(z.lazy(() => SupportedProperty$inboundSchema)) .optional(), }).transform((v) => { return remap$(v, { "unified_property": "unifiedProperty", "child_properties": "childProperties", }); }); /** @internal */ export type SupportedProperty$Outbound = { unified_property?: string | undefined; child_properties?: Array | undefined; }; /** @internal */ export const SupportedProperty$outboundSchema: z.ZodType< SupportedProperty$Outbound, z.ZodTypeDef, SupportedProperty > = z.object({ unifiedProperty: z.string().optional(), childProperties: z.array(z.lazy(() => SupportedProperty$outboundSchema)) .optional(), }).transform((v) => { return remap$(v, { unifiedProperty: "unified_property", childProperties: "child_properties", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SupportedProperty$ { /** @deprecated use `SupportedProperty$inboundSchema` instead. */ export const inboundSchema = SupportedProperty$inboundSchema; /** @deprecated use `SupportedProperty$outboundSchema` instead. */ export const outboundSchema = SupportedProperty$outboundSchema; /** @deprecated use `SupportedProperty$Outbound` instead. */ export type Outbound = SupportedProperty$Outbound; } export function supportedPropertyToJSON( supportedProperty: SupportedProperty, ): string { return JSON.stringify( SupportedProperty$outboundSchema.parse(supportedProperty), ); } export function supportedPropertyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SupportedProperty$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SupportedProperty' from JSON`, ); }