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::ml;
12use crate::common;
13use serde::{Deserialize, Serialize};
14
15
16
17
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct SearchModelsResponse {  /// Whether the search timed out.
20    #[serde(rename = "timed_out", default, skip_serializing_if = "Option::is_none")]
21    pub timed_out: Option<bool>,
22    #[serde(rename = "_shards", default, skip_serializing_if = "Option::is_none")]
23    pub shards: Option<common::ShardStatistics>,
24    #[serde(rename = "hits")]
25    pub hits: ml::SearchHits,  /// The time taken to execute the search.
26    #[serde(rename = "took", default, skip_serializing_if = "Option::is_none")]
27    pub took: Option<u32>,
28}
29
30impl SearchModelsResponse {
31    
32    pub fn new(hits: ml::SearchHits) -> SearchModelsResponse {
33        SearchModelsResponse {
34            timed_out: None,
35            shards: None,
36            hits,
37            took: None,
38        }
39    }
40}