/* * 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"; export type SubScores = { bluetoothConnected?: number | undefined; bluetoothPaired?: number | undefined; bluetoothScanned?: number | undefined; distance?: number | undefined; inclusion?: number | undefined; wifiConnected?: number | undefined; wifiScanned?: number | undefined; }; /** @internal */ export const SubScores$inboundSchema: z.ZodType< SubScores, z.ZodTypeDef, unknown > = z.object({ bluetoothConnected: z.number().optional(), bluetoothPaired: z.number().optional(), bluetoothScanned: z.number().optional(), distance: z.number().optional(), inclusion: z.number().optional(), wifiConnected: z.number().optional(), wifiScanned: z.number().optional(), }); /** @internal */ export type SubScores$Outbound = { bluetoothConnected?: number | undefined; bluetoothPaired?: number | undefined; bluetoothScanned?: number | undefined; distance?: number | undefined; inclusion?: number | undefined; wifiConnected?: number | undefined; wifiScanned?: number | undefined; }; /** @internal */ export const SubScores$outboundSchema: z.ZodType< SubScores$Outbound, z.ZodTypeDef, SubScores > = z.object({ bluetoothConnected: z.number().optional(), bluetoothPaired: z.number().optional(), bluetoothScanned: z.number().optional(), distance: z.number().optional(), inclusion: z.number().optional(), wifiConnected: z.number().optional(), wifiScanned: z.number().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace SubScores$ { /** @deprecated use `SubScores$inboundSchema` instead. */ export const inboundSchema = SubScores$inboundSchema; /** @deprecated use `SubScores$outboundSchema` instead. */ export const outboundSchema = SubScores$outboundSchema; /** @deprecated use `SubScores$Outbound` instead. */ export type Outbound = SubScores$Outbound; } export function subScoresToJSON(subScores: SubScores): string { return JSON.stringify(SubScores$outboundSchema.parse(subScores)); } export function subScoresFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SubScores$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SubScores' from JSON`, ); }