/* * 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 AssetsGetAssetCorrespondentRequest = { /** * The correspondent id. */ correspondentId: string; /** * The asset id. */ assetId: string; }; export type AssetsGetAssetCorrespondentResponse = { httpMeta: components.HTTPMetadata; /** * OK */ asset?: components.Asset | undefined; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AssetsGetAssetCorrespondentRequest$inboundSchema: z.ZodType< AssetsGetAssetCorrespondentRequest, 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 AssetsGetAssetCorrespondentRequest$Outbound = { correspondent_id: string; asset_id: string; }; /** @internal */ export const AssetsGetAssetCorrespondentRequest$outboundSchema: z.ZodType< AssetsGetAssetCorrespondentRequest$Outbound, z.ZodTypeDef, AssetsGetAssetCorrespondentRequest > = 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 AssetsGetAssetCorrespondentRequest$ { /** @deprecated use `AssetsGetAssetCorrespondentRequest$inboundSchema` instead. */ export const inboundSchema = AssetsGetAssetCorrespondentRequest$inboundSchema; /** @deprecated use `AssetsGetAssetCorrespondentRequest$outboundSchema` instead. */ export const outboundSchema = AssetsGetAssetCorrespondentRequest$outboundSchema; /** @deprecated use `AssetsGetAssetCorrespondentRequest$Outbound` instead. */ export type Outbound = AssetsGetAssetCorrespondentRequest$Outbound; } export function assetsGetAssetCorrespondentRequestToJSON( assetsGetAssetCorrespondentRequest: AssetsGetAssetCorrespondentRequest, ): string { return JSON.stringify( AssetsGetAssetCorrespondentRequest$outboundSchema.parse( assetsGetAssetCorrespondentRequest, ), ); } export function assetsGetAssetCorrespondentRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetsGetAssetCorrespondentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetsGetAssetCorrespondentRequest' from JSON`, ); } /** @internal */ export const AssetsGetAssetCorrespondentResponse$inboundSchema: z.ZodType< AssetsGetAssetCorrespondentResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Asset: components.Asset$inboundSchema.optional(), Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Asset": "asset", "Status": "status", }); }); /** @internal */ export type AssetsGetAssetCorrespondentResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Asset?: components.Asset$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AssetsGetAssetCorrespondentResponse$outboundSchema: z.ZodType< AssetsGetAssetCorrespondentResponse$Outbound, z.ZodTypeDef, AssetsGetAssetCorrespondentResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, asset: components.Asset$outboundSchema.optional(), status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", asset: "Asset", 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 AssetsGetAssetCorrespondentResponse$ { /** @deprecated use `AssetsGetAssetCorrespondentResponse$inboundSchema` instead. */ export const inboundSchema = AssetsGetAssetCorrespondentResponse$inboundSchema; /** @deprecated use `AssetsGetAssetCorrespondentResponse$outboundSchema` instead. */ export const outboundSchema = AssetsGetAssetCorrespondentResponse$outboundSchema; /** @deprecated use `AssetsGetAssetCorrespondentResponse$Outbound` instead. */ export type Outbound = AssetsGetAssetCorrespondentResponse$Outbound; } export function assetsGetAssetCorrespondentResponseToJSON( assetsGetAssetCorrespondentResponse: AssetsGetAssetCorrespondentResponse, ): string { return JSON.stringify( AssetsGetAssetCorrespondentResponse$outboundSchema.parse( assetsGetAssetCorrespondentResponse, ), ); } export function assetsGetAssetCorrespondentResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetsGetAssetCorrespondentResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetsGetAssetCorrespondentResponse' from JSON`, ); }