/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest = { ledgerCanisterId: string; blockHash: string; }; /** @internal */ export const GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$inboundSchema: z.ZodType< GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest, z.ZodTypeDef, unknown > = z.object({ ledger_canister_id: z.string(), block_hash: z.string(), }).transform((v) => { return remap$(v, { "ledger_canister_id": "ledgerCanisterId", "block_hash": "blockHash", }); }); /** @internal */ export type GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$Outbound = { ledger_canister_id: string; block_hash: string; }; /** @internal */ export const GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$outboundSchema: z.ZodType< GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$Outbound, z.ZodTypeDef, GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest > = z.object({ ledgerCanisterId: z.string(), blockHash: z.string(), }).transform((v) => { return remap$(v, { ledgerCanisterId: "ledger_canister_id", blockHash: "block_hash", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$ { /** @deprecated use `GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$inboundSchema` instead. */ export const inboundSchema = GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$inboundSchema; /** @deprecated use `GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$outboundSchema` instead. */ export const outboundSchema = GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$outboundSchema; /** @deprecated use `GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$Outbound` instead. */ export type Outbound = GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$Outbound; } export function getTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequestToJSON( getTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest: GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest, ): string { return JSON.stringify( GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$outboundSchema .parse( getTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest, ), ); } export function getTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequestFromJSON( jsonString: string, ): SafeParseResult< GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest, SDKValidationError > { return safeParse( jsonString, (x) => GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'GetTansactionApiV1LedgersLedgerCanisterIdBlocksBlockHashGetRequest' from JSON`, ); }