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

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.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,
  z.ZodTypeDef,
  AgentVersion
> = z.union([z.number().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,
  z.ZodTypeDef,
  AgentsApiV1AgentsGetRequest
> = z.object({
  agentId: z.string(),
  agentVersion: z.nullable(z.union([z.number().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,
    ),
  );
}
