/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ 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"; export type FieldValuePair = { /** * The field to match */ field: string; /** * The value to match */ value: string; }; /** @internal */ export const FieldValuePair$inboundSchema: z.ZodType< FieldValuePair, z.ZodTypeDef, unknown > = z.object({ field: z.string(), value: z.string(), }); /** @internal */ export type FieldValuePair$Outbound = { field: string; value: string; }; /** @internal */ export const FieldValuePair$outboundSchema: z.ZodType< FieldValuePair$Outbound, z.ZodTypeDef, FieldValuePair > = z.object({ field: z.string(), value: z.string(), }); export function fieldValuePairToJSON(fieldValuePair: FieldValuePair): string { return JSON.stringify(FieldValuePair$outboundSchema.parse(fieldValuePair)); } export function fieldValuePairFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FieldValuePair$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FieldValuePair' from JSON`, ); }