/* * 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. */ export type TermsOfService = { /** * 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; }; /** @internal */ export const TermsOfService$inboundSchema: z.ZodType< TermsOfService, z.ZodTypeDef, unknown > = z.object({ acceptedDate: z.string().datetime({ offset: true }).transform(v => new Date(v) ), acceptedIP: z.string(), }); /** @internal */ export type TermsOfService$Outbound = { acceptedDate: string; acceptedIP: string; }; /** @internal */ export const TermsOfService$outboundSchema: z.ZodType< TermsOfService$Outbound, z.ZodTypeDef, TermsOfService > = z.object({ acceptedDate: z.date().transform(v => v.toISOString()), acceptedIP: z.string(), }); export function termsOfServiceToJSON(termsOfService: TermsOfService): string { return JSON.stringify(TermsOfService$outboundSchema.parse(termsOfService)); } export function termsOfServiceFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => TermsOfService$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'TermsOfService' from JSON`, ); }