/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { SubScores, SubScores$inboundSchema, SubScores$Outbound, SubScores$outboundSchema, } from "./subscores.js"; export type UserTrustScore = { fused?: number | undefined; reasons?: number | undefined; subScores?: SubScores | undefined; }; /** @internal */ export const UserTrustScore$inboundSchema: z.ZodType< UserTrustScore, z.ZodTypeDef, unknown > = z.object({ fused: z.number().optional(), reasons: z.number().int().optional(), subScores: SubScores$inboundSchema.optional(), }); /** @internal */ export type UserTrustScore$Outbound = { fused?: number | undefined; reasons?: number | undefined; subScores?: SubScores$Outbound | undefined; }; /** @internal */ export const UserTrustScore$outboundSchema: z.ZodType< UserTrustScore$Outbound, z.ZodTypeDef, UserTrustScore > = z.object({ fused: z.number().optional(), reasons: z.number().int().optional(), subScores: SubScores$outboundSchema.optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace UserTrustScore$ { /** @deprecated use `UserTrustScore$inboundSchema` instead. */ export const inboundSchema = UserTrustScore$inboundSchema; /** @deprecated use `UserTrustScore$outboundSchema` instead. */ export const outboundSchema = UserTrustScore$outboundSchema; /** @deprecated use `UserTrustScore$Outbound` instead. */ export type Outbound = UserTrustScore$Outbound; } export function userTrustScoreToJSON(userTrustScore: UserTrustScore): string { return JSON.stringify(UserTrustScore$outboundSchema.parse(userTrustScore)); } export function userTrustScoreFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UserTrustScore$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UserTrustScore' from JSON`, ); }