/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type TenantUpsert = { /** * Optional metadata to store with the tenant. */ metadata?: { [k: string]: string } | null | undefined; }; /** @internal */ export const TenantUpsert$inboundSchema: z.ZodType< TenantUpsert, z.ZodTypeDef, unknown > = z.object({ metadata: z.nullable(z.record(z.string())).optional(), }); /** @internal */ export type TenantUpsert$Outbound = { metadata?: { [k: string]: string } | null | undefined; }; /** @internal */ export const TenantUpsert$outboundSchema: z.ZodType< TenantUpsert$Outbound, z.ZodTypeDef, TenantUpsert > = z.object({ metadata: z.nullable(z.record(z.string())).optional(), }); export function tenantUpsertToJSON(tenantUpsert: TenantUpsert): string { return JSON.stringify(TenantUpsert$outboundSchema.parse(tenantUpsert)); } export function tenantUpsertFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TenantUpsert$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TenantUpsert' from JSON`, ); }