/* * 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 ComputeTenant = { createdAt: Date; enabled: boolean; maxLiveJobs: number | null; maxLiveServices: number | null; orgId: string; updatedAt: Date; }; /** @internal */ export const ComputeTenant$inboundSchema: z.ZodType< ComputeTenant, z.ZodTypeDef, unknown > = z.object({ created_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), enabled: z.boolean(), max_live_jobs: z.nullable(z.number().int()), max_live_services: z.nullable(z.number().int()), org_id: z.string(), updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v)), }).transform((v) => { return remap$(v, { "created_at": "createdAt", "max_live_jobs": "maxLiveJobs", "max_live_services": "maxLiveServices", "org_id": "orgId", "updated_at": "updatedAt", }); }); /** @internal */ export type ComputeTenant$Outbound = { created_at: string; enabled: boolean; max_live_jobs: number | null; max_live_services: number | null; org_id: string; updated_at: string; }; /** @internal */ export const ComputeTenant$outboundSchema: z.ZodType< ComputeTenant$Outbound, z.ZodTypeDef, ComputeTenant > = z.object({ createdAt: z.date().transform(v => v.toISOString()), enabled: z.boolean(), maxLiveJobs: z.nullable(z.number().int()), maxLiveServices: z.nullable(z.number().int()), orgId: z.string(), updatedAt: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { createdAt: "created_at", maxLiveJobs: "max_live_jobs", maxLiveServices: "max_live_services", orgId: "org_id", updatedAt: "updated_at", }); }); export function computeTenantToJSON(computeTenant: ComputeTenant): string { return JSON.stringify(ComputeTenant$outboundSchema.parse(computeTenant)); } export function computeTenantFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ComputeTenant$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ComputeTenant' from JSON`, ); }