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