/* * 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 V3CollectionsSearchQueryGlobals = { organizationId?: string | undefined; }; export type V3CollectionsSearchQueryRequest = { /** * 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; /** * The UID for the collection */ collectionUid: string; searchQueryInputBody: components.SearchQueryInputBody; }; export type V3CollectionsSearchQueryResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeSearchQueryResponse; }; /** @internal */ export type V3CollectionsSearchQueryRequest$Outbound = { organization_id?: string | undefined; collection_uid: string; SearchQueryInputBody: components.SearchQueryInputBody$Outbound; }; /** @internal */ export const V3CollectionsSearchQueryRequest$outboundSchema: z.ZodType< V3CollectionsSearchQueryRequest$Outbound, z.ZodTypeDef, V3CollectionsSearchQueryRequest > = z.object({ organizationId: z.string().optional(), collectionUid: z.string(), searchQueryInputBody: components.SearchQueryInputBody$outboundSchema, }).transform((v) => { return remap$(v, { organizationId: "organization_id", collectionUid: "collection_uid", searchQueryInputBody: "SearchQueryInputBody", }); }); export function v3CollectionsSearchQueryRequestToJSON( v3CollectionsSearchQueryRequest: V3CollectionsSearchQueryRequest, ): string { return JSON.stringify( V3CollectionsSearchQueryRequest$outboundSchema.parse( v3CollectionsSearchQueryRequest, ), ); } /** @internal */ export const V3CollectionsSearchQueryResponse$inboundSchema: z.ZodType< V3CollectionsSearchQueryResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeSearchQueryResponse$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3CollectionsSearchQueryResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3CollectionsSearchQueryResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3CollectionsSearchQueryResponse' from JSON`, ); }