aws-sdk-appconfig 1.103.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 Environment {
    /// <p>The application ID.</p>
    pub application_id: ::std::option::Option<::std::string::String>,
    /// <p>The environment ID.</p>
    pub id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the environment.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The description of the environment.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
    pub state: ::std::option::Option<crate::types::EnvironmentState>,
    /// <p>Amazon CloudWatch alarms monitored during the deployment.</p>
    pub monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
}
impl Environment {
    /// <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 id(&self) -> ::std::option::Option<&str> {
        self.id.as_deref()
    }
    /// <p>The name of the environment.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The description of the environment.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::EnvironmentState> {
        self.state.as_ref()
    }
    /// <p>Amazon CloudWatch alarms monitored during the deployment.</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 Environment {
    /// Creates a new builder-style object to manufacture [`Environment`](crate::types::Environment).
    pub fn builder() -> crate::types::builders::EnvironmentBuilder {
        crate::types::builders::EnvironmentBuilder::default()
    }
}

/// A builder for [`Environment`](crate::types::Environment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct EnvironmentBuilder {
    pub(crate) application_id: ::std::option::Option<::std::string::String>,
    pub(crate) 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) state: ::std::option::Option<crate::types::EnvironmentState>,
    pub(crate) monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
}
impl EnvironmentBuilder {
    /// <p>The application ID.</p>
    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>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The environment ID.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The environment ID.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.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>The 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>The description of the environment.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the environment.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
    pub fn state(mut self, input: crate::types::EnvironmentState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::EnvironmentState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::EnvironmentState> {
        &self.state
    }
    /// Appends an item to `monitors`.
    ///
    /// To override the contents of this collection use [`set_monitors`](Self::set_monitors).
    ///
    /// <p>Amazon CloudWatch alarms monitored during the deployment.</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 monitored during the deployment.</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 monitored during the deployment.</p>
    pub fn get_monitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Monitor>> {
        &self.monitors
    }
    /// Consumes the builder and constructs a [`Environment`](crate::types::Environment).
    pub fn build(self) -> crate::types::Environment {
        crate::types::Environment {
            application_id: self.application_id,
            id: self.id,
            name: self.name,
            description: self.description,
            state: self.state,
            monitors: self.monitors,
        }
    }
}