/* * 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 { FeedbackCategory, FeedbackCategory$inboundSchema, } from "./feedback-category.js"; import { FeedbackContext, FeedbackContext$inboundSchema, } from "./feedback-context.js"; import { FeedbackTarget, FeedbackTarget$inboundSchema, } from "./feedback-target.js"; import { FeedbackVerificationKind, FeedbackVerificationKind$inboundSchema, } from "./feedback-verification-kind.js"; export type FeedbackRecord = { id: string; target: FeedbackTarget; category: FeedbackCategory; rating?: number | undefined; message?: string | undefined; labels: Array; context: FeedbackContext; metadata: { [k: string]: any }; verification: FeedbackVerificationKind; createdAt: number; }; /** @internal */ export const FeedbackRecord$inboundSchema: z.ZodMiniType< FeedbackRecord, unknown > = z.object({ id: types.string(), target: FeedbackTarget$inboundSchema, category: FeedbackCategory$inboundSchema, rating: types.optional(types.number()), message: types.optional(types.string()), labels: z.array(types.string()), context: FeedbackContext$inboundSchema, metadata: z.record(z.string(), z.any()), verification: FeedbackVerificationKind$inboundSchema, createdAt: types.number(), }); export function feedbackRecordFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => FeedbackRecord$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'FeedbackRecord' from JSON`, ); }