Skip to main content

windmill_api/models/
acl_change_revoke.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.817.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 AclChangeRevoke {
16    #[serde(rename = "type")]
17    pub r#type: Type,
18    /// a data table role of the instance, other than admin
19    #[serde(rename = "role")]
20    pub role: String,
21    #[serde(rename = "privileges")]
22    pub privileges: Vec<String>,
23    #[serde(rename = "scope")]
24    pub scope: models::AclGrantScope,
25    /// objects inside the target the revoke covers, empty for the target itself. Only with the target scope; a revoke on all objects of a kind is refused, since it cannot say which grants it takes back.
26    #[serde(rename = "objects", skip_serializing_if = "Option::is_none")]
27    pub objects: Option<Vec<models::AclObject>>,
28}
29
30impl AclChangeRevoke {
31    pub fn new(r#type: Type, role: String, privileges: Vec<String>, scope: models::AclGrantScope) -> AclChangeRevoke {
32        AclChangeRevoke {
33            r#type,
34            role,
35            privileges,
36            scope,
37            objects: None,
38        }
39    }
40}
41/// 
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum Type {
44    #[serde(rename = "revoke")]
45    Revoke,
46}
47
48impl Default for Type {
49    fn default() -> Type {
50        Self::Revoke
51    }
52}
53