/* * 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"; /** * Describes the acceptance of the Terms of Service. All data is required, and must be from the user. */ export type ManualTermsOfServiceUpdate = { /** * The date and time the terms of service were accepted. */ acceptedDate?: Date | undefined; /** * The IP address from which the terms of service were accepted. */ acceptedIP?: string | undefined; /** * The user-agent of the user making the request. */ acceptedUserAgent?: string | undefined; acceptedDomain?: string | undefined; }; /** @internal */ export const ManualTermsOfServiceUpdate$inboundSchema: z.ZodType< ManualTermsOfServiceUpdate, z.ZodTypeDef, unknown > = z.object({ acceptedDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ).optional(), acceptedIP: z.string().optional(), acceptedUserAgent: z.string().optional(), acceptedDomain: z.string().optional(), }); /** @internal */ export type ManualTermsOfServiceUpdate$Outbound = { acceptedDate?: string | undefined; acceptedIP?: string | undefined; acceptedUserAgent?: string | undefined; acceptedDomain?: string | undefined; }; /** @internal */ export const ManualTermsOfServiceUpdate$outboundSchema: z.ZodType< ManualTermsOfServiceUpdate$Outbound, z.ZodTypeDef, ManualTermsOfServiceUpdate > = z.object({ acceptedDate: z.date().transform(v => v.toISOString()).optional(), acceptedIP: z.string().optional(), acceptedUserAgent: z.string().optional(), acceptedDomain: z.string().optional(), }); export function manualTermsOfServiceUpdateToJSON( manualTermsOfServiceUpdate: ManualTermsOfServiceUpdate, ): string { return JSON.stringify( ManualTermsOfServiceUpdate$outboundSchema.parse(manualTermsOfServiceUpdate), ); } export function manualTermsOfServiceUpdateFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManualTermsOfServiceUpdate$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManualTermsOfServiceUpdate' from JSON`, ); }