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

import * as z from "zod/v4";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";

/**
 * Header definition for a remote transport (SEP-2127).
 */
export type MCPServerRemoteHeader = {
  /**
   * Header name
   */
  name: string;
  /**
   * Human-readable description of the header
   */
  description: string;
  isRequired?: boolean | null | undefined;
  isSecret?: boolean | null | undefined;
  default?: string | null | undefined;
  choices?: Array<string> | null | undefined;
};

/** @internal */
export const MCPServerRemoteHeader$inboundSchema: z.ZodType<
  MCPServerRemoteHeader,
  unknown
> = z.object({
  name: z.string(),
  description: z.string(),
  isRequired: z.nullable(z.boolean()).optional(),
  isSecret: z.nullable(z.boolean()).optional(),
  default: z.nullable(z.string()).optional(),
  choices: z.nullable(z.array(z.string())).optional(),
});

export function mcpServerRemoteHeaderFromJSON(
  jsonString: string,
): SafeParseResult<MCPServerRemoteHeader, SDKValidationError> {
  return safeParse(
    jsonString,
    (x) => MCPServerRemoteHeader$inboundSchema.parse(JSON.parse(x)),
    `Failed to parse 'MCPServerRemoteHeader' from JSON`,
  );
}
