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