jira_api_v2/models/
event_notification.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/// EventNotification : Details about a notification associated with an event.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct EventNotification {
17    /// Expand options that include additional event notification details in the response.
18    #[serde(rename = "expand", skip_serializing_if = "Option::is_none")]
19    pub expand: Option<String>,
20    /// The ID of the notification.
21    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
22    pub id: Option<i64>,
23    /// Identifies the recipients of the notification.
24    #[serde(rename = "notificationType", skip_serializing_if = "Option::is_none")]
25    pub notification_type: Option<NotificationType>,
26    /// The value of the `notificationType`:   *  `User` The `parameter` is the user account ID.  *  `Group` The `parameter` is the group name.  *  `ProjectRole` The `parameter` is the project role ID.  *  `UserCustomField` The `parameter` is the ID of the custom field.  *  `GroupCustomField` The `parameter` is the ID of the custom field.
27    #[serde(rename = "parameter", skip_serializing_if = "Option::is_none")]
28    pub parameter: Option<String>,
29    /// The specified group.
30    #[serde(rename = "group", skip_serializing_if = "Option::is_none")]
31    pub group: Option<Box<models::GroupName>>,
32    /// The custom user or group field.
33    #[serde(rename = "field", skip_serializing_if = "Option::is_none")]
34    pub field: Option<Box<models::FieldDetails>>,
35    /// The email address.
36    #[serde(rename = "emailAddress", skip_serializing_if = "Option::is_none")]
37    pub email_address: Option<String>,
38    /// The specified project role.
39    #[serde(rename = "projectRole", skip_serializing_if = "Option::is_none")]
40    pub project_role: Option<Box<models::ProjectRole>>,
41    /// The specified user.
42    #[serde(rename = "user", skip_serializing_if = "Option::is_none")]
43    pub user: Option<Box<models::UserDetails>>,
44}
45
46impl EventNotification {
47    /// Details about a notification associated with an event.
48    pub fn new() -> EventNotification {
49        EventNotification {
50            expand: None,
51            id: None,
52            notification_type: None,
53            parameter: None,
54            group: None,
55            field: None,
56            email_address: None,
57            project_role: None,
58            user: None,
59        }
60    }
61}
62/// Identifies the recipients of the notification.
63#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
64pub enum NotificationType {
65    #[serde(rename = "CurrentAssignee")]
66    CurrentAssignee,
67    #[serde(rename = "Reporter")]
68    Reporter,
69    #[serde(rename = "CurrentUser")]
70    CurrentUser,
71    #[serde(rename = "ProjectLead")]
72    ProjectLead,
73    #[serde(rename = "ComponentLead")]
74    ComponentLead,
75    #[serde(rename = "User")]
76    User,
77    #[serde(rename = "Group")]
78    Group,
79    #[serde(rename = "ProjectRole")]
80    ProjectRole,
81    #[serde(rename = "EmailAddress")]
82    EmailAddress,
83    #[serde(rename = "AllWatchers")]
84    AllWatchers,
85    #[serde(rename = "UserCustomField")]
86    UserCustomField,
87    #[serde(rename = "GroupCustomField")]
88    GroupCustomField,
89}
90
91impl Default for NotificationType {
92    fn default() -> NotificationType {
93        Self::CurrentAssignee
94    }
95}
96