Skip to main content

opensearch_client/common/
bulk_by_scroll_task_status.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 serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct BulkByScrollTaskStatus {
16    /// The number of requests per second effectively executed during the reindex operation.
17    #[serde(rename = "requests_per_second")]
18    pub requests_per_second: f64,
19    /// The number of documents that were successfully processed.
20    #[serde(rename = "total")]
21    pub total: u32,
22    /// The number of documents that were successfully deleted.
23    #[serde(rename = "deleted")]
24    pub deleted: u32,
25    /// The number of documents that were successfully updated after the reindex operation.
26    #[serde(rename = "updated", default, skip_serializing_if = "Option::is_none")]
27    pub updated: Option<u32>,
28    /// The number of documents that were successfully created.
29    #[serde(rename = "created", default, skip_serializing_if = "Option::is_none")]
30    pub created: Option<u32>,
31    #[serde(rename = "retries")]
32    pub retries: common::Retries,
33    /// The number of version conflicts encountered by the reindex operation.
34    #[serde(rename = "version_conflicts")]
35    pub version_conflicts: u32,
36    #[serde(rename = "canceled", default, skip_serializing_if = "Option::is_none")]
37    pub canceled: Option<String>,
38    #[serde(rename = "throttled_millis")]
39    pub throttled_millis: String,
40    #[serde(rename = "throttled_until_millis")]
41    pub throttled_until_millis: String,
42    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
43    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
44    #[serde(rename = "throttled", default, skip_serializing_if = "Option::is_none")]
45    pub throttled: Option<String>,
46    /// The number of scroll responses pulled back by the reindex operation.
47    #[serde(rename = "batches")]
48    pub batches: u32,
49    /// The number of documents that were ignored.
50    #[serde(rename = "noops")]
51    pub noops: u32,
52    #[serde(rename = "slice_id", default, skip_serializing_if = "Option::is_none")]
53    pub slice_id: Option<u32>,
54    #[serde(rename = "slices", default, skip_serializing_if = "Option::is_none")]
55    pub slices: Option<Vec<common::BulkByScrollTaskStatusOrException>>,
56    /// A duration. Units can be `nanos`, `micros`, `ms` (milliseconds), `s` (seconds), `m` (minutes), `h` (hours) and
57    /// `d` (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.
58    #[serde(
59        rename = "throttled_until",
60        default,
61        skip_serializing_if = "Option::is_none"
62    )]
63    pub throttled_until: Option<String>,
64}
65
66impl BulkByScrollTaskStatus {
67    pub fn new(
68        requests_per_second: f64,
69        total: u32,
70        deleted: u32,
71        retries: common::Retries,
72        version_conflicts: u32,
73        throttled_millis: String,
74        throttled_until_millis: String,
75        batches: u32,
76        noops: u32,
77    ) -> BulkByScrollTaskStatus {
78        BulkByScrollTaskStatus {
79            requests_per_second,
80            total,
81            deleted,
82            updated: None,
83            created: None,
84            retries,
85            version_conflicts,
86            canceled: None,
87            throttled_millis,
88            throttled_until_millis,
89            throttled: None,
90            batches,
91            noops,
92            slice_id: None,
93            slices: None,
94            throttled_until: None,
95        }
96    }
97}