/*
 * 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 { ClosedEnum } from "../../types/enums.js";

export const Confirmation = {
  Allow: "allow",
  Deny: "deny",
} as const;
export type Confirmation = ClosedEnum<typeof Confirmation>;

export type ToolCallConfirmation = {
  toolCallId: string;
  confirmation: Confirmation;
};

/** @internal */
export const Confirmation$outboundSchema: z.ZodNativeEnum<typeof Confirmation> =
  z.nativeEnum(Confirmation);

/** @internal */
export type ToolCallConfirmation$Outbound = {
  tool_call_id: string;
  confirmation: string;
};

/** @internal */
export const ToolCallConfirmation$outboundSchema: z.ZodType<
  ToolCallConfirmation$Outbound,
  z.ZodTypeDef,
  ToolCallConfirmation
> = z.object({
  toolCallId: z.string(),
  confirmation: Confirmation$outboundSchema,
}).transform((v) => {
  return remap$(v, {
    toolCallId: "tool_call_id",
  });
});

export function toolCallConfirmationToJSON(
  toolCallConfirmation: ToolCallConfirmation,
): string {
  return JSON.stringify(
    ToolCallConfirmation$outboundSchema.parse(toolCallConfirmation),
  );
}
