/* * 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 V3GlobaldataAssetHostTimelineGlobals = { organizationId?: string | undefined; }; export type V3GlobaldataAssetHostTimelineRequest = { /** * 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; /** * Start time of the host timeline. Equivalent to the To field in the event history UI. This must be the timestamp closest to the current time. For example, if you want events from January 1, 2025 to the start of January 2, 2025, input the January 2 timestamp here. Must be a valid RFC3339 string. Ensure that you suffix the date with T00:00:00Z or a specific time. */ startTime: Date; /** * End time of the host timeline. Equivalent to the From field in the event history UI. This must be the timestamp furthest from the current time. For example, if you want events from January 1, 2025 to the start of January 2, 2025, input the January 1 timestamp here. Must be a valid RFC3339 string. Ensure that you suffix the date with T00:00:00Z or a specific time. */ endTime: Date; }; export type V3GlobaldataAssetHostTimelineResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeHostTimeline; }; /** @internal */ export type V3GlobaldataAssetHostTimelineRequest$Outbound = { organization_id?: string | undefined; host_id: string; start_time: string; end_time: string; }; /** @internal */ export const V3GlobaldataAssetHostTimelineRequest$outboundSchema: z.ZodType< V3GlobaldataAssetHostTimelineRequest$Outbound, z.ZodTypeDef, V3GlobaldataAssetHostTimelineRequest > = z.object({ organizationId: z.string().optional(), hostId: z.string(), startTime: z.date().transform(v => v.toISOString()), endTime: z.date().transform(v => v.toISOString()), }).transform((v) => { return remap$(v, { organizationId: "organization_id", hostId: "host_id", startTime: "start_time", endTime: "end_time", }); }); export function v3GlobaldataAssetHostTimelineRequestToJSON( v3GlobaldataAssetHostTimelineRequest: V3GlobaldataAssetHostTimelineRequest, ): string { return JSON.stringify( V3GlobaldataAssetHostTimelineRequest$outboundSchema.parse( v3GlobaldataAssetHostTimelineRequest, ), ); } /** @internal */ export const V3GlobaldataAssetHostTimelineResponse$inboundSchema: z.ZodType< V3GlobaldataAssetHostTimelineResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeHostTimeline$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3GlobaldataAssetHostTimelineResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3GlobaldataAssetHostTimelineResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3GlobaldataAssetHostTimelineResponse' from JSON`, ); }