/* * 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 V3GlobaldataAssetWebpropertyGlobals = { organizationId?: string | undefined; }; export type V3GlobaldataAssetWebpropertyRequest = { /** * 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; /** * A web property identifier. */ webpropertyId: string; /** * RFC3339 Timestamp to view a webproperty 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 V3GlobaldataAssetWebpropertyResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeWebpropertyAsset; }; /** @internal */ export type V3GlobaldataAssetWebpropertyRequest$Outbound = { organization_id?: string | undefined; webproperty_id: string; at_time?: string | undefined; }; /** @internal */ export const V3GlobaldataAssetWebpropertyRequest$outboundSchema: z.ZodType< V3GlobaldataAssetWebpropertyRequest$Outbound, z.ZodTypeDef, V3GlobaldataAssetWebpropertyRequest > = z.object({ organizationId: z.string().optional(), webpropertyId: z.string(), atTime: z.date().transform(v => v.toISOString()).optional(), }).transform((v) => { return remap$(v, { organizationId: "organization_id", webpropertyId: "webproperty_id", atTime: "at_time", }); }); export function v3GlobaldataAssetWebpropertyRequestToJSON( v3GlobaldataAssetWebpropertyRequest: V3GlobaldataAssetWebpropertyRequest, ): string { return JSON.stringify( V3GlobaldataAssetWebpropertyRequest$outboundSchema.parse( v3GlobaldataAssetWebpropertyRequest, ), ); } /** @internal */ export const V3GlobaldataAssetWebpropertyResponse$inboundSchema: z.ZodType< V3GlobaldataAssetWebpropertyResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeWebpropertyAsset$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3GlobaldataAssetWebpropertyResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3GlobaldataAssetWebpropertyResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3GlobaldataAssetWebpropertyResponse' from JSON`, ); }