/* * 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 { collectExtraKeys as collectExtraKeys$, safeParse, } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * single entity */ export type MetadataWithOneEntity = { /** * Name of the entity that the error corresponds to. */ entityType?: string | undefined; /** * Unique identifier for the entity. */ entityUuid?: string | undefined; validFrom?: string | null | undefined; validUpTo?: string | null | undefined; key?: string | null | undefined; state?: string | null | undefined; additionalProperties?: { [k: string]: any } | undefined; }; /** @internal */ export const MetadataWithOneEntity$inboundSchema: z.ZodType< MetadataWithOneEntity, z.ZodTypeDef, unknown > = collectExtraKeys$( z.object({ entity_type: z.string().optional(), entity_uuid: z.string().optional(), valid_from: z.nullable(z.string()).optional(), valid_up_to: z.nullable(z.string()).optional(), key: z.nullable(z.string()).optional(), state: z.nullable(z.string()).optional(), }).catchall(z.any()), "additionalProperties", true, ).transform((v) => { return remap$(v, { "entity_type": "entityType", "entity_uuid": "entityUuid", "valid_from": "validFrom", "valid_up_to": "validUpTo", }); }); export function metadataWithOneEntityFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => MetadataWithOneEntity$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetadataWithOneEntity' from JSON`, ); }