/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; import { FeedbackTargetType, FeedbackTargetType$inboundSchema, FeedbackTargetType$outboundSchema, } from "./feedback-target-type.js"; export type FeedbackTarget = { type: FeedbackTargetType; id: string; }; /** @internal */ export const FeedbackTarget$inboundSchema: z.ZodMiniType< FeedbackTarget, unknown > = z.object({ type: FeedbackTargetType$inboundSchema, id: types.string(), }); /** @internal */ export type FeedbackTarget$Outbound = { type: string; id: string; }; /** @internal */ export const FeedbackTarget$outboundSchema: z.ZodMiniType< FeedbackTarget$Outbound, FeedbackTarget > = z.object({ type: FeedbackTargetType$outboundSchema, id: z.string(), }); export function feedbackTargetToJSON(feedbackTarget: FeedbackTarget): string { return JSON.stringify(FeedbackTarget$outboundSchema.parse(feedbackTarget)); } export function feedbackTargetFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeedbackTarget$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeedbackTarget' from JSON`, ); }