/*
 * Tapis Systems API
 *
 * The Tapis Systems API provides for management of Tapis Systems including permissions, credentials and Scheduler Profiles.
 *
 * The version of the OpenAPI document: 26Q1.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 Capability {
    #[serde(rename = "category")]
    pub category: models::CategoryEnum,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "datatype")]
    pub datatype: models::DatatypeEnum,
    #[serde(rename = "precedence", skip_serializing_if = "Option::is_none")]
    pub precedence: Option<i32>,
    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
    pub value: Option<String>,
}

impl Capability {
    pub fn new(
        category: models::CategoryEnum,
        name: String,
        datatype: models::DatatypeEnum,
    ) -> Capability {
        Capability {
            category,
            name,
            datatype,
            precedence: None,
            value: None,
        }
    }
}
