jira_api_v2/models/
scope.rs

1/*
2 * The Jira Cloud platform REST API
3 *
4 * Jira Cloud platform REST API documentation
5 *
6 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT
7 * Contact: ecosystem@atlassian.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Scope : The projects the item is associated with. Indicated for items associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO).
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Scope {
17    /// The type of scope.
18    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
19    pub r#type: Option<Type>,
20    /// The project the item has scope in.
21    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
22    pub project: Option<Box<models::ProjectForScope>>,
23}
24
25impl Scope {
26    /// The projects the item is associated with. Indicated for items associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO).
27    pub fn new() -> Scope {
28        Scope {
29            r#type: None,
30            project: None,
31        }
32    }
33}
34/// The type of scope.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Type {
37    #[serde(rename = "PROJECT")]
38    Project,
39    #[serde(rename = "TEMPLATE")]
40    Template,
41}
42
43impl Default for Type {
44    fn default() -> Type {
45        Self::Project
46    }
47}
48