hi_jira2/models/project_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
11/// ProjectComponent : Details about a project component.
12
13
14
15#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
16pub struct ProjectComponent {
17 /// The URL of the component.
18 #[serde(rename = "self", skip_serializing_if = "Option::is_none")]
19 pub _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<crate::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<crate::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<crate::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 ProjectComponent {
62 /// Details about a project component.
63 pub fn new() -> ProjectComponent {
64 ProjectComponent {
65 _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
83/// 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.
84#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
85pub enum AssigneeType {
86 #[serde(rename = "PROJECT_DEFAULT")]
87 PROJECTDEFAULT,
88 #[serde(rename = "COMPONENT_LEAD")]
89 COMPONENTLEAD,
90 #[serde(rename = "PROJECT_LEAD")]
91 PROJECTLEAD,
92 #[serde(rename = "UNASSIGNED")]
93 UNASSIGNED,
94}
95
96impl Default for AssigneeType {
97 fn default() -> AssigneeType {
98 Self::PROJECTDEFAULT
99 }
100}
101/// 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.
102#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
103pub enum RealAssigneeType {
104 #[serde(rename = "PROJECT_DEFAULT")]
105 PROJECTDEFAULT,
106 #[serde(rename = "COMPONENT_LEAD")]
107 COMPONENTLEAD,
108 #[serde(rename = "PROJECT_LEAD")]
109 PROJECTLEAD,
110 #[serde(rename = "UNASSIGNED")]
111 UNASSIGNED,
112}
113
114impl Default for RealAssigneeType {
115 fn default() -> RealAssigneeType {
116 Self::PROJECTDEFAULT
117 }
118}
119