Skip to main content

opensearch_client/indices/
create_request_body_json.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::indices;
13use serde::{Deserialize, Serialize};
14
15/// CreateRequestBodyJson
16/// The configuration for the index (`settings` and `mappings`)
17
18#[derive(Clone, Default, Debug, Serialize, Deserialize)]
19pub struct CreateRequestBodyJson {
20    #[serde(rename = "mappings", default, skip_serializing_if = "Option::is_none")]
21    pub mappings: Option<common::mapping::TypeMapping>,
22    /// Aliases for the index.
23    #[serde(rename = "aliases", default, skip_serializing_if = "Option::is_none")]
24    pub aliases: Option<serde_json::Value>,
25    /// The index settings to be updated.
26    #[serde(rename = "settings", default, skip_serializing_if = "Option::is_none")]
27    pub settings: Option<indices::IndexSettings>,
28}
29
30impl CreateRequestBodyJson {
31    /// The configuration for the index (`settings` and `mappings`)
32    pub fn new() -> CreateRequestBodyJson {
33        CreateRequestBodyJson {
34            mappings: None,
35            aliases: None,
36            settings: None,
37        }
38    }
39}