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