jira_v3_openapi 1.6.0

Jira Cloud platform REST API lib (OpenAPI document version: 1001.0.0-SNAPSHOT-af42c50d50804c2f1b8ad4bb80d52c53890867e2)
Documentation
/*
 * The Jira Cloud platform REST API
 *
 * Jira Cloud platform REST API documentation
 *
 * The version of the OpenAPI document: 1001.0.0-SNAPSHOT-af42c50d50804c2f1b8ad4bb80d52c53890867e2
 * 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 Jira events that trigger the webhook.
    #[serde(rename = "events")]
    pub events: Vec<Events>,
    /// A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. If this parameter is not present, the app is notified about all field updates.
    #[serde(rename = "fieldIdsFilter", skip_serializing_if = "Option::is_none")]
    pub field_ids_filter: Option<Vec<String>>,
    /// A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property updates.
    #[serde(rename = "issuePropertyKeysFilter", skip_serializing_if = "Option::is_none")]
    pub issue_property_keys_filter: Option<Vec<String>>,
    /// 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 (`cf[id]`), only the epic label custom field is supported.\".  *  Operators: `=`, `!=`, `IN`, and `NOT IN`.
    #[serde(rename = "jqlFilter")]
    pub jql_filter: String,
}

impl WebhookDetails {
    /// A list of webhooks.
    pub fn new(events: Vec<Events>, jql_filter: String) -> WebhookDetails {
        WebhookDetails {
            events,
            field_ids_filter: None,
            issue_property_keys_filter: None,
            jql_filter,
        }
    }
}
/// 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,
    #[serde(rename = "sprint_created")]
    SprintCreated,
    #[serde(rename = "sprint_updated")]
    SprintUpdated,
    #[serde(rename = "sprint_closed")]
    SprintClosed,
    #[serde(rename = "sprint_deleted")]
    SprintDeleted,
    #[serde(rename = "sprint_started")]
    SprintStarted,
    #[serde(rename = "jira:version_released")]
    JiraColonVersionReleased,
    #[serde(rename = "jira:version_unreleased")]
    JiraColonVersionUnreleased,
    #[serde(rename = "jira:version_created")]
    JiraColonVersionCreated,
    #[serde(rename = "jira:version_moved")]
    JiraColonVersionMoved,
    #[serde(rename = "jira:version_updated")]
    JiraColonVersionUpdated,
    #[serde(rename = "jira:version_merged")]
    JiraColonVersionMerged,
    #[serde(rename = "jira:version_deleted")]
    JiraColonVersionDeleted,
}

impl Default for Events {
    fn default() -> Events {
        Self::JiraColonIssueCreated
    }
}