/* * 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 AssetTradingConfigServiceGetAssetTradingConfigRequest = { /** * The correspondent id. */ correspondentId: string; /** * The asset id. */ assetId: string; }; export type AssetTradingConfigServiceGetAssetTradingConfigResponse = { httpMeta: components.HTTPMetadata; /** * OK */ assetTradingConfig?: components.AssetTradingConfig | undefined; /** * INVALID_ARGUMENT: The correspondent_id or the asset_id could not be determined for the request. * * @remarks * FAILED_PRECONDITION: The requested asset trading config was not found even though the asset exists. */ status?: components.Status | undefined; }; /** @internal */ export const AssetTradingConfigServiceGetAssetTradingConfigRequest$inboundSchema: z.ZodType< AssetTradingConfigServiceGetAssetTradingConfigRequest, z.ZodTypeDef, unknown > = z.object({ correspondent_id: z.string(), asset_id: z.string(), }).transform((v) => { return remap$(v, { "correspondent_id": "correspondentId", "asset_id": "assetId", }); }); /** @internal */ export type AssetTradingConfigServiceGetAssetTradingConfigRequest$Outbound = { correspondent_id: string; asset_id: string; }; /** @internal */ export const AssetTradingConfigServiceGetAssetTradingConfigRequest$outboundSchema: z.ZodType< AssetTradingConfigServiceGetAssetTradingConfigRequest$Outbound, z.ZodTypeDef, AssetTradingConfigServiceGetAssetTradingConfigRequest > = z.object({ correspondentId: z.string(), assetId: z.string(), }).transform((v) => { return remap$(v, { correspondentId: "correspondent_id", assetId: "asset_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AssetTradingConfigServiceGetAssetTradingConfigRequest$ { /** @deprecated use `AssetTradingConfigServiceGetAssetTradingConfigRequest$inboundSchema` instead. */ export const inboundSchema = AssetTradingConfigServiceGetAssetTradingConfigRequest$inboundSchema; /** @deprecated use `AssetTradingConfigServiceGetAssetTradingConfigRequest$outboundSchema` instead. */ export const outboundSchema = AssetTradingConfigServiceGetAssetTradingConfigRequest$outboundSchema; /** @deprecated use `AssetTradingConfigServiceGetAssetTradingConfigRequest$Outbound` instead. */ export type Outbound = AssetTradingConfigServiceGetAssetTradingConfigRequest$Outbound; } export function assetTradingConfigServiceGetAssetTradingConfigRequestToJSON( assetTradingConfigServiceGetAssetTradingConfigRequest: AssetTradingConfigServiceGetAssetTradingConfigRequest, ): string { return JSON.stringify( AssetTradingConfigServiceGetAssetTradingConfigRequest$outboundSchema.parse( assetTradingConfigServiceGetAssetTradingConfigRequest, ), ); } export function assetTradingConfigServiceGetAssetTradingConfigRequestFromJSON( jsonString: string, ): SafeParseResult< AssetTradingConfigServiceGetAssetTradingConfigRequest, SDKValidationError > { return safeParse( jsonString, (x) => AssetTradingConfigServiceGetAssetTradingConfigRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'AssetTradingConfigServiceGetAssetTradingConfigRequest' from JSON`, ); } /** @internal */ export const AssetTradingConfigServiceGetAssetTradingConfigResponse$inboundSchema: z.ZodType< AssetTradingConfigServiceGetAssetTradingConfigResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, AssetTradingConfig: components.AssetTradingConfig$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "AssetTradingConfig": "assetTradingConfig", "Status": "status", }); }); /** @internal */ export type AssetTradingConfigServiceGetAssetTradingConfigResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; AssetTradingConfig?: components.AssetTradingConfig$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AssetTradingConfigServiceGetAssetTradingConfigResponse$outboundSchema: z.ZodType< AssetTradingConfigServiceGetAssetTradingConfigResponse$Outbound, z.ZodTypeDef, AssetTradingConfigServiceGetAssetTradingConfigResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, assetTradingConfig: components.AssetTradingConfig$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", assetTradingConfig: "AssetTradingConfig", 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 AssetTradingConfigServiceGetAssetTradingConfigResponse$ { /** @deprecated use `AssetTradingConfigServiceGetAssetTradingConfigResponse$inboundSchema` instead. */ export const inboundSchema = AssetTradingConfigServiceGetAssetTradingConfigResponse$inboundSchema; /** @deprecated use `AssetTradingConfigServiceGetAssetTradingConfigResponse$outboundSchema` instead. */ export const outboundSchema = AssetTradingConfigServiceGetAssetTradingConfigResponse$outboundSchema; /** @deprecated use `AssetTradingConfigServiceGetAssetTradingConfigResponse$Outbound` instead. */ export type Outbound = AssetTradingConfigServiceGetAssetTradingConfigResponse$Outbound; } export function assetTradingConfigServiceGetAssetTradingConfigResponseToJSON( assetTradingConfigServiceGetAssetTradingConfigResponse: AssetTradingConfigServiceGetAssetTradingConfigResponse, ): string { return JSON.stringify( AssetTradingConfigServiceGetAssetTradingConfigResponse$outboundSchema.parse( assetTradingConfigServiceGetAssetTradingConfigResponse, ), ); } export function assetTradingConfigServiceGetAssetTradingConfigResponseFromJSON( jsonString: string, ): SafeParseResult< AssetTradingConfigServiceGetAssetTradingConfigResponse, SDKValidationError > { return safeParse( jsonString, (x) => AssetTradingConfigServiceGetAssetTradingConfigResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'AssetTradingConfigServiceGetAssetTradingConfigResponse' from JSON`, ); }