1#[derive(Debug, Clone, PartialEq)]
3pub enum ParamLocation {
4 Path,
5 Query,
6 Header,
7}
8
9#[derive(Debug, Clone, PartialEq)]
11pub struct ApiParam {
12 pub name: String,
13 pub location: ParamLocation,
14 pub required: bool,
15 pub schema: serde_json::Value,
16 pub description: Option<String>,
17}
18
19#[derive(Debug, Clone, PartialEq)]
25pub struct ApiOperation {
26 pub tool_name: String,
27 pub method: String,
28 pub path: String,
29 pub description: String,
30 pub parameters: Vec<ApiParam>,
31 pub request_body_schema: Option<serde_json::Value>,
32 pub input_schema: serde_json::Value,
33 pub hint: Option<String>,
34}
35
36impl ApiOperation {
37 pub fn new(tool_name: String, method: String, path: String, description: String) -> Self {
42 Self {
43 tool_name,
44 method,
45 path,
46 description,
47 parameters: Vec::new(),
48 request_body_schema: None,
49 input_schema: serde_json::json!({"type": "object", "properties": {}}),
50 hint: None,
51 }
52 }
53}