/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; 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 UsageResult = { /** * Voice identifier */ voiceId?: string | undefined; /** * Human-readable voice name */ voiceName?: string | undefined; /** * API key used */ apiKey?: string | undefined; /** * Model used */ model?: string | undefined; /** * Total minutes of API usage */ minutesUsed: number; }; /** @internal */ export const UsageResult$inboundSchema: z.ZodType< UsageResult, z.ZodTypeDef, unknown > = z.object({ voice_id: z.string().optional(), voice_name: z.string().optional(), api_key: z.string().optional(), model: z.string().optional(), minutes_used: z.number(), }).transform((v) => { return remap$(v, { "voice_id": "voiceId", "voice_name": "voiceName", "api_key": "apiKey", "minutes_used": "minutesUsed", }); }); /** @internal */ export type UsageResult$Outbound = { voice_id?: string | undefined; voice_name?: string | undefined; api_key?: string | undefined; model?: string | undefined; minutes_used: number; }; /** @internal */ export const UsageResult$outboundSchema: z.ZodType< UsageResult$Outbound, z.ZodTypeDef, UsageResult > = z.object({ voiceId: z.string().optional(), voiceName: z.string().optional(), apiKey: z.string().optional(), model: z.string().optional(), minutesUsed: z.number(), }).transform((v) => { return remap$(v, { voiceId: "voice_id", voiceName: "voice_name", apiKey: "api_key", minutesUsed: "minutes_used", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UsageResult$ { /** @deprecated use `UsageResult$inboundSchema` instead. */ export const inboundSchema = UsageResult$inboundSchema; /** @deprecated use `UsageResult$outboundSchema` instead. */ export const outboundSchema = UsageResult$outboundSchema; /** @deprecated use `UsageResult$Outbound` instead. */ export type Outbound = UsageResult$Outbound; } export function usageResultToJSON(usageResult: UsageResult): string { return JSON.stringify(UsageResult$outboundSchema.parse(usageResult)); } export function usageResultFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UsageResult$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UsageResult' from JSON`, ); }