aws-sdk-opsworks 0.27.0

AWS SDK for AWS OpsWorks
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 CreateAppInput {
    /// <p>The stack ID.</p>
    #[doc(hidden)]
    pub stack_id: std::option::Option<std::string::String>,
    /// <p>The app's short name.</p>
    #[doc(hidden)]
    pub shortname: std::option::Option<std::string::String>,
    /// <p>The app name.</p>
    #[doc(hidden)]
    pub name: std::option::Option<std::string::String>,
    /// <p>A description of the app.</p>
    #[doc(hidden)]
    pub description: std::option::Option<std::string::String>,
    /// <p>The app's data source.</p>
    #[doc(hidden)]
    pub data_sources: std::option::Option<std::vec::Vec<crate::types::DataSource>>,
    /// <p>The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. AWS OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify <code>other</code>.</p>
    #[doc(hidden)]
    pub r#type: std::option::Option<crate::types::AppType>,
    /// <p>A <code>Source</code> object that specifies the app repository.</p>
    #[doc(hidden)]
    pub app_source: std::option::Option<crate::types::Source>,
    /// <p>The app virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code> </p>
    #[doc(hidden)]
    pub domains: std::option::Option<std::vec::Vec<std::string::String>>,
    /// <p>Whether to enable SSL for the app.</p>
    #[doc(hidden)]
    pub enable_ssl: std::option::Option<bool>,
    /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
    #[doc(hidden)]
    pub ssl_configuration: std::option::Option<crate::types::SslConfiguration>,
    /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
    #[doc(hidden)]
    pub attributes: std::option::Option<
        std::collections::HashMap<crate::types::AppAttributesKeys, std::string::String>,
    >,
    /// <p>An array of <code>EnvironmentVariable</code> objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
    /// <p>There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."</p> <note>
    /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
    /// </note>
    #[doc(hidden)]
    pub environment: std::option::Option<std::vec::Vec<crate::types::EnvironmentVariable>>,
}
impl CreateAppInput {
    /// <p>The stack ID.</p>
    pub fn stack_id(&self) -> std::option::Option<&str> {
        self.stack_id.as_deref()
    }
    /// <p>The app's short name.</p>
    pub fn shortname(&self) -> std::option::Option<&str> {
        self.shortname.as_deref()
    }
    /// <p>The app name.</p>
    pub fn name(&self) -> std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the app.</p>
    pub fn description(&self) -> std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The app's data source.</p>
    pub fn data_sources(&self) -> std::option::Option<&[crate::types::DataSource]> {
        self.data_sources.as_deref()
    }
    /// <p>The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. AWS OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify <code>other</code>.</p>
    pub fn r#type(&self) -> std::option::Option<&crate::types::AppType> {
        self.r#type.as_ref()
    }
    /// <p>A <code>Source</code> object that specifies the app repository.</p>
    pub fn app_source(&self) -> std::option::Option<&crate::types::Source> {
        self.app_source.as_ref()
    }
    /// <p>The app virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code> </p>
    pub fn domains(&self) -> std::option::Option<&[std::string::String]> {
        self.domains.as_deref()
    }
    /// <p>Whether to enable SSL for the app.</p>
    pub fn enable_ssl(&self) -> std::option::Option<bool> {
        self.enable_ssl
    }
    /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
    pub fn ssl_configuration(&self) -> std::option::Option<&crate::types::SslConfiguration> {
        self.ssl_configuration.as_ref()
    }
    /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
    pub fn attributes(
        &self,
    ) -> std::option::Option<
        &std::collections::HashMap<crate::types::AppAttributesKeys, std::string::String>,
    > {
        self.attributes.as_ref()
    }
    /// <p>An array of <code>EnvironmentVariable</code> objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
    /// <p>There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."</p> <note>
    /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
    /// </note>
    pub fn environment(&self) -> std::option::Option<&[crate::types::EnvironmentVariable]> {
        self.environment.as_deref()
    }
}
impl CreateAppInput {
    /// Creates a new builder-style object to manufacture [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
    pub fn builder() -> crate::operation::create_app::builders::CreateAppInputBuilder {
        crate::operation::create_app::builders::CreateAppInputBuilder::default()
    }
}

/// A builder for [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CreateAppInputBuilder {
    pub(crate) stack_id: std::option::Option<std::string::String>,
    pub(crate) shortname: 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) data_sources: std::option::Option<std::vec::Vec<crate::types::DataSource>>,
    pub(crate) r#type: std::option::Option<crate::types::AppType>,
    pub(crate) app_source: std::option::Option<crate::types::Source>,
    pub(crate) domains: std::option::Option<std::vec::Vec<std::string::String>>,
    pub(crate) enable_ssl: std::option::Option<bool>,
    pub(crate) ssl_configuration: std::option::Option<crate::types::SslConfiguration>,
    pub(crate) attributes: std::option::Option<
        std::collections::HashMap<crate::types::AppAttributesKeys, std::string::String>,
    >,
    pub(crate) environment: std::option::Option<std::vec::Vec<crate::types::EnvironmentVariable>>,
}
impl CreateAppInputBuilder {
    /// <p>The stack ID.</p>
    pub fn stack_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.stack_id = Some(input.into());
        self
    }
    /// <p>The stack ID.</p>
    pub fn set_stack_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.stack_id = input;
        self
    }
    /// <p>The app's short name.</p>
    pub fn shortname(mut self, input: impl Into<std::string::String>) -> Self {
        self.shortname = Some(input.into());
        self
    }
    /// <p>The app's short name.</p>
    pub fn set_shortname(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.shortname = input;
        self
    }
    /// <p>The app name.</p>
    pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
        self.name = Some(input.into());
        self
    }
    /// <p>The app name.</p>
    pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>A description of the app.</p>
    pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
        self.description = Some(input.into());
        self
    }
    /// <p>A description of the app.</p>
    pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// Appends an item to `data_sources`.
    ///
    /// To override the contents of this collection use [`set_data_sources`](Self::set_data_sources).
    ///
    /// <p>The app's data source.</p>
    pub fn data_sources(mut self, input: crate::types::DataSource) -> Self {
        let mut v = self.data_sources.unwrap_or_default();
        v.push(input);
        self.data_sources = Some(v);
        self
    }
    /// <p>The app's data source.</p>
    pub fn set_data_sources(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::DataSource>>,
    ) -> Self {
        self.data_sources = input;
        self
    }
    /// <p>The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. AWS OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify <code>other</code>.</p>
    pub fn r#type(mut self, input: crate::types::AppType) -> Self {
        self.r#type = Some(input);
        self
    }
    /// <p>The app type. Each supported type is associated with a particular layer. For example, PHP applications are associated with a PHP layer. AWS OpsWorks Stacks deploys an application to those instances that are members of the corresponding layer. If your app isn't one of the standard types, or you prefer to implement your own Deploy recipes, specify <code>other</code>.</p>
    pub fn set_type(mut self, input: std::option::Option<crate::types::AppType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>A <code>Source</code> object that specifies the app repository.</p>
    pub fn app_source(mut self, input: crate::types::Source) -> Self {
        self.app_source = Some(input);
        self
    }
    /// <p>A <code>Source</code> object that specifies the app repository.</p>
    pub fn set_app_source(mut self, input: std::option::Option<crate::types::Source>) -> Self {
        self.app_source = input;
        self
    }
    /// Appends an item to `domains`.
    ///
    /// To override the contents of this collection use [`set_domains`](Self::set_domains).
    ///
    /// <p>The app virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code> </p>
    pub fn domains(mut self, input: impl Into<std::string::String>) -> Self {
        let mut v = self.domains.unwrap_or_default();
        v.push(input.into());
        self.domains = Some(v);
        self
    }
    /// <p>The app virtual host settings, with multiple domains separated by commas. For example: <code>'www.example.com, example.com'</code> </p>
    pub fn set_domains(
        mut self,
        input: std::option::Option<std::vec::Vec<std::string::String>>,
    ) -> Self {
        self.domains = input;
        self
    }
    /// <p>Whether to enable SSL for the app.</p>
    pub fn enable_ssl(mut self, input: bool) -> Self {
        self.enable_ssl = Some(input);
        self
    }
    /// <p>Whether to enable SSL for the app.</p>
    pub fn set_enable_ssl(mut self, input: std::option::Option<bool>) -> Self {
        self.enable_ssl = input;
        self
    }
    /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
    pub fn ssl_configuration(mut self, input: crate::types::SslConfiguration) -> Self {
        self.ssl_configuration = Some(input);
        self
    }
    /// <p>An <code>SslConfiguration</code> object with the SSL configuration.</p>
    pub fn set_ssl_configuration(
        mut self,
        input: std::option::Option<crate::types::SslConfiguration>,
    ) -> Self {
        self.ssl_configuration = input;
        self
    }
    /// Adds a key-value pair to `attributes`.
    ///
    /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
    ///
    /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
    pub fn attributes(
        mut self,
        k: crate::types::AppAttributesKeys,
        v: impl Into<std::string::String>,
    ) -> Self {
        let mut hash_map = self.attributes.unwrap_or_default();
        hash_map.insert(k, v.into());
        self.attributes = Some(hash_map);
        self
    }
    /// <p>One or more user-defined key/value pairs to be added to the stack attributes.</p>
    pub fn set_attributes(
        mut self,
        input: std::option::Option<
            std::collections::HashMap<crate::types::AppAttributesKeys, std::string::String>,
        >,
    ) -> Self {
        self.attributes = input;
        self
    }
    /// Appends an item to `environment`.
    ///
    /// To override the contents of this collection use [`set_environment`](Self::set_environment).
    ///
    /// <p>An array of <code>EnvironmentVariable</code> objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
    /// <p>There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."</p> <note>
    /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
    /// </note>
    pub fn environment(mut self, input: crate::types::EnvironmentVariable) -> Self {
        let mut v = self.environment.unwrap_or_default();
        v.push(input);
        self.environment = Some(v);
        self
    }
    /// <p>An array of <code>EnvironmentVariable</code> objects that specify environment variables to be associated with the app. After you deploy the app, these variables are defined on the associated app server instance. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-creating.html#workingapps-creating-environment"> Environment Variables</a>.</p>
    /// <p>There is no specific limit on the number of environment variables. However, the size of the associated data structure - which includes the variables' names, values, and protected flag values - cannot exceed 20 KB. This limit should accommodate most if not all use cases. Exceeding it will cause an exception with the message, "Environment: is too large (maximum is 20KB)."</p> <note>
    /// <p>If you have specified one or more environment variables, you cannot modify the stack's Chef version.</p>
    /// </note>
    pub fn set_environment(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::EnvironmentVariable>>,
    ) -> Self {
        self.environment = input;
        self
    }
    /// Consumes the builder and constructs a [`CreateAppInput`](crate::operation::create_app::CreateAppInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::create_app::CreateAppInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(crate::operation::create_app::CreateAppInput {
            stack_id: self.stack_id,
            shortname: self.shortname,
            name: self.name,
            description: self.description,
            data_sources: self.data_sources,
            r#type: self.r#type,
            app_source: self.app_source,
            domains: self.domains,
            enable_ssl: self.enable_ssl,
            ssl_configuration: self.ssl_configuration,
            attributes: self.attributes,
            environment: self.environment,
        })
    }
}