1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* The Jira Cloud platform REST API
*
* Jira Cloud platform REST API documentation
*
* The version of the OpenAPI document: 1001.0.0-SNAPSHOT
* Contact: ecosystem@atlassian.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// WebhookDetails : A list of webhooks.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookDetails {
/// The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported elements are: * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]` (for custom fields—only the epic label custom field is supported). * Operators: `=`, `!=`, `IN`, and `NOT IN`.
#[serde(rename = "jqlFilter")]
pub jql_filter: String,
/// The Jira events that trigger the webhook.
#[serde(rename = "events")]
pub events: Vec<Events>,
}
impl WebhookDetails {
/// A list of webhooks.
pub fn new(jql_filter: String, events: Vec<Events>) -> WebhookDetails {
WebhookDetails {
jql_filter,
events,
}
}
}
/// The Jira events that trigger the webhook.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Events {
#[serde(rename = "jira:issue_created")]
JiraColonIssueCreated,
#[serde(rename = "jira:issue_updated")]
JiraColonIssueUpdated,
#[serde(rename = "jira:issue_deleted")]
JiraColonIssueDeleted,
#[serde(rename = "comment_created")]
CommentCreated,
#[serde(rename = "comment_updated")]
CommentUpdated,
#[serde(rename = "comment_deleted")]
CommentDeleted,
#[serde(rename = "issue_property_set")]
IssuePropertySet,
#[serde(rename = "issue_property_deleted")]
IssuePropertyDeleted,
}
impl Default for Events {
fn default() -> Events {
Self::JiraColonIssueCreated
}
}