/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type SourceUsageBreakdown = { /** * The amount of credits consumed through the Platform API. */ api: number; /** * The amount of credits consumed through auto-replenishment. */ autoReplenishment?: number | undefined; /** * The amount of credits consumed through other operations. */ other?: number | undefined; /** * The amount of credits consumed through the Platform UI. */ ui: number; }; /** @internal */ export const SourceUsageBreakdown$inboundSchema: z.ZodType< SourceUsageBreakdown, z.ZodTypeDef, unknown > = z.object({ api: z.number().int(), auto_replenishment: z.number().int().optional(), other: z.number().int().optional(), ui: z.number().int(), }).transform((v) => { return remap$(v, { "auto_replenishment": "autoReplenishment", }); }); export function sourceUsageBreakdownFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SourceUsageBreakdown$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SourceUsageBreakdown' from JSON`, ); }