Skip to main content

opensearch_client/ml/
search_models_response.rs

1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use crate::common;
12use crate::ml;
13use serde::{Deserialize, Serialize};
14
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SearchModelsResponse {
17    /// Whether the search timed out.
18    #[serde(rename = "timed_out", default, skip_serializing_if = "Option::is_none")]
19    pub timed_out: Option<bool>,
20    #[serde(rename = "_shards", default, skip_serializing_if = "Option::is_none")]
21    pub shards: Option<common::ShardStatistics>,
22    #[serde(rename = "hits")]
23    pub hits: ml::SearchHits,
24    /// The time taken to execute the search.
25    #[serde(rename = "took", default, skip_serializing_if = "Option::is_none")]
26    pub took: Option<u32>,
27}
28
29impl SearchModelsResponse {
30    pub fn new(hits: ml::SearchHits) -> SearchModelsResponse {
31        SearchModelsResponse {
32            timed_out: None,
33            shards: None,
34            hits,
35            took: None,
36        }
37    }
38}