jira-api-v2 1.0.1

Jira Cloud platform REST API
Documentation
/*
 * The Jira Cloud platform REST API
 *
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
 * Contact: ecosystem@atlassian.com
 * Generated by: https://openapi-generator.tech
 */

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

/// ProjectFeature : Project feature.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ProjectFeature {
    /// Project ID.
    #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
    pub project_id: Option<i64>,
    /// State of the feature.
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<State>,
    /// Determines whether a feature can be toggled or not.
    #[serde(rename = "toggleLocked", skip_serializing_if = "Option::is_none")]
    pub toggle_locked: Option<bool>,
    /// Feature's key.
    #[serde(rename = "feature", skip_serializing_if = "Option::is_none")]
    pub feature: Option<String>,
    /// Feature's category.
    #[serde(rename = "featureCategory", skip_serializing_if = "Option::is_none")]
    pub feature_category: Option<String>,
    /// List of the keys of features required as prerequisites to enable this feature.
    #[serde(rename = "prerequisites", skip_serializing_if = "Option::is_none")]
    pub prerequisites: Option<Vec<String>>,
    /// Name to display for this feature, localised.
    #[serde(rename = "localisedName", skip_serializing_if = "Option::is_none")]
    pub localised_name: Option<String>,
    /// Description to display for this feature, localised.
    #[serde(rename = "localisedDescription", skip_serializing_if = "Option::is_none")]
    pub localised_description: Option<String>,
    /// Uri to the image that should be used to display this feature.
    #[serde(rename = "imageUri", skip_serializing_if = "Option::is_none")]
    pub image_uri: Option<String>,
}

impl ProjectFeature {
    /// Project feature.
    pub fn new() -> ProjectFeature {
        ProjectFeature {
            project_id: None,
            state: None,
            toggle_locked: None,
            feature: None,
            feature_category: None,
            prerequisites: None,
            localised_name: None,
            localised_description: None,
            image_uri: None,
        }
    }
}
/// State of the feature.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum State {
    #[serde(rename = "ENABLED")]
    Enabled,
    #[serde(rename = "DISABLED")]
    Disabled,
    #[serde(rename = "COMING_SOON")]
    ComingSoon,
}

impl Default for State {
    fn default() -> State {
        Self::Enabled
    }
}