/*
 * 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 ActorNonce {
    /// the id of the nonce
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The permission level associated with the nonce.
    #[serde(rename = "level", skip_serializing_if = "Option::is_none")]
    pub level: Option<Level>,
    /// Max uses for the nonce; set to -1 for unlimited uses.
    #[serde(rename = "max_uses", skip_serializing_if = "Option::is_none")]
    pub max_uses: Option<i32>,
    /// the id of the actor
    #[serde(rename = "actor_id", skip_serializing_if = "Option::is_none")]
    pub actor_id: Option<String>,
    /// the base URL for this Abaco instance.
    #[serde(rename = "api_server", skip_serializing_if = "Option::is_none")]
    pub api_server: Option<String>,
    /// The user who owns the associated actor.
    #[serde(rename = "owner", skip_serializing_if = "Option::is_none")]
    pub owner: Option<String>,
    /// Time (in UTC) the nonce was created.
    #[serde(rename = "create_time", skip_serializing_if = "Option::is_none")]
    pub create_time: Option<String>,
    /// Number of uses remaining for the nonce; set to -1 for unlimited uses.
    #[serde(rename = "remaining_uses", skip_serializing_if = "Option::is_none")]
    pub remaining_uses: Option<i32>,
    /// The roles associated with the nonce.
    #[serde(rename = "roles", skip_serializing_if = "Option::is_none")]
    pub roles: Option<Vec<String>>,
}

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