/*
 * Orvanta API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.2.0
 * Contact: contact@orvanta.cloud
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EndpointTool {
    /// The tool name/operation ID
    #[serde(rename = "name")]
    pub name: String,
    /// Short description of the tool
    #[serde(rename = "description")]
    pub description: String,
    /// Detailed instructions for using the tool
    #[serde(rename = "instructions")]
    pub instructions: String,
    /// API endpoint path
    #[serde(rename = "path")]
    pub path: String,
    /// HTTP method (GET, POST, etc.)
    #[serde(rename = "method")]
    pub method: String,
    /// JSON schema for path parameters
    #[serde(rename = "path_params_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub path_params_schema: Option<Option<serde_json::Value>>,
    /// JSON schema for query parameters
    #[serde(rename = "query_params_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub query_params_schema: Option<Option<serde_json::Value>>,
    /// JSON schema for request body
    #[serde(rename = "body_schema", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub body_schema: Option<Option<serde_json::Value>>,
}

impl EndpointTool {
    pub fn new(name: String, description: String, instructions: String, path: String, method: String) -> EndpointTool {
        EndpointTool {
            name,
            description,
            instructions,
            path,
            method,
            path_params_schema: None,
            query_params_schema: None,
            body_schema: None,
        }
    }
}

