/* * 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 { AggregationType, AggregationType$inboundSchema, } from "./aggregation-type.js"; import { SDKValidationError } from "./sdk-validation-error.js"; import { UsageResult, UsageResult$inboundSchema } from "./usage-result.js"; export type GetUsageResponse = { eventName?: string | undefined; results?: Array | undefined; type?: AggregationType | undefined; value?: number | undefined; }; /** @internal */ export const GetUsageResponse$inboundSchema: z.ZodMiniType< GetUsageResponse, unknown > = z.pipe( z.object({ event_name: types.optional(types.string()), results: types.optional(z.array(UsageResult$inboundSchema)), type: types.optional(AggregationType$inboundSchema), value: types.optional(types.number()), }), z.transform((v) => { return remap$(v, { "event_name": "eventName", }); }), ); export function getUsageResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetUsageResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetUsageResponse' from JSON`, ); }