use crate::snapshot;
use crate::common;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SnapshotStatus {
#[serde(rename = "repository")]
pub repository: String,
#[serde(rename = "uuid")]
pub uuid: String,
#[serde(rename = "state")]
pub state: String,
#[serde(rename = "indices")]
pub indices: serde_json::Value,
#[serde(rename = "snapshot")]
pub snapshot: String,
#[serde(rename = "stats")]
pub stats: snapshot::SnapshotStats,
#[serde(rename = "include_global_state", default, skip_serializing_if = "Option::is_none")]
pub include_global_state: Option<bool>,
#[serde(rename = "shards_stats")]
pub shards_stats: snapshot::SnapshotShardsStats,
}
impl SnapshotStatus {
pub fn new(repository: String, uuid: String, state: String, indices: serde_json::Value, snapshot: String, stats: snapshot::SnapshotStats, shards_stats: snapshot::SnapshotShardsStats) -> SnapshotStatus {
SnapshotStatus {
repository,
uuid,
state,
indices,
snapshot,
stats,
include_global_state: None,
shards_stats,
}
}
}