/* * 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 WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest = { /** * The account id. */ accountId: string; /** * The wireWithdrawalSchedule id. */ wireWithdrawalScheduleId: string; /** * A field mask representing the update. Note: only the 'schedule_details.amount' field of a schedule is currently updatable */ updateMask?: string | undefined; wireWithdrawalScheduleUpdate: components.WireWithdrawalScheduleUpdate; }; export type WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse = { httpMeta: components.HTTPMetadata; /** * OK */ wireWithdrawalSchedule?: components.WireWithdrawalSchedule | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$inboundSchema: z.ZodType< WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), wireWithdrawalSchedule_id: z.string(), update_mask: z.string().optional(), WireWithdrawalScheduleUpdate: components.WireWithdrawalScheduleUpdate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "wireWithdrawalSchedule_id": "wireWithdrawalScheduleId", "update_mask": "updateMask", "WireWithdrawalScheduleUpdate": "wireWithdrawalScheduleUpdate", }); }); /** @internal */ export type WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$Outbound = { account_id: string; wireWithdrawalSchedule_id: string; update_mask?: string | undefined; WireWithdrawalScheduleUpdate: components.WireWithdrawalScheduleUpdate$Outbound; }; /** @internal */ export const WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$outboundSchema: z.ZodType< WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$Outbound, z.ZodTypeDef, WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest > = z.object({ accountId: z.string(), wireWithdrawalScheduleId: z.string(), updateMask: z.string().optional(), wireWithdrawalScheduleUpdate: components.WireWithdrawalScheduleUpdate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", wireWithdrawalScheduleId: "wireWithdrawalSchedule_id", updateMask: "update_mask", wireWithdrawalScheduleUpdate: "WireWithdrawalScheduleUpdate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$ { /** @deprecated use `WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$inboundSchema; /** @deprecated use `WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$outboundSchema; /** @deprecated use `WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$Outbound` instead. */ export type Outbound = WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$Outbound; } export function wireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequestToJSON( wireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest: WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest, ): string { return JSON.stringify( WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$outboundSchema .parse(wireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest), ); } export function wireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequestFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalSchedulesUpdateWireWithdrawalScheduleRequest' from JSON`, ); } /** @internal */ export const WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$inboundSchema: z.ZodType< WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, WireWithdrawalSchedule: components.WireWithdrawalSchedule$inboundSchema .optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "WireWithdrawalSchedule": "wireWithdrawalSchedule", "Status": "status", }); }); /** @internal */ export type WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; WireWithdrawalSchedule?: | components.WireWithdrawalSchedule$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$outboundSchema: z.ZodType< WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$Outbound, z.ZodTypeDef, WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, wireWithdrawalSchedule: components.WireWithdrawalSchedule$outboundSchema .optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", wireWithdrawalSchedule: "WireWithdrawalSchedule", 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 WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$ { /** @deprecated use `WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$inboundSchema` instead. */ export const inboundSchema = WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$inboundSchema; /** @deprecated use `WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$outboundSchema` instead. */ export const outboundSchema = WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$outboundSchema; /** @deprecated use `WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$Outbound` instead. */ export type Outbound = WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$Outbound; } export function wireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponseToJSON( wireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse: WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse, ): string { return JSON.stringify( WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$outboundSchema .parse(wireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse), ); } export function wireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponseFromJSON( jsonString: string, ): SafeParseResult< WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse, SDKValidationError > { return safeParse( jsonString, (x) => WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'WireWithdrawalSchedulesUpdateWireWithdrawalScheduleResponse' from JSON`, ); }