/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { Agreement, Agreement$inboundSchema, Agreement$Outbound, Agreement$outboundSchema, } from "./agreement.js"; /** * The response for enrolling an account. */ export type EnrollAccountResponse = { /** * The collection of legal agreements that require affirmation to enroll the account in a program. */ agreements?: Array | undefined; }; /** @internal */ export const EnrollAccountResponse$inboundSchema: z.ZodType< EnrollAccountResponse, z.ZodTypeDef, unknown > = z.object({ agreements: z.array(Agreement$inboundSchema).optional(), }); /** @internal */ export type EnrollAccountResponse$Outbound = { agreements?: Array | undefined; }; /** @internal */ export const EnrollAccountResponse$outboundSchema: z.ZodType< EnrollAccountResponse$Outbound, z.ZodTypeDef, EnrollAccountResponse > = z.object({ agreements: z.array(Agreement$outboundSchema).optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace EnrollAccountResponse$ { /** @deprecated use `EnrollAccountResponse$inboundSchema` instead. */ export const inboundSchema = EnrollAccountResponse$inboundSchema; /** @deprecated use `EnrollAccountResponse$outboundSchema` instead. */ export const outboundSchema = EnrollAccountResponse$outboundSchema; /** @deprecated use `EnrollAccountResponse$Outbound` instead. */ export type Outbound = EnrollAccountResponse$Outbound; } export function enrollAccountResponseToJSON( enrollAccountResponse: EnrollAccountResponse, ): string { return JSON.stringify( EnrollAccountResponse$outboundSchema.parse(enrollAccountResponse), ); } export function enrollAccountResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => EnrollAccountResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'EnrollAccountResponse' from JSON`, ); }