Skip to main content

windmill_api/models/
token_route_check.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.891.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 TokenRouteCheck {
16    #[serde(rename = "method")]
17    pub method: String,
18    #[serde(rename = "path")]
19    pub path: String,
20    #[serde(rename = "allowed")]
21    pub allowed: bool,
22    /// why the route layer refuses the token, when it does
23    #[serde(rename = "reason", skip_serializing_if = "Option::is_none")]
24    pub reason: Option<String>,
25}
26
27impl TokenRouteCheck {
28    pub fn new(method: String, path: String, allowed: bool) -> TokenRouteCheck {
29        TokenRouteCheck {
30            method,
31            path,
32            allowed,
33            reason: None,
34        }
35    }
36}
37