/* * 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"; export enum PaymentResponsePendingTag { Pending = "pending", } export enum PaymentResponsePendingStatus { AwaitingUserConfirmation = "awaiting_user_confirmation", } export enum Action { Redirect = "redirect", } export type PaymentResponsePending = { dotTag: PaymentResponsePendingTag; id?: string | undefined; status: PaymentResponsePendingStatus; action: Action; url: string; }; /** @internal */ export const PaymentResponsePendingTag$inboundSchema: z.ZodNativeEnum< typeof PaymentResponsePendingTag > = z.nativeEnum(PaymentResponsePendingTag); /** @internal */ export const PaymentResponsePendingTag$outboundSchema: z.ZodNativeEnum< typeof PaymentResponsePendingTag > = PaymentResponsePendingTag$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PaymentResponsePendingTag$ { /** @deprecated use `PaymentResponsePendingTag$inboundSchema` instead. */ export const inboundSchema = PaymentResponsePendingTag$inboundSchema; /** @deprecated use `PaymentResponsePendingTag$outboundSchema` instead. */ export const outboundSchema = PaymentResponsePendingTag$outboundSchema; } /** @internal */ export const PaymentResponsePendingStatus$inboundSchema: z.ZodNativeEnum< typeof PaymentResponsePendingStatus > = z.nativeEnum(PaymentResponsePendingStatus); /** @internal */ export const PaymentResponsePendingStatus$outboundSchema: z.ZodNativeEnum< typeof PaymentResponsePendingStatus > = PaymentResponsePendingStatus$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PaymentResponsePendingStatus$ { /** @deprecated use `PaymentResponsePendingStatus$inboundSchema` instead. */ export const inboundSchema = PaymentResponsePendingStatus$inboundSchema; /** @deprecated use `PaymentResponsePendingStatus$outboundSchema` instead. */ export const outboundSchema = PaymentResponsePendingStatus$outboundSchema; } /** @internal */ export const Action$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Action); /** @internal */ export const Action$outboundSchema: z.ZodNativeEnum = Action$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace Action$ { /** @deprecated use `Action$inboundSchema` instead. */ export const inboundSchema = Action$inboundSchema; /** @deprecated use `Action$outboundSchema` instead. */ export const outboundSchema = Action$outboundSchema; } /** @internal */ export const PaymentResponsePending$inboundSchema: z.ZodType< PaymentResponsePending, z.ZodTypeDef, unknown > = z.object({ ".tag": PaymentResponsePendingTag$inboundSchema, id: z.string().optional(), status: PaymentResponsePendingStatus$inboundSchema, action: Action$inboundSchema, url: z.string(), }).transform((v) => { return remap$(v, { ".tag": "dotTag", }); }); /** @internal */ export type PaymentResponsePending$Outbound = { ".tag": string; id?: string | undefined; status: string; action: string; url: string; }; /** @internal */ export const PaymentResponsePending$outboundSchema: z.ZodType< PaymentResponsePending$Outbound, z.ZodTypeDef, PaymentResponsePending > = z.object({ dotTag: PaymentResponsePendingTag$outboundSchema, id: z.string().optional(), status: PaymentResponsePendingStatus$outboundSchema, action: Action$outboundSchema, url: z.string(), }).transform((v) => { return remap$(v, { dotTag: ".tag", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace PaymentResponsePending$ { /** @deprecated use `PaymentResponsePending$inboundSchema` instead. */ export const inboundSchema = PaymentResponsePending$inboundSchema; /** @deprecated use `PaymentResponsePending$outboundSchema` instead. */ export const outboundSchema = PaymentResponsePending$outboundSchema; /** @deprecated use `PaymentResponsePending$Outbound` instead. */ export type Outbound = PaymentResponsePending$Outbound; } export function paymentResponsePendingToJSON( paymentResponsePending: PaymentResponsePending, ): string { return JSON.stringify( PaymentResponsePending$outboundSchema.parse(paymentResponsePending), ); } export function paymentResponsePendingFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentResponsePending$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentResponsePending' from JSON`, ); }