/* * 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 V3GlobaldataAssetHostGlobals = { organizationId?: string | undefined; }; export type V3GlobaldataAssetHostRequest = { /** * The ID of a Censys organization to associate the request with. If omitted, the request will be processed using the authenticated user's free wallet where applicable. 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 IP address of a host. */ hostId: string; /** * RFC3339 Timestamp to view a host at a specific point in time. Must be a valid RFC3339 string. Ensure that you suffix the date with T00:00:00Z or a specific time. */ atTime?: Date | undefined; }; export type V3GlobaldataAssetHostResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeHostAsset; }; /** @internal */ export type V3GlobaldataAssetHostRequest$Outbound = { organization_id?: string | undefined; host_id: string; at_time?: string | undefined; }; /** @internal */ export const V3GlobaldataAssetHostRequest$outboundSchema: z.ZodType< V3GlobaldataAssetHostRequest$Outbound, z.ZodTypeDef, V3GlobaldataAssetHostRequest > = z.object({ organizationId: z.string().optional(), hostId: z.string(), atTime: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { return remap$(v, { organizationId: "organization_id", hostId: "host_id", atTime: "at_time", }); }); export function v3GlobaldataAssetHostRequestToJSON( v3GlobaldataAssetHostRequest: V3GlobaldataAssetHostRequest, ): string { return JSON.stringify( V3GlobaldataAssetHostRequest$outboundSchema.parse( v3GlobaldataAssetHostRequest, ), ); } /** @internal */ export const V3GlobaldataAssetHostResponse$inboundSchema: z.ZodType< V3GlobaldataAssetHostResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeHostAsset$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3GlobaldataAssetHostResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3GlobaldataAssetHostResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3GlobaldataAssetHostResponse' from JSON`, ); }