/* * 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 CenseyeTarget = { /** * SHA-256 fingerprint of the certificate to analyze. */ certificateId?: string | undefined; /** * IP address of the host to analyze. */ hostId?: string | undefined; /** * Web property identifier (hostname:port) to analyze. */ webpropertyId?: string | undefined; }; /** @internal */ export const CenseyeTarget$inboundSchema: z.ZodType< CenseyeTarget, z.ZodTypeDef, unknown > = z.object({ certificate_id: z.string().optional(), host_id: z.string().optional(), webproperty_id: z.string().optional(), }).transform((v) => { return remap$(v, { "certificate_id": "certificateId", "host_id": "hostId", "webproperty_id": "webpropertyId", }); }); /** @internal */ export type CenseyeTarget$Outbound = { certificate_id?: string | undefined; host_id?: string | undefined; webproperty_id?: string | undefined; }; /** @internal */ export const CenseyeTarget$outboundSchema: z.ZodType< CenseyeTarget$Outbound, z.ZodTypeDef, CenseyeTarget > = z.object({ certificateId: z.string().optional(), hostId: z.string().optional(), webpropertyId: z.string().optional(), }).transform((v) => { return remap$(v, { certificateId: "certificate_id", hostId: "host_id", webpropertyId: "webproperty_id", }); }); export function censeyeTargetToJSON(censeyeTarget: CenseyeTarget): string { return JSON.stringify(CenseyeTarget$outboundSchema.parse(censeyeTarget)); } export function censeyeTargetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CenseyeTarget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CenseyeTarget' from JSON`, ); }