feat: add owner field and implement Hash for all Gitea response types

This commit is contained in:
Aravinth Manivannan 2022-04-30 23:50:45 +05:30
parent 4cd62dcb40
commit a57759ea80
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88

View file

@ -25,7 +25,7 @@ pub struct SearchResults {
pub data: Vec<Repository>, pub data: Vec<Repository>,
} }
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Hash, Eq, Serialize, Deserialize)]
pub struct User { pub struct User {
pub id: usize, pub id: usize,
pub login: String, pub login: String,
@ -65,6 +65,7 @@ pub struct Repository {
pub ssh_url: String, pub ssh_url: String,
pub clone_url: String, pub clone_url: String,
pub original_url: String, pub original_url: String,
pub owner: User,
pub website: String, pub website: String,
pub stars_count: usize, pub stars_count: usize,
pub forks_count: usize, pub forks_count: usize,
@ -108,7 +109,7 @@ pub struct RepoTransfer {
pub teams: Option<Team>, pub teams: Option<Team>,
} }
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Serialize, Hash, Deserialize)]
pub struct Organization { pub struct Organization {
pub avatar_url: String, pub avatar_url: String,
pub description: String, pub description: String,
@ -121,7 +122,7 @@ pub struct Organization {
pub website: String, pub website: String,
} }
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Serialize, Hash, Deserialize)]
#[serde(rename_all = "lowercase")] #[serde(rename_all = "lowercase")]
pub enum Permission { pub enum Permission {
None, None,