/* * 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 ManualTermsOfService = { /** * The date and time the terms of service were accepted. */ acceptedDate: Date; /** * The IP address from which the terms of service were accepted. */ acceptedIP: string; /** * The user-agent of the user making the request. */ acceptedUserAgent: string; acceptedDomain: string; }; /** @internal */ export const ManualTermsOfService$inboundSchema: z.ZodType< ManualTermsOfService, z.ZodTypeDef, unknown > = z.object({ acceptedDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), acceptedIP: z.string(), acceptedUserAgent: z.string(), acceptedDomain: z.string(), }); /** @internal */ export type ManualTermsOfService$Outbound = { acceptedDate: string; acceptedIP: string; acceptedUserAgent: string; acceptedDomain: string; }; /** @internal */ export const ManualTermsOfService$outboundSchema: z.ZodType< ManualTermsOfService$Outbound, z.ZodTypeDef, ManualTermsOfService > = z.object({ acceptedDate: z.date().transform(v => v.toISOString()), acceptedIP: z.string(), acceptedUserAgent: z.string(), acceptedDomain: z.string(), }); export function manualTermsOfServiceToJSON( manualTermsOfService: ManualTermsOfService, ): string { return JSON.stringify( ManualTermsOfService$outboundSchema.parse(manualTermsOfService), ); } export function manualTermsOfServiceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ManualTermsOfService$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ManualTermsOfService' from JSON`, ); }