windmill_api/models/
http_trigger.rs1use 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 = "is_async")]
29 pub is_async: bool,
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 #[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}
64
65impl HttpTrigger {
66 pub fn new(route_path: String, http_method: models::HttpMethod, is_async: bool, 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) -> HttpTrigger {
67 HttpTrigger {
68 route_path,
69 static_asset_config: None,
70 http_method,
71 authentication_resource_path: None,
72 summary: None,
73 description: None,
74 is_async,
75 authentication_method,
76 is_static_website,
77 workspaced_route,
78 wrap_body,
79 raw_string,
80 error_handler_path: None,
81 error_handler_args: None,
82 retry: None,
83 path,
84 script_path,
85 email,
86 extra_perms,
87 workspace_id,
88 edited_by,
89 edited_at,
90 is_flow,
91 }
92 }
93}
94