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