/* * 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 GovernmentDataPostzonRetrieveByPostcodeErrorItem = { /** * The id of the error returned */ error?: string | undefined; /** * A description of the error */ description?: string | undefined; /** * The cause of the error */ cause?: string | undefined; /** * Actions to resolve the error */ resolution?: string | undefined; }; /** @internal */ export const GovernmentDataPostzonRetrieveByPostcodeErrorItem$inboundSchema: z.ZodType< GovernmentDataPostzonRetrieveByPostcodeErrorItem, z.ZodTypeDef, unknown > = z.object({ Error: z.string().optional(), Description: z.string().optional(), Cause: z.string().optional(), Resolution: z.string().optional(), }).transform((v) => { return remap$(v, { "Error": "error", "Description": "description", "Cause": "cause", "Resolution": "resolution", }); }); export function governmentDataPostzonRetrieveByPostcodeErrorItemFromJSON( jsonString: string, ): SafeParseResult< GovernmentDataPostzonRetrieveByPostcodeErrorItem, SDKValidationError > { return safeParse( jsonString, (x) => GovernmentDataPostzonRetrieveByPostcodeErrorItem$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GovernmentDataPostzonRetrieveByPostcodeErrorItem' from JSON`, ); }