/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type V3GlobaldataAssetCertificateRawGlobals = { organizationId?: string | undefined; }; export type V3GlobaldataAssetCertificateRawRequest = { /** * 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 SHA-256 certificate fingerprint. */ certificateId: string; }; export type V3GlobaldataAssetCertificateRawResponse = { headers: { [k: string]: Array }; result: ReadableStream; }; /** @internal */ export type V3GlobaldataAssetCertificateRawRequest$Outbound = { organization_id?: string | undefined; certificate_id: string; }; /** @internal */ export const V3GlobaldataAssetCertificateRawRequest$outboundSchema: z.ZodType< V3GlobaldataAssetCertificateRawRequest$Outbound, z.ZodTypeDef, V3GlobaldataAssetCertificateRawRequest > = z.object({ organizationId: z.string().optional(), certificateId: z.string(), }).transform((v) => { return remap$(v, { organizationId: "organization_id", certificateId: "certificate_id", }); }); export function v3GlobaldataAssetCertificateRawRequestToJSON( v3GlobaldataAssetCertificateRawRequest: V3GlobaldataAssetCertificateRawRequest, ): string { return JSON.stringify( V3GlobaldataAssetCertificateRawRequest$outboundSchema.parse( v3GlobaldataAssetCertificateRawRequest, ), ); } /** @internal */ export const V3GlobaldataAssetCertificateRawResponse$inboundSchema: z.ZodType< V3GlobaldataAssetCertificateRawResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: z.instanceof(ReadableStream), }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3GlobaldataAssetCertificateRawResponseFromJSON( jsonString: string, ): SafeParseResult< V3GlobaldataAssetCertificateRawResponse, SDKValidationError > { return safeParse( jsonString, (x) => V3GlobaldataAssetCertificateRawResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'V3GlobaldataAssetCertificateRawResponse' from JSON`, ); }