/*
 * Abaco API
 *
 * Abaco (Actor Based Containers) is an API and distributed computing platform funded by the National Science Foundation to provide Functions-as-a-service to the research computing community. Abaco leverages Docker containers and the Actor Model of Concurrent Computation to provide generic function primitives that are portable, composable and scalable.
 *
 * The version of the OpenAPI document: 1
 * Contact: cicsupport@tacc.utexas.edu
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ActorPermission {
    /// The username associated with the permission.
    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
    pub user: Option<String>,
    /// The level associated with the permission.
    #[serde(rename = "level", skip_serializing_if = "Option::is_none")]
    pub level: Option<Level>,
}

impl ActorPermission {
    pub fn new() -> ActorPermission {
        ActorPermission {
            user: None,
            level: None,
        }
    }
}
/// The level associated with the permission.
#[derive(
    Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize, Default,
)]
pub enum Level {
    #[serde(rename = "READ")]
    #[default]
    Read,
    #[serde(rename = "EXECUTE")]
    Execute,
    #[serde(rename = "WRITE")]
    Write,
}
