jira_api_v2/models/
webhook_details.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/// WebhookDetails : A list of webhooks.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct WebhookDetails {
17    /// 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`.
18    #[serde(rename = "jqlFilter")]
19    pub jql_filter: String,
20    /// The Jira events that trigger the webhook.
21    #[serde(rename = "events")]
22    pub events: Vec<Events>,
23}
24
25impl WebhookDetails {
26    /// A list of webhooks.
27    pub fn new(jql_filter: String, events: Vec<Events>) -> WebhookDetails {
28        WebhookDetails {
29            jql_filter,
30            events,
31        }
32    }
33}
34/// The Jira events that trigger the webhook.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Events {
37    #[serde(rename = "jira:issue_created")]
38    JiraColonIssueCreated,
39    #[serde(rename = "jira:issue_updated")]
40    JiraColonIssueUpdated,
41    #[serde(rename = "jira:issue_deleted")]
42    JiraColonIssueDeleted,
43    #[serde(rename = "comment_created")]
44    CommentCreated,
45    #[serde(rename = "comment_updated")]
46    CommentUpdated,
47    #[serde(rename = "comment_deleted")]
48    CommentDeleted,
49    #[serde(rename = "issue_property_set")]
50    IssuePropertySet,
51    #[serde(rename = "issue_property_deleted")]
52    IssuePropertyDeleted,
53}
54
55impl Default for Events {
56    fn default() -> Events {
57        Self::JiraColonIssueCreated
58    }
59}
60