/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { AggregatedEntitlement, AggregatedEntitlement$inboundSchema, } from "./aggregated-entitlement.js"; import { EntitlementSource, EntitlementSource$inboundSchema, } from "./entitlement-source.js"; import { FeatureResponse, FeatureResponse$inboundSchema, } from "./feature-response.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type AggregatedFeature = { entitlement?: AggregatedEntitlement | undefined; feature?: FeatureResponse | undefined; sources?: Array | undefined; }; /** @internal */ export const AggregatedFeature$inboundSchema: z.ZodMiniType< AggregatedFeature, unknown > = z.object({ entitlement: types.optional(AggregatedEntitlement$inboundSchema), feature: types.optional(FeatureResponse$inboundSchema), sources: types.optional(z.array(EntitlementSource$inboundSchema)), }); export function aggregatedFeatureFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AggregatedFeature$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AggregatedFeature' from JSON`, ); }