aws_sdk_mq/operation/promote/
_promote_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Promotes a data replication replica broker to the primary broker role.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PromoteInput {
7    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
8    pub broker_id: ::std::option::Option<::std::string::String>,
9    /// <p>The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.</p>
10    pub mode: ::std::option::Option<crate::types::PromoteMode>,
11}
12impl PromoteInput {
13    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
14    pub fn broker_id(&self) -> ::std::option::Option<&str> {
15        self.broker_id.as_deref()
16    }
17    /// <p>The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.</p>
18    pub fn mode(&self) -> ::std::option::Option<&crate::types::PromoteMode> {
19        self.mode.as_ref()
20    }
21}
22impl PromoteInput {
23    /// Creates a new builder-style object to manufacture [`PromoteInput`](crate::operation::promote::PromoteInput).
24    pub fn builder() -> crate::operation::promote::builders::PromoteInputBuilder {
25        crate::operation::promote::builders::PromoteInputBuilder::default()
26    }
27}
28
29/// A builder for [`PromoteInput`](crate::operation::promote::PromoteInput).
30#[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    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
38    /// This field is required.
39    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    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
44    pub fn set_broker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
45        self.broker_id = input;
46        self
47    }
48    /// <p>The unique ID that Amazon MQ generates for the broker.</p>
49    pub fn get_broker_id(&self) -> &::std::option::Option<::std::string::String> {
50        &self.broker_id
51    }
52    /// <p>The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.</p>
53    /// This field is required.
54    pub fn mode(mut self, input: crate::types::PromoteMode) -> Self {
55        self.mode = ::std::option::Option::Some(input);
56        self
57    }
58    /// <p>The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.</p>
59    pub fn set_mode(mut self, input: ::std::option::Option<crate::types::PromoteMode>) -> Self {
60        self.mode = input;
61        self
62    }
63    /// <p>The Promote mode requested. Note: Valid values for the parameter are SWITCHOVER, FAILOVER.</p>
64    pub fn get_mode(&self) -> &::std::option::Option<crate::types::PromoteMode> {
65        &self.mode
66    }
67    /// Consumes the builder and constructs a [`PromoteInput`](crate::operation::promote::PromoteInput).
68    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}