/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CreateResponseFeedbackRequest = { /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; createFeedbackRequest: components.CreateFeedbackRequest; }; /** @internal */ export const CreateResponseFeedbackRequest$inboundSchema: z.ZodType< CreateResponseFeedbackRequest, z.ZodTypeDef, unknown > = z.object({ "X-On-Behalf-Of": z.string().optional(), CreateFeedbackRequest: components.CreateFeedbackRequest$inboundSchema, }).transform((v) => { return remap$(v, { "X-On-Behalf-Of": "xOnBehalfOf", "CreateFeedbackRequest": "createFeedbackRequest", }); }); /** @internal */ export type CreateResponseFeedbackRequest$Outbound = { "X-On-Behalf-Of"?: string | undefined; CreateFeedbackRequest: components.CreateFeedbackRequest$Outbound; }; /** @internal */ export const CreateResponseFeedbackRequest$outboundSchema: z.ZodType< CreateResponseFeedbackRequest$Outbound, z.ZodTypeDef, CreateResponseFeedbackRequest > = z.object({ xOnBehalfOf: z.string().optional(), createFeedbackRequest: components.CreateFeedbackRequest$outboundSchema, }).transform((v) => { return remap$(v, { xOnBehalfOf: "X-On-Behalf-Of", createFeedbackRequest: "CreateFeedbackRequest", }); }); export function createResponseFeedbackRequestToJSON( createResponseFeedbackRequest: CreateResponseFeedbackRequest, ): string { return JSON.stringify( CreateResponseFeedbackRequest$outboundSchema.parse( createResponseFeedbackRequest, ), ); } export function createResponseFeedbackRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateResponseFeedbackRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateResponseFeedbackRequest' from JSON`, ); }