windmill_api/models/
new_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.512.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 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")]
37    pub is_async: bool,
38    #[serde(rename = "authentication_method")]
39    pub authentication_method: models::AuthenticationMethod,
40    #[serde(rename = "is_static_website")]
41    pub is_static_website: bool,
42    #[serde(rename = "wrap_body", skip_serializing_if = "Option::is_none")]
43    pub wrap_body: Option<bool>,
44    #[serde(rename = "raw_string", skip_serializing_if = "Option::is_none")]
45    pub raw_string: Option<bool>,
46    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
47    pub error_handler_path: Option<String>,
48    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
49    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
50    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
51    pub retry: Option<Box<models::Retry>>,
52}
53
54impl NewHttpTrigger {
55    pub fn new(path: String, script_path: String, route_path: String, is_flow: bool, http_method: models::HttpMethod, is_async: bool, authentication_method: models::AuthenticationMethod, is_static_website: bool) -> NewHttpTrigger {
56        NewHttpTrigger {
57            path,
58            script_path,
59            route_path,
60            workspaced_route: None,
61            summary: None,
62            description: None,
63            static_asset_config: None,
64            is_flow,
65            http_method,
66            authentication_resource_path: None,
67            is_async,
68            authentication_method,
69            is_static_website,
70            wrap_body: None,
71            raw_string: None,
72            error_handler_path: None,
73            error_handler_args: None,
74            retry: None,
75        }
76    }
77}
78