/* * 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 AssetsGetAssetRequest = { /** * The asset id. */ assetId: string; }; export type AssetsGetAssetResponse = { 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 AssetsGetAssetRequest$inboundSchema: z.ZodType< AssetsGetAssetRequest, z.ZodTypeDef, unknown > = z.object({ asset_id: z.string(), }).transform((v) => { return remap$(v, { "asset_id": "assetId", }); }); /** @internal */ export type AssetsGetAssetRequest$Outbound = { asset_id: string; }; /** @internal */ export const AssetsGetAssetRequest$outboundSchema: z.ZodType< AssetsGetAssetRequest$Outbound, z.ZodTypeDef, AssetsGetAssetRequest > = z.object({ assetId: z.string(), }).transform((v) => { return remap$(v, { 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 AssetsGetAssetRequest$ { /** @deprecated use `AssetsGetAssetRequest$inboundSchema` instead. */ export const inboundSchema = AssetsGetAssetRequest$inboundSchema; /** @deprecated use `AssetsGetAssetRequest$outboundSchema` instead. */ export const outboundSchema = AssetsGetAssetRequest$outboundSchema; /** @deprecated use `AssetsGetAssetRequest$Outbound` instead. */ export type Outbound = AssetsGetAssetRequest$Outbound; } export function assetsGetAssetRequestToJSON( assetsGetAssetRequest: AssetsGetAssetRequest, ): string { return JSON.stringify( AssetsGetAssetRequest$outboundSchema.parse(assetsGetAssetRequest), ); } export function assetsGetAssetRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetsGetAssetRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetsGetAssetRequest' from JSON`, ); } /** @internal */ export const AssetsGetAssetResponse$inboundSchema: z.ZodType< AssetsGetAssetResponse, 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 AssetsGetAssetResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Asset?: components.Asset$Outbound | undefined; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AssetsGetAssetResponse$outboundSchema: z.ZodType< AssetsGetAssetResponse$Outbound, z.ZodTypeDef, AssetsGetAssetResponse > = 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 AssetsGetAssetResponse$ { /** @deprecated use `AssetsGetAssetResponse$inboundSchema` instead. */ export const inboundSchema = AssetsGetAssetResponse$inboundSchema; /** @deprecated use `AssetsGetAssetResponse$outboundSchema` instead. */ export const outboundSchema = AssetsGetAssetResponse$outboundSchema; /** @deprecated use `AssetsGetAssetResponse$Outbound` instead. */ export type Outbound = AssetsGetAssetResponse$Outbound; } export function assetsGetAssetResponseToJSON( assetsGetAssetResponse: AssetsGetAssetResponse, ): string { return JSON.stringify( AssetsGetAssetResponse$outboundSchema.parse(assetsGetAssetResponse), ); } export function assetsGetAssetResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AssetsGetAssetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AssetsGetAssetResponse' from JSON`, ); }