/* SPDX-FileCopyrightText: 2026 M5Stack Technology CO LTD SPDX-License-Identifier: MIT */ ///responsemodel class EndpointsResponse { final List endpoints; EndpointsResponse({required this.endpoints}); factory EndpointsResponse.fromJson(Map json) { return EndpointsResponse( endpoints: (json['endpoints'] as List?) ?.map((e) => Endpoint.fromJson(e as Map)) .toList() ?? [], ); } } ///singleendpointinfo class Endpoint { final String endpointId; final int connectionCount; final String status; final int rpm; final dynamic lastRequestTime; final int totalRequests; final List tools; final List brokers; Endpoint({ required this.endpointId, required this.connectionCount, required this.status, required this.rpm, required this.lastRequestTime, required this.totalRequests, required this.tools, required this.brokers, }); factory Endpoint.fromJson(Map json) { return Endpoint( endpointId: json['endpointId'] ?? '', connectionCount: json['connectionCount'] ?? 0, status: json['status'] ?? '', rpm: json['rpm'] ?? 0, lastRequestTime: json['lastRequestTime'], totalRequests: json['totalRequests'] ?? 0, tools: (json['tools'] as List?) ?.map((e) => Tool.fromJson(e as Map)) .toList() ?? [], brokers: (json['brokers'] as List?) ?.map((e) => e.toString()) .toList() ?? [], ); } } ///toolinfo class Tool { final String name; final String description; final InputSchema inputSchema; Tool({ required this.name, required this.description, required this.inputSchema, }); factory Tool.fromJson(Map json) { return Tool( name: json['name'] ?? '', description: json['description'] ?? '', inputSchema: InputSchema.fromJson(json['inputSchema'] ?? {}), ); } } ///input schema class InputSchema { final String type; final Map? properties; InputSchema({required this.type, this.properties}); factory InputSchema.fromJson(Map json) { return InputSchema( type: json['type'] ?? 'object', properties: json['properties'] != null ? Map.from(json['properties']) : null, ); } }