aws_sdk_appconfig/operation/update_environment/
_update_environment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateEnvironmentInput {
6    /// <p>The application ID.</p>
7    pub application_id: ::std::option::Option<::std::string::String>,
8    /// <p>The environment ID.</p>
9    pub environment_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the environment.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>A description of the environment.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
15    pub monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
16}
17impl UpdateEnvironmentInput {
18    /// <p>The application ID.</p>
19    pub fn application_id(&self) -> ::std::option::Option<&str> {
20        self.application_id.as_deref()
21    }
22    /// <p>The environment ID.</p>
23    pub fn environment_id(&self) -> ::std::option::Option<&str> {
24        self.environment_id.as_deref()
25    }
26    /// <p>The name of the environment.</p>
27    pub fn name(&self) -> ::std::option::Option<&str> {
28        self.name.as_deref()
29    }
30    /// <p>A description of the environment.</p>
31    pub fn description(&self) -> ::std::option::Option<&str> {
32        self.description.as_deref()
33    }
34    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
35    ///
36    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.monitors.is_none()`.
37    pub fn monitors(&self) -> &[crate::types::Monitor] {
38        self.monitors.as_deref().unwrap_or_default()
39    }
40}
41impl UpdateEnvironmentInput {
42    /// Creates a new builder-style object to manufacture [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
43    pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
44        crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder::default()
45    }
46}
47
48/// A builder for [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct UpdateEnvironmentInputBuilder {
52    pub(crate) application_id: ::std::option::Option<::std::string::String>,
53    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
54    pub(crate) name: ::std::option::Option<::std::string::String>,
55    pub(crate) description: ::std::option::Option<::std::string::String>,
56    pub(crate) monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
57}
58impl UpdateEnvironmentInputBuilder {
59    /// <p>The application ID.</p>
60    /// This field is required.
61    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.application_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The application ID.</p>
66    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.application_id = input;
68        self
69    }
70    /// <p>The application ID.</p>
71    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.application_id
73    }
74    /// <p>The environment ID.</p>
75    /// This field is required.
76    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.environment_id = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The environment ID.</p>
81    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.environment_id = input;
83        self
84    }
85    /// <p>The environment ID.</p>
86    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
87        &self.environment_id
88    }
89    /// <p>The name of the environment.</p>
90    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.name = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The name of the environment.</p>
95    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.name = input;
97        self
98    }
99    /// <p>The name of the environment.</p>
100    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.name
102    }
103    /// <p>A description of the environment.</p>
104    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.description = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>A description of the environment.</p>
109    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.description = input;
111        self
112    }
113    /// <p>A description of the environment.</p>
114    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
115        &self.description
116    }
117    /// Appends an item to `monitors`.
118    ///
119    /// To override the contents of this collection use [`set_monitors`](Self::set_monitors).
120    ///
121    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
122    pub fn monitors(mut self, input: crate::types::Monitor) -> Self {
123        let mut v = self.monitors.unwrap_or_default();
124        v.push(input);
125        self.monitors = ::std::option::Option::Some(v);
126        self
127    }
128    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
129    pub fn set_monitors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>) -> Self {
130        self.monitors = input;
131        self
132    }
133    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
134    pub fn get_monitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Monitor>> {
135        &self.monitors
136    }
137    /// Consumes the builder and constructs a [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
138    pub fn build(
139        self,
140    ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
141        ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentInput {
142            application_id: self.application_id,
143            environment_id: self.environment_id,
144            name: self.name,
145            description: self.description,
146            monitors: self.monitors,
147        })
148    }
149}