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