gitea-webhook-builds-sr-ht/src/model/gitea.rs

65 lines
1.4 KiB
Rust

use serde::Deserialize;
#[derive(Debug, Deserialize)]
pub struct GiteaWebhook {
#[serde(rename = "ref")]
pub ref_: String,
pub before: String,
pub after: String,
pub compare_url: String,
pub commits: Vec<GiteaCommit>,
pub head_commit: GiteaCommit,
pub repository: GiteaRepository,
pub pusher: GiteaUser,
pub sender: GiteaUser,
}
#[derive(Debug, Deserialize)]
pub struct GiteaCommit {
pub id: String,
pub message: String,
pub url: String,
pub author: GitUser,
pub committer: GitUser,
pub timestamp: String,
}
#[derive(Debug, Deserialize)]
pub struct GitUser {
pub name: String,
pub email: String,
pub username: String,
}
#[derive(Debug, Deserialize)]
pub struct GiteaRepository {
pub id: u32,
pub owner: GiteaUser,
pub name: String,
pub full_name: String,
pub description: String,
pub private: bool,
pub fork: bool,
pub html_url: String,
pub ssh_url: String,
pub clone_url: String,
pub website: String,
pub stars_count: u32,
pub forks_count: u32,
pub watchers_count: u32,
pub open_issues_count: u32,
pub default_branch: String,
pub created_at: String,
pub updated_at: String,
}
#[derive(Debug, Deserialize)]
pub struct GiteaUser {
pub id: u32,
pub login: String,
pub full_name: String,
pub email: String,
pub avatar_url: String,
pub username: String,
}