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 = "path")]
41 pub path: String,
42 #[serde(rename = "script_path")]
43 pub script_path: String,
44 #[serde(rename = "email")]
45 pub email: String,
46 #[serde(rename = "extra_perms")]
47 pub extra_perms: std::collections::HashMap<String, bool>,
48 #[serde(rename = "workspace_id")]
49 pub workspace_id: String,
50 #[serde(rename = "edited_by")]
51 pub edited_by: String,
52 #[serde(rename = "edited_at")]
53 pub edited_at: String,
54 #[serde(rename = "is_flow")]
55 pub is_flow: bool,
56}
57
58impl HttpTrigger {
59 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 {
60 HttpTrigger {
61 route_path,
62 static_asset_config: None,
63 http_method,
64 authentication_resource_path: None,
65 summary: None,
66 description: None,
67 is_async,
68 authentication_method,
69 is_static_website,
70 workspaced_route,
71 wrap_body,
72 raw_string,
73 path,
74 script_path,
75 email,
76 extra_perms,
77 workspace_id,
78 edited_by,
79 edited_at,
80 is_flow,
81 }
82 }
83}
84