jira_api_v2/models/
component.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/// Component : Details about a project component.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Component {
17    /// The URL of the component.
18    #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
19    pub param_self: Option<String>,
20    /// The unique identifier for the component.
21    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
22    pub id: Option<String>,
23    /// The unique name for the component in the project. Required when creating a component. Optional when updating a component. The maximum length is 255 characters.
24    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
25    pub name: Option<String>,
26    /// The description for the component. Optional when creating or updating a component.
27    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
28    pub description: Option<String>,
29    /// The user details for the component's lead user.
30    #[serde(rename = "lead", skip_serializing_if = "Option::is_none")]
31    pub lead: Option<Box<models::User>>,
32    /// This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details.
33    #[serde(rename = "leadUserName", skip_serializing_if = "Option::is_none")]
34    pub lead_user_name: Option<String>,
35    /// The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*.
36    #[serde(rename = "leadAccountId", skip_serializing_if = "Option::is_none")]
37    pub lead_account_id: Option<String>,
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. Can take 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.  Default value: `PROJECT_DEFAULT`.   Optional when creating or updating a component.
39    #[serde(rename = "assigneeType", skip_serializing_if = "Option::is_none")]
40    pub assignee_type: Option<AssigneeType>,
41    /// The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned to issues created with this component.
42    #[serde(rename = "assignee", skip_serializing_if = "Option::is_none")]
43    pub assignee: Option<Box<models::User>>,
44    /// 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.
45    #[serde(rename = "realAssigneeType", skip_serializing_if = "Option::is_none")]
46    pub real_assignee_type: Option<RealAssigneeType>,
47    /// The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee.
48    #[serde(rename = "realAssignee", skip_serializing_if = "Option::is_none")]
49    pub real_assignee: Option<Box<models::User>>,
50    /// 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.
51    #[serde(rename = "isAssigneeTypeValid", skip_serializing_if = "Option::is_none")]
52    pub is_assignee_type_valid: Option<bool>,
53    /// The key of the project the component is assigned to. Required when creating a component. Can't be updated.
54    #[serde(rename = "project", skip_serializing_if = "Option::is_none")]
55    pub project: Option<String>,
56    /// The ID of the project the component is assigned to.
57    #[serde(rename = "projectId", skip_serializing_if = "Option::is_none")]
58    pub project_id: Option<i64>,
59}
60
61impl Component {
62    /// Details about a project component.
63    pub fn new() -> Component {
64        Component {
65            param_self: None,
66            id: None,
67            name: None,
68            description: None,
69            lead: None,
70            lead_user_name: None,
71            lead_account_id: None,
72            assignee_type: None,
73            assignee: None,
74            real_assignee_type: None,
75            real_assignee: None,
76            is_assignee_type_valid: None,
77            project: None,
78            project_id: None,
79        }
80    }
81}
82/// 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. Can take 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.  Default value: `PROJECT_DEFAULT`.   Optional when creating or updating a component.
83#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
84pub enum AssigneeType {
85    #[serde(rename = "PROJECT_DEFAULT")]
86    ProjectDefault,
87    #[serde(rename = "COMPONENT_LEAD")]
88    ComponentLead,
89    #[serde(rename = "PROJECT_LEAD")]
90    ProjectLead,
91    #[serde(rename = "UNASSIGNED")]
92    Unassigned,
93}
94
95impl Default for AssigneeType {
96    fn default() -> AssigneeType {
97        Self::ProjectDefault
98    }
99}
100/// 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.
101#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
102pub enum RealAssigneeType {
103    #[serde(rename = "PROJECT_DEFAULT")]
104    ProjectDefault,
105    #[serde(rename = "COMPONENT_LEAD")]
106    ComponentLead,
107    #[serde(rename = "PROJECT_LEAD")]
108    ProjectLead,
109    #[serde(rename = "UNASSIGNED")]
110    Unassigned,
111}
112
113impl Default for RealAssigneeType {
114    fn default() -> RealAssigneeType {
115        Self::ProjectDefault
116    }
117}
118