aws-sdk-amplifygen3 1.0.0

AWS SDK for AWS Amplify Gen 3
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 PutEnvironmentVariablesInput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the environment.</p>
    pub environment_name: ::std::option::Option<::std::string::String>,
    /// <p>The environment variables.</p>
    pub environment_variables: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariableInput>>,
}
impl PutEnvironmentVariablesInput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> ::std::option::Option<&str> {
        self.app_name.as_deref()
    }
    /// <p>The name of the environment.</p>
    pub fn environment_name(&self) -> ::std::option::Option<&str> {
        self.environment_name.as_deref()
    }
    /// <p>The environment variables.</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 `.environment_variables.is_none()`.
    pub fn environment_variables(&self) -> &[crate::types::EnvironmentVariableInput] {
        self.environment_variables.as_deref().unwrap_or_default()
    }
}
impl PutEnvironmentVariablesInput {
    /// Creates a new builder-style object to manufacture [`PutEnvironmentVariablesInput`](crate::operation::put_environment_variables::PutEnvironmentVariablesInput).
    pub fn builder() -> crate::operation::put_environment_variables::builders::PutEnvironmentVariablesInputBuilder {
        crate::operation::put_environment_variables::builders::PutEnvironmentVariablesInputBuilder::default()
    }
}

/// A builder for [`PutEnvironmentVariablesInput`](crate::operation::put_environment_variables::PutEnvironmentVariablesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutEnvironmentVariablesInputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_variables: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariableInput>>,
}
impl PutEnvironmentVariablesInputBuilder {
    /// <p>The name of the app.</p>
    /// This field is required.
    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the app.</p>
    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_name = input;
        self
    }
    /// <p>The name of the app.</p>
    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_name
    }
    /// <p>The name of the environment.</p>
    /// This field is required.
    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the environment.</p>
    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_name = input;
        self
    }
    /// <p>The name of the environment.</p>
    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_name
    }
    /// Appends an item to `environment_variables`.
    ///
    /// To override the contents of this collection use [`set_environment_variables`](Self::set_environment_variables).
    ///
    /// <p>The environment variables.</p>
    pub fn environment_variables(mut self, input: crate::types::EnvironmentVariableInput) -> Self {
        let mut v = self.environment_variables.unwrap_or_default();
        v.push(input);
        self.environment_variables = ::std::option::Option::Some(v);
        self
    }
    /// <p>The environment variables.</p>
    pub fn set_environment_variables(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariableInput>>) -> Self {
        self.environment_variables = input;
        self
    }
    /// <p>The environment variables.</p>
    pub fn get_environment_variables(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnvironmentVariableInput>> {
        &self.environment_variables
    }
    /// Consumes the builder and constructs a [`PutEnvironmentVariablesInput`](crate::operation::put_environment_variables::PutEnvironmentVariablesInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::put_environment_variables::PutEnvironmentVariablesInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::put_environment_variables::PutEnvironmentVariablesInput {
            app_name: self.app_name,
            environment_name: self.environment_name,
            environment_variables: self.environment_variables,
        })
    }
}