Skip to main content

windmill_api/models/
edit_http_trigger.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.626.0
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 EditHttpTrigger {
16    /// The unique path identifier for this trigger
17    #[serde(rename = "path")]
18    pub path: String,
19    /// Path to the script or flow to execute when triggered
20    #[serde(rename = "script_path")]
21    pub script_path: String,
22    /// The URL route path that will trigger this endpoint (e.g., 'api/myendpoint'). Must NOT start with a /.
23    #[serde(rename = "route_path", skip_serializing_if = "Option::is_none")]
24    pub route_path: Option<String>,
25    /// Short summary describing the purpose of this trigger
26    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
27    pub summary: Option<String>,
28    /// Detailed description of what this trigger does
29    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
30    pub description: Option<String>,
31    /// If true, the route includes the workspace ID in the path
32    #[serde(rename = "workspaced_route", skip_serializing_if = "Option::is_none")]
33    pub workspaced_route: Option<bool>,
34    #[serde(rename = "static_asset_config", skip_serializing_if = "Option::is_none")]
35    pub static_asset_config: Option<Box<models::NewHttpTriggerStaticAssetConfig>>,
36    /// Path to the resource containing authentication configuration (for api_key, basic_http, custom_script, signature methods)
37    #[serde(rename = "authentication_resource_path", skip_serializing_if = "Option::is_none")]
38    pub authentication_resource_path: Option<String>,
39    /// True if script_path points to a flow, false if it points to a script
40    #[serde(rename = "is_flow")]
41    pub is_flow: bool,
42    #[serde(rename = "http_method")]
43    pub http_method: models::HttpMethod,
44    /// Deprecated, use request_type instead
45    #[serde(rename = "is_async", skip_serializing_if = "Option::is_none")]
46    pub is_async: Option<bool>,
47    #[serde(rename = "request_type", skip_serializing_if = "Option::is_none")]
48    pub request_type: Option<models::HttpRequestType>,
49    #[serde(rename = "authentication_method")]
50    pub authentication_method: models::AuthenticationMethod,
51    /// If true, serves static files from S3/storage instead of running a script
52    #[serde(rename = "is_static_website")]
53    pub is_static_website: bool,
54    /// If true, wraps the request body in a 'body' parameter
55    #[serde(rename = "wrap_body", skip_serializing_if = "Option::is_none")]
56    pub wrap_body: Option<bool>,
57    /// If true, passes the request body as a raw string instead of parsing as JSON
58    #[serde(rename = "raw_string", skip_serializing_if = "Option::is_none")]
59    pub raw_string: Option<bool>,
60    /// Path to a script or flow to run when the triggered job fails
61    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
62    pub error_handler_path: Option<String>,
63    /// The arguments to pass to the script or flow
64    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
65    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
66    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
67    pub retry: Option<Box<models::Retry>>,
68}
69
70impl EditHttpTrigger {
71    pub fn new(path: String, script_path: String, is_flow: bool, http_method: models::HttpMethod, authentication_method: models::AuthenticationMethod, is_static_website: bool) -> EditHttpTrigger {
72        EditHttpTrigger {
73            path,
74            script_path,
75            route_path: None,
76            summary: None,
77            description: None,
78            workspaced_route: None,
79            static_asset_config: None,
80            authentication_resource_path: None,
81            is_flow,
82            http_method,
83            is_async: None,
84            request_type: None,
85            authentication_method,
86            is_static_website,
87            wrap_body: None,
88            raw_string: None,
89            error_handler_path: None,
90            error_handler_args: None,
91            retry: None,
92        }
93    }
94}
95