/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ContextsControllerDeleteContextRequest = { /** * Context ID */ id: string; /** * Context type */ type: string; /** * A header for idempotency purposes */ idempotencyKey?: string | undefined; }; export type ContextsControllerDeleteContextResponse = { headers: { [k: string]: Array }; }; /** @internal */ export type ContextsControllerDeleteContextRequest$Outbound = { id: string; type: string; "idempotency-key"?: string | undefined; }; /** @internal */ export const ContextsControllerDeleteContextRequest$outboundSchema: z.ZodType< ContextsControllerDeleteContextRequest$Outbound, z.ZodTypeDef, ContextsControllerDeleteContextRequest > = z.object({ id: z.string(), type: z.string(), idempotencyKey: z.string().optional(), }).transform((v) => { return remap$(v, { idempotencyKey: "idempotency-key", }); }); export function contextsControllerDeleteContextRequestToJSON( contextsControllerDeleteContextRequest: ContextsControllerDeleteContextRequest, ): string { return JSON.stringify( ContextsControllerDeleteContextRequest$outboundSchema.parse( contextsControllerDeleteContextRequest, ), ); } /** @internal */ export const ContextsControllerDeleteContextResponse$inboundSchema: z.ZodType< ContextsControllerDeleteContextResponse, z.ZodTypeDef, unknown > = z.object({ Headers: z.record(z.array(z.string())).default({}), }).transform((v) => { return remap$(v, { "Headers": "headers", }); }); export function contextsControllerDeleteContextResponseFromJSON( jsonString: string, ): SafeParseResult< ContextsControllerDeleteContextResponse, SDKValidationError > { return safeParse( jsonString, (x) => ContextsControllerDeleteContextResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'ContextsControllerDeleteContextResponse' from JSON`, ); }