Skip to main content

windmill_api/models/
get_http_trigger_200_response.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.813.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 GetHttpTrigger200Response {
16    /// The URL route path that will trigger this endpoint (e.g., 'api/myendpoint'). Must NOT start with a /.
17    #[serde(rename = "route_path")]
18    pub route_path: String,
19    /// Configuration for serving static assets (s3 bucket, storage path, filename)
20    #[serde(rename = "static_asset_config", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub static_asset_config: Option<Option<Box<serde_json::Value>>>,
22    #[serde(rename = "http_method")]
23    pub http_method: models::HttpMethod,
24    /// Path to the resource containing authentication configuration (for api_key, basic_http, custom_script, signature methods)
25    #[serde(rename = "authentication_resource_path", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub authentication_resource_path: Option<Option<String>>,
27    /// Short summary describing the purpose of this trigger
28    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub summary: Option<Option<String>>,
30    /// Detailed description of what this trigger does
31    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub description: Option<Option<String>>,
33    #[serde(rename = "request_type")]
34    pub request_type: models::HttpRequestType,
35    #[serde(rename = "authentication_method")]
36    pub authentication_method: models::AuthenticationMethod,
37    /// If true, serves static files from S3/storage instead of running a script
38    #[serde(rename = "is_static_website")]
39    pub is_static_website: bool,
40    /// If true, the route includes the workspace ID in the path
41    #[serde(rename = "workspaced_route")]
42    pub workspaced_route: bool,
43    /// If true, wraps the request body in a 'body' parameter
44    #[serde(rename = "wrap_body")]
45    pub wrap_body: bool,
46    /// If true, passes the request body as a raw string instead of parsing as JSON
47    #[serde(rename = "raw_string")]
48    pub raw_string: bool,
49    /// Origins allowed to call this route cross-origin, matched against the request's Origin header (ignoring case) and echoed back on a match. When set, the list governs both the preflight and the response, overriding any Access-Control-Allow-Origin the runnable returns via wm_headers. Use ['*'] to opt out of any restriction, including the http_route_default_allowed_origins instance setting. An empty list is not a configuration and resolves exactly as null does. When null, the instance setting applies, or Access-Control-Allow-Origin: * if it is unset. Ignored on a static website, which has no authentication of its own and so hands out public files: restricting which browsers may read them protects nothing while breaking cross-origin webfonts and fetches. A single-file static asset is not exempt, since it can carry an authentication_method.
50    #[serde(rename = "allowed_origins", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub allowed_origins: Option<Option<Vec<String>>>,
52    /// Path to a script to run when the triggered job fails. A bare path, without the script/ or flow/ prefix a schedule error handler takes; it cannot be a flow.
53    #[serde(rename = "error_handler_path", skip_serializing_if = "Option::is_none")]
54    pub error_handler_path: Option<String>,
55    /// The arguments to pass to the script or flow
56    #[serde(rename = "error_handler_args", skip_serializing_if = "Option::is_none")]
57    pub error_handler_args: Option<std::collections::HashMap<String, serde_json::Value>>,
58    #[serde(rename = "retry", skip_serializing_if = "Option::is_none")]
59    pub retry: Option<Box<models::Retry>>,
60    /// The unique Windmill path for this trigger. Must be of the form `u/<user>/<path>` or `f/<folder>/<path>`. This is the trigger object path, not the HTTP route path.
61    #[serde(rename = "path")]
62    pub path: String,
63    /// Path to the script or flow to execute when triggered
64    #[serde(rename = "script_path")]
65    pub script_path: String,
66    /// The user or group this trigger runs as (permissioned_as)
67    #[serde(rename = "permissioned_as")]
68    pub permissioned_as: String,
69    /// Additional permissions for this trigger
70    #[serde(rename = "extra_perms")]
71    pub extra_perms: std::collections::HashMap<String, bool>,
72    /// The workspace this trigger belongs to
73    #[serde(rename = "workspace_id")]
74    pub workspace_id: String,
75    /// Username of the last person who edited this trigger
76    #[serde(rename = "edited_by")]
77    pub edited_by: String,
78    /// Timestamp of the last edit
79    #[serde(rename = "edited_at")]
80    pub edited_at: String,
81    /// True if script_path points to a flow, false if it points to a script
82    #[serde(rename = "is_flow")]
83    pub is_flow: bool,
84    #[serde(rename = "mode")]
85    pub mode: models::TriggerMode,
86    #[serde(rename = "labels", skip_serializing_if = "Option::is_none")]
87    pub labels: Option<Vec<String>>,
88    /// True when this row is a per-user draft with no deployed trigger at the same path. Set by list endpoints when `include_draft_only=true` synthesizes the row from the draft. Frontend renders a \"Draft\" badge. 
89    #[serde(rename = "draft_only", skip_serializing_if = "Option::is_none")]
90    pub draft_only: Option<bool>,
91    #[serde(rename = "is_draft")]
92    pub is_draft: bool,
93    #[serde(rename = "draft_saved_at", skip_serializing_if = "Option::is_none")]
94    pub draft_saved_at: Option<String>,
95    #[serde(rename = "no_deployed", skip_serializing_if = "Option::is_none")]
96    pub no_deployed: Option<bool>,
97    #[serde(rename = "draft", skip_serializing_if = "Option::is_none")]
98    pub draft: Option<std::collections::HashMap<String, serde_json::Value>>,
99    /// Other workspace users (and the legacy NULL-email row, if any) with a saved draft at the same path. Populated only on the authed user's \"get by path\" responses for kinds the editor surfaces a fork banner for (script, flow, app, raw_app). Empty / omitted for kinds without that UI. 
100    #[serde(rename = "other_drafts_users", skip_serializing_if = "Option::is_none")]
101    pub other_drafts_users: Option<Vec<models::UserDraftOverlayOtherDraftsUsersInner>>,
102}
103
104impl GetHttpTrigger200Response {
105    pub fn new(route_path: String, http_method: models::HttpMethod, request_type: models::HttpRequestType, authentication_method: models::AuthenticationMethod, is_static_website: bool, workspaced_route: bool, wrap_body: bool, raw_string: bool, path: String, script_path: String, permissioned_as: String, extra_perms: std::collections::HashMap<String, bool>, workspace_id: String, edited_by: String, edited_at: String, is_flow: bool, mode: models::TriggerMode, is_draft: bool) -> GetHttpTrigger200Response {
106        GetHttpTrigger200Response {
107            route_path,
108            static_asset_config: None,
109            http_method,
110            authentication_resource_path: None,
111            summary: None,
112            description: None,
113            request_type,
114            authentication_method,
115            is_static_website,
116            workspaced_route,
117            wrap_body,
118            raw_string,
119            allowed_origins: None,
120            error_handler_path: None,
121            error_handler_args: None,
122            retry: None,
123            path,
124            script_path,
125            permissioned_as,
126            extra_perms,
127            workspace_id,
128            edited_by,
129            edited_at,
130            is_flow,
131            mode,
132            labels: None,
133            draft_only: None,
134            is_draft,
135            draft_saved_at: None,
136            no_deployed: None,
137            draft: None,
138            other_drafts_users: None,
139        }
140    }
141}
142