Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Uploader struct for Asset uploader field #355

Merged
merged 2 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ id_type!(
StatusId,
TeamId,
ThreadId,
UploaderId,
UserId,
UserOrOrgId,
WorkflowId,
Expand Down
29 changes: 28 additions & 1 deletion src/models/repos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,34 @@ pub struct Asset {
pub download_count: i64,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub uploader: CommitAuthor,
pub uploader: Option<Uploader>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub struct Uploader {
pub name: Option<String>,
pub email: Option<String>,
pub login: String,
pub id: UploaderId,
pub node_id: String,
pub avatar_url: Url,
pub gravatar_id: Option<String>,
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,
pub starred_at: Option<String>,
}

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
Expand Down