forgejo-hooks: Introduce chrono dep

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2024-09-01 16:33:08 +02:00 committed by pep
parent 38b366204b
commit 962fc592ee
2 changed files with 11 additions and 9 deletions

View file

@ -4,4 +4,5 @@ version = "0.1.0"
edition = "2021"
[dependencies]
chrono = { version = "0.4", default-features = false, features = ["serde"] }
serde = { version = "1.0", features = ["derive"] }

View file

@ -1,3 +1,4 @@
use chrono::{DateTime, Utc};
use serde::Deserialize;
#[derive(Deserialize, Debug)]
@ -24,7 +25,7 @@ pub struct Commit {
pub url: String,
pub author: CommitAuthor,
pub committer: CommitAuthor,
pub timestamp: String,
pub timestamp: DateTime<Utc>,
}
#[derive(Deserialize, Debug)]
@ -59,8 +60,8 @@ pub struct Repository {
pub watchers_count: u32,
pub open_issues_count: u32,
pub default_branch: String,
pub created_at: String,
pub updated_at: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}
#[derive(Deserialize, Debug)]
@ -91,9 +92,9 @@ pub struct RepositoryFull {
pub open_issues_count: u32,
pub open_pr_counter: u32,
pub default_branch: String,
pub created_at: String,
pub updated_at: String,
pub archived_at: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub archived_at: DateTime<Utc>,
pub permissions: Perms,
pub has_issues: bool,
pub internal_tracker: InternalTracker,
@ -114,7 +115,7 @@ pub struct RepositoryFull {
pub avatar_url: String,
pub internal: bool,
pub mirror_internal: String,
pub mirror_updated: String,
pub mirror_updated: DateTime<Utc>,
pub repo_transfer: Option<String>,
}
@ -128,8 +129,8 @@ pub struct RepositoryOwner {
pub avatar_url: String,
pub language: String,
pub is_admin: bool,
pub last_login: String,
pub created: String,
pub last_login: DateTime<Utc>,
pub created: DateTime<Utc>,
pub restricted: bool,
pub active: bool,
pub prohibit_login: bool,