/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 9b8780e714ef */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type DetectionPattern = { name: string; regex: string; category: string; confidence: string; }; /** @internal */ export const DetectionPattern$inboundSchema: z.ZodType< DetectionPattern, unknown > = z.object({ name: z.string(), regex: z.string(), category: z.string(), confidence: z.string(), }); /** @internal */ export type DetectionPattern$Outbound = { name: string; regex: string; category: string; confidence: string; }; /** @internal */ export const DetectionPattern$outboundSchema: z.ZodType< DetectionPattern$Outbound, DetectionPattern > = z.object({ name: z.string(), regex: z.string(), category: z.string(), confidence: z.string(), }); export function detectionPatternToJSON( detectionPattern: DetectionPattern, ): string { return JSON.stringify( DetectionPattern$outboundSchema.parse(detectionPattern), ); } export function detectionPatternFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DetectionPattern$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DetectionPattern' from JSON`, ); }