Skip to main content

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