/* * 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 { MeterAggregation, MeterAggregation$inboundSchema, } from "./meter-aggregation.js"; import { MeterFilter, MeterFilter$inboundSchema } from "./meter-filter.js"; import { ResetUsage, ResetUsage$inboundSchema } from "./reset-usage.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type MeterResponse = { aggregation?: MeterAggregation | undefined; createdAt?: Date | undefined; eventName?: string | undefined; filters?: Array | undefined; id?: string | undefined; name?: string | undefined; resetUsage?: ResetUsage | undefined; status?: string | undefined; tenantId?: string | undefined; updatedAt?: Date | undefined; }; /** @internal */ export const MeterResponse$inboundSchema: z.ZodMiniType< MeterResponse, unknown > = z.pipe( z.object({ aggregation: types.optional(MeterAggregation$inboundSchema), created_at: types.optional(types.date()), event_name: types.optional(types.string()), filters: types.optional(z.array(MeterFilter$inboundSchema)), id: types.optional(types.string()), name: types.optional(types.string()), reset_usage: types.optional(ResetUsage$inboundSchema), status: types.optional(types.string()), tenant_id: types.optional(types.string()), updated_at: types.optional(types.date()), }), z.transform((v) => { return remap$(v, { "created_at": "createdAt", "event_name": "eventName", "reset_usage": "resetUsage", "tenant_id": "tenantId", "updated_at": "updatedAt", }); }), ); export function meterResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MeterResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MeterResponse' from JSON`, ); }