/* * 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 DisablePaymentLinkGlobals = { /** * Specify an API version. * * @remarks * * API versioning follows the format `vYYYY.QQ.BB`, where * - `YYYY` is the year * - `QQ` is the two-digit month for the first month of the quarter (e.g., 01, 04, 07, 10) * - `BB` is the build number, starting at `.01`, for subsequent builds in the same quarter. * - For example, `v2024.01.00` is the initial release of the first quarter of 2024. * * The `latest` version represents the most recent development state. It may include breaking changes and should be treated as a beta release. * When no version is specified, the API defaults to `v2024.01.00`. */ xMoovVersion?: string | undefined; }; export type DisablePaymentLinkRequest = { /** * The merchant account ID. */ accountID: string; paymentLinkCode: string; }; export type DisablePaymentLinkResponse = { headers: { [k: string]: Array }; }; /** @internal */ export const DisablePaymentLinkGlobals$inboundSchema: z.ZodType< DisablePaymentLinkGlobals, z.ZodTypeDef, unknown > = z.object({ "X-Moov-Version": z.string().optional(), }).transform((v) => { return remap$(v, { "X-Moov-Version": "xMoovVersion", }); }); /** @internal */ export type DisablePaymentLinkGlobals$Outbound = { "X-Moov-Version"?: string | undefined; }; /** @internal */ export const DisablePaymentLinkGlobals$outboundSchema: z.ZodType< DisablePaymentLinkGlobals$Outbound, z.ZodTypeDef, DisablePaymentLinkGlobals > = z.object({ xMoovVersion: z.string().optional(), }).transform((v) => { return remap$(v, { xMoovVersion: "X-Moov-Version", }); }); export function disablePaymentLinkGlobalsToJSON( disablePaymentLinkGlobals: DisablePaymentLinkGlobals, ): string { return JSON.stringify( DisablePaymentLinkGlobals$outboundSchema.parse(disablePaymentLinkGlobals), ); } export function disablePaymentLinkGlobalsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DisablePaymentLinkGlobals$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DisablePaymentLinkGlobals' from JSON`, ); } /** @internal */ export const DisablePaymentLinkRequest$inboundSchema: z.ZodType< DisablePaymentLinkRequest, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), paymentLinkCode: z.string(), }); /** @internal */ export type DisablePaymentLinkRequest$Outbound = { accountID: string; paymentLinkCode: string; }; /** @internal */ export const DisablePaymentLinkRequest$outboundSchema: z.ZodType< DisablePaymentLinkRequest$Outbound, z.ZodTypeDef, DisablePaymentLinkRequest > = z.object({ accountID: z.string(), paymentLinkCode: z.string(), }); export function disablePaymentLinkRequestToJSON( disablePaymentLinkRequest: DisablePaymentLinkRequest, ): string { return JSON.stringify( DisablePaymentLinkRequest$outboundSchema.parse(disablePaymentLinkRequest), ); } export function disablePaymentLinkRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DisablePaymentLinkRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DisablePaymentLinkRequest' from JSON`, ); } /** @internal */ export const DisablePaymentLinkResponse$inboundSchema: z.ZodType< DisablePaymentLinkResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), }).transform((v) => { return remap$(v, { "Headers": "headers", }); }); /** @internal */ export type DisablePaymentLinkResponse$Outbound = { Headers: { [k: string]: Array }; }; /** @internal */ export const DisablePaymentLinkResponse$outboundSchema: z.ZodType< DisablePaymentLinkResponse$Outbound, z.ZodTypeDef, DisablePaymentLinkResponse > = z.object({ headers: z.record(z.array(z.string())), }).transform((v) => { return remap$(v, { headers: "Headers", }); }); export function disablePaymentLinkResponseToJSON( disablePaymentLinkResponse: DisablePaymentLinkResponse, ): string { return JSON.stringify( DisablePaymentLinkResponse$outboundSchema.parse(disablePaymentLinkResponse), ); } export function disablePaymentLinkResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DisablePaymentLinkResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DisablePaymentLinkResponse' from JSON`, ); }