/* * 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 IctWithdrawalsCancelIctWithdrawalRequest = { /** * The account id. */ accountId: string; /** * The ictWithdrawal id. */ ictWithdrawalId: string; cancelIctWithdrawalRequestCreate: components.CancelIctWithdrawalRequestCreate; }; export type IctWithdrawalsCancelIctWithdrawalResponse = { httpMeta: components.HTTPMetadata; /** * OK */ ictWithdrawal?: components.IctWithdrawal | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const IctWithdrawalsCancelIctWithdrawalRequest$inboundSchema: z.ZodType< IctWithdrawalsCancelIctWithdrawalRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), ictWithdrawal_id: z.string(), CancelIctWithdrawalRequestCreate: components.CancelIctWithdrawalRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "ictWithdrawal_id": "ictWithdrawalId", "CancelIctWithdrawalRequestCreate": "cancelIctWithdrawalRequestCreate", }); }); /** @internal */ export type IctWithdrawalsCancelIctWithdrawalRequest$Outbound = { account_id: string; ictWithdrawal_id: string; CancelIctWithdrawalRequestCreate: components.CancelIctWithdrawalRequestCreate$Outbound; }; /** @internal */ export const IctWithdrawalsCancelIctWithdrawalRequest$outboundSchema: z.ZodType< IctWithdrawalsCancelIctWithdrawalRequest$Outbound, z.ZodTypeDef, IctWithdrawalsCancelIctWithdrawalRequest > = z.object({ accountId: z.string(), ictWithdrawalId: z.string(), cancelIctWithdrawalRequestCreate: components.CancelIctWithdrawalRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", ictWithdrawalId: "ictWithdrawal_id", cancelIctWithdrawalRequestCreate: "CancelIctWithdrawalRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IctWithdrawalsCancelIctWithdrawalRequest$ { /** @deprecated use `IctWithdrawalsCancelIctWithdrawalRequest$inboundSchema` instead. */ export const inboundSchema = IctWithdrawalsCancelIctWithdrawalRequest$inboundSchema; /** @deprecated use `IctWithdrawalsCancelIctWithdrawalRequest$outboundSchema` instead. */ export const outboundSchema = IctWithdrawalsCancelIctWithdrawalRequest$outboundSchema; /** @deprecated use `IctWithdrawalsCancelIctWithdrawalRequest$Outbound` instead. */ export type Outbound = IctWithdrawalsCancelIctWithdrawalRequest$Outbound; } export function ictWithdrawalsCancelIctWithdrawalRequestToJSON( ictWithdrawalsCancelIctWithdrawalRequest: IctWithdrawalsCancelIctWithdrawalRequest, ): string { return JSON.stringify( IctWithdrawalsCancelIctWithdrawalRequest$outboundSchema.parse( ictWithdrawalsCancelIctWithdrawalRequest, ), ); } export function ictWithdrawalsCancelIctWithdrawalRequestFromJSON( jsonString: string, ): SafeParseResult< IctWithdrawalsCancelIctWithdrawalRequest, SDKValidationError > { return safeParse( jsonString, (x) => IctWithdrawalsCancelIctWithdrawalRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IctWithdrawalsCancelIctWithdrawalRequest' from JSON`, ); } /** @internal */ export const IctWithdrawalsCancelIctWithdrawalResponse$inboundSchema: z.ZodType< IctWithdrawalsCancelIctWithdrawalResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, IctWithdrawal: components.IctWithdrawal$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "IctWithdrawal": "ictWithdrawal", "Status": "status", }); }); /** @internal */ export type IctWithdrawalsCancelIctWithdrawalResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; IctWithdrawal?: components.IctWithdrawal$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const IctWithdrawalsCancelIctWithdrawalResponse$outboundSchema: z.ZodType< IctWithdrawalsCancelIctWithdrawalResponse$Outbound, z.ZodTypeDef, IctWithdrawalsCancelIctWithdrawalResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, ictWithdrawal: components.IctWithdrawal$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", ictWithdrawal: "IctWithdrawal", 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 IctWithdrawalsCancelIctWithdrawalResponse$ { /** @deprecated use `IctWithdrawalsCancelIctWithdrawalResponse$inboundSchema` instead. */ export const inboundSchema = IctWithdrawalsCancelIctWithdrawalResponse$inboundSchema; /** @deprecated use `IctWithdrawalsCancelIctWithdrawalResponse$outboundSchema` instead. */ export const outboundSchema = IctWithdrawalsCancelIctWithdrawalResponse$outboundSchema; /** @deprecated use `IctWithdrawalsCancelIctWithdrawalResponse$Outbound` instead. */ export type Outbound = IctWithdrawalsCancelIctWithdrawalResponse$Outbound; } export function ictWithdrawalsCancelIctWithdrawalResponseToJSON( ictWithdrawalsCancelIctWithdrawalResponse: IctWithdrawalsCancelIctWithdrawalResponse, ): string { return JSON.stringify( IctWithdrawalsCancelIctWithdrawalResponse$outboundSchema.parse( ictWithdrawalsCancelIctWithdrawalResponse, ), ); } export function ictWithdrawalsCancelIctWithdrawalResponseFromJSON( jsonString: string, ): SafeParseResult< IctWithdrawalsCancelIctWithdrawalResponse, SDKValidationError > { return safeParse( jsonString, (x) => IctWithdrawalsCancelIctWithdrawalResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IctWithdrawalsCancelIctWithdrawalResponse' from JSON`, ); }