-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
146 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
use std::collections::HashMap; | ||
|
||
use serde::Deserialize; | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct JiraData { | ||
pub timestamp: i64, | ||
pub webhook_event: String, | ||
pub user: JiraUser, | ||
pub issue: Option<JiraIssue>, | ||
pub issue_event_type_name: Option<String>, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
pub struct JiraIssue { | ||
#[serde(rename = "self")] | ||
pub self_url: String, | ||
pub id: String, | ||
pub key: String, | ||
pub fields: JiraIssueFields, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct JiraIssueFields { | ||
pub creator: JiraUser, | ||
pub project: JiraProject, | ||
pub summary: String, | ||
pub description: String, | ||
pub priority: JiraIssuePriority, | ||
#[serde(rename = "issuetype")] | ||
pub issue_type: JiraIssueType, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct JiraIssuePriority { | ||
#[serde(rename = "self")] | ||
pub self_url: String, | ||
pub icon_url: String, | ||
pub name: String, | ||
pub id: String, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct JiraIssueType { | ||
#[serde(rename = "self")] | ||
pub self_url: String, | ||
pub id: String, | ||
pub description: String, | ||
pub icon_url: String, | ||
pub name: String, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct JiraUser { | ||
#[serde(rename = "self")] | ||
pub self_url: String, | ||
pub account_id: String, | ||
pub avatar_urls: HashMap<String, String>, | ||
pub display_name: String, | ||
} | ||
|
||
#[derive(Deserialize)] | ||
#[serde(rename_all = "camelCase")] | ||
pub struct JiraProject { | ||
#[serde(rename = "self")] | ||
pub self_url: String, | ||
pub id: String, | ||
pub key: String, | ||
pub name: String, | ||
pub avatar_urls: HashMap<String, String>, | ||
} |