aws_sdk_cloud9/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)]
5pub struct UpdateEnvironmentInput {
6 /// <p>The ID of the environment to change settings.</p>
7 pub environment_id: ::std::option::Option<::std::string::String>,
8 /// <p>A replacement name for the environment.</p>
9 pub name: ::std::option::Option<::std::string::String>,
10 /// <p>Any new or replacement description for the environment.</p>
11 pub description: ::std::option::Option<::std::string::String>,
12 /// <p>Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:</p>
13 /// <ul>
14 /// <li>
15 /// <p><code>ENABLE</code></p></li>
16 /// <li>
17 /// <p><code>DISABLE</code></p></li>
18 /// </ul><note>
19 /// <p>Only the environment owner can change the status of managed temporary credentials. An <code>AccessDeniedException</code> is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that's not the environment owner.</p>
20 /// </note>
21 pub managed_credentials_action: ::std::option::Option<crate::types::ManagedCredentialsAction>,
22}
23impl UpdateEnvironmentInput {
24 /// <p>The ID of the environment to change settings.</p>
25 pub fn environment_id(&self) -> ::std::option::Option<&str> {
26 self.environment_id.as_deref()
27 }
28 /// <p>A replacement name for the environment.</p>
29 pub fn name(&self) -> ::std::option::Option<&str> {
30 self.name.as_deref()
31 }
32 /// <p>Any new or replacement description for the environment.</p>
33 pub fn description(&self) -> ::std::option::Option<&str> {
34 self.description.as_deref()
35 }
36 /// <p>Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:</p>
37 /// <ul>
38 /// <li>
39 /// <p><code>ENABLE</code></p></li>
40 /// <li>
41 /// <p><code>DISABLE</code></p></li>
42 /// </ul><note>
43 /// <p>Only the environment owner can change the status of managed temporary credentials. An <code>AccessDeniedException</code> is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that's not the environment owner.</p>
44 /// </note>
45 pub fn managed_credentials_action(&self) -> ::std::option::Option<&crate::types::ManagedCredentialsAction> {
46 self.managed_credentials_action.as_ref()
47 }
48}
49impl ::std::fmt::Debug for UpdateEnvironmentInput {
50 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
51 let mut formatter = f.debug_struct("UpdateEnvironmentInput");
52 formatter.field("environment_id", &self.environment_id);
53 formatter.field("name", &self.name);
54 formatter.field("description", &"*** Sensitive Data Redacted ***");
55 formatter.field("managed_credentials_action", &self.managed_credentials_action);
56 formatter.finish()
57 }
58}
59impl UpdateEnvironmentInput {
60 /// Creates a new builder-style object to manufacture [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
61 pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
62 crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder::default()
63 }
64}
65
66/// A builder for [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
68#[non_exhaustive]
69pub struct UpdateEnvironmentInputBuilder {
70 pub(crate) environment_id: ::std::option::Option<::std::string::String>,
71 pub(crate) name: ::std::option::Option<::std::string::String>,
72 pub(crate) description: ::std::option::Option<::std::string::String>,
73 pub(crate) managed_credentials_action: ::std::option::Option<crate::types::ManagedCredentialsAction>,
74}
75impl UpdateEnvironmentInputBuilder {
76 /// <p>The ID of the environment to change settings.</p>
77 /// This field is required.
78 pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.environment_id = ::std::option::Option::Some(input.into());
80 self
81 }
82 /// <p>The ID of the environment to change settings.</p>
83 pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.environment_id = input;
85 self
86 }
87 /// <p>The ID of the environment to change settings.</p>
88 pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
89 &self.environment_id
90 }
91 /// <p>A replacement name for the environment.</p>
92 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93 self.name = ::std::option::Option::Some(input.into());
94 self
95 }
96 /// <p>A replacement name for the environment.</p>
97 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98 self.name = input;
99 self
100 }
101 /// <p>A replacement name for the environment.</p>
102 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
103 &self.name
104 }
105 /// <p>Any new or replacement description for the environment.</p>
106 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107 self.description = ::std::option::Option::Some(input.into());
108 self
109 }
110 /// <p>Any new or replacement description for the environment.</p>
111 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112 self.description = input;
113 self
114 }
115 /// <p>Any new or replacement description for the environment.</p>
116 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
117 &self.description
118 }
119 /// <p>Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:</p>
120 /// <ul>
121 /// <li>
122 /// <p><code>ENABLE</code></p></li>
123 /// <li>
124 /// <p><code>DISABLE</code></p></li>
125 /// </ul><note>
126 /// <p>Only the environment owner can change the status of managed temporary credentials. An <code>AccessDeniedException</code> is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that's not the environment owner.</p>
127 /// </note>
128 pub fn managed_credentials_action(mut self, input: crate::types::ManagedCredentialsAction) -> Self {
129 self.managed_credentials_action = ::std::option::Option::Some(input);
130 self
131 }
132 /// <p>Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:</p>
133 /// <ul>
134 /// <li>
135 /// <p><code>ENABLE</code></p></li>
136 /// <li>
137 /// <p><code>DISABLE</code></p></li>
138 /// </ul><note>
139 /// <p>Only the environment owner can change the status of managed temporary credentials. An <code>AccessDeniedException</code> is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that's not the environment owner.</p>
140 /// </note>
141 pub fn set_managed_credentials_action(mut self, input: ::std::option::Option<crate::types::ManagedCredentialsAction>) -> Self {
142 self.managed_credentials_action = input;
143 self
144 }
145 /// <p>Allows the environment owner to turn on or turn off the Amazon Web Services managed temporary credentials for an Cloud9 environment by using one of the following values:</p>
146 /// <ul>
147 /// <li>
148 /// <p><code>ENABLE</code></p></li>
149 /// <li>
150 /// <p><code>DISABLE</code></p></li>
151 /// </ul><note>
152 /// <p>Only the environment owner can change the status of managed temporary credentials. An <code>AccessDeniedException</code> is thrown if an attempt to turn on or turn off managed temporary credentials is made by an account that's not the environment owner.</p>
153 /// </note>
154 pub fn get_managed_credentials_action(&self) -> &::std::option::Option<crate::types::ManagedCredentialsAction> {
155 &self.managed_credentials_action
156 }
157 /// Consumes the builder and constructs a [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
158 pub fn build(
159 self,
160 ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
161 ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentInput {
162 environment_id: self.environment_id,
163 name: self.name,
164 description: self.description,
165 managed_credentials_action: self.managed_credentials_action,
166 })
167 }
168}
169impl ::std::fmt::Debug for UpdateEnvironmentInputBuilder {
170 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
171 let mut formatter = f.debug_struct("UpdateEnvironmentInputBuilder");
172 formatter.field("environment_id", &self.environment_id);
173 formatter.field("name", &self.name);
174 formatter.field("description", &"*** Sensitive Data Redacted ***");
175 formatter.field("managed_credentials_action", &self.managed_credentials_action);
176 formatter.finish()
177 }
178}