aws_sdk_route53recoveryreadiness/operation/update_recovery_group/
_update_recovery_group_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Name of a recovery group.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateRecoveryGroupInput {
7    /// <p>A list of cell Amazon Resource Names (ARNs). This list completely replaces the previous list.</p>
8    pub cells: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
9    /// <p>The name of a recovery group.</p>
10    pub recovery_group_name: ::std::option::Option<::std::string::String>,
11}
12impl UpdateRecoveryGroupInput {
13    /// <p>A list of cell Amazon Resource Names (ARNs). This list completely replaces the previous list.</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 `.cells.is_none()`.
16    pub fn cells(&self) -> &[::std::string::String] {
17        self.cells.as_deref().unwrap_or_default()
18    }
19    /// <p>The name of a recovery group.</p>
20    pub fn recovery_group_name(&self) -> ::std::option::Option<&str> {
21        self.recovery_group_name.as_deref()
22    }
23}
24impl UpdateRecoveryGroupInput {
25    /// Creates a new builder-style object to manufacture [`UpdateRecoveryGroupInput`](crate::operation::update_recovery_group::UpdateRecoveryGroupInput).
26    pub fn builder() -> crate::operation::update_recovery_group::builders::UpdateRecoveryGroupInputBuilder {
27        crate::operation::update_recovery_group::builders::UpdateRecoveryGroupInputBuilder::default()
28    }
29}
30
31/// A builder for [`UpdateRecoveryGroupInput`](crate::operation::update_recovery_group::UpdateRecoveryGroupInput).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct UpdateRecoveryGroupInputBuilder {
35    pub(crate) cells: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36    pub(crate) recovery_group_name: ::std::option::Option<::std::string::String>,
37}
38impl UpdateRecoveryGroupInputBuilder {
39    /// Appends an item to `cells`.
40    ///
41    /// To override the contents of this collection use [`set_cells`](Self::set_cells).
42    ///
43    /// <p>A list of cell Amazon Resource Names (ARNs). This list completely replaces the previous list.</p>
44    pub fn cells(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        let mut v = self.cells.unwrap_or_default();
46        v.push(input.into());
47        self.cells = ::std::option::Option::Some(v);
48        self
49    }
50    /// <p>A list of cell Amazon Resource Names (ARNs). This list completely replaces the previous list.</p>
51    pub fn set_cells(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
52        self.cells = input;
53        self
54    }
55    /// <p>A list of cell Amazon Resource Names (ARNs). This list completely replaces the previous list.</p>
56    pub fn get_cells(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
57        &self.cells
58    }
59    /// <p>The name of a recovery group.</p>
60    /// This field is required.
61    pub fn recovery_group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.recovery_group_name = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The name of a recovery group.</p>
66    pub fn set_recovery_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.recovery_group_name = input;
68        self
69    }
70    /// <p>The name of a recovery group.</p>
71    pub fn get_recovery_group_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.recovery_group_name
73    }
74    /// Consumes the builder and constructs a [`UpdateRecoveryGroupInput`](crate::operation::update_recovery_group::UpdateRecoveryGroupInput).
75    pub fn build(
76        self,
77    ) -> ::std::result::Result<crate::operation::update_recovery_group::UpdateRecoveryGroupInput, ::aws_smithy_types::error::operation::BuildError>
78    {
79        ::std::result::Result::Ok(crate::operation::update_recovery_group::UpdateRecoveryGroupInput {
80            cells: self.cells,
81            recovery_group_name: self.recovery_group_name,
82        })
83    }
84}