/* * 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 { SDKValidationError } from "./sdk-validation-error.js"; export type CustomAnalyticItem = { /** * Name of the feature this applies to */ featureName?: string | undefined; id?: string | undefined; /** * Calculation name (e.g., "Revenue per Minute") */ name?: string | undefined; /** * "feature", "meter", "event_name" */ type?: string | undefined; value?: string | undefined; }; /** @internal */ export const CustomAnalyticItem$inboundSchema: z.ZodMiniType< CustomAnalyticItem, unknown > = z.pipe( z.object({ feature_name: types.optional(types.string()), id: types.optional(types.string()), name: types.optional(types.string()), type: types.optional(types.string()), value: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "feature_name": "featureName", }); }), ); export function customAnalyticItemFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CustomAnalyticItem$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CustomAnalyticItem' from JSON`, ); }