/* * 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 ApiKeyDto = { /** * API key */ key: string; /** * User ID associated with the API key */ userId: string; /** * Hashed representation of the API key */ hash?: string | undefined; }; /** @internal */ export const ApiKeyDto$inboundSchema: z.ZodType< ApiKeyDto, z.ZodTypeDef, unknown > = z.object({ key: z.string(), _userId: z.string(), hash: z.string().optional(), }).transform((v) => { return remap$(v, { "_userId": "userId", }); }); export function apiKeyDtoFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ApiKeyDto$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ApiKeyDto' from JSON`, ); }