/* * 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 { GreynoiseTag, GreynoiseTag$inboundSchema } from "./greynoisetag.js"; export type Greynoise = { /** * The actor that was observed. */ actor?: string | undefined; /** * The classification of the IP address. */ classification?: string | undefined; /** * The last time the IP address was observed. */ lastObservedTime?: string | undefined; /** * The tags associated with the IP address. */ tags?: Array | null | undefined; }; /** @internal */ export const Greynoise$inboundSchema: z.ZodType< Greynoise, z.ZodTypeDef, unknown > = z.object({ actor: z.string().optional(), classification: z.string().optional(), last_observed_time: z.string().optional(), tags: z.nullable(z.array(GreynoiseTag$inboundSchema)).optional(), }).transform((v) => { return remap$(v, { "last_observed_time": "lastObservedTime", }); }); export function greynoiseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Greynoise$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Greynoise' from JSON`, ); }