/* * 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 affirming agreements. */ export type AffirmAgreementsResponse = { /** * The collection of affirmed legal agreements belonging to a given account. */ agreements?: Array | undefined; }; /** @internal */ export const AffirmAgreementsResponse$inboundSchema: z.ZodType< AffirmAgreementsResponse, z.ZodTypeDef, unknown > = z.object({ agreements: z.array(Agreement$inboundSchema).optional(), }); /** @internal */ export type AffirmAgreementsResponse$Outbound = { agreements?: Array | undefined; }; /** @internal */ export const AffirmAgreementsResponse$outboundSchema: z.ZodType< AffirmAgreementsResponse$Outbound, z.ZodTypeDef, AffirmAgreementsResponse > = 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 AffirmAgreementsResponse$ { /** @deprecated use `AffirmAgreementsResponse$inboundSchema` instead. */ export const inboundSchema = AffirmAgreementsResponse$inboundSchema; /** @deprecated use `AffirmAgreementsResponse$outboundSchema` instead. */ export const outboundSchema = AffirmAgreementsResponse$outboundSchema; /** @deprecated use `AffirmAgreementsResponse$Outbound` instead. */ export type Outbound = AffirmAgreementsResponse$Outbound; } export function affirmAgreementsResponseToJSON( affirmAgreementsResponse: AffirmAgreementsResponse, ): string { return JSON.stringify( AffirmAgreementsResponse$outboundSchema.parse(affirmAgreementsResponse), ); } export function affirmAgreementsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AffirmAgreementsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AffirmAgreementsResponse' from JSON`, ); }