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
//! https://bigml.com/api/clusters

use serde::{Deserialize, Serialize};

use super::id::*;
use super::status::*;
use super::{Resource, ResourceCommon};

/// An cluster of multiple predictive models.
///
/// TODO: Still lots of missing fields.
#[derive(Clone, Debug, Deserialize, Resource, Serialize)]
#[api_name = "cluster"]
#[non_exhaustive]
pub struct Cluster {
    /// Common resource information. These fields will be serialized at the
    /// top-level of this structure by `serde`.
    #[serde(flatten)]
    pub common: ResourceCommon,

    /// The ID of this resource.
    pub resource: Id<Cluster>,

    /// The current status of this cluster.
    pub status: GenericStatus,

    /// Details about the clusters that BigML found.
    ///
    /// TODO: Convert to a strongly-typed struct.
    pub clusters: Option<serde_json::Value>,
}