Skip to content

Commit

Permalink
add additional webhook model fields (#696)
Browse files Browse the repository at this point in the history
* feat: add assignee to issues

* feat: support owner and name repo change fields
  • Loading branch information
backwardspy authored Sep 27, 2024
1 parent 53e3d4f commit 5ffd531
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/models/webhook_events/payload/issues.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ pub enum IssuesWebhookEventAction {
pub struct IssuesWebhookEventChanges {
pub body: Option<OldValue<String>>,
pub title: Option<OldValue<String>>,
pub assignee: Option<OldValue<Author>>,
}
16 changes: 16 additions & 0 deletions src/models/webhook_events/payload/repository.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use serde::{Deserialize, Serialize};

use crate::models::Author;

use super::OldValue;

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
Expand Down Expand Up @@ -32,4 +34,18 @@ pub struct RepositoryWebhookEventChanges {
pub description: Option<OldValue<Option<String>>>,
pub homepage: Option<OldValue<Option<String>>>,
pub topics: Option<OldValue<Option<Vec<String>>>>,
pub owner: Option<OldValue<RepositoryWebhookEventChangesOwner>>,
pub repository: Option<RepositoryWebhookEventChangesRepository>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct RepositoryWebhookEventChangesOwner {
pub user: Author,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct RepositoryWebhookEventChangesRepository {
pub name: Option<OldValue<String>>,
}

0 comments on commit 5ffd531

Please sign in to comment.