Skip to main content

aws_sdk_continuum/operation/update_environment/
_update_environment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Specifies the mutable environment properties. Supply a name or a change under configuration.codeConfiguration. Its sourceConfiguration.s3Sources and sourceConfiguration.repositorySources replace the S3 source and repository selections. Its environmentConfiguration has patch semantics: omitted members preserve stored values, scanFrequency updates scan cadence, and network and patchCreationPolicy replace the corresponding policies.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateEnvironmentInput {
7    /// The unique identifier of the environment to update.
8    pub environment_id: ::std::option::Option<::std::string::String>,
9    /// The new customer-visible name.
10    pub name: ::std::option::Option<::std::string::String>,
11    /// Type-specific configuration changes. Omission preserves the configuration.
12    pub configuration: ::std::option::Option<crate::types::UpdateEnvironmentConfiguration>,
13}
14impl UpdateEnvironmentInput {
15    /// The unique identifier of the environment to update.
16    pub fn environment_id(&self) -> ::std::option::Option<&str> {
17        self.environment_id.as_deref()
18    }
19    /// The new customer-visible name.
20    pub fn name(&self) -> ::std::option::Option<&str> {
21        self.name.as_deref()
22    }
23    /// Type-specific configuration changes. Omission preserves the configuration.
24    pub fn configuration(&self) -> ::std::option::Option<&crate::types::UpdateEnvironmentConfiguration> {
25        self.configuration.as_ref()
26    }
27}
28impl UpdateEnvironmentInput {
29    /// Creates a new builder-style object to manufacture [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
30    pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
31        crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder::default()
32    }
33}
34
35/// A builder for [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct UpdateEnvironmentInputBuilder {
39    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
40    pub(crate) name: ::std::option::Option<::std::string::String>,
41    pub(crate) configuration: ::std::option::Option<crate::types::UpdateEnvironmentConfiguration>,
42}
43impl UpdateEnvironmentInputBuilder {
44    /// The unique identifier of the environment to update.
45    /// This field is required.
46    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
47        self.environment_id = ::std::option::Option::Some(input.into());
48        self
49    }
50    /// The unique identifier of the environment to update.
51    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
52        self.environment_id = input;
53        self
54    }
55    /// The unique identifier of the environment to update.
56    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
57        &self.environment_id
58    }
59    /// The new customer-visible name.
60    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.name = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// The new customer-visible name.
65    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.name = input;
67        self
68    }
69    /// The new customer-visible name.
70    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
71        &self.name
72    }
73    /// Type-specific configuration changes. Omission preserves the configuration.
74    pub fn configuration(mut self, input: crate::types::UpdateEnvironmentConfiguration) -> Self {
75        self.configuration = ::std::option::Option::Some(input);
76        self
77    }
78    /// Type-specific configuration changes. Omission preserves the configuration.
79    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::UpdateEnvironmentConfiguration>) -> Self {
80        self.configuration = input;
81        self
82    }
83    /// Type-specific configuration changes. Omission preserves the configuration.
84    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::UpdateEnvironmentConfiguration> {
85        &self.configuration
86    }
87    /// Consumes the builder and constructs a [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentInput {
92            environment_id: self.environment_id,
93            name: self.name,
94            configuration: self.configuration,
95        })
96    }
97}