aws_sdk_kafka/operation/reboot_broker/
_reboot_broker_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Reboots a node.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RebootBrokerInput {
7    /// <p>The list of broker IDs to be rebooted. The reboot-broker operation supports rebooting one broker at a time.</p>
8    pub broker_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9    /// <p>The Amazon Resource Name (ARN) of the cluster to be updated.</p>
10    pub cluster_arn: ::std::option::Option<::std::string::String>,
11}
12impl RebootBrokerInput {
13    /// <p>The list of broker IDs to be rebooted. The reboot-broker operation supports rebooting one broker at a time.</p>
14    ///
15    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.broker_ids.is_none()`.
16    pub fn broker_ids(&self) -> &[::std::string::String] {
17        self.broker_ids.as_deref().unwrap_or_default()
18    }
19    /// <p>The Amazon Resource Name (ARN) of the cluster to be updated.</p>
20    pub fn cluster_arn(&self) -> ::std::option::Option<&str> {
21        self.cluster_arn.as_deref()
22    }
23}
24impl RebootBrokerInput {
25    /// Creates a new builder-style object to manufacture [`RebootBrokerInput`](crate::operation::reboot_broker::RebootBrokerInput).
26    pub fn builder() -> crate::operation::reboot_broker::builders::RebootBrokerInputBuilder {
27        crate::operation::reboot_broker::builders::RebootBrokerInputBuilder::default()
28    }
29}
30
31/// A builder for [`RebootBrokerInput`](crate::operation::reboot_broker::RebootBrokerInput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct RebootBrokerInputBuilder {
35    pub(crate) broker_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36    pub(crate) cluster_arn: ::std::option::Option<::std::string::String>,
37}
38impl RebootBrokerInputBuilder {
39    /// Appends an item to `broker_ids`.
40    ///
41    /// To override the contents of this collection use [`set_broker_ids`](Self::set_broker_ids).
42    ///
43    /// <p>The list of broker IDs to be rebooted. The reboot-broker operation supports rebooting one broker at a time.</p>
44    pub fn broker_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        let mut v = self.broker_ids.unwrap_or_default();
46        v.push(input.into());
47        self.broker_ids = ::std::option::Option::Some(v);
48        self
49    }
50    /// <p>The list of broker IDs to be rebooted. The reboot-broker operation supports rebooting one broker at a time.</p>
51    pub fn set_broker_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
52        self.broker_ids = input;
53        self
54    }
55    /// <p>The list of broker IDs to be rebooted. The reboot-broker operation supports rebooting one broker at a time.</p>
56    pub fn get_broker_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
57        &self.broker_ids
58    }
59    /// <p>The Amazon Resource Name (ARN) of the cluster to be updated.</p>
60    /// This field is required.
61    pub fn cluster_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.cluster_arn = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The Amazon Resource Name (ARN) of the cluster to be updated.</p>
66    pub fn set_cluster_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.cluster_arn = input;
68        self
69    }
70    /// <p>The Amazon Resource Name (ARN) of the cluster to be updated.</p>
71    pub fn get_cluster_arn(&self) -> &::std::option::Option<::std::string::String> {
72        &self.cluster_arn
73    }
74    /// Consumes the builder and constructs a [`RebootBrokerInput`](crate::operation::reboot_broker::RebootBrokerInput).
75    pub fn build(
76        self,
77    ) -> ::std::result::Result<crate::operation::reboot_broker::RebootBrokerInput, ::aws_smithy_types::error::operation::BuildError> {
78        ::std::result::Result::Ok(crate::operation::reboot_broker::RebootBrokerInput {
79            broker_ids: self.broker_ids,
80            cluster_arn: self.cluster_arn,
81        })
82    }
83}