Skip to main content

opensearch_client/cluster/reroute/
command.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::cluster;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Command {
16    #[serde(
17        rename = "allocate_replica",
18        default,
19        skip_serializing_if = "Option::is_none"
20    )]
21    pub allocate_replica: Option<cluster::reroute::CommandAllocateReplicaAction>,
22    #[serde(rename = "move", default, skip_serializing_if = "Option::is_none")]
23    pub r#move: Option<cluster::reroute::CommandMoveAction>,
24    #[serde(
25        rename = "allocate_stale_primary",
26        default,
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub allocate_stale_primary: Option<cluster::reroute::CommandAllocatePrimaryAction>,
30    #[serde(
31        rename = "allocate_empty_primary",
32        default,
33        skip_serializing_if = "Option::is_none"
34    )]
35    pub allocate_empty_primary: Option<cluster::reroute::CommandAllocatePrimaryAction>,
36    #[serde(rename = "cancel", default, skip_serializing_if = "Option::is_none")]
37    pub cancel: Option<cluster::reroute::CommandCancelAction>,
38}
39
40impl Command {
41    pub fn new() -> Command {
42        Command {
43            allocate_replica: None,
44            r#move: None,
45            allocate_stale_primary: None,
46            allocate_empty_primary: None,
47            cancel: None,
48        }
49    }
50}