/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type V3ThreathuntingScansDiscoveryGlobals = { organizationId?: string | undefined; }; export type V3ThreathuntingScansDiscoveryRequest = { /** * The ID of a Censys organization to associate the request with. See the [Getting Started docs](https://docs.censys.com/reference/get-started#step-3-find-and-use-your-organization-id-optional) for more information. */ organizationId?: string | undefined; scansDiscoveryInputBody: components.ScansDiscoveryInputBody; }; export type V3ThreathuntingScansDiscoveryResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeTrackedScan; }; /** @internal */ export type V3ThreathuntingScansDiscoveryRequest$Outbound = { organization_id?: string | undefined; ScansDiscoveryInputBody: components.ScansDiscoveryInputBody$Outbound; }; /** @internal */ export const V3ThreathuntingScansDiscoveryRequest$outboundSchema: z.ZodType< V3ThreathuntingScansDiscoveryRequest$Outbound, z.ZodTypeDef, V3ThreathuntingScansDiscoveryRequest > = z.object({ organizationId: z.string().optional(), scansDiscoveryInputBody: components.ScansDiscoveryInputBody$outboundSchema, }).transform((v) => { return remap$(v, { organizationId: "organization_id", scansDiscoveryInputBody: "ScansDiscoveryInputBody", }); }); export function v3ThreathuntingScansDiscoveryRequestToJSON( v3ThreathuntingScansDiscoveryRequest: V3ThreathuntingScansDiscoveryRequest, ): string { return JSON.stringify( V3ThreathuntingScansDiscoveryRequest$outboundSchema.parse( v3ThreathuntingScansDiscoveryRequest, ), ); } /** @internal */ export const V3ThreathuntingScansDiscoveryResponse$inboundSchema: z.ZodType< V3ThreathuntingScansDiscoveryResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeTrackedScan$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3ThreathuntingScansDiscoveryResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3ThreathuntingScansDiscoveryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3ThreathuntingScansDiscoveryResponse' from JSON`, ); }