/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The message describing a basket */ export type BasketCreate = { /** * User-supplied unique basket ID. Cannot be more than 40 characters long. */ clientBasketId: string; /** * The unique id for the correspondent for the basket */ correspondentId: string; }; /** @internal */ export const BasketCreate$inboundSchema: z.ZodType< BasketCreate, z.ZodTypeDef, unknown > = z.object({ client_basket_id: z.string(), correspondent_id: z.string(), }).transform((v) => { return remap$(v, { "client_basket_id": "clientBasketId", "correspondent_id": "correspondentId", }); }); /** @internal */ export type BasketCreate$Outbound = { client_basket_id: string; correspondent_id: string; }; /** @internal */ export const BasketCreate$outboundSchema: z.ZodType< BasketCreate$Outbound, z.ZodTypeDef, BasketCreate > = z.object({ clientBasketId: z.string(), correspondentId: z.string(), }).transform((v) => { return remap$(v, { clientBasketId: "client_basket_id", correspondentId: "correspondent_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace BasketCreate$ { /** @deprecated use `BasketCreate$inboundSchema` instead. */ export const inboundSchema = BasketCreate$inboundSchema; /** @deprecated use `BasketCreate$outboundSchema` instead. */ export const outboundSchema = BasketCreate$outboundSchema; /** @deprecated use `BasketCreate$Outbound` instead. */ export type Outbound = BasketCreate$Outbound; } export function basketCreateToJSON(basketCreate: BasketCreate): string { return JSON.stringify(BasketCreate$outboundSchema.parse(basketCreate)); } export function basketCreateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => BasketCreate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'BasketCreate' from JSON`, ); }