/* * 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 AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest = { /** * The account id. */ accountId: string; /** * The achWithdrawalSchedule id. */ achWithdrawalScheduleId: string; }; export type AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse = { httpMeta: components.HTTPMetadata; /** * OK */ achWithdrawalSchedule?: components.AchWithdrawalSchedule | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$inboundSchema: z.ZodType< AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), achWithdrawalSchedule_id: z.string(), }).transform((v) => { return remap$(v, { "account_id": "accountId", "achWithdrawalSchedule_id": "achWithdrawalScheduleId", }); }); /** @internal */ export type AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$Outbound = { account_id: string; achWithdrawalSchedule_id: string; }; /** @internal */ export const AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$outboundSchema: z.ZodType< AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$Outbound, z.ZodTypeDef, AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest > = z.object({ accountId: z.string(), achWithdrawalScheduleId: z.string(), }).transform((v) => { return remap$(v, { accountId: "account_id", achWithdrawalScheduleId: "achWithdrawalSchedule_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$ { /** @deprecated use `AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$inboundSchema; /** @deprecated use `AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$outboundSchema; /** @deprecated use `AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$Outbound` instead. */ export type Outbound = AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$Outbound; } export function achWithdrawalSchedulesGetAchWithdrawalScheduleRequestToJSON( achWithdrawalSchedulesGetAchWithdrawalScheduleRequest: AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest, ): string { return JSON.stringify( AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$outboundSchema.parse( achWithdrawalSchedulesGetAchWithdrawalScheduleRequest, ), ); } export function achWithdrawalSchedulesGetAchWithdrawalScheduleRequestFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AchWithdrawalSchedulesGetAchWithdrawalScheduleRequest' from JSON`, ); } /** @internal */ export const AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$inboundSchema: z.ZodType< AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AchWithdrawalSchedule: components.AchWithdrawalSchedule$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AchWithdrawalSchedule": "achWithdrawalSchedule", "Status": "status", }); }); /** @internal */ export type AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AchWithdrawalSchedule?: components.AchWithdrawalSchedule$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$outboundSchema: z.ZodType< AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$Outbound, z.ZodTypeDef, AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, achWithdrawalSchedule: components.AchWithdrawalSchedule$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", achWithdrawalSchedule: "AchWithdrawalSchedule", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$ { /** @deprecated use `AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$inboundSchema` instead. */ export const inboundSchema = AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$inboundSchema; /** @deprecated use `AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$outboundSchema` instead. */ export const outboundSchema = AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$outboundSchema; /** @deprecated use `AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$Outbound` instead. */ export type Outbound = AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$Outbound; } export function achWithdrawalSchedulesGetAchWithdrawalScheduleResponseToJSON( achWithdrawalSchedulesGetAchWithdrawalScheduleResponse: AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse, ): string { return JSON.stringify( AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$outboundSchema.parse( achWithdrawalSchedulesGetAchWithdrawalScheduleResponse, ), ); } export function achWithdrawalSchedulesGetAchWithdrawalScheduleResponseFromJSON( jsonString: string, ): SafeParseResult< AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse, SDKValidationError > { return safeParse( jsonString, (x) => AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AchWithdrawalSchedulesGetAchWithdrawalScheduleResponse' from JSON`, ); }