/* * 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 V3CollectionsCrudGetGlobals = { organizationId?: string | undefined; }; export type V3CollectionsCrudGetRequest = { /** * 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; /** * The UID for the collection. Obtain the collection ID using the [list collections endpoint](https://docs.censys.com/reference/v3-collections-crud-list#/) or via the collection URL when using the web console. */ collectionUid: string; }; export type V3CollectionsCrudGetResponse = { headers: { [k: string]: Array }; result: components.ResponseEnvelopeCollection; }; /** @internal */ export type V3CollectionsCrudGetRequest$Outbound = { organization_id?: string | undefined; collection_uid: string; }; /** @internal */ export const V3CollectionsCrudGetRequest$outboundSchema: z.ZodType< V3CollectionsCrudGetRequest$Outbound, z.ZodTypeDef, V3CollectionsCrudGetRequest > = z.object({ organizationId: z.string().optional(), collectionUid: z.string(), }).transform((v) => { return remap$(v, { organizationId: "organization_id", collectionUid: "collection_uid", }); }); export function v3CollectionsCrudGetRequestToJSON( v3CollectionsCrudGetRequest: V3CollectionsCrudGetRequest, ): string { return JSON.stringify( V3CollectionsCrudGetRequest$outboundSchema.parse( v3CollectionsCrudGetRequest, ), ); } /** @internal */ export const V3CollectionsCrudGetResponse$inboundSchema: z.ZodType< V3CollectionsCrudGetResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), Result: components.ResponseEnvelopeCollection$inboundSchema, }).transform((v) => { return remap$(v, { "Headers": "headers", "Result": "result", }); }); export function v3CollectionsCrudGetResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => V3CollectionsCrudGetResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'V3CollectionsCrudGetResponse' from JSON`, ); }