windmill-api 1.817.0

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.817.0
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AclGrant {
    #[serde(rename = "grantee")]
    pub grantee: String,
    #[serde(rename = "privileges")]
    pub privileges: Vec<String>,
    #[serde(rename = "object", skip_serializing_if = "Option::is_none")]
    pub object: Option<Box<models::AclObject>>,
    /// set for a default privilege, naming the kind of object it covers (TABLES, SEQUENCES, FUNCTIONS, TYPES, or SCHEMAS). On a schema, the defaults set in that schema; on the database, the ones set database-wide, which apply in every schema and which no schema's own defaults take back.
    #[serde(rename = "future", skip_serializing_if = "Option::is_none")]
    pub future: Option<String>,
    /// the roles the grant comes from, each once — who granted it, or for a default privilege the role whose future objects it covers. A revoke of some of the grant's privileges takes them back from every source that gave them.
    #[serde(rename = "sources")]
    pub sources: Vec<models::AclSource>,
}

impl AclGrant {
    pub fn new(grantee: String, privileges: Vec<String>, sources: Vec<models::AclSource>) -> AclGrant {
        AclGrant {
            grantee,
            privileges,
            object: None,
            future: None,
            sources,
        }
    }
}