/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; import { KeyPurpose, KeyPurpose$inboundSchema } from "./key-purpose.js"; export type KeyRecord = { keyId: string; purpose: KeyPurpose; /** * Non-negative integer amount in USDC atomic units. */ budgetLimit: string; /** * Non-negative integer amount in USDC atomic units. */ budgetUsed: string; /** * Non-negative integer amount in USDC atomic units. */ budgetReserved?: string | undefined; /** * Non-negative integer amount in USDC atomic units. */ budgetRemaining: string; createdAt: number; expiresAt: number; revokedAt?: number | undefined; lastUsedAt?: number | undefined; name?: string | undefined; network: string; }; /** @internal */ export const KeyRecord$inboundSchema: z.ZodMiniType = z .object({ keyId: types.string(), purpose: KeyPurpose$inboundSchema, budgetLimit: types.string(), budgetUsed: types.string(), budgetReserved: types.optional(types.string()), budgetRemaining: types.string(), createdAt: types.number(), expiresAt: types.number(), revokedAt: types.optional(types.number()), lastUsedAt: types.optional(types.number()), name: types.optional(types.string()), network: types.string(), }); export function keyRecordFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => KeyRecord$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'KeyRecord' from JSON`, ); }