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 serde::{Deserialize, Serialize};




#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ResponseItem {  /// Result of the operation.
  /// Successful values are `created`, `deleted`, and `updated`.
    #[serde(rename = "result", default, skip_serializing_if = "Option::is_none")]
    pub result: Option<String>,  /// HTTP status code returned for the operation.
    #[serde(rename = "status")]
    pub status: u32,
    #[serde(rename = "forced_refresh", default, skip_serializing_if = "Option::is_none")]
    pub forced_refresh: Option<bool>,
    #[serde(rename = "_shards", default, skip_serializing_if = "Option::is_none")]
    pub shards: Option<common::ShardStatistics>,
    #[serde(rename = "get", default, skip_serializing_if = "Option::is_none")]
    pub get: Option<common::InlineGetDictUserDefined>,  /// The primary term assigned to the document for the operation.
    #[serde(rename = "_primary_term", default, skip_serializing_if = "Option::is_none")]
    pub primary_term: Option<u32>,  /// The name of the index associated with the operation.
  /// If the operation targets a data stream, this is the backing index into which the document was written.
    #[serde(rename = "_index")]
    pub index: String,
    #[serde(rename = "_seq_no", default, skip_serializing_if = "Option::is_none")]
    pub seq_no: Option<u32>,
    #[serde(rename = "error", default, skip_serializing_if = "Option::is_none")]
    pub error: Option<common::ErrorCause>,
    #[serde(rename = "_version", default, skip_serializing_if = "Option::is_none")]
    pub version: Option<u32>,
}

impl ResponseItem {
    
    pub fn new(status: u32, index: String) -> ResponseItem {
        ResponseItem {
            result: None,
            status,
            forced_refresh: None,
            shards: None,
            get: None,
            primary_term: None,
            index,
            seq_no: None,
            error: None,
            version: None,
        }
    }
}