aws-sdk-appconfig 1.100.0

AWS SDK for Amazon AppConfig
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateEnvironmentInput {
    /// <p>The application ID.</p>
    pub application_id: ::std::option::Option<::std::string::String>,
    /// <p>The environment ID.</p>
    pub environment_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the environment.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the environment.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
    pub monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
}
impl UpdateEnvironmentInput {
    /// <p>The application ID.</p>
    pub fn application_id(&self) -> ::std::option::Option<&str> {
        self.application_id.as_deref()
    }
    /// <p>The environment ID.</p>
    pub fn environment_id(&self) -> ::std::option::Option<&str> {
        self.environment_id.as_deref()
    }
    /// <p>The name of the environment.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the environment.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
    ///
    /// 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()`.
    pub fn monitors(&self) -> &[crate::types::Monitor] {
        self.monitors.as_deref().unwrap_or_default()
    }
}
impl UpdateEnvironmentInput {
    /// Creates a new builder-style object to manufacture [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
    pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder {
        crate::operation::update_environment::builders::UpdateEnvironmentInputBuilder::default()
    }
}

/// A builder for [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateEnvironmentInputBuilder {
    pub(crate) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
}
impl UpdateEnvironmentInputBuilder {
    /// <p>The application ID.</p>
    /// This field is required.
    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.application_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The application ID.</p>
    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.application_id = input;
        self
    }
    /// <p>The application ID.</p>
    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.application_id
    }
    /// <p>The environment ID.</p>
    /// This field is required.
    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The environment ID.</p>
    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_id = input;
        self
    }
    /// <p>The environment ID.</p>
    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_id
    }
    /// <p>The name of the environment.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the environment.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the environment.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the environment.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the environment.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the environment.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `monitors`.
    ///
    /// To override the contents of this collection use [`set_monitors`](Self::set_monitors).
    ///
    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
    pub fn monitors(mut self, input: crate::types::Monitor) -> Self {
        let mut v = self.monitors.unwrap_or_default();
        v.push(input);
        self.monitors = ::std::option::Option::Some(v);
        self
    }
    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
    pub fn set_monitors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>) -> Self {
        self.monitors = input;
        self
    }
    /// <p>Amazon CloudWatch alarms to monitor during the deployment process.</p>
    pub fn get_monitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Monitor>> {
        &self.monitors
    }
    /// Consumes the builder and constructs a [`UpdateEnvironmentInput`](crate::operation::update_environment::UpdateEnvironmentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentInput {
            application_id: self.application_id,
            environment_id: self.environment_id,
            name: self.name,
            description: self.description,
            monitors: self.monitors,
        })
    }
}