aws_sdk_datazone/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 identifier of the domain in which the environment is to be updated.</p>
7    pub domain_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the environment that is to be updated.</p>
9    pub identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The name to be updated as part of the <code>UpdateEnvironment</code> action.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The description to be updated as part of the <code>UpdateEnvironment</code> action.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The glossary terms to be updated as part of the <code>UpdateEnvironment</code> action.</p>
15    pub glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16}
17impl UpdateEnvironmentInput {
18    /// <p>The identifier of the domain in which the environment is to be updated.</p>
19    pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
20        self.domain_identifier.as_deref()
21    }
22    /// <p>The identifier of the environment that is to be updated.</p>
23    pub fn identifier(&self) -> ::std::option::Option<&str> {
24        self.identifier.as_deref()
25    }
26    /// <p>The name to be updated as part of the <code>UpdateEnvironment</code> action.</p>
27    pub fn name(&self) -> ::std::option::Option<&str> {
28        self.name.as_deref()
29    }
30    /// <p>The description to be updated as part of the <code>UpdateEnvironment</code> action.</p>
31    pub fn description(&self) -> ::std::option::Option<&str> {
32        self.description.as_deref()
33    }
34    /// <p>The glossary terms to be updated as part of the <code>UpdateEnvironment</code> action.</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 `.glossary_terms.is_none()`.
37    pub fn glossary_terms(&self) -> &[::std::string::String] {
38        self.glossary_terms.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) domain_identifier: ::std::option::Option<::std::string::String>,
53    pub(crate) identifier: ::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) glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
57}
58impl UpdateEnvironmentInputBuilder {
59    /// <p>The identifier of the domain in which the environment is to be updated.</p>
60    /// This field is required.
61    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.domain_identifier = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The identifier of the domain in which the environment is to be updated.</p>
66    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.domain_identifier = input;
68        self
69    }
70    /// <p>The identifier of the domain in which the environment is to be updated.</p>
71    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
72        &self.domain_identifier
73    }
74    /// <p>The identifier of the environment that is to be updated.</p>
75    /// This field is required.
76    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.identifier = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The identifier of the environment that is to be updated.</p>
81    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.identifier = input;
83        self
84    }
85    /// <p>The identifier of the environment that is to be updated.</p>
86    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
87        &self.identifier
88    }
89    /// <p>The name to be updated as part of the <code>UpdateEnvironment</code> action.</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 to be updated as part of the <code>UpdateEnvironment</code> action.</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 to be updated as part of the <code>UpdateEnvironment</code> action.</p>
100    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
101        &self.name
102    }
103    /// <p>The description to be updated as part of the <code>UpdateEnvironment</code> action.</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>The description to be updated as part of the <code>UpdateEnvironment</code> action.</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>The description to be updated as part of the <code>UpdateEnvironment</code> action.</p>
114    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
115        &self.description
116    }
117    /// Appends an item to `glossary_terms`.
118    ///
119    /// To override the contents of this collection use [`set_glossary_terms`](Self::set_glossary_terms).
120    ///
121    /// <p>The glossary terms to be updated as part of the <code>UpdateEnvironment</code> action.</p>
122    pub fn glossary_terms(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        let mut v = self.glossary_terms.unwrap_or_default();
124        v.push(input.into());
125        self.glossary_terms = ::std::option::Option::Some(v);
126        self
127    }
128    /// <p>The glossary terms to be updated as part of the <code>UpdateEnvironment</code> action.</p>
129    pub fn set_glossary_terms(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
130        self.glossary_terms = input;
131        self
132    }
133    /// <p>The glossary terms to be updated as part of the <code>UpdateEnvironment</code> action.</p>
134    pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
135        &self.glossary_terms
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            domain_identifier: self.domain_identifier,
143            identifier: self.identifier,
144            name: self.name,
145            description: self.description,
146            glossary_terms: self.glossary_terms,
147        })
148    }
149}