jira_api_v2/models/
component_with_issue_count.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/// ComponentWithIssueCount : Details about a component with a count of the issues it contains.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ComponentWithIssueCount {
17    /// Count of issues for the component.
18    #[serde(rename = "issueCount", skip_serializing_if = "Option::is_none")]
19    pub issue_count: Option<i64>,
20    /// The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee.
21    #[serde(rename = "realAssignee", skip_serializing_if = "Option::is_none")]
22    pub real_assignee: Option<Box<models::User>>,
23    /// Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but the component lead is not set, then `false` is returned.
24    #[serde(rename = "isAssigneeTypeValid", skip_serializing_if = "Option::is_none")]
25    pub is_assignee_type_valid: Option<bool>,
26    /// The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This property is set to one of the following values:   *  `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in the project that the component is in.  *  `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned issues in the project that the component is in.  *  `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues.  *  `PROJECT_DEFAULT` when none of the preceding cases are true.
27    #[serde(rename = "realAssigneeType", skip_serializing_if = "Option::is_none")]
28    pub real_assignee_type: Option<RealAssigneeType>,
29    /// The description for the component.
30    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
31    pub description: Option<String>,
32    /// The URL for this count of the issues contained in the component.
33    #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
34    pub param_self: Option<String>,
35    /// The user details for the component's lead user.
36    #[serde(rename = "lead", skip_serializing_if = "Option::is_none")]
37    pub lead: Option<Box<models::User>>,
38    /// The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following values:   *  `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the component is in.  *  `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component.  *  `UNASSIGNED` an assignee is not set for issues created with this component.  *  `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the project that the component is in.
39    #[serde(rename = "assigneeType", skip_serializing_if = "Option::is_none")]
40    pub assignee_type: Option<AssigneeType>,
41    /// The key of the project to which the component is assigned.
42    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
43    pub project: Option<String>,
44    /// Not used.
45    #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
46    pub project_id: Option<i64>,
47    /// The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned to issues created with this component.
48    #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")]
49    pub assignee: Option<Box<models::User>>,
50    /// The name for the component.
51    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
52    pub name: Option<String>,
53    /// The unique identifier for the component.
54    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
55    pub id: Option<String>,
56}
57
58impl ComponentWithIssueCount {
59    /// Details about a component with a count of the issues it contains.
60    pub fn new() -> ComponentWithIssueCount {
61        ComponentWithIssueCount {
62            issue_count: None,
63            real_assignee: None,
64            is_assignee_type_valid: None,
65            real_assignee_type: None,
66            description: None,
67            param_self: None,
68            lead: None,
69            assignee_type: None,
70            project: None,
71            project_id: None,
72            assignee: None,
73            name: None,
74            id: None,
75        }
76    }
77}
78/// The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This property is set to one of the following values:   *  `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in the project that the component is in.  *  `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned issues in the project that the component is in.  *  `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues.  *  `PROJECT_DEFAULT` when none of the preceding cases are true.
79#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
80pub enum RealAssigneeType {
81    #[serde(rename = "PROJECT_DEFAULT")]
82    ProjectDefault,
83    #[serde(rename = "COMPONENT_LEAD")]
84    ComponentLead,
85    #[serde(rename = "PROJECT_LEAD")]
86    ProjectLead,
87    #[serde(rename = "UNASSIGNED")]
88    Unassigned,
89}
90
91impl Default for RealAssigneeType {
92    fn default() -> RealAssigneeType {
93        Self::ProjectDefault
94    }
95}
96/// The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following values:   *  `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the component is in.  *  `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component.  *  `UNASSIGNED` an assignee is not set for issues created with this component.  *  `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the project that the component is in.
97#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
98pub enum AssigneeType {
99    #[serde(rename = "PROJECT_DEFAULT")]
100    ProjectDefault,
101    #[serde(rename = "COMPONENT_LEAD")]
102    ComponentLead,
103    #[serde(rename = "PROJECT_LEAD")]
104    ProjectLead,
105    #[serde(rename = "UNASSIGNED")]
106    Unassigned,
107}
108
109impl Default for AssigneeType {
110    fn default() -> AssigneeType {
111        Self::ProjectDefault
112    }
113}
114