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




#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SegmentsRecord {  /// If `true`, the segment is stored in a compound file.
  /// This means Lucene merged all files from the segment in a single file to save file descriptors.
    #[serde(rename = "compound", default, skip_serializing_if = "Option::is_none")]
    pub compound: Option<String>,  /// The shard type: `primary` or `replica`.
    #[serde(rename = "prirep", default, skip_serializing_if = "Option::is_none")]
    pub prirep: Option<String>,
    #[serde(rename = "id", default, skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,  /// The segment generation number.
  /// OpenSearch increments this generation number for each segment written then uses this number to derive the segment name.
    #[serde(rename = "generation", default, skip_serializing_if = "Option::is_none")]
    pub generation: Option<String>,  /// The shard name.
    #[serde(rename = "shard", default, skip_serializing_if = "Option::is_none")]
    pub shard: Option<String>,
    #[serde(rename = "size.memory", default, skip_serializing_if = "Option::is_none")]
    pub size_memory: Option<String>,
    #[serde(rename = "version", default, skip_serializing_if = "Option::is_none")]
    pub version: Option<String>,  /// The number of deleted documents in the segment, which might be higher or lower than the number of delete operations you have performed.
  /// This number excludes deletes that were performed recently and do not yet belong to a segment.
  /// Deleted documents are cleaned up by the automatic merge process if it makes sense to do so.
  /// Also, OpenSearch creates extra deleted documents to internally track the recent history of operations on a shard.
    #[serde(rename = "docs.deleted", default, skip_serializing_if = "Option::is_none")]
    pub docs_deleted: Option<String>,
    #[serde(rename = "index", default, skip_serializing_if = "Option::is_none")]
    pub index: Option<String>,  /// The number of documents in the segment.
  /// This excludes deleted documents and counts any nested documents separately from their parents.
  /// It also excludes documents which were indexed recently and do not yet belong to a segment.
    #[serde(rename = "docs.count", default, skip_serializing_if = "Option::is_none")]
    pub docs_count: Option<String>,  /// If `true`, the segment is searchable.
  /// If `false`, the segment has most likely been written to disk but needs a refresh to be searchable.
    #[serde(rename = "searchable", default, skip_serializing_if = "Option::is_none")]
    pub searchable: Option<String>,  /// The IP address of the node where it lives.
    #[serde(rename = "ip", default, skip_serializing_if = "Option::is_none")]
    pub ip: Option<String>,  /// If `true`, the segment is synced to disk.
  /// Segments that are synced can survive a hard reboot.
  /// If `false`, the data from uncommitted segments is also stored in the transaction log so that OpenSearch is able to replay changes on the next start.
    #[serde(rename = "committed", default, skip_serializing_if = "Option::is_none")]
    pub committed: Option<String>,  /// The segment name, which is derived from the segment generation and used internally to create file names in the directory of the shard.
    #[serde(rename = "segment", default, skip_serializing_if = "Option::is_none")]
    pub segment: Option<String>,
    #[serde(rename = "size", default, skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
}

impl SegmentsRecord {
    
    pub fn new() -> SegmentsRecord {
        SegmentsRecord {
            compound: None,
            prirep: None,
            id: None,
            generation: None,
            shard: None,
            size_memory: None,
            version: None,
            docs_deleted: None,
            index: None,
            docs_count: None,
            searchable: None,
            ip: None,
            committed: None,
            segment: None,
            size: None,
        }
    }
}