/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type V3UnifyRequestResponse = { httpMeta: components.HTTPMetadata; /** * Successful Request. */ v3UnifyResponse?: components.V3UnifyResponse | undefined; }; /** @internal */ export const V3UnifyRequestResponse$inboundSchema: z.ZodType< V3UnifyRequestResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, V3UnifyResponse: components.V3UnifyResponse$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "V3UnifyResponse": "v3UnifyResponse", }); }); /** @internal */ export type V3UnifyRequestResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; V3UnifyResponse?: components.V3UnifyResponse$Outbound | undefined; }; /** @internal */ export const V3UnifyRequestResponse$outboundSchema: z.ZodType< V3UnifyRequestResponse$Outbound, z.ZodTypeDef, V3UnifyRequestResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, v3UnifyResponse: components.V3UnifyResponse$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", v3UnifyResponse: "V3UnifyResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace V3UnifyRequestResponse$ { /** @deprecated use `V3UnifyRequestResponse$inboundSchema` instead. */ export const inboundSchema = V3UnifyRequestResponse$inboundSchema; /** @deprecated use `V3UnifyRequestResponse$outboundSchema` instead. */ export const outboundSchema = V3UnifyRequestResponse$outboundSchema; /** @deprecated use `V3UnifyRequestResponse$Outbound` instead. */ export type Outbound = V3UnifyRequestResponse$Outbound; } export function v3UnifyRequestResponseToJSON( v3UnifyRequestResponse: V3UnifyRequestResponse, ): string { return JSON.stringify( V3UnifyRequestResponse$outboundSchema.parse(v3UnifyRequestResponse), ); } export function v3UnifyRequestResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3UnifyRequestResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3UnifyRequestResponse' from JSON`, ); }