/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as types from "../../types/primitives.js"; import { Address, Address$inboundSchema, Address$Outbound, Address$outboundSchema, } from "./address.js"; import { SDKValidationError } from "./sdk-validation-error.js"; export type TenantBillingDetails = { address?: Address | undefined; email?: string | undefined; helpEmail?: string | undefined; phone?: string | undefined; }; /** @internal */ export const TenantBillingDetails$inboundSchema: z.ZodMiniType< TenantBillingDetails, unknown > = z.pipe( z.object({ address: types.optional(Address$inboundSchema), email: types.optional(types.string()), help_email: types.optional(types.string()), phone: types.optional(types.string()), }), z.transform((v) => { return remap$(v, { "help_email": "helpEmail", }); }), ); /** @internal */ export type TenantBillingDetails$Outbound = { address?: Address$Outbound | undefined; email?: string | undefined; help_email?: string | undefined; phone?: string | undefined; }; /** @internal */ export const TenantBillingDetails$outboundSchema: z.ZodMiniType< TenantBillingDetails$Outbound, TenantBillingDetails > = z.pipe( z.object({ address: z.optional(Address$outboundSchema), email: z.optional(z.string()), helpEmail: z.optional(z.string()), phone: z.optional(z.string()), }), z.transform((v) => { return remap$(v, { helpEmail: "help_email", }); }), ); export function tenantBillingDetailsToJSON( tenantBillingDetails: TenantBillingDetails, ): string { return JSON.stringify( TenantBillingDetails$outboundSchema.parse(tenantBillingDetails), ); } export function tenantBillingDetailsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TenantBillingDetails$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TenantBillingDetails' from JSON`, ); }