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

import * as z from "zod/v3";
import { remap as remap$ } from "../../lib/primitives.js";
import {
  AuthData,
  AuthData$Outbound,
  AuthData$outboundSchema,
} from "./authdata.js";
import {
  ResourceVisibility,
  ResourceVisibility$outboundSchema,
} from "./resourcevisibility.js";

export type ConnectorMCPCreate = {
  /**
   * The name of the connector. Should be 64 char length maximum, alphanumeric, only underscores/dashes.
   */
  name: string;
  /**
   * The description of the connector.
   */
  description: string;
  /**
   * The optional url of the icon you want to associate to the connector.
   */
  iconUrl?: string | null | undefined;
  visibility?: ResourceVisibility | undefined;
  /**
   * The url of the MCP server.
   */
  server: string;
  /**
   * Optional organization-level headers to be sent with the request to the mcp server.
   */
  headers?: { [k: string]: any } | null | undefined;
  /**
   * Optional additional authentication data for the connector.
   */
  authData?: AuthData | null | undefined;
  /**
   * Optional system prompt for the connector.
   */
  systemPrompt?: string | null | undefined;
};

/** @internal */
export type ConnectorMCPCreate$Outbound = {
  name: string;
  description: string;
  icon_url?: string | null | undefined;
  visibility?: string | undefined;
  server: string;
  headers?: { [k: string]: any } | null | undefined;
  auth_data?: AuthData$Outbound | null | undefined;
  system_prompt?: string | null | undefined;
};

/** @internal */
export const ConnectorMCPCreate$outboundSchema: z.ZodType<
  ConnectorMCPCreate$Outbound,
  z.ZodTypeDef,
  ConnectorMCPCreate
> = z.object({
  name: z.string(),
  description: z.string(),
  iconUrl: z.nullable(z.string()).optional(),
  visibility: ResourceVisibility$outboundSchema.optional(),
  server: z.string(),
  headers: z.nullable(z.record(z.any())).optional(),
  authData: z.nullable(AuthData$outboundSchema).optional(),
  systemPrompt: z.nullable(z.string()).optional(),
}).transform((v) => {
  return remap$(v, {
    iconUrl: "icon_url",
    authData: "auth_data",
    systemPrompt: "system_prompt",
  });
});

export function connectorMCPCreateToJSON(
  connectorMCPCreate: ConnectorMCPCreate,
): string {
  return JSON.stringify(
    ConnectorMCPCreate$outboundSchema.parse(connectorMCPCreate),
  );
}
