/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type DeleteAgentRequest = { agentId: string; /** * Optional external end-user identifier forwarded by the API gateway. */ xOnBehalfOf?: string | undefined; }; export const DeleteAgentObject = { AgentDeleted: "agent.deleted", } as const; export type DeleteAgentObject = ClosedEnum; /** * Deletion result. */ export type DeleteAgentResponseBody = { object: DeleteAgentObject; id: string; deleted: boolean; }; /** @internal */ export const DeleteAgentRequest$inboundSchema: z.ZodType< DeleteAgentRequest, z.ZodTypeDef, unknown > = z.object({ agent_id: z.string(), "X-On-Behalf-Of": z.string().optional(), }).transform((v) => { return remap$(v, { "agent_id": "agentId", "X-On-Behalf-Of": "xOnBehalfOf", }); }); /** @internal */ export type DeleteAgentRequest$Outbound = { agent_id: string; "X-On-Behalf-Of"?: string | undefined; }; /** @internal */ export const DeleteAgentRequest$outboundSchema: z.ZodType< DeleteAgentRequest$Outbound, z.ZodTypeDef, DeleteAgentRequest > = z.object({ agentId: z.string(), xOnBehalfOf: z.string().optional(), }).transform((v) => { return remap$(v, { agentId: "agent_id", xOnBehalfOf: "X-On-Behalf-Of", }); }); export function deleteAgentRequestToJSON( deleteAgentRequest: DeleteAgentRequest, ): string { return JSON.stringify( DeleteAgentRequest$outboundSchema.parse(deleteAgentRequest), ); } export function deleteAgentRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteAgentRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteAgentRequest' from JSON`, ); } /** @internal */ export const DeleteAgentObject$inboundSchema: z.ZodNativeEnum< typeof DeleteAgentObject > = z.nativeEnum(DeleteAgentObject); /** @internal */ export const DeleteAgentObject$outboundSchema: z.ZodNativeEnum< typeof DeleteAgentObject > = DeleteAgentObject$inboundSchema; /** @internal */ export const DeleteAgentResponseBody$inboundSchema: z.ZodType< DeleteAgentResponseBody, z.ZodTypeDef, unknown > = z.object({ object: DeleteAgentObject$inboundSchema, id: z.string(), deleted: z.boolean(), }); /** @internal */ export type DeleteAgentResponseBody$Outbound = { object: string; id: string; deleted: boolean; }; /** @internal */ export const DeleteAgentResponseBody$outboundSchema: z.ZodType< DeleteAgentResponseBody$Outbound, z.ZodTypeDef, DeleteAgentResponseBody > = z.object({ object: DeleteAgentObject$outboundSchema, id: z.string(), deleted: z.boolean(), }); export function deleteAgentResponseBodyToJSON( deleteAgentResponseBody: DeleteAgentResponseBody, ): string { return JSON.stringify( DeleteAgentResponseBody$outboundSchema.parse(deleteAgentResponseBody), ); } export function deleteAgentResponseBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => DeleteAgentResponseBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'DeleteAgentResponseBody' from JSON`, ); }