/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: c2c43762e32d */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Regular expression to apply to an arbitrary string to transform it into a canonical string. */ export type CanonicalizingRegexType = { /** * Regular expression to match to an arbitrary string. */ matchRegex?: string | undefined; /** * Regular expression to transform into a canonical string. */ rewriteRegex?: string | undefined; }; /** @internal */ export const CanonicalizingRegexType$inboundSchema: z.ZodType< CanonicalizingRegexType, z.ZodTypeDef, unknown > = z.object({ matchRegex: z.string().optional(), rewriteRegex: z.string().optional(), }); /** @internal */ export type CanonicalizingRegexType$Outbound = { matchRegex?: string | undefined; rewriteRegex?: string | undefined; }; /** @internal */ export const CanonicalizingRegexType$outboundSchema: z.ZodType< CanonicalizingRegexType$Outbound, z.ZodTypeDef, CanonicalizingRegexType > = z.object({ matchRegex: z.string().optional(), rewriteRegex: z.string().optional(), }); export function canonicalizingRegexTypeToJSON( canonicalizingRegexType: CanonicalizingRegexType, ): string { return JSON.stringify( CanonicalizingRegexType$outboundSchema.parse(canonicalizingRegexType), ); } export function canonicalizingRegexTypeFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CanonicalizingRegexType$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CanonicalizingRegexType' from JSON`, ); }