windmill_api/models/
endpoint_tool.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.549.1
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct EndpointTool {
16    /// The tool name/operation ID
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Short description of the tool
20    #[serde(rename = "description")]
21    pub description: String,
22    /// Detailed instructions for using the tool
23    #[serde(rename = "instructions")]
24    pub instructions: String,
25    /// API endpoint path
26    #[serde(rename = "path")]
27    pub path: String,
28    /// HTTP method (GET, POST, etc.)
29    #[serde(rename = "method")]
30    pub method: String,
31    /// JSON schema for path parameters
32    #[serde(rename = "path_params_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub path_params_schema: Option<Option<serde_json::Value>>,
34    /// JSON schema for query parameters
35    #[serde(rename = "query_params_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub query_params_schema: Option<Option<serde_json::Value>>,
37    /// JSON schema for request body
38    #[serde(rename = "body_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub body_schema: Option<Option<serde_json::Value>>,
40}
41
42impl EndpointTool {
43    pub fn new(name: String, description: String, instructions: String, path: String, method: String) -> EndpointTool {
44        EndpointTool {
45            name,
46            description,
47            instructions,
48            path,
49            method,
50            path_params_schema: None,
51            query_params_schema: None,
52            body_schema: None,
53        }
54    }
55}
56