/* * 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 ReplicaVersion = { /** * Replica Version ID */ replicaVersionId?: string | undefined; /** * Executed Timestamp Seconds */ executedTimestampSeconds?: string | undefined; /** * Proposal ID */ proposalId?: string | undefined; }; /** @internal */ export const ReplicaVersion$inboundSchema: z.ZodType< ReplicaVersion, z.ZodTypeDef, unknown > = z.object({ replica_version_id: z.string().optional(), executed_timestamp_seconds: z.string().optional(), proposal_id: z.string().optional(), }).transform((v) => { return remap$(v, { "replica_version_id": "replicaVersionId", "executed_timestamp_seconds": "executedTimestampSeconds", "proposal_id": "proposalId", }); }); /** @internal */ export type ReplicaVersion$Outbound = { replica_version_id?: string | undefined; executed_timestamp_seconds?: string | undefined; proposal_id?: string | undefined; }; /** @internal */ export const ReplicaVersion$outboundSchema: z.ZodType< ReplicaVersion$Outbound, z.ZodTypeDef, ReplicaVersion > = z.object({ replicaVersionId: z.string().optional(), executedTimestampSeconds: z.string().optional(), proposalId: z.string().optional(), }).transform((v) => { return remap$(v, { replicaVersionId: "replica_version_id", executedTimestampSeconds: "executed_timestamp_seconds", proposalId: "proposal_id", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ReplicaVersion$ { /** @deprecated use `ReplicaVersion$inboundSchema` instead. */ export const inboundSchema = ReplicaVersion$inboundSchema; /** @deprecated use `ReplicaVersion$outboundSchema` instead. */ export const outboundSchema = ReplicaVersion$outboundSchema; /** @deprecated use `ReplicaVersion$Outbound` instead. */ export type Outbound = ReplicaVersion$Outbound; } export function replicaVersionToJSON(replicaVersion: ReplicaVersion): string { return JSON.stringify(ReplicaVersion$outboundSchema.parse(replicaVersion)); } export function replicaVersionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReplicaVersion$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReplicaVersion' from JSON`, ); }