/* * 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 ComputeTenantUpdate = { enabled?: boolean | undefined; maxLiveJobs?: number | null | undefined; maxLiveServices?: number | null | undefined; }; /** @internal */ export const ComputeTenantUpdate$inboundSchema: z.ZodType< ComputeTenantUpdate, z.ZodTypeDef, unknown > = z.object({ enabled: z.boolean().optional(), max_live_jobs: z.nullable(z.number().int()).optional(), max_live_services: z.nullable(z.number().int()).optional(), }).transform((v) => { return remap$(v, { "max_live_jobs": "maxLiveJobs", "max_live_services": "maxLiveServices", }); }); /** @internal */ export type ComputeTenantUpdate$Outbound = { enabled?: boolean | undefined; max_live_jobs?: number | null | undefined; max_live_services?: number | null | undefined; }; /** @internal */ export const ComputeTenantUpdate$outboundSchema: z.ZodType< ComputeTenantUpdate$Outbound, z.ZodTypeDef, ComputeTenantUpdate > = z.object({ enabled: z.boolean().optional(), maxLiveJobs: z.nullable(z.number().int()).optional(), maxLiveServices: z.nullable(z.number().int()).optional(), }).transform((v) => { return remap$(v, { maxLiveJobs: "max_live_jobs", maxLiveServices: "max_live_services", }); }); export function computeTenantUpdateToJSON( computeTenantUpdate: ComputeTenantUpdate, ): string { return JSON.stringify( ComputeTenantUpdate$outboundSchema.parse(computeTenantUpdate), ); } export function computeTenantUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputeTenantUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputeTenantUpdate' from JSON`, ); }