/* * 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 UpdateResponseRequest = { responseId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; updateResponseRequest: components.UpdateResponseRequest; }; /** @internal */ export const UpdateResponseRequest$inboundSchema: z.ZodType< UpdateResponseRequest, z.ZodTypeDef, unknown > = z.object({ response_id: z.string(), "X-On-Behalf-Of": z.string().optional(), UpdateResponseRequest: components.UpdateResponseRequest$inboundSchema, }).transform((v) => { return remap$(v, { "response_id": "responseId", "X-On-Behalf-Of": "xOnBehalfOf", "UpdateResponseRequest": "updateResponseRequest", }); }); /** @internal */ export type UpdateResponseRequest$Outbound = { response_id: string; "X-On-Behalf-Of"?: string | undefined; UpdateResponseRequest: components.UpdateResponseRequest$Outbound; }; /** @internal */ export const UpdateResponseRequest$outboundSchema: z.ZodType< UpdateResponseRequest$Outbound, z.ZodTypeDef, UpdateResponseRequest > = z.object({ responseId: z.string(), xOnBehalfOf: z.string().optional(), updateResponseRequest: components.UpdateResponseRequest$outboundSchema, }).transform((v) => { return remap$(v, { responseId: "response_id", xOnBehalfOf: "X-On-Behalf-Of", updateResponseRequest: "UpdateResponseRequest", }); }); export function updateResponseRequestToJSON( updateResponseRequest: UpdateResponseRequest, ): string { return JSON.stringify( UpdateResponseRequest$outboundSchema.parse(updateResponseRequest), ); } export function updateResponseRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => UpdateResponseRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'UpdateResponseRequest' from JSON`, ); }