/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type UpsertTenantRequest = { /** * The ID of the tenant. Required when using AdminApiKey authentication. */ tenantId: string; /** * Optional tenant metadata */ body?: components.TenantUpsert | undefined; }; /** @internal */ export const UpsertTenantRequest$inboundSchema: z.ZodType< UpsertTenantRequest, z.ZodTypeDef, unknown > = z.object({ tenant_id: z.string(), body: components.TenantUpsert$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "tenant_id": "tenantId", }); }); /** @internal */ export type UpsertTenantRequest$Outbound = { tenant_id: string; body?: components.TenantUpsert$Outbound | undefined; }; /** @internal */ export const UpsertTenantRequest$outboundSchema: z.ZodType< UpsertTenantRequest$Outbound, z.ZodTypeDef, UpsertTenantRequest > = z.object({ tenantId: z.string(), body: components.TenantUpsert$outboundSchema.optional(), }).transform((v) => { return remap$(v, { tenantId: "tenant_id", }); }); export function upsertTenantRequestToJSON( upsertTenantRequest: UpsertTenantRequest, ): string { return JSON.stringify( UpsertTenantRequest$outboundSchema.parse(upsertTenantRequest), ); } export function upsertTenantRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpsertTenantRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpsertTenantRequest' from JSON`, ); }