1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use super::EntityDescriptorConst;

#[derive(
    schemars::JsonSchema, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Debug,
)]
pub struct WebcPackageVersionV1Alpha1Spec {
    pub namespace: String,
    pub name: String,
    pub version: String,

    pub webc_hash_sha256: String,

    pub backend_package_id: Option<String>,
    pub backend_id: Option<String>,
    pub webc_manifest: Option<serde_json::Value>,
    pub download_url: Option<url::Url>,

    /// If the package is private or public.
    #[serde(default)]
    pub is_private: bool,
}

impl EntityDescriptorConst for WebcPackageVersionV1Alpha1Spec {
    const NAMESPACE: &'static str = "wasmer.io";
    const NAME: &'static str = "PackageVersion";
    const VERSION: &'static str = "1alpha1";
    const KIND: &'static str = "wasmer.io/PackageVersion.v1alpha1";

    type Spec = Self;
    type State = ();
}

pub type WebcPackageVersion = super::Entity<WebcPackageVersionV1Alpha1Spec>;