/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { ApplicationScope, ApplicationScope$inboundSchema, ApplicationScope$outboundSchema, } from "./applicationscope.js"; import { CapabilityID, CapabilityID$inboundSchema, CapabilityID$outboundSchema, } from "./capabilityid.js"; import { CreateAccount, CreateAccount$inboundSchema, CreateAccount$Outbound, CreateAccount$outboundSchema, } from "./createaccount.js"; /** * Request to create an onboarding invite. */ export type OnboardingInviteRequest = { /** * Optional URL to redirect the user to after they complete the onboarding process. */ returnURL?: string | undefined; /** * Optional URL to your organization's terms of service. */ termsOfServiceURL?: string | undefined; /** * List of [scopes](https://docs.moov.io/api/authentication/scopes/) you request to use on this * * @remarks * account. These values are used to determine what can be done with the account onboarded. */ scopes: Array; /** * List of [scopes](https://docs.moov.io/api/authentication/scopes/) you grant to allow being used * * @remarks * by the new account on yourself. These values are used to determine what the account onboarded can do. */ grantScopes?: Array | undefined; /** * List of [capabilities](https://docs.moov.io/guides/accounts/capabilities/) you intend to request for this * * @remarks * account. These values are used to determine what information to collect from the user during onboarding. */ capabilities: Array; /** * List of fee plan codes to assign the account created by the invitee. */ feePlanCodes: Array; prefill?: CreateAccount | undefined; }; /** @internal */ export const OnboardingInviteRequest$inboundSchema: z.ZodType< OnboardingInviteRequest, z.ZodTypeDef, unknown > = z.object({ returnURL: z.string().optional(), termsOfServiceURL: z.string().optional(), scopes: z.array(ApplicationScope$inboundSchema), grantScopes: z.array(ApplicationScope$inboundSchema).optional(), capabilities: z.array(CapabilityID$inboundSchema), feePlanCodes: z.array(z.string()), prefill: CreateAccount$inboundSchema.optional(), }); /** @internal */ export type OnboardingInviteRequest$Outbound = { returnURL?: string | undefined; termsOfServiceURL?: string | undefined; scopes: Array; grantScopes?: Array | undefined; capabilities: Array; feePlanCodes: Array; prefill?: CreateAccount$Outbound | undefined; }; /** @internal */ export const OnboardingInviteRequest$outboundSchema: z.ZodType< OnboardingInviteRequest$Outbound, z.ZodTypeDef, OnboardingInviteRequest > = z.object({ returnURL: z.string().optional(), termsOfServiceURL: z.string().optional(), scopes: z.array(ApplicationScope$outboundSchema), grantScopes: z.array(ApplicationScope$outboundSchema).optional(), capabilities: z.array(CapabilityID$outboundSchema), feePlanCodes: z.array(z.string()), prefill: CreateAccount$outboundSchema.optional(), }); export function onboardingInviteRequestToJSON( onboardingInviteRequest: OnboardingInviteRequest, ): string { return JSON.stringify( OnboardingInviteRequest$outboundSchema.parse(onboardingInviteRequest), ); } export function onboardingInviteRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => OnboardingInviteRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'OnboardingInviteRequest' from JSON`, ); }