windmill_api/models/
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.577.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 HttpTrigger {
16    #[serde(rename = "route_path")]
17    pub route_path: String,
18    #[serde(rename = "static_asset_config", skip_serializing_if = "Option::is_none")]
19    pub static_asset_config: Option<Box<serde_json::Value>>,
20    #[serde(rename = "http_method")]
21    pub http_method: models::HttpMethod,
22    #[serde(rename = "authentication_resource_path", skip_serializing_if = "Option::is_none")]
23    pub authentication_resource_path: Option<String>,
24    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
25    pub summary: Option<String>,
26    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
27    pub description: Option<String>,
28    #[serde(rename = "request_type")]
29    pub request_type: models::HttpRequestType,
30    #[serde(rename = "authentication_method")]
31    pub authentication_method: models::AuthenticationMethod,
32    #[serde(rename = "is_static_website")]
33    pub is_static_website: bool,
34    #[serde(rename = "workspaced_route")]
35    pub workspaced_route: bool,
36    #[serde(rename = "wrap_body")]
37    pub wrap_body: bool,
38    #[serde(rename = "raw_string")]
39    pub raw_string: bool,
40    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
41    pub error_handler_path: Option<String>,
42    /// The arguments to pass to the script or flow
43    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
44    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
45    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
46    pub retry: Option<Box<models::Retry>>,
47    #[serde(rename = "path")]
48    pub path: String,
49    #[serde(rename = "script_path")]
50    pub script_path: String,
51    #[serde(rename = "email")]
52    pub email: String,
53    #[serde(rename = "extra_perms")]
54    pub extra_perms: std::collections::HashMap<String, bool>,
55    #[serde(rename = "workspace_id")]
56    pub workspace_id: String,
57    #[serde(rename = "edited_by")]
58    pub edited_by: String,
59    #[serde(rename = "edited_at")]
60    pub edited_at: String,
61    #[serde(rename = "is_flow")]
62    pub is_flow: bool,
63    #[serde(rename = "enabled")]
64    pub enabled: bool,
65}
66
67impl HttpTrigger {
68    pub fn new(route_path: String, http_method: models::HttpMethod, request_type: models::HttpRequestType, authentication_method: models::AuthenticationMethod, is_static_website: bool, workspaced_route: bool, wrap_body: bool, raw_string: bool, path: String, script_path: String, email: String, extra_perms: std::collections::HashMap<String, bool>, workspace_id: String, edited_by: String, edited_at: String, is_flow: bool, enabled: bool) -> HttpTrigger {
69        HttpTrigger {
70            route_path,
71            static_asset_config: None,
72            http_method,
73            authentication_resource_path: None,
74            summary: None,
75            description: None,
76            request_type,
77            authentication_method,
78            is_static_website,
79            workspaced_route,
80            wrap_body,
81            raw_string,
82            error_handler_path: None,
83            error_handler_args: None,
84            retry: None,
85            path,
86            script_path,
87            email,
88            extra_perms,
89            workspace_id,
90            edited_by,
91            edited_at,
92            is_flow,
93            enabled,
94        }
95    }
96}
97