jira_api_v2/models/
project.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/// Project : Details about a project.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Project {
17    /// Expand options that include additional project details in the response.
18    #[serde(rename = "expand", skip_serializing_if = "Option::is_none")]
19    pub expand: Option<String>,
20    /// The URL of the project details.
21    #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
22    pub param_self: Option<String>,
23    /// The ID of the project.
24    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
25    pub id: Option<String>,
26    /// The key of the project.
27    #[serde(rename = "key", skip_serializing_if = "Option::is_none")]
28    pub key: Option<String>,
29    /// A brief description of the project.
30    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
31    pub description: Option<String>,
32    /// The username of the project lead.
33    #[serde(rename = "lead", skip_serializing_if = "Option::is_none")]
34    pub lead: Option<Box<models::User>>,
35    /// List of the components contained in the project.
36    #[serde(rename = "components", skip_serializing_if = "Option::is_none")]
37    pub components: Option<Vec<models::Component>>,
38    /// List of the issue types available in the project.
39    #[serde(rename = "issueTypes", skip_serializing_if = "Option::is_none")]
40    pub issue_types: Option<Vec<models::IssueTypeDetails>>,
41    /// A link to information about this project, such as project documentation.
42    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
43    pub url: Option<String>,
44    /// An email address associated with the project.
45    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
46    pub email: Option<String>,
47    /// The default assignee when creating issues for this project.
48    #[serde(rename = "assigneeType", skip_serializing_if = "Option::is_none")]
49    pub assignee_type: Option<AssigneeType>,
50    /// The versions defined in the project. For more information, see [Create version](#api-rest-api-2-version-post).
51    #[serde(rename = "versions", skip_serializing_if = "Option::is_none")]
52    pub versions: Option<Vec<models::Version>>,
53    /// The name of the project.
54    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
55    pub name: Option<String>,
56    /// The name and self URL for each role defined in the project. For more information, see [Create project role](#api-rest-api-2-role-post).
57    #[serde(rename = "roles", skip_serializing_if = "Option::is_none")]
58    pub roles: Option<std::collections::HashMap<String, String>>,
59    /// The URLs of the project's avatars.
60    #[serde(rename = "avatarUrls", skip_serializing_if = "Option::is_none")]
61    pub avatar_urls: Option<Box<models::AvatarUrlsBean>>,
62    /// The category the project belongs to.
63    #[serde(rename = "projectCategory", skip_serializing_if = "Option::is_none")]
64    pub project_category: Option<Box<models::ProjectCategory>>,
65    /// The [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the project.
66    #[serde(rename = "projectTypeKey", skip_serializing_if = "Option::is_none")]
67    pub project_type_key: Option<ProjectTypeKey>,
68    /// Whether the project is simplified.
69    #[serde(rename = "simplified", skip_serializing_if = "Option::is_none")]
70    pub simplified: Option<bool>,
71    /// The type of the project.
72    #[serde(rename = "style", skip_serializing_if = "Option::is_none")]
73    pub style: Option<Style>,
74    /// Whether the project is selected as a favorite.
75    #[serde(rename = "favourite", skip_serializing_if = "Option::is_none")]
76    pub favourite: Option<bool>,
77    /// Whether the project is private.
78    #[serde(rename = "isPrivate", skip_serializing_if = "Option::is_none")]
79    pub is_private: Option<bool>,
80    /// The issue type hierarchy for the project.
81    #[serde(rename = "issueTypeHierarchy", skip_serializing_if = "Option::is_none")]
82    pub issue_type_hierarchy: Option<Box<models::Hierarchy>>,
83    /// User permissions on the project
84    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
85    pub permissions: Option<Box<models::ProjectPermissions>>,
86    /// Map of project properties
87    #[serde(rename = "properties", skip_serializing_if = "Option::is_none")]
88    pub properties: Option<std::collections::HashMap<String, serde_json::Value>>,
89    /// Unique ID for next-gen projects.
90    #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
91    pub uuid: Option<uuid::Uuid>,
92    /// Insights about the project.
93    #[serde(rename = "insight", skip_serializing_if = "Option::is_none")]
94    pub insight: Option<Box<models::ProjectInsight>>,
95    /// Whether the project is marked as deleted.
96    #[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
97    pub deleted: Option<bool>,
98    /// The date when the project is deleted permanently.
99    #[serde(rename = "retentionTillDate", skip_serializing_if = "Option::is_none")]
100    pub retention_till_date: Option<String>,
101    /// The date when the project was marked as deleted.
102    #[serde(rename = "deletedDate", skip_serializing_if = "Option::is_none")]
103    pub deleted_date: Option<String>,
104    /// The user who marked the project as deleted.
105    #[serde(rename = "deletedBy", skip_serializing_if = "Option::is_none")]
106    pub deleted_by: Option<Box<models::User>>,
107    /// Whether the project is archived.
108    #[serde(rename = "archived", skip_serializing_if = "Option::is_none")]
109    pub archived: Option<bool>,
110    /// The date when the project was archived.
111    #[serde(rename = "archivedDate", skip_serializing_if = "Option::is_none")]
112    pub archived_date: Option<String>,
113    /// The user who archived the project.
114    #[serde(rename = "archivedBy", skip_serializing_if = "Option::is_none")]
115    pub archived_by: Option<Box<models::User>>,
116}
117
118impl Project {
119    /// Details about a project.
120    pub fn new() -> Project {
121        Project {
122            expand: None,
123            param_self: None,
124            id: None,
125            key: None,
126            description: None,
127            lead: None,
128            components: None,
129            issue_types: None,
130            url: None,
131            email: None,
132            assignee_type: None,
133            versions: None,
134            name: None,
135            roles: None,
136            avatar_urls: None,
137            project_category: None,
138            project_type_key: None,
139            simplified: None,
140            style: None,
141            favourite: None,
142            is_private: None,
143            issue_type_hierarchy: None,
144            permissions: None,
145            properties: None,
146            uuid: None,
147            insight: None,
148            deleted: None,
149            retention_till_date: None,
150            deleted_date: None,
151            deleted_by: None,
152            archived: None,
153            archived_date: None,
154            archived_by: None,
155        }
156    }
157}
158/// The default assignee when creating issues for this project.
159#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
160pub enum AssigneeType {
161    #[serde(rename = "PROJECT_LEAD")]
162    ProjectLead,
163    #[serde(rename = "UNASSIGNED")]
164    Unassigned,
165}
166
167impl Default for AssigneeType {
168    fn default() -> AssigneeType {
169        Self::ProjectLead
170    }
171}
172/// The [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the project.
173#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
174pub enum ProjectTypeKey {
175    #[serde(rename = "software")]
176    Software,
177    #[serde(rename = "service_desk")]
178    ServiceDesk,
179    #[serde(rename = "business")]
180    Business,
181}
182
183impl Default for ProjectTypeKey {
184    fn default() -> ProjectTypeKey {
185        Self::Software
186    }
187}
188/// The type of the project.
189#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
190pub enum Style {
191    #[serde(rename = "classic")]
192    Classic,
193    #[serde(rename = "next-gen")]
194    NextGen,
195}
196
197impl Default for Style {
198    fn default() -> Style {
199        Self::Classic
200    }
201}
202