aws_sdk_elasticbeanstalk/operation/create_application/
_create_application_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Request to create an application.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateApplicationInput {
7    /// <p>The name of the application. Must be unique within your account.</p>
8    pub application_name: ::std::option::Option<::std::string::String>,
9    /// <p>Your description of the application.</p>
10    pub description: ::std::option::Option<::std::string::String>,
11    /// <p>Specifies an application resource lifecycle configuration to prevent your application from accumulating too many versions.</p>
12    pub resource_lifecycle_config: ::std::option::Option<crate::types::ApplicationResourceLifecycleConfig>,
13    /// <p>Specifies the tags applied to the application.</p>
14    /// <p>Elastic Beanstalk applies these tags only to the application. Environments that you create in the application don't inherit the tags.</p>
15    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
16}
17impl CreateApplicationInput {
18    /// <p>The name of the application. Must be unique within your account.</p>
19    pub fn application_name(&self) -> ::std::option::Option<&str> {
20        self.application_name.as_deref()
21    }
22    /// <p>Your description of the application.</p>
23    pub fn description(&self) -> ::std::option::Option<&str> {
24        self.description.as_deref()
25    }
26    /// <p>Specifies an application resource lifecycle configuration to prevent your application from accumulating too many versions.</p>
27    pub fn resource_lifecycle_config(&self) -> ::std::option::Option<&crate::types::ApplicationResourceLifecycleConfig> {
28        self.resource_lifecycle_config.as_ref()
29    }
30    /// <p>Specifies the tags applied to the application.</p>
31    /// <p>Elastic Beanstalk applies these tags only to the application. Environments that you create in the application don't inherit the tags.</p>
32    ///
33    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
34    pub fn tags(&self) -> &[crate::types::Tag] {
35        self.tags.as_deref().unwrap_or_default()
36    }
37}
38impl CreateApplicationInput {
39    /// Creates a new builder-style object to manufacture [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
40    pub fn builder() -> crate::operation::create_application::builders::CreateApplicationInputBuilder {
41        crate::operation::create_application::builders::CreateApplicationInputBuilder::default()
42    }
43}
44
45/// A builder for [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct CreateApplicationInputBuilder {
49    pub(crate) application_name: ::std::option::Option<::std::string::String>,
50    pub(crate) description: ::std::option::Option<::std::string::String>,
51    pub(crate) resource_lifecycle_config: ::std::option::Option<crate::types::ApplicationResourceLifecycleConfig>,
52    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
53}
54impl CreateApplicationInputBuilder {
55    /// <p>The name of the application. Must be unique within your account.</p>
56    /// This field is required.
57    pub fn application_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.application_name = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>The name of the application. Must be unique within your account.</p>
62    pub fn set_application_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
63        self.application_name = input;
64        self
65    }
66    /// <p>The name of the application. Must be unique within your account.</p>
67    pub fn get_application_name(&self) -> &::std::option::Option<::std::string::String> {
68        &self.application_name
69    }
70    /// <p>Your description of the application.</p>
71    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72        self.description = ::std::option::Option::Some(input.into());
73        self
74    }
75    /// <p>Your description of the application.</p>
76    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
77        self.description = input;
78        self
79    }
80    /// <p>Your description of the application.</p>
81    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
82        &self.description
83    }
84    /// <p>Specifies an application resource lifecycle configuration to prevent your application from accumulating too many versions.</p>
85    pub fn resource_lifecycle_config(mut self, input: crate::types::ApplicationResourceLifecycleConfig) -> Self {
86        self.resource_lifecycle_config = ::std::option::Option::Some(input);
87        self
88    }
89    /// <p>Specifies an application resource lifecycle configuration to prevent your application from accumulating too many versions.</p>
90    pub fn set_resource_lifecycle_config(mut self, input: ::std::option::Option<crate::types::ApplicationResourceLifecycleConfig>) -> Self {
91        self.resource_lifecycle_config = input;
92        self
93    }
94    /// <p>Specifies an application resource lifecycle configuration to prevent your application from accumulating too many versions.</p>
95    pub fn get_resource_lifecycle_config(&self) -> &::std::option::Option<crate::types::ApplicationResourceLifecycleConfig> {
96        &self.resource_lifecycle_config
97    }
98    /// Appends an item to `tags`.
99    ///
100    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
101    ///
102    /// <p>Specifies the tags applied to the application.</p>
103    /// <p>Elastic Beanstalk applies these tags only to the application. Environments that you create in the application don't inherit the tags.</p>
104    pub fn tags(mut self, input: crate::types::Tag) -> Self {
105        let mut v = self.tags.unwrap_or_default();
106        v.push(input);
107        self.tags = ::std::option::Option::Some(v);
108        self
109    }
110    /// <p>Specifies the tags applied to the application.</p>
111    /// <p>Elastic Beanstalk applies these tags only to the application. Environments that you create in the application don't inherit the tags.</p>
112    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
113        self.tags = input;
114        self
115    }
116    /// <p>Specifies the tags applied to the application.</p>
117    /// <p>Elastic Beanstalk applies these tags only to the application. Environments that you create in the application don't inherit the tags.</p>
118    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
119        &self.tags
120    }
121    /// Consumes the builder and constructs a [`CreateApplicationInput`](crate::operation::create_application::CreateApplicationInput).
122    pub fn build(
123        self,
124    ) -> ::std::result::Result<crate::operation::create_application::CreateApplicationInput, ::aws_smithy_types::error::operation::BuildError> {
125        ::std::result::Result::Ok(crate::operation::create_application::CreateApplicationInput {
126            application_name: self.application_name,
127            description: self.description,
128            resource_lifecycle_config: self.resource_lifecycle_config,
129            tags: self.tags,
130        })
131    }
132}