manticoresearch 2.0.0

Сlient for Manticore Search.
Documentation
/*
 * Manticore Search Client
 *
 * Сlient for Manticore Search. 
 *
 * The version of the OpenAPI document: 5.0.0
 * Contact: info@manticoresearch.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// SearchResponse : Response object containing the results of a search request
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SearchResponse {
    /// Time taken to execute the search
    #[serde(rename = "took", skip_serializing_if = "Option::is_none")]
    pub took: Option<i32>,
    /// Indicates whether the search operation timed out
    #[serde(rename = "timed_out", skip_serializing_if = "Option::is_none")]
    pub timed_out: Option<bool>,
    /// Aggregated search results grouped by the specified criteria
    #[serde(rename = "aggregations", skip_serializing_if = "Option::is_none")]
    pub aggregations: Option<serde_json::Value>,
    #[serde(rename = "hits", skip_serializing_if = "Option::is_none")]
    pub hits: Option<Box<models::SearchResponseHits>>,
    /// Profile information about the search execution, if profiling is enabled
    #[serde(rename = "profile", skip_serializing_if = "Option::is_none")]
    pub profile: Option<serde_json::Value>,
    /// Scroll token to be used fo pagination
    #[serde(rename = "scroll", skip_serializing_if = "Option::is_none")]
    pub scroll: Option<String>,
    /// Warnings encountered during the search operation
    #[serde(rename = "warning", skip_serializing_if = "Option::is_none")]
    pub warning: Option<serde_json::Value>,
}

impl SearchResponse {
    /// Response object containing the results of a search request
    pub fn new() -> SearchResponse {
        SearchResponse {
            took: None,
            timed_out: None,
            aggregations: None,
            hits: None,
            profile: None,
            scroll: None,
            warning: None,
        }
    }
}