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