From 137d48aca7447ba1ba00ef9f4ae025e9582e7eef Mon Sep 17 00:00:00 2001 From: Adam Curtis Date: Fri, 5 May 2023 12:49:30 -0400 Subject: [PATCH 1/2] add Uploader struct for Asset uploader field --- src/models.rs | 1 + src/models/repos.rs | 28 +++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/models.rs b/src/models.rs index 59142db1..1bd7c65e 100644 --- a/src/models.rs +++ b/src/models.rs @@ -120,6 +120,7 @@ id_type!( StatusId, TeamId, ThreadId, + UploaderId, UserId, UserOrOrgId, WorkflowId, diff --git a/src/models/repos.rs b/src/models/repos.rs index 2562310f..8d0bca75 100644 --- a/src/models/repos.rs +++ b/src/models/repos.rs @@ -319,7 +319,33 @@ pub struct Asset { pub download_count: i64, pub created_at: DateTime, pub updated_at: DateTime, - pub uploader: CommitAuthor, + pub uploader: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "snake_case")] +#[non_exhaustive] +pub struct Uploader { + pub name: Option, + pub email: Option, + pub login: String, + pub id: UploaderId, + pub node_id: String, + pub avatar_url: Url, + pub gravatar_id: Option, + pub url: Url, + pub html_url: Url, + pub followers_url: Url, + pub following_url: Url, + pub gists_url: Url, + pub starred_url: Url, + pub subscriptions_url: Url, + pub organizations_url: Url, + pub repos_url: Url, + pub events_url: Url, + pub received_events_url: Url, + pub r#type: String, + pub site_admin: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] From cf867f9ef6c6a6b32e7ffec791cb9eb8c1382233 Mon Sep 17 00:00:00 2001 From: Adam Curtis Date: Fri, 5 May 2023 13:02:04 -0400 Subject: [PATCH 2/2] add optional starred_at field to Uploader struct --- src/models/repos.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/models/repos.rs b/src/models/repos.rs index 8d0bca75..3b1c68e3 100644 --- a/src/models/repos.rs +++ b/src/models/repos.rs @@ -346,6 +346,7 @@ pub struct Uploader { pub received_events_url: Url, pub r#type: String, pub site_admin: bool, + pub starred_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]