Skip to main content

windmill_api/models/
new_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 NewHttpTrigger {
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")]
24    pub route_path: String,
25    /// If true, the route includes the workspace ID in the path
26    #[serde(rename = "workspaced_route", skip_serializing_if = "Option::is_none")]
27    pub workspaced_route: Option<bool>,
28    /// Short summary describing the purpose of this trigger
29    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
30    pub summary: Option<String>,
31    /// Detailed description of what this trigger does
32    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
33    pub description: Option<String>,
34    #[serde(rename = "static_asset_config", skip_serializing_if = "Option::is_none")]
35    pub static_asset_config: Option<Box<models::NewHttpTriggerStaticAssetConfig>>,
36    /// True if script_path points to a flow, false if it points to a script
37    #[serde(rename = "is_flow")]
38    pub is_flow: bool,
39    #[serde(rename = "http_method")]
40    pub http_method: models::HttpMethod,
41    /// Path to the resource containing authentication configuration (for api_key, basic_http, custom_script, signature methods)
42    #[serde(rename = "authentication_resource_path", skip_serializing_if = "Option::is_none")]
43    pub authentication_resource_path: Option<String>,
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    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
58    pub mode: Option<models::TriggerMode>,
59    /// If true, passes the request body as a raw string instead of parsing as JSON
60    #[serde(rename = "raw_string", skip_serializing_if = "Option::is_none")]
61    pub raw_string: Option<bool>,
62    /// Path to a script or flow to run when the triggered job fails
63    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
64    pub error_handler_path: Option<String>,
65    /// The arguments to pass to the script or flow
66    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
67    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
68    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
69    pub retry: Option<Box<models::Retry>>,
70}
71
72impl NewHttpTrigger {
73    pub fn new(path: String, script_path: String, route_path: String, is_flow: bool, http_method: models::HttpMethod, authentication_method: models::AuthenticationMethod, is_static_website: bool) -> NewHttpTrigger {
74        NewHttpTrigger {
75            path,
76            script_path,
77            route_path,
78            workspaced_route: None,
79            summary: None,
80            description: None,
81            static_asset_config: None,
82            is_flow,
83            http_method,
84            authentication_resource_path: None,
85            is_async: None,
86            request_type: None,
87            authentication_method,
88            is_static_website,
89            wrap_body: None,
90            mode: None,
91            raw_string: None,
92            error_handler_path: None,
93            error_handler_args: None,
94            retry: None,
95        }
96    }
97}
98