/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { PrivacyTorInfo, PrivacyTorInfo$inboundSchema, } from "./privacytorinfo.js"; export type Privacy = { /** * Whether the host uses any kind of privacy service. */ anonymous?: boolean | undefined; /** * Whether the host is an open web proxy. */ proxy?: boolean | undefined; /** * Whether the host is a location-preserving anonymous relay service, like iCloud Private Relay.. */ relay?: boolean | undefined; /** * The name of the privacy service providers detected. */ serviceProvider?: Array | null | undefined; /** * The source of the data. */ source?: string | undefined; /** * Whether the host is a Tor exit node. */ tor?: boolean | undefined; torInfo?: PrivacyTorInfo | undefined; /** * Whether the host is a VPN service exit node IP address. */ vpn?: boolean | undefined; }; /** @internal */ export const Privacy$inboundSchema: z.ZodType = z.object({ anonymous: z.boolean().optional(), proxy: z.boolean().optional(), relay: z.boolean().optional(), service_provider: z.nullable(z.array(z.string())).optional(), source: z.string().optional(), tor: z.boolean().optional(), tor_info: PrivacyTorInfo$inboundSchema.optional(), vpn: z.boolean().optional(), }).transform((v) => { return remap$(v, { "service_provider": "serviceProvider", "tor_info": "torInfo", }); }); export function privacyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Privacy$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Privacy' from JSON`, ); }