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")]
18 pub path: String,
19 #[serde(rename = "script_path")]
21 pub script_path: String,
22 #[serde(rename = "route_path")]
24 pub route_path: String,
25 #[serde(rename = "workspaced_route", skip_serializing_if = "Option::is_none")]
27 pub workspaced_route: Option<bool>,
28 #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
30 pub summary: Option<String>,
31 #[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 #[serde(rename = "is_flow")]
38 pub is_flow: bool,
39 #[serde(rename = "http_method")]
40 pub http_method: models::HttpMethod,
41 #[serde(rename = "authentication_resource_path", skip_serializing_if = "Option::is_none")]
43 pub authentication_resource_path: Option<String>,
44 #[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 #[serde(rename = "is_static_website")]
53 pub is_static_website: bool,
54 #[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 #[serde(rename = "raw_string", skip_serializing_if = "Option::is_none")]
61 pub raw_string: Option<bool>,
62 #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
64 pub error_handler_path: Option<String>,
65 #[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