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