/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 47108dc49d4f */ 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"; import { Hotword, Hotword$inboundSchema, Hotword$Outbound, Hotword$outboundSchema, } from "./hotword.js"; export type SensitiveExpression = { /** * Sensitive word, phrase, or regular expression. */ expression?: string | undefined; /** * Zero to three proximate regular expressions necessary to consider an expression as sensitive content. */ hotwords?: Array | undefined; }; /** @internal */ export const SensitiveExpression$inboundSchema: z.ZodType< SensitiveExpression, z.ZodTypeDef, unknown > = z.object({ expression: z.string().optional(), hotwords: z.array(Hotword$inboundSchema).optional(), }); /** @internal */ export type SensitiveExpression$Outbound = { expression?: string | undefined; hotwords?: Array | undefined; }; /** @internal */ export const SensitiveExpression$outboundSchema: z.ZodType< SensitiveExpression$Outbound, z.ZodTypeDef, SensitiveExpression > = z.object({ expression: z.string().optional(), hotwords: z.array(Hotword$outboundSchema).optional(), }); export function sensitiveExpressionToJSON( sensitiveExpression: SensitiveExpression, ): string { return JSON.stringify( SensitiveExpression$outboundSchema.parse(sensitiveExpression), ); } export function sensitiveExpressionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => SensitiveExpression$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'SensitiveExpression' from JSON`, ); }