/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PortalRedirect = { /** * Redirect URL containing a JWT to authenticate the user with the portal. */ redirectUrl?: string | undefined; /** * The ID of the tenant associated with this portal session. */ tenantId?: string | undefined; }; /** @internal */ export const PortalRedirect$inboundSchema: z.ZodType< PortalRedirect, z.ZodTypeDef, unknown > = z.object({ redirect_url: z.string().optional(), tenant_id: z.string().optional(), }).transform((v) => { return remap$(v, { "redirect_url": "redirectUrl", "tenant_id": "tenantId", }); }); /** @internal */ export type PortalRedirect$Outbound = { redirect_url?: string | undefined; tenant_id?: string | undefined; }; /** @internal */ export const PortalRedirect$outboundSchema: z.ZodType< PortalRedirect$Outbound, z.ZodTypeDef, PortalRedirect > = z.object({ redirectUrl: z.string().optional(), tenantId: z.string().optional(), }).transform((v) => { return remap$(v, { redirectUrl: "redirect_url", tenantId: "tenant_id", }); }); export function portalRedirectToJSON(portalRedirect: PortalRedirect): string { return JSON.stringify(PortalRedirect$outboundSchema.parse(portalRedirect)); } export function portalRedirectFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PortalRedirect$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PortalRedirect' from JSON`, ); }