opensearch_client/common/
count_response.rs1use crate::common;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct CountResponse {
16 #[serde(rename = "count")]
17 pub count: u32,
18 #[serde(
19 rename = "terminated_early",
20 default,
21 skip_serializing_if = "Option::is_none"
22 )]
23 pub terminated_early: Option<bool>,
24 #[serde(rename = "_shards")]
25 pub shards: common::ShardStatistics,
26}
27
28impl CountResponse {
29 pub fn new(count: u32, shards: common::ShardStatistics) -> CountResponse {
30 CountResponse {
31 count,
32 terminated_early: None,
33 shards,
34 }
35 }
36}