aws_sdk_mq/operation/promote/
_promote_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PromoteInput {
7 pub broker_id: ::std::option::Option<::std::string::String>,
9 pub mode: ::std::option::Option<crate::types::PromoteMode>,
11}
12impl PromoteInput {
13 pub fn broker_id(&self) -> ::std::option::Option<&str> {
15 self.broker_id.as_deref()
16 }
17 pub fn mode(&self) -> ::std::option::Option<&crate::types::PromoteMode> {
19 self.mode.as_ref()
20 }
21}
22impl PromoteInput {
23 pub fn builder() -> crate::operation::promote::builders::PromoteInputBuilder {
25 crate::operation::promote::builders::PromoteInputBuilder::default()
26 }
27}
28
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct PromoteInputBuilder {
33 pub(crate) broker_id: ::std::option::Option<::std::string::String>,
34 pub(crate) mode: ::std::option::Option<crate::types::PromoteMode>,
35}
36impl PromoteInputBuilder {
37 pub fn broker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
40 self.broker_id = ::std::option::Option::Some(input.into());
41 self
42 }
43 pub fn set_broker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45 self.broker_id = input;
46 self
47 }
48 pub fn get_broker_id(&self) -> &::std::option::Option<::std::string::String> {
50 &self.broker_id
51 }
52 pub fn mode(mut self, input: crate::types::PromoteMode) -> Self {
55 self.mode = ::std::option::Option::Some(input);
56 self
57 }
58 pub fn set_mode(mut self, input: ::std::option::Option<crate::types::PromoteMode>) -> Self {
60 self.mode = input;
61 self
62 }
63 pub fn get_mode(&self) -> &::std::option::Option<crate::types::PromoteMode> {
65 &self.mode
66 }
67 pub fn build(self) -> ::std::result::Result<crate::operation::promote::PromoteInput, ::aws_smithy_types::error::operation::BuildError> {
69 ::std::result::Result::Ok(crate::operation::promote::PromoteInput {
70 broker_id: self.broker_id,
71 mode: self.mode,
72 })
73 }
74}