/* * 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"; export type ServiceOnHostRange = { /** * When the service was last observed */ endTime: Date; /** * IP address where the service was observed */ ip: string; /** * Port number where the service was observed */ port: string; /** * Application protocol (e.g., HTTP, HTTPS) */ protocol: string; /** * When the service was first observed */ startTime: Date; /** * Transport protocol (e.g., TCP, UDP, QUIC) */ transportProtocol: string; }; /** @internal */ export const ServiceOnHostRange$inboundSchema: z.ZodType< ServiceOnHostRange, z.ZodTypeDef, unknown > = z.object({ end_time: z.string().datetime({ offset: true }).transform(v => new Date(v)), ip: z.string(), port: z.string(), protocol: z.string(), start_time: z.string().datetime({ offset: true }).transform(v => new Date(v)), transport_protocol: z.string(), }).transform((v) => { return remap$(v, { "end_time": "endTime", "start_time": "startTime", "transport_protocol": "transportProtocol", }); }); export function serviceOnHostRangeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ServiceOnHostRange$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ServiceOnHostRange' from JSON`, ); }