/* * 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 FeatureUsageInfo = { customerId?: string | undefined; featureId?: string | undefined; meterId?: string | undefined; priceId?: string | undefined; processedAt?: Date | undefined; qtyTotal?: string | undefined; subLineItemId?: string | undefined; subscriptionId?: string | undefined; }; /** @internal */ export const FeatureUsageInfo$inboundSchema: z.ZodMiniType< FeatureUsageInfo, unknown > = z.pipe( z.object({ customer_id: types.optional(types.string()), feature_id: types.optional(types.string()), meter_id: types.optional(types.string()), price_id: types.optional(types.string()), processed_at: types.optional(types.date()), qty_total: types.optional(types.string()), sub_line_item_id: types.optional(types.string()), subscription_id: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "customer_id": "customerId", "feature_id": "featureId", "meter_id": "meterId", "price_id": "priceId", "processed_at": "processedAt", "qty_total": "qtyTotal", "sub_line_item_id": "subLineItemId", "subscription_id": "subscriptionId", }); }), ); export function featureUsageInfoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeatureUsageInfo$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeatureUsageInfo' from JSON`, ); }