/* * 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 V3ThreathuntingGetHostObservationsWithCertificateGlobals = { organizationId?: string | undefined; }; export type V3ThreathuntingGetHostObservationsWithCertificateRequest = { /** * 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; /** * SHA-256 hash of the certificate */ certificateId: string; /** * Only show ranges ending at or after this time (ISO 8601) */ startTime?: string | undefined; /** * Only show ranges starting at or before this time (ISO 8601) */ endTime?: string | undefined; /** * The port to filter by */ port?: number | undefined; /** * The transport protocol to filter by */ protocol?: string | undefined; /** * Pagination token from previous response to retrieve next page of results */ pageToken?: string | undefined; /** * Number of results per page. Maximum 100, defaults to 100 if not specified */ pageSize?: number | undefined; }; export type V3ThreathuntingGetHostObservationsWithCertificateResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeHostObservationResponse; }; /** @internal */ export type V3ThreathuntingGetHostObservationsWithCertificateRequest$Outbound = { organization_id?: string | undefined; certificate_id: string; start_time?: string | undefined; end_time?: string | undefined; port?: number | undefined; protocol?: string | undefined; page_token?: string | undefined; page_size?: number | undefined; }; /** @internal */ export const V3ThreathuntingGetHostObservationsWithCertificateRequest$outboundSchema: z.ZodType< V3ThreathuntingGetHostObservationsWithCertificateRequest$Outbound, z.ZodTypeDef, V3ThreathuntingGetHostObservationsWithCertificateRequest > = z.object({ organizationId: z.string().optional(), certificateId: z.string(), startTime: z.string().optional(), endTime: z.string().optional(), port: z.number().int().optional(), protocol: z.string().optional(), pageToken: z.string().optional(), pageSize: z.number().int().optional(), }).transform((v) => { return remap$(v, { organizationId: "organization_id", certificateId: "certificate_id", startTime: "start_time", endTime: "end_time", pageToken: "page_token", pageSize: "page_size", }); }); export function v3ThreathuntingGetHostObservationsWithCertificateRequestToJSON( v3ThreathuntingGetHostObservationsWithCertificateRequest: V3ThreathuntingGetHostObservationsWithCertificateRequest, ): string { return JSON.stringify( V3ThreathuntingGetHostObservationsWithCertificateRequest$outboundSchema .parse(v3ThreathuntingGetHostObservationsWithCertificateRequest), ); } /** @internal */ export const V3ThreathuntingGetHostObservationsWithCertificateResponse$inboundSchema: z.ZodType< V3ThreathuntingGetHostObservationsWithCertificateResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeHostObservationResponse$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3ThreathuntingGetHostObservationsWithCertificateResponseFromJSON( jsonString: string, ): SafeParseResult< V3ThreathuntingGetHostObservationsWithCertificateResponse, SDKValidationError > { return safeParse( jsonString, (x) => V3ThreathuntingGetHostObservationsWithCertificateResponse$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'V3ThreathuntingGetHostObservationsWithCertificateResponse' from JSON`, ); }