opensearch-client 0.3.1

Strongly typed OpenSearch Client
Documentation
/*
 * opensearch-client
 *
 * Rust Client for OpenSearch
 *
 * The version of the OpenAPI document: 3.1.0
 * Contact: alberto.paro@gmail.com
 * Generated by Paro OpenAPI Generator
 */

use crate::common;
use crate::indices;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IndexSettingsStore {
    #[serde(rename = "preload", default, skip_serializing_if = "Option::is_none")]
    pub preload: Option<Vec<String>>,
    /// Certain APIs may return values, including numbers such as epoch timestamps, as strings. This setting captures
    /// this behavior while keeping the semantics of the field type.
    ///
    /// Depending on the target language, code generators can keep the union or remove it and leniently parse
    /// strings to the target type.
    #[serde(
        rename = "allow_mmap",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub allow_mmap: Option<common::StringifiedBoolean>,
    #[serde(rename = "fs", default, skip_serializing_if = "Option::is_none")]
    pub fs: Option<indices::IndexSettingsStoreFs>,
    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
    #[serde(
        rename = "stats_refresh_interval",
        default,
        skip_serializing_if = "Option::is_none"
    )]
    pub stats_refresh_interval: Option<String>,
    #[serde(rename = "hybrid", default, skip_serializing_if = "Option::is_none")]
    pub hybrid: Option<indices::IndexSettingsStoreHybrid>,
    #[serde(rename = "type")]
    pub r#type: indices::StorageType,
}

impl IndexSettingsStore {
    pub fn new(r#type: indices::StorageType) -> IndexSettingsStore {
        IndexSettingsStore {
            preload: None,
            allow_mmap: None,
            fs: None,
            stats_refresh_interval: None,
            hybrid: None,
            r#type,
        }
    }
}