/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Optional theme preference for the portal. */ export const Theme = { Light: "light", Dark: "dark", } as const; /** * Optional theme preference for the portal. */ export type Theme = ClosedEnum; export type GetTenantPortalUrlRequest = { /** * The ID of the tenant. Required when using AdminApiKey authentication. */ tenantId: string; /** * Optional theme preference for the portal. */ theme?: Theme | undefined; }; /** @internal */ export const Theme$inboundSchema: z.ZodNativeEnum = z.nativeEnum( Theme, ); /** @internal */ export const Theme$outboundSchema: z.ZodNativeEnum = Theme$inboundSchema; /** @internal */ export const GetTenantPortalUrlRequest$inboundSchema: z.ZodType< GetTenantPortalUrlRequest, z.ZodTypeDef, unknown > = z.object({ tenant_id: z.string(), theme: Theme$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "tenant_id": "tenantId", }); }); /** @internal */ export type GetTenantPortalUrlRequest$Outbound = { tenant_id: string; theme?: string | undefined; }; /** @internal */ export const GetTenantPortalUrlRequest$outboundSchema: z.ZodType< GetTenantPortalUrlRequest$Outbound, z.ZodTypeDef, GetTenantPortalUrlRequest > = z.object({ tenantId: z.string(), theme: Theme$outboundSchema.optional(), }).transform((v) => { return remap$(v, { tenantId: "tenant_id", }); }); export function getTenantPortalUrlRequestToJSON( getTenantPortalUrlRequest: GetTenantPortalUrlRequest, ): string { return JSON.stringify( GetTenantPortalUrlRequest$outboundSchema.parse(getTenantPortalUrlRequest), ); } export function getTenantPortalUrlRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetTenantPortalUrlRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetTenantPortalUrlRequest' from JSON`, ); }