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

import * as z from "zod/v4";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  ToolConfiguration,
  ToolConfiguration$Outbound,
  ToolConfiguration$outboundSchema,
} from "./toolconfiguration.js";

export type WebSearchPremiumTool = {
  toolConfiguration?: ToolConfiguration | null | undefined;
  type: "web_search_premium";
};

/** @internal */
export type WebSearchPremiumTool$Outbound = {
  tool_configuration?: ToolConfiguration$Outbound | null | undefined;
  type: "web_search_premium";
};

/** @internal */
export const WebSearchPremiumTool$outboundSchema: z.ZodType<
  WebSearchPremiumTool$Outbound,
  WebSearchPremiumTool
> = z.object({
  toolConfiguration: z.nullable(ToolConfiguration$outboundSchema).optional(),
  type: z.literal("web_search_premium"),
}).transform((v) => {
  return remap$(v, {
    toolConfiguration: "tool_configuration",
  });
});

export function webSearchPremiumToolToJSON(
  webSearchPremiumTool: WebSearchPremiumTool,
): string {
  return JSON.stringify(
    WebSearchPremiumTool$outboundSchema.parse(webSearchPremiumTool),
  );
}
