/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { CustomerPortalCustomerSettings, CustomerPortalCustomerSettings$inboundSchema, CustomerPortalCustomerSettings$Outbound, CustomerPortalCustomerSettings$outboundSchema, } from "./customerportalcustomersettings.js"; import { CustomerPortalSubscriptionSettings, CustomerPortalSubscriptionSettings$inboundSchema, CustomerPortalSubscriptionSettings$Outbound, CustomerPortalSubscriptionSettings$outboundSchema, } from "./customerportalsubscriptionsettings.js"; import { CustomerPortalUsageSettings, CustomerPortalUsageSettings$inboundSchema, CustomerPortalUsageSettings$Outbound, CustomerPortalUsageSettings$outboundSchema, } from "./customerportalusagesettings.js"; export type OrganizationCustomerPortalSettings = { usage: CustomerPortalUsageSettings; subscription: CustomerPortalSubscriptionSettings; customer?: CustomerPortalCustomerSettings | undefined; }; /** @internal */ export const OrganizationCustomerPortalSettings$inboundSchema: z.ZodMiniType< OrganizationCustomerPortalSettings, unknown > = z.object({ usage: CustomerPortalUsageSettings$inboundSchema, subscription: CustomerPortalSubscriptionSettings$inboundSchema, customer: z.optional(CustomerPortalCustomerSettings$inboundSchema), }); /** @internal */ export type OrganizationCustomerPortalSettings$Outbound = { usage: CustomerPortalUsageSettings$Outbound; subscription: CustomerPortalSubscriptionSettings$Outbound; customer?: CustomerPortalCustomerSettings$Outbound | undefined; }; /** @internal */ export const OrganizationCustomerPortalSettings$outboundSchema: z.ZodMiniType< OrganizationCustomerPortalSettings$Outbound, OrganizationCustomerPortalSettings > = z.object({ usage: CustomerPortalUsageSettings$outboundSchema, subscription: CustomerPortalSubscriptionSettings$outboundSchema, customer: z.optional(CustomerPortalCustomerSettings$outboundSchema), }); export function organizationCustomerPortalSettingsToJSON( organizationCustomerPortalSettings: OrganizationCustomerPortalSettings, ): string { return JSON.stringify( OrganizationCustomerPortalSettings$outboundSchema.parse( organizationCustomerPortalSettings, ), ); } export function organizationCustomerPortalSettingsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OrganizationCustomerPortalSettings$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OrganizationCustomerPortalSettings' from JSON`, ); }