jira_v3_openapi 1.6.1

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

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

/// UiModificationContextDetails : The details of a UI modification's context, which define where to activate the UI modification.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UiModificationContextDetails {
    /// The ID of the UI modification context.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// Whether a context is available. For example, when a project is deleted the context becomes unavailable.
    #[serde(rename = "isAvailable", skip_serializing_if = "Option::is_none")]
    pub is_available: Option<bool>,
    /// The issue type ID of the context. Null is treated as a wildcard, meaning the UI modification will be applied to all issue types. Each UI modification context can have a maximum of one wildcard.
    #[serde(rename = "issueTypeId", skip_serializing_if = "Option::is_none")]
    pub issue_type_id: Option<String>,
    /// The portal ID of the context. Only required for Jira Service Management request create portal view (`JSMRequestCreate`).
    #[serde(rename = "portalId", skip_serializing_if = "Option::is_none")]
    pub portal_id: Option<String>,
    /// The project ID of the context. Null is treated as a wildcard, meaning the UI modification will be applied to all projects. Each UI modification context can have a maximum of one wildcard.
    #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
    pub project_id: Option<String>,
    /// The request type ID of the context. Only required for Jira Service Management request create portal view (`JSMRequestCreate`).
    #[serde(rename = "requestTypeId", skip_serializing_if = "Option::is_none")]
    pub request_type_id: Option<String>,
    /// The view type of the context.   Supported values:   *  `GIC` \\- Jira global issue create  *  `IssueView` \\- Jira issue view  *  `IssueTransition` \\- Jira issue transition  *  `JSMRequestCreate` \\- Jira Service Management request create portal view  For Jira view types (`GIC`, `IssueView`, `IssueTransition`), null is treated as a wildcard, meaning the UI modification will be applied to all view types. Each Jira context can have a maximum of one wildcard.      Wildcards are not applicable for JSM contexts.
    #[serde(rename = "viewType", skip_serializing_if = "Option::is_none")]
    pub view_type: Option<ViewType>,
}

impl UiModificationContextDetails {
    /// The details of a UI modification's context, which define where to activate the UI modification.
    pub fn new() -> UiModificationContextDetails {
        UiModificationContextDetails {
            id: None,
            is_available: None,
            issue_type_id: None,
            portal_id: None,
            project_id: None,
            request_type_id: None,
            view_type: None,
        }
    }
}
/// The view type of the context.   Supported values:   *  `GIC` \\- Jira global issue create  *  `IssueView` \\- Jira issue view  *  `IssueTransition` \\- Jira issue transition  *  `JSMRequestCreate` \\- Jira Service Management request create portal view  For Jira view types (`GIC`, `IssueView`, `IssueTransition`), null is treated as a wildcard, meaning the UI modification will be applied to all view types. Each Jira context can have a maximum of one wildcard.      Wildcards are not applicable for JSM contexts.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ViewType {
    #[serde(rename = "GIC")]
    Gic,
    #[serde(rename = "IssueView")]
    IssueView,
    #[serde(rename = "IssueTransition")]
    IssueTransition,
    #[serde(rename = "JSMRequestCreate")]
    JsmRequestCreate,
}

impl Default for ViewType {
    fn default() -> ViewType {
        Self::Gic
    }
}