Skip to content

Commit

Permalink
GitHubClient: Add size field to Artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbobbio committed Dec 4, 2024
1 parent c1a260d commit 3fd6345
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/maelstrom-github/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ futures.workspace = true
reqwest.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_with.workspace = true
tokio-util.workspace = true
tokio.workspace = true
url.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions crates/maelstrom-github/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use anyhow::{anyhow, bail, Result};
use azure_storage_blobs::prelude::BlobClient;
use futures::{stream::TryStreamExt as _, StreamExt as _};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use serde_with::{serde_as, DisplayFromStr};
use tokio::io::AsyncRead;
use tokio_util::compat::FuturesAsyncReadCompatExt as _;
use url::Url;
Expand Down Expand Up @@ -118,11 +119,14 @@ struct ListArtifactsRequest {
backend_ids: BackendIds,
}

#[serde_as]
#[derive(Debug, Deserialize)]
pub struct Artifact {
#[serde(flatten, with = "BackendIdsSnakeCase")]
pub backend_ids: BackendIds,
pub name: String,
#[serde_as(as = "DisplayFromStr")]
pub size: i64,
}

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

0 comments on commit 3fd6345

Please sign in to comment.