windmill_api/models/
new_http_trigger.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct NewHttpTrigger {
16 #[serde(rename = "path")]
17 pub path: String,
18 #[serde(rename = "script_path")]
19 pub script_path: String,
20 #[serde(rename = "route_path")]
21 pub route_path: String,
22 #[serde(rename = "workspaced_route", skip_serializing_if = "Option::is_none")]
23 pub workspaced_route: Option<bool>,
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 = "static_asset_config", skip_serializing_if = "Option::is_none")]
29 pub static_asset_config: Option<Box<models::NewHttpTriggerStaticAssetConfig>>,
30 #[serde(rename = "is_flow")]
31 pub is_flow: bool,
32 #[serde(rename = "http_method")]
33 pub http_method: models::HttpMethod,
34 #[serde(rename = "authentication_resource_path", skip_serializing_if = "Option::is_none")]
35 pub authentication_resource_path: Option<String>,
36 #[serde(rename = "is_async", skip_serializing_if = "Option::is_none")]
38 pub is_async: Option<bool>,
39 #[serde(rename = "request_type", skip_serializing_if = "Option::is_none")]
40 pub request_type: Option<models::HttpRequestType>,
41 #[serde(rename = "authentication_method")]
42 pub authentication_method: models::AuthenticationMethod,
43 #[serde(rename = "is_static_website")]
44 pub is_static_website: bool,
45 #[serde(rename = "wrap_body", skip_serializing_if = "Option::is_none")]
46 pub wrap_body: Option<bool>,
47 #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
48 pub enabled: Option<bool>,
49 #[serde(rename = "raw_string", skip_serializing_if = "Option::is_none")]
50 pub raw_string: Option<bool>,
51 #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
52 pub error_handler_path: Option<String>,
53 #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
55 pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
56 #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
57 pub retry: Option<Box<models::Retry>>,
58}
59
60impl NewHttpTrigger {
61 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 {
62 NewHttpTrigger {
63 path,
64 script_path,
65 route_path,
66 workspaced_route: None,
67 summary: None,
68 description: None,
69 static_asset_config: None,
70 is_flow,
71 http_method,
72 authentication_resource_path: None,
73 is_async: None,
74 request_type: None,
75 authentication_method,
76 is_static_website,
77 wrap_body: None,
78 enabled: None,
79 raw_string: None,
80 error_handler_path: None,
81 error_handler_args: None,
82 retry: None,
83 }
84 }
85}
86