diff --git a/src/schema/anybundle/metadata.rs b/src/schema/anybundle/metadata.rs new file mode 100644 index 0000000..3a24582 --- /dev/null +++ b/src/schema/anybundle/metadata.rs @@ -0,0 +1,32 @@ +/// The contents of the `anybundle.json` file of a bundle. +/// +/// Both Core Bundles and Set Bundles are bundles, and both have anybundle. +#[derive(Clone, Debug, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)] +pub struct BundleMetadata { + /// The locales included in the bundle. + /// + /// I've never seen more that a single locale here, but the specification allows that. + locales: Vec, + + /// ??? + #[serde(default = "none")] + client_hash: Option, + + /// ??? + #[serde(default = "none")] + gameplay_data_hash: Option, + + /// ??? + #[serde(default = "none")] + timestamp: Option, + + /// ??? + #[serde(default = "none")] + patchline_ref: Option, +} + + +/// Generate a [Option::None] to use as default in [serde]. +fn none() -> Option { + Option::::None +} diff --git a/src/schema/anybundle/mod.rs b/src/schema/anybundle/mod.rs new file mode 100644 index 0000000..8fe44fb --- /dev/null +++ b/src/schema/anybundle/mod.rs @@ -0,0 +1,5 @@ +//! This module defines the types used in all Data Dragon bundles. + +mod metadata; + +pub use metadata::BundleMetadata; diff --git a/src/schema/mod.rs b/src/schema/mod.rs index d10e3b2..9950cdf 100644 --- a/src/schema/mod.rs +++ b/src/schema/mod.rs @@ -2,3 +2,4 @@ pub mod corebundle; pub mod setbundle; +pub mod anybundle;