/* * 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 { SDKValidationError } from "./sdk-validation-error.js"; import { SecretResponse, SecretResponse$inboundSchema, } from "./secret-response.js"; export type CreateAPIKeyResponse = { apiKey?: string | undefined; secret?: SecretResponse | undefined; }; /** @internal */ export const CreateAPIKeyResponse$inboundSchema: z.ZodMiniType< CreateAPIKeyResponse, unknown > = z.pipe( z.object({ api_key: types.optional(types.string()), secret: types.optional(SecretResponse$inboundSchema), }), z.transform((v) => { return remap$(v, { "api_key": "apiKey", }); }), ); export function createAPIKeyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateAPIKeyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateAPIKeyResponse' from JSON`, ); }