/* * 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 { ManualTermsOfService, ManualTermsOfService$inboundSchema, ManualTermsOfService$Outbound, ManualTermsOfService$outboundSchema, } from "./manualtermsofservice.js"; export type TermsOfServicePayload = { token?: string | undefined; /** * Describes the acceptance of the Terms of Service. All data is required, and must be from the user. */ manual?: ManualTermsOfService | undefined; }; /** @internal */ export const TermsOfServicePayload$inboundSchema: z.ZodType< TermsOfServicePayload, z.ZodTypeDef, unknown > = z.object({ token: z.string().optional(), manual: ManualTermsOfService$inboundSchema.optional(), }); /** @internal */ export type TermsOfServicePayload$Outbound = { token?: string | undefined; manual?: ManualTermsOfService$Outbound | undefined; }; /** @internal */ export const TermsOfServicePayload$outboundSchema: z.ZodType< TermsOfServicePayload$Outbound, z.ZodTypeDef, TermsOfServicePayload > = z.object({ token: z.string().optional(), manual: ManualTermsOfService$outboundSchema.optional(), }); export function termsOfServicePayloadToJSON( termsOfServicePayload: TermsOfServicePayload, ): string { return JSON.stringify( TermsOfServicePayload$outboundSchema.parse(termsOfServicePayload), ); } export function termsOfServicePayloadFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TermsOfServicePayload$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TermsOfServicePayload' from JSON`, ); }