/* * 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 V3ThreathuntingValueCountsGlobals = { organizationId?: string | undefined; }; export type V3ThreathuntingValueCountsRequest = { /** * 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; searchValueCountsInputBody: components.SearchValueCountsInputBody; }; export type V3ThreathuntingValueCountsResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeValueCountsResponse; }; /** @internal */ export type V3ThreathuntingValueCountsRequest$Outbound = { organization_id?: string | undefined; SearchValueCountsInputBody: components.SearchValueCountsInputBody$Outbound; }; /** @internal */ export const V3ThreathuntingValueCountsRequest$outboundSchema: z.ZodType< V3ThreathuntingValueCountsRequest$Outbound, z.ZodTypeDef, V3ThreathuntingValueCountsRequest > = z.object({ organizationId: z.string().optional(), searchValueCountsInputBody: components.SearchValueCountsInputBody$outboundSchema, }).transform((v) => { return remap$(v, { organizationId: "organization_id", searchValueCountsInputBody: "SearchValueCountsInputBody", }); }); export function v3ThreathuntingValueCountsRequestToJSON( v3ThreathuntingValueCountsRequest: V3ThreathuntingValueCountsRequest, ): string { return JSON.stringify( V3ThreathuntingValueCountsRequest$outboundSchema.parse( v3ThreathuntingValueCountsRequest, ), ); } /** @internal */ export const V3ThreathuntingValueCountsResponse$inboundSchema: z.ZodType< V3ThreathuntingValueCountsResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeValueCountsResponse$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3ThreathuntingValueCountsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3ThreathuntingValueCountsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3ThreathuntingValueCountsResponse' from JSON`, ); }