-
-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Issue Timeline API #389
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
be452a1
add missing issue event types
0xB10C 250d9ef
add model for issue timeline events
0xB10C 249dc61
add ListTimelineEventsBuilder for Issue
0xB10C 3ffafc2
add Issue Timeline Event deserialization test
0xB10C b801909
fix: column_url is sometimes not set
0xB10C File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,130 @@ | ||
use super::*; | ||
|
||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[non_exhaustive] | ||
pub struct TimelineEvent { | ||
/// Identifies the actual type of event that occurred. | ||
pub event: Event, | ||
/// The unique identifier of the event. | ||
pub id: Option<TimelineEventId>, | ||
/// The Global Node ID of the event. | ||
pub node_id: Option<String>, | ||
/// The REST API URL for fetching the event. | ||
pub url: Option<Url>, | ||
/// The person who generated the event. | ||
pub actor: Option<Author>, | ||
/// The SHA of the commit that referenced this issue. | ||
pub commit_id: Option<String>, | ||
/// The GitHub REST API link to the commit that referenced this issue. | ||
pub commit_url: Option<String>, | ||
/// The timestamp indicating when the event occurred. | ||
pub created_at: Option<chrono::DateTime<chrono::Utc>>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub project_card: Option<ProjectCard>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub project_id: Option<ProjectId>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub project_url: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub column_name: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub assignees: Option<Vec<Author>>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub assigner: Option<Author>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub updated_at: Option<chrono::DateTime<chrono::Utc>>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub author_association: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub body: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub user: Option<Author>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub html_url: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub issue_url: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub tree: Option<repos::CommitObject>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub verification: Option<repos::Verification>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub parents: Option<Vec<repos::Commit>>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub message: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub committer: Option<CommitAuthor>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub author: Option<CommitAuthor>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub sha: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub source: Option<Source>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub milestone: Option<Milestone>, // differs from other milestones the API returns. Has only a title. | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub label: Option<Label>, // differs from other labels the API returns. Has only a name and a color. | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub lock_reason: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub previous_column_name: Option<String>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub rename: Option<Rename>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub submitted_at: Option<chrono::DateTime<chrono::Utc>>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub state: Option<pulls::ReviewState>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub dismissed_review: Option<DismissedReview>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub pull_request_url: Option<Url>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub requested_reviewers: Option<Vec<Author>>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub review_requester: Option<Author>, | ||
#[serde(skip_serializing_if = "Option::is_none")] | ||
pub assignee: Option<Author>, | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[non_exhaustive] | ||
pub struct DismissedReview { | ||
state: pulls::ReviewState, | ||
review_id: ReviewId, | ||
dismissal_message: String, | ||
dismissal_commit_id: Option<String>, | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[non_exhaustive] | ||
pub struct Source { | ||
issue: issues::Issue, | ||
r#type: String, | ||
} | ||
|
||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
#[non_exhaustive] | ||
pub struct Rename { | ||
from: String, | ||
to: String, | ||
} | ||
|
||
#[derive(Debug, Clone, Hash, Eq, PartialEq, Serialize, Deserialize)] | ||
#[non_exhaustive] | ||
pub struct Label { | ||
pub name: String, | ||
pub color: String, | ||
} | ||
|
||
#[derive(Debug, Clone, Hash, Eq, PartialEq, Serialize, Deserialize)] | ||
#[non_exhaustive] | ||
pub struct Milestone { | ||
pub title: String, | ||
} | ||
|
||
/// The author of a commit, identified by its name and email. | ||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] | ||
pub struct CommitAuthor { | ||
pub name: String, | ||
pub email: String, | ||
pub date: Option<chrono::DateTime<chrono::Utc>>, | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been
pub requested_reviewers: Option<Author>
. It's only a single reviewer that's requested per event and not multiple.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed with #390