/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 * @generated-id: fa57119b8e69
 */

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import { smartUnion } from "../../types/smartUnion.js";

export type AgentVersion = number | string;

export type AgentsApiV1AgentsGetRequest = {
  agentId: string;
  agentVersion?: number | string | null | undefined;
};

/** @internal */
export type AgentVersion$Outbound = number | string;

/** @internal */
export const AgentVersion$outboundSchema: z.ZodType<
  AgentVersion$Outbound,
  AgentVersion
> = smartUnion([z.int(), z.string()]);

export function agentVersionToJSON(agentVersion: AgentVersion): string {
  return JSON.stringify(AgentVersion$outboundSchema.parse(agentVersion));
}

/** @internal */
export type AgentsApiV1AgentsGetRequest$Outbound = {
  agent_id: string;
  agent_version?: number | string | null | undefined;
};

/** @internal */
export const AgentsApiV1AgentsGetRequest$outboundSchema: z.ZodType<
  AgentsApiV1AgentsGetRequest$Outbound,
  AgentsApiV1AgentsGetRequest
> = z.object({
  agentId: z.string(),
  agentVersion: z.nullable(smartUnion([z.int(), z.string()])).optional(),
}).transform((v) => {
  return remap$(v, {
    agentId: "agent_id",
    agentVersion: "agent_version",
  });
});

export function agentsApiV1AgentsGetRequestToJSON(
  agentsApiV1AgentsGetRequest: AgentsApiV1AgentsGetRequest,
): string {
  return JSON.stringify(
    AgentsApiV1AgentsGetRequest$outboundSchema.parse(
      agentsApiV1AgentsGetRequest,
    ),
  );
}
