/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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 SandboxPriceRate = { perHour?: number | undefined; perGibHour?: number | undefined; }; /** @internal */ export const SandboxPriceRate$inboundSchema: z.ZodType< SandboxPriceRate, z.ZodTypeDef, unknown > = z.object({ per_hour: z.number().default(0), per_gib_hour: z.number().default(0), }).transform((v) => { return remap$(v, { "per_hour": "perHour", "per_gib_hour": "perGibHour", }); }); /** @internal */ export type SandboxPriceRate$Outbound = { per_hour: number; per_gib_hour: number; }; /** @internal */ export const SandboxPriceRate$outboundSchema: z.ZodType< SandboxPriceRate$Outbound, z.ZodTypeDef, SandboxPriceRate > = z.object({ perHour: z.number().default(0), perGibHour: z.number().default(0), }).transform((v) => { return remap$(v, { perHour: "per_hour", perGibHour: "per_gib_hour", }); }); export function sandboxPriceRateToJSON( sandboxPriceRate: SandboxPriceRate, ): string { return JSON.stringify( SandboxPriceRate$outboundSchema.parse(sandboxPriceRate), ); } export function sandboxPriceRateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SandboxPriceRate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SandboxPriceRate' from JSON`, ); }