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

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";

/**
 * An icon for display in user interfaces.
 */
export type MCPServerIcon = {
  src: string;
  mimeType?: string | null | undefined;
  sizes?: Array<string> | null | undefined;
  [additionalProperties: string]: unknown;
};

/** @internal */
export const MCPServerIcon$inboundSchema: z.ZodType<MCPServerIcon, unknown> = z
  .object({
    src: z.string(),
    mimeType: z.nullable(z.string()).optional(),
    sizes: z.nullable(z.array(z.string())).optional(),
  }).catchall(z.any());

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