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