/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The feedback rating indicating user satisfaction */ export const UpdateFeedbackResponseRating = { ThumbsUp: "thumbs_up", ThumbsDown: "thumbs_down", } as const; /** * The feedback rating indicating user satisfaction */ export type UpdateFeedbackResponseRating = ClosedEnum< typeof UpdateFeedbackResponseRating >; /** * Response containing the updated feedback entry with new updatedAt timestamp. */ export type UpdateFeedbackResponse = { /** * The request ID that this feedback is associated with */ id: string; /** * The feedback rating indicating user satisfaction */ rating?: UpdateFeedbackResponseRating | undefined; /** * Optional detailed feedback description providing additional context or explanation (max 2000 characters) */ description?: string | undefined; /** * Timestamp when the feedback was created */ createdAt?: Date | undefined; /** * Timestamp when the feedback was last updated */ updatedAt?: Date | undefined; }; /** @internal */ export const UpdateFeedbackResponseRating$inboundSchema: z.ZodNativeEnum< typeof UpdateFeedbackResponseRating > = z.nativeEnum(UpdateFeedbackResponseRating); /** @internal */ export const UpdateFeedbackResponseRating$outboundSchema: z.ZodNativeEnum< typeof UpdateFeedbackResponseRating > = UpdateFeedbackResponseRating$inboundSchema; /** @internal */ export const UpdateFeedbackResponse$inboundSchema: z.ZodType< UpdateFeedbackResponse, z.ZodTypeDef, unknown > = z.object({ id: z.string(), rating: UpdateFeedbackResponseRating$inboundSchema.optional(), description: z.string().optional(), createdAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), updatedAt: z.string().datetime({ offset: true }).transform(v => new Date(v)) .optional(), }); /** @internal */ export type UpdateFeedbackResponse$Outbound = { id: string; rating?: string | undefined; description?: string | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; }; /** @internal */ export const UpdateFeedbackResponse$outboundSchema: z.ZodType< UpdateFeedbackResponse$Outbound, z.ZodTypeDef, UpdateFeedbackResponse > = z.object({ id: z.string(), rating: UpdateFeedbackResponseRating$outboundSchema.optional(), description: z.string().optional(), createdAt: z.date().transform(v => v.toISOString()).optional(), updatedAt: z.date().transform(v => v.toISOString()).optional(), }); export function updateFeedbackResponseToJSON( updateFeedbackResponse: UpdateFeedbackResponse, ): string { return JSON.stringify( UpdateFeedbackResponse$outboundSchema.parse(updateFeedbackResponse), ); } export function updateFeedbackResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateFeedbackResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateFeedbackResponse' from JSON`, ); }