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