/* * 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 FeesCancelFeeRequest = { /** * The account id. */ accountId: string; /** * The fee id. */ feeId: string; cancelFeeRequestCreate: components.CancelFeeRequestCreate; }; export type FeesCancelFeeResponse = { httpMeta: components.HTTPMetadata; /** * OK */ transfersFee?: components.TransfersFee | undefined; /** * INVALID_ARGUMENT: The request has an invalid argument. */ status?: components.Status | undefined; }; /** @internal */ export const FeesCancelFeeRequest$inboundSchema: z.ZodType< FeesCancelFeeRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), fee_id: z.string(), CancelFeeRequestCreate: components.CancelFeeRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "fee_id": "feeId", "CancelFeeRequestCreate": "cancelFeeRequestCreate", }); }); /** @internal */ export type FeesCancelFeeRequest$Outbound = { account_id: string; fee_id: string; CancelFeeRequestCreate: components.CancelFeeRequestCreate$Outbound; }; /** @internal */ export const FeesCancelFeeRequest$outboundSchema: z.ZodType< FeesCancelFeeRequest$Outbound, z.ZodTypeDef, FeesCancelFeeRequest > = z.object({ accountId: z.string(), feeId: z.string(), cancelFeeRequestCreate: components.CancelFeeRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", feeId: "fee_id", cancelFeeRequestCreate: "CancelFeeRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace FeesCancelFeeRequest$ { /** @deprecated use `FeesCancelFeeRequest$inboundSchema` instead. */ export const inboundSchema = FeesCancelFeeRequest$inboundSchema; /** @deprecated use `FeesCancelFeeRequest$outboundSchema` instead. */ export const outboundSchema = FeesCancelFeeRequest$outboundSchema; /** @deprecated use `FeesCancelFeeRequest$Outbound` instead. */ export type Outbound = FeesCancelFeeRequest$Outbound; } export function feesCancelFeeRequestToJSON( feesCancelFeeRequest: FeesCancelFeeRequest, ): string { return JSON.stringify( FeesCancelFeeRequest$outboundSchema.parse(feesCancelFeeRequest), ); } export function feesCancelFeeRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeesCancelFeeRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeesCancelFeeRequest' from JSON`, ); } /** @internal */ export const FeesCancelFeeResponse$inboundSchema: z.ZodType< FeesCancelFeeResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, TransfersFee: components.TransfersFee$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "TransfersFee": "transfersFee", "Status": "status", }); }); /** @internal */ export type FeesCancelFeeResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; TransfersFee?: components.TransfersFee$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const FeesCancelFeeResponse$outboundSchema: z.ZodType< FeesCancelFeeResponse$Outbound, z.ZodTypeDef, FeesCancelFeeResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, transfersFee: components.TransfersFee$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", transfersFee: "TransfersFee", 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 FeesCancelFeeResponse$ { /** @deprecated use `FeesCancelFeeResponse$inboundSchema` instead. */ export const inboundSchema = FeesCancelFeeResponse$inboundSchema; /** @deprecated use `FeesCancelFeeResponse$outboundSchema` instead. */ export const outboundSchema = FeesCancelFeeResponse$outboundSchema; /** @deprecated use `FeesCancelFeeResponse$Outbound` instead. */ export type Outbound = FeesCancelFeeResponse$Outbound; } export function feesCancelFeeResponseToJSON( feesCancelFeeResponse: FeesCancelFeeResponse, ): string { return JSON.stringify( FeesCancelFeeResponse$outboundSchema.parse(feesCancelFeeResponse), ); } export function feesCancelFeeResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeesCancelFeeResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeesCancelFeeResponse' from JSON`, ); }