/* * 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"; export type Manual = { acceptedDate?: string | undefined; acceptedDomain?: string | undefined; acceptedIP?: string | undefined; acceptedUserAgent?: string | undefined; }; export type TermsOfServiceError = { token?: string | undefined; manual?: Manual | undefined; }; /** @internal */ export const Manual$inboundSchema: z.ZodType = z .object({ acceptedDate: z.string().optional(), acceptedDomain: z.string().optional(), acceptedIP: z.string().optional(), acceptedUserAgent: z.string().optional(), }); /** @internal */ export type Manual$Outbound = { acceptedDate?: string | undefined; acceptedDomain?: string | undefined; acceptedIP?: string | undefined; acceptedUserAgent?: string | undefined; }; /** @internal */ export const Manual$outboundSchema: z.ZodType< Manual$Outbound, z.ZodTypeDef, Manual > = z.object({ acceptedDate: z.string().optional(), acceptedDomain: z.string().optional(), acceptedIP: z.string().optional(), acceptedUserAgent: z.string().optional(), }); export function manualToJSON(manual: Manual): string { return JSON.stringify(Manual$outboundSchema.parse(manual)); } export function manualFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Manual$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Manual' from JSON`, ); } /** @internal */ export const TermsOfServiceError$inboundSchema: z.ZodType< TermsOfServiceError, z.ZodTypeDef, unknown > = z.object({ token: z.string().optional(), manual: z.lazy(() => Manual$inboundSchema).optional(), }); /** @internal */ export type TermsOfServiceError$Outbound = { token?: string | undefined; manual?: Manual$Outbound | undefined; }; /** @internal */ export const TermsOfServiceError$outboundSchema: z.ZodType< TermsOfServiceError$Outbound, z.ZodTypeDef, TermsOfServiceError > = z.object({ token: z.string().optional(), manual: z.lazy(() => Manual$outboundSchema).optional(), }); export function termsOfServiceErrorToJSON( termsOfServiceError: TermsOfServiceError, ): string { return JSON.stringify( TermsOfServiceError$outboundSchema.parse(termsOfServiceError), ); } export function termsOfServiceErrorFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TermsOfServiceError$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TermsOfServiceError' from JSON`, ); }